JSON bindings
<name> is defined in <jsonRef> by json path "<expression>"
Captures content from a referenced JSON value using the given JSON path expression and associates it with the given name. The value is resolved every time the name is referenced.
<name> is defined in <jsonRef> by json path "<expression>"
Where
<name>is the name of the name to associate the captured value to<nodeType>is one of:textto capture the text nodenodeto capture a single nodenodesetto capture multiple nodes
<sourceRef>is the name of the binding containing the XML source- Can be the name of any binding that contains or resolves to XML text, including a web element in which case the text in the element will be dynamically retrieved and used.
<expression>is the XPath selector expression
Optionally accepts the @Eager, @Lazy or @Masked annotations.
@Eagerimmediately evaluates the<expression>and binds the result to<name>@Lazyevaluates the<expression>and binds the result to<name>when it is first referenced- In the absence of either of the above annotations,
<expression>is evaluated every time<name>is referenced @Maskedmasks the captured value to prevent it from being logged as clear text
Example
Given the json is "{ "status": "passed" }"
And the status is defined in the json by json path "$.status"
Then the status should be "passed"
I capture the content in <element> by json path "<expression>" as <name>
Captures JSON content from a web element using the given JSON Path expression and binds it to the given name in the global scope.
I capture the content in <element> by json path "<expression>" as <name>
Where
<element>is the name of the element containing the JSON content<expression>is the JSON selector expression<name>is the name to bind the captured value to
Example
# assuming a web element contains json: { "status": "passed" }
Given the json web element can be located by id "json"
When I capture the content in the json web element by json path "$.status" as the status
Then the status should be "passed"