Forum Discussion

steveKubik's avatar
steveKubik
Occasional Contributor
7 years ago

Test Steps issue

Hi ,

              I need to execute a particular Test Case Step(testCaseToExecute) from this code. When I tried below code I am getting error and Page is loading only. Would you please some one assist me on this.

 

def project = workspace.createProject(projectName,new File("C:\\Temp\\" + projectName + ".xml"));
WsdlInterfaceFactory.importWsdl(project, 'http://www.webservicex.com/globalweather.asmx?WSDL', true)
def suite = project.addNewTestSuite("TestSuite")
tc = suite.addNewTestCase("TestCase")

groovyScript = tc.addTestStep( GroovyScriptStepFactory.GROOVY_TYPE, "testCaseToExecute" )

def operation = project.getInterfaceAt(0).getOperationList()[0]

def factory = new WsdlTestRequestStepFactory()

 config = factory.createConfig(operation,"SOAPRequest")

testStep = tc.addTestStep(config)

def project = testRunner.testCase.testSuite.project
testRunner.runTestStep( project.testSuites['TestSuite'].testCases['TestCase'].testSteps['getTestCasesToExecute'] )

 

 

 

 

Regards,

Steve

 

2 Replies

    • nmrao's avatar
      nmrao
      Champion Level 3
      You are using a public web service hosted by someone and that is currently not available. You may need to check for the alternative service provider or build it for your self.