tomovermeers
7 years agoOccasional Contributor
Launch teststep automatically from groovyscript
I am new to SoapUI. This is the groovyscript I wrote. But now I want to launch a teststep called "isAlive-SoapCall" in a TestCase "Sanity-TC" in a TestSuite "Sanity-TS". So while i loop and change every time the endpoint I want to execute this one teststep and maybe log the result to be sure the teststep is executed in the 6 different environments. How can I achieve this? I would like to know also where i place the groovyscript in my soapui-project. Do not forget that I am a junior who has everything still to learn. Thanks in advance.
def environments = ['tt':'10', 'dv':'20', 'qa':'30', 'pp':'40', 'pr':'50', 'tr':'60'] environments.each{environment , url -> testRunner .testCase .getTestStepByName("isAlive-SoapCall") .getHttpRequest() .setEndpoint("http://esb-${environment}.xxx.be:7800/esb/v1/vehicle/xxx") }