question

pkamonar avatar image
pkamonar asked pkamonar posted

How to set key for the repeat output in block?

I have some output as below  and created responsemap as the attached file but I need to set the key by following Switch_number.

How to set the key as the switch number for the sub-info under that switch?

Please see the responsemap for more details. 

 

 Switch : 1 : (Master)
---------------------
License Store: Primary License Storage
StoreIndex: 4  Feature: advipservices                     Version: 1.0
 License Type: Permanent
 License State: Active, In Use
 License Priority: Medium
 License Count: Non-Counted

License Store: Evaluation License Storage
StoreIndex: 0  Feature: ipservices                        Version: 1.0
 License Type: Evaluation
 License State: Active, Not in Use, EULA accepted
     Evaluation total period: 8  weeks 4  days
     Evaluation period left: 8  weeks 4  days
 License Priority: Low
 License Count: Non-Counted


Switch : 2 :
------------
License Store: Primary License Storage
StoreIndex: 1  Feature: advipservices                     Version: 1.0
 License Type: Permanent
 License State: Active, In Use
 License Priority: Medium
 License Count: Non-Counted

License Store: Evaluation License Storage
StoreIndex: 0  Feature: ipservices                        Version: 1.0
 License Type: Evaluation
 License State: Active, Not in Use, EULA not accepted
     Evaluation total period: 8  weeks 4  days
     Evaluation period left: 8  weeks 4  days
 License Priority: None
 License Count: Non-Counted


Switch : 3 :
------------
License Store: Primary License Storage
StoreIndex: 1  Feature: advipservices                     Version: 1.0
 License Type: Permanent
 License State: Active, In Use
 License Priority: Medium
 License Count: Non-Counted

License Store: Evaluation License Storage
StoreIndex: 0  Feature: ipservices                        Version: 1.0
 License Type: Evaluation
 License State: Active, Not in Use, EULA not accepted
     Evaluation total period: 8  weeks 4  days
     Evaluation period left: 8  weeks 4  days
 License Priority: None
 License Count: Non-Counted

iTestresponse map
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
KumarS avatar image
KumarS answered KumarS posted

You can create queries whose XPATH looks like:

 

//License_Store[../../../Switch_number/Switch_num = '1']

 

You will simply add a query on the query page (by clicking on add custom query button) in the response map.  You will set the query string to:  //License_Store[../../../Switch_number/Switch_num = '{0}']  where {0} represents the first argument. You will then add an argument to the query and now it is ready to use in your testcase. You can see the results of matches in the Queries view. This is just one example of extracting data in a container based on an xml tag value in another container which happens to be the key.

10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.