Forum Discussion

CrazyFrog's avatar
CrazyFrog
Contributor
8 years ago

How can i in java check if a teststepname already exists

Hello    I write my own testautomation script in java using the SoapUI API. My script create teststeps when the aren't there. How can i check if a teststep is already created?   I can use  the ...
  • groovyguy's avatar
    groovyguy
    8 years ago

    Here's how I check:

     

    def testStepName = "Name to Check";
    
    if (context.testCase.getTestStepIndexByName(testStepName) == -1)
    {
          log.info("test step does not exist");
    }
    else
    {
          log.info("test step exists.");
    }