Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

X-path going back to a different field in same payload

Options
Neil
Neil Posts: 38

Hello,

I want to apply an assertion on below fields only when the "name" : "woodGundyDeposit"...

"categorization" : {
            "category" : "NON_REGISTERED_INVESTMENT",
        },

so i am going to name field .. But I want to know how to come back and assert on Category field.
/root/accounts/item/displayAttributes/name[text()='woodGundyDeposit']

I tried below but didn't work /root/accounts/item/displayAttributes/name[text()='woodGundyDeposit']/../categorization

Sample request

"accounts" : [
{
"id" : "4a7ac7c831ae1adde39233a4b2cb7dcfc02b88c23a4a7921b4caaa53d6df6614",
"number" : "1130137",
"nickname" : "",
"capabilities" : [
"TRANSFER_FROM",
"TRANSFER_TO",
],
},
{
"id" : "65502f7dfa1a5ec7d332720e42c133a4e011ce2682871e9f5a28a7cfdf90d7b1",
"number" : "50000066",
"nickname" : "",
"capabilities" : [
"RENAMEABLE",
"SHOW_ACCOUNT_DETAILS"
],
"_type" : "InternalAccountV2",
"categorization" : {
"category" : "NON_REGISTERED_INVESTMENT",
"subCategory" : "WGINV",
"extraSubCategory" : null,
"instance" : null,
"holding" : "WGINV",
"taxPlan" : "NON_REGISTERED"
},
"availableFunds" : null,
"balance" : 90951576.39,
"transit" : "",
"status" : "ACTIVE",
"displayAttributes" : {
"quickLinks" : "WOODGUNDY_INVESTING_ACCOUNT",
"name" : "woodGundyDeposit"
},
"currency" : "CAD",
"details" : null,
"external" : false
},

please provide your feedback. Thank you!

Regards,
Neil