alibaba82
17 years agoSuper Contributor
Adding a test request via groovy
Hello,
I have a some groovy function that adds a test request during test execution and then deletes it. My code looks like this
def iface = testRunner.testCase.testSuite.project.getInterfaceByName( "UserProfileServiceSoap12" )
def request = iface.getOperationByName( "VerifyAccount" ).getRequestByName( "Request 1" )
def config = WsdlTestRequestStepFactory.createConfig(request,"VerifyAccount_Temp - Request 1");
def testStep = testRunner.testCase.insertTestStep( config, -1 )
def result = testStep.run(testRunner,context);
testRunner.testCase.removeTestStep(testStep);
so currently the test steps that gets inserted takes the username/password as specified in the serviceendpoint definition.
I want to be able to specify a different username/password for this test step. can you help me with some groovy code so that the test step has the username/password that I specify and not the one from service endpoints config.
Thanks
Ali
I have a some groovy function that adds a test request during test execution and then deletes it. My code looks like this
def iface = testRunner.testCase.testSuite.project.getInterfaceByName( "UserProfileServiceSoap12" )
def request = iface.getOperationByName( "VerifyAccount" ).getRequestByName( "Request 1" )
def config = WsdlTestRequestStepFactory.createConfig(request,"VerifyAccount_Temp - Request 1");
def testStep = testRunner.testCase.insertTestStep( config, -1 )
def result = testStep.run(testRunner,context);
testRunner.testCase.removeTestStep(testStep);
so currently the test steps that gets inserted takes the username/password as specified in the serviceendpoint definition.
I want to be able to specify a different username/password for this test step. can you help me with some groovy code so that the test step has the username/password that I specify and not the one from service endpoints config.
Thanks
Ali