Forum Discussion

URN123's avatar
URN123
Occasional Contributor
12 years ago

How to READ NAME VALUE PAIRS FROM PROPERTIES TESTSTEP?

Hi,

I have a bunch of properties stored in "Properties" test step. They look as follows:

Name Value
name1 value1
name2 value2
name3 value3
name4 value4

Using Groovy, I want to read the name value pairs into my script. I want to access them as follows after reading them into my script.

name = name1
value = value1

I want to load them into an array and want to loop through them for further processing.

Can anyone help me how to accomplish this?

Thanks in advance.

2 Replies

  • Try something like this in a Groovy test step:

    log.info testRunner.testCase.getTestStepByName("Properties").getPropertyAt(0).getName()
    log.info testRunner.testCase.getTestStepByName("Properties").getPropertyAt(0).getValue()

    Thanks,
    Michael Giller
    SmartBear Software