Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

How can i iterate through the values from page.getProperties() in groovy?

Avatar

Level 5

How can i iterate through the values from page.getProperties() in groovy?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Shaheena_Sheikh,

getProperties method returns ValueMap , you can iterate like this:

 

page?.getProperties()?.each { property ->
    println "Property key: ${property?.key}"
    println "Property value: ${property?.value}"
}

 

key represents property key, value represents property value.

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @Shaheena_Sheikh,

getProperties method returns ValueMap , you can iterate like this:

 

page?.getProperties()?.each { property ->
    println "Property key: ${property?.key}"
    println "Property value: ${property?.value}"
}

 

key represents property key, value represents property value.