Batch file is not running in the External tool

BorysHsBorysHs Posts: 5


I hava a problem with launching bat file in my SOAtest project. I add it into External tool and after attempt to run the test suite bat file wasn't executed.

Also I configured this file via Run->External tools and it was executed successful and displayed in the console tab of test tool.

Please, can you help to provide bat running together with test suite?


  • Ireneusz SzmigielIreneusz Szmigiel Posts: 149 ✭✭
    edited March 23

    Hi BorysHS,

    what error do you see when executing batch file in Test Scenario with Test Configuration?
    Can you post your run.bat file here?

    Ireneusz Szmigiel

  • benken_parasoftbenken_parasoft Posts: 511 ✭✭✭
    edited March 23

    .bat files are actually executed by cmd.exe. You need to run C:\Windows\System32\cmd.exe /C path_to_your_bat_file

  • BorysHsBorysHs Posts: 5

    Thank you all for the replies!

    I specified a command as benken_parasoft suggested:
    C:\Windows\System32\cmd.exe /C C:\Users\Administrator\parasoft\workspace\scripts\run.bat

    .bat wasn't executed. I don't see any errors, just info about successful REST tests, which were executed with the external tool simultaneously in the same test suite.

    .bat file is attached to this message.

  • Ireneusz SzmigielIreneusz Szmigiel Posts: 149 ✭✭

    I'm able to execute your batch on my side using simple batch call and approach suggested by @benken_parasoft.

    Could you please attack to External Tool additional tool?
    Please do the following:
    -right click on External Tool and select "Add Output"
    -in new window select tool called Edit (from Console stdout/stderr)
    -it will open a new window (close it)
    -run your scenario using Test Configuration
    -open attached Console (by double click on it)

    What do you have as output from your batch?

    Ireneusz Szmigiel

  • BorysHsBorysHs Posts: 5

    @Ireneusz Szmigiel

    No, I haven't. I think the cause of the problem in that the external tool saves the command in incorrect form.
    Example, I insert such path and save it:

    But reopening it again I actually have another path:

    Have you faced with such behavior?

  • Ireneusz SzmigielIreneusz Szmigiel Posts: 149 ✭✭

    You have incorrect configuration of External Tool.
    See my examples:
    -first one:

    -second one:

    Ireneusz Szmigiel

  • BorysHsBorysHs Posts: 5
    edited March 26

    It works! Thank you a lot :)

    And one more question. How to pass Environment variable (in soatest we use such form ${test}) as an argument in the bat file via External tool?

  • benken_parasoftbenken_parasoft Posts: 511 ✭✭✭

    You should configure your bat file to accept any input as command line arguments, then configure those as additional arguments in your External tool

    Please take note of the following:

    • The Executable field is for the path to the executable.
    • The Flag/Arguments table is where you pass arguments to the executable. In this case, cmd.exe takes a /C flag followed by a command string.
    • The command string argument should include the entire command you want cmd.exe to execute. In this case, the argument to /C should include the path to the .bat file followed by any command line arguments to your .bat file.
    • SOAtest environment variables, test suite variables, data bank columns, etc. can be referenced in tool configuration fields as ${var_name_of_variable}. This generally works in any tool configuration fields, like the various ones you see in the External tool.
    • Within the .bat file itself, you reference any command line arguments as variables %1, %2, etc.
  • BorysHsBorysHs Posts: 5

    @benken_parasoft @Ireneusz Szmigiel
    Thank you all for helping!) Now it's clear.

Sign In or Register to comment.