Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Soatest Server api'S

reactancexl
reactancexl Posts: 178

I want to be able to use the ../V6/testExecutions api (POST) to execute the test at the scenario level. I am able to do at tst level. I have a test.tst with two scenarios, each with a rest API. Scenario1 and scenario2. Is it possible and what do I put in the "payload' to run just Scenario1? Here is my payload to run at tst level. (using 2024.2): Note: i want to do this without using CTP. thx
{
"scopeOptions" : {
"workspace" : {
"resources" : [
"/TestAssets/RestPOC.tst"
]
}
},
"general" : {
"config" : "soatest.builtin://Run Automated Server Tests"
},
"soatestOptions" : {
}
}

Comments

  • benken_parasoft
    benken_parasoft Posts: 1,322 ✭✭✭
    edited March 3

    The "testExecutions" REST API largely mirrors the soatestcli. You can specify individual folders or tst files under "resources" similar to "soatestcli -resource" but you can't necessarily restrict execution to an individual scenario under a .tst file.

  • jakubiak
    jakubiak Posts: 815 admin

    The -testName CLI parameter may be able to help you here, since it allows you to specify the name of a test or test suite within your .tst file that you want to run (with some options for how to match). See https://docs.parasoft.com/display/SOA20242/CLI+Options#CLIOptions--testName. The equivalent field in the testExecutions endpoint is the "testNames" field.

  • benken_parasoft
    benken_parasoft Posts: 1,322 ✭✭✭
    edited March 4

    Other alternatives can include breaking up your tst file into multiple tst files or using test flow logic to conditionally run one suite or another based on the value of a test variable. The request to testExecutions can let you inject environment variables and you can initialize test variables from environment variables.