Forum Discussion

steveKubik's avatar
steveKubik
Occasional Contributor
7 years ago

Requesting code for Test Suit and Test Cases in Groovy Script

Hi,

    I am trying to add Test Suite but my groovy script is not adding Test Suite. Please let me know how to add Test Suite and Test Cases from the below code. Could you please anyone assist me. 

 

def currentProject = testRunner.testCase.testSuite.project
WsdlProject project = currentProject.getWorkspace().createProject(projectName, new File("C:\\Temp\\" + projectName + ".xml"));
def iface=WsdlInterfaceFactory.importWsdl("Country","http://www.webservicex.com/country.asmx?wsdl",true)[0]

def suite = context.testCase.testSuite.project.addNewTestSuite("Customer1111")

context.testCase.testSuite.project.save()


log.info suite

 

1 Reply

  • steveKubik's avatar
    steveKubik
    Occasional Contributor

    Hi,

         I have got answer by adding this steps

     

    def suite = project.addNewTestSuite("Suite")
    tc = suite.addNewTestCase("TestCases")

     

    Thanks

    Steve