Contributions
Re: Running specific test step in SoapUI based on testSuite property
Well, after executing the script, the flow continues to the next step, without running desired step. The code looks like this now: def CC1 = testRunner.testCase.testSuite.getPropertyValue("CC1") log.info testRunner.testCase.testSuite.getPropertyValue("CC1") switch(CC1) { case ~/(.)*?[H1]/: log.info('PT02_H1'); testRunner.runTestStepByName( "PT02_H1" ); break; case ~/(.)*?[Y5]/: log.info('PT02_Y5'); testRunner.runTestStepByName( "PT02_Y5" ); break; case ~/(.)*?[Q2]/: log.info('PT02_Q2'); testRunner.runTestStepByName( "PT02_Q2" ); break; case ~/(.)*?[T5]/: log.info('PT02_T5'); testRunner.runTestStepByName( "PT02_T5" ); break; default : log.info('testing PT02_AQ'); testRunner.runTestStepByName( "PT02_AQ" ); }1.1KViews0likes0CommentsJavaScript incrementing letter string properties
Hello all. I am new to JavaScript, so I could use some help. I need script for SoapUI that will increment letter string global properties for me each time I ran Test Case. It should looks like this: 1.st TC run: "aaaa" 2.nd TC run: "aaab" and so on. Script I have now, increments only number strings: import java.text.SimpleDateFormat incrementStringProperty(5, 'firstName') // defines incrementation of string property void incrementStringProperty (end, propertyName) { def propertyToChange = testRunner.testCase.testSuite.getPropertyValue(propertyName) def propertyEnd = String.valueOf(Long.parseLong(propertyToChange.substring(propertyToChange.length() - end)) + 1) def propertyStart = propertyToChange.substring(0, propertyToChange.length() - end) for (int i = propertyEnd.length(); i < end; i++) { propertyEnd = "0" + propertyEnd } testRunner.testCase.testSuite.setPropertyValue(propertyName, propertyStart + propertyEnd) } Can somebody help me with this please? Thank you.490Views0likes0CommentsRunning specific test step in SoapUI based on testSuite property
I am new to scripting and have an issues regarding SoapUI groovy script I could use help with. I need a script that will let me run specific testStep in testCase based on value of testSuite property ('CC1' is name of property) with 5 possibilities. I guess switch/case could be used, but don't know how to write it properly. I tried using this: def CC1 = testRunner.testCase.testSuite.getPropertyValue("CC1") switch(CC1) { case ~/^[H1]+$/: testRunner.runTestStepByName( "PT02_H1" ); break; case ~/^[Y5]+$/: testRunner.runTestStepByName( "PT02_Y5" ); break; case ~/^[Q2]+$/: testRunner.runTestStepByName( "PT02_Q2" ); break; case ~/^[T5]+$/: testRunner.runTestStepByName( "PT02_T5" ); break; default : testRunner.runTestStepByName( "PT02_AQ" ); } But doesn't run the desired step. Can someone help me with this, please?1.1KViews0likes4Comments