Forum Discussion

Harinadh's avatar
Harinadh
New Contributor
2 years ago
Solved

How to get all the properties and its values at the test step level using groovy script?

  • //It is the working code

    def testStep = testRunner.testCase.testSteps["***Enter your testStepName***"]
    if (testStep.getPropertyCount() > 0)

    {
     for (prop in testStep.getPropertyList())

     {
       log.info( prop.getName()+" = "+prop.getValue())
      }
     }

     else

     {
      log.info(testStep.getName() + " doesn't have properties!")
     }

1 Reply

  • Harinadh's avatar
    Harinadh
    New Contributor

    //It is the working code

    def testStep = testRunner.testCase.testSteps["***Enter your testStepName***"]
    if (testStep.getPropertyCount() > 0)

    {
     for (prop in testStep.getPropertyList())

     {
       log.info( prop.getName()+" = "+prop.getValue())
      }
     }

     else

     {
      log.info(testStep.getName() + " doesn't have properties!")
     }