Submit and vote on feature ideas.

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.

Triggering SOAtest TestSuite Runs Using Java Code Internally through ExtensionTool

rahul157
rahul157 Posts: 30

Requirement:-
1) I have a set of TestSuites In a Project.
2) I want to use Extension Tool that'll call Java code or another supported prmm. language.
3)Code will run the desired TestSuite on basis on some conditions that I'll set.

Any Help appreciated. :smile:

Comments

  • Thomas Moore
    Thomas Moore Posts: 82 admin

    Hi Rahul,

    One thing you might be able to try is calling the SOAtest REST API to execute the additional tests. To use it, you must first start up the SOAtest server, which can be found under Window -> Show View -> SOAtest Server.

    From there, you can start up the server, and you can find the API at http://[machine_name]:9080/soavirt/api. The specific API you would be looking for would be POST /v5/testExecutions. Could you give this a look and see if it might work for your use case?

    Hope this helps,

    Thomas

  • [Deleted User]
    [Deleted User] Posts: 0 admin
    edited May 2017

    Hi Rahul157,

    What you can do now involves Test Flow Logic. You can extract or define a condition variable at run time then use test flow logic to indicate which test suite should be disabled if the input is present. See the following workflow

    1. Create a variable to define the execution number
    2. Extract or define the user input, with a databank, into the variable
    3. Create an extension tool to map the user input to an integer
      "See code in next post"
    4. Set Test flow logic (In Execution Options) to execute the test scenario if the input does NOT = the desired value. Like this example

    This should give you the desired effect. I have attached a tst file that does this. It was created using SOAtest 9.9

  • [Deleted User]
    [Deleted User] Posts: 0 admin
    from com.parasoft.api import *
    
    def swapValueForInt(input,context):
        userInput = context.getValue("Generated Data Source", "dataBankUserInput")
        if userInput=="acctadd":
            context.setValue("UserInputAsInt","1")
            Application.showMessage ("user input was acctadd setting test execution var to 1")
        if userInput=="copycard":
            context.setValue("UserInputAsInt","2")
            Application.showMessage ("user input was copycard setting test execution var to 2")
    
  • rahul157
    rahul157 Posts: 30

    Thanks @Thomas Moore & @Chris Colosimo.I got it meanwhile @Thomas Moore can you help me out using soatest API.if you have any doc or manual can you pls share it.
    I am very keen to learn this. :)

  • AnushaKotra
    AnushaKotra Posts: 4

    Can please provide this .tst file?