Forum Discussion
- Nastya_KhovrinaSmartBear Alumni (Retired)
Hi,
Can you please provide an example of a script and let us know what event you use?
- 678Regular Contributor
TestRunListner.afterstep
Script :
import com.eviware.soapui.model.testsuite.TestStepResult.TestStepStatus
import com.eviware.soapui.model.testsuite.TestRunner.Status
import com.eviware.soapui.model.project.ProjectFactoryRegistry
import com.eviware.soapui.impl.wsdl.WsdlProjectFactorydef Workspace = testRunner.getTestCase().getTestSuite().getProject().getWorkspace()
def Project =
ProjectFactoryRegistry.getProjectFactory(WsdlProjectFactory.WSDL_TYPE).createNew("c:\\users\\project1\\soapuitestproject.xml")
if(!Project.open && Workspace!=null) Workspace.openProject(Project)def Lib = Project.getTestSuiteByName("Library");
testCase = Lib.getTestCaseByName("TestCase1")
Random rand1 = new Random();
int num1 = rand1.nextInt(9000) + 99999;
userid = "num1"
testCase.setPropertyValue("randomID", userid)
Related Content
- 4 years ago