cancel
Showing results for 
Search instead for 
Did you mean: 

How to get all the propertyValues using code?

SOLVED
Community Leader

How to get all the propertyValues using code?

I am trying to fetch all the propertyValues together.. To fetch the propertyNames, I have tried this code and it works:-

 

import groovy.json.*

def prop = context.testCase.getTestStepByName("Properties");
propToGet = prop.getPropertyNames();

 

log.info propToGet

 

Similarly, I want to fetch the values also.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: How to get all the propertyValues using code?

What is your use case?

 

How about the below?

def step = context.testCase.getTestStepByName("Properties")
step.propertyNames.collect { log.info step.getPropertyValue(it)}


Regards,
Rao.
1 REPLY 1
Highlighted
Community Hero

Re: How to get all the propertyValues using code?

What is your use case?

 

How about the below?

def step = context.testCase.getTestStepByName("Properties")
step.propertyNames.collect { log.info step.getPropertyValue(it)}


Regards,
Rao.
New Here?
Join us and watch the welcome video:
Join the Online Event to Win
Top Kudoed Authors