Creating the batch command

This example offers general guidelines for running a scan using an automation framework script for the Explore stage.

About this task

In this example the Demo test site is tested and Port 56232 is used for communication between the framework and AppScan. You could of course change this as needed. In each code sample, the code added in that step is highlighted in bold.

Procedure

  1. Create a TXT file and open it in a text editor.
  2. Type in the AppScan command to open AppScan and define the Starting URL, login credentials, Test Only option, open proxy, and proxy listening port:
    START "" "[AppScan Standard installation folder]\AppScanCMD.exe" 
    /starting_url "https://demo.testfire.net" 
    /credentials "jsmith:demo1234" 
    /test_only 
    /opr 
    /lp "56232"
    Tip: You can add additional commands as needed, such as to define a specific Test Policy, or create a report (for details, see CLI).
  3. Add a fifteen second timeout batch, to allow AppScan time to open:
    START "" "[AppScan Standard installation folder]\AppScanCMD.exe" 
    /starting_url "https://demo.testfire.net" 
    /credentials "jsmith:demo1234" /test_only /opr /lp "56232"
    
    timeout /t 15
  4. Add your script and configure the proxy in your third party tool for Host=localhost and Port=56232.
    Important: The Starting URL for the third-party tool must be identical to the Starting URL in the AppScan template.
  5. Add a command at the end to close the AppScan proxy and start the Test stage:
    START "" "[AppScan Standard installation folder]\AppScanCMD.exe" /scan_template 
    " C:\Users\<username>\Documents\AppScan\QA Automation Demo Template.scant " /test_only /opr /lp
    "56232"
    
    timeout /t 15
    
    [Invoke script with HTTP proxy configured to AppScan]
    
    "[AppScan Standard installation folder]\AppScanCMD.exe" cpr
  6. Save the file, and run it using the command line.