question

nkankipati avatar image
nkankipati asked ericnute edited

how to substitute regex in xpath

Hi

 

i am trying to get the o/p from xpath query like below,  

 

mapped/Regex/Body/ipv6_neighbor_pattern[interface='Vlan232']/address  << this is working : and i am gettting all the ip address belongs to Vlan232, 

 

but instead of Vlan232, i need to get all the ipaddress for all Vlan interfaces, so in this i case how can i substiture regular expression in place on Vlan232 ? 

 

this xpath i am trying on structure window, 

 

any help is greatly appriciated. 

iTestxpath
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

·
drakesh avatar image
drakesh answered drakesh posted

I have created a one response map for you. Please find the attachment.In this response you find out the how to pass the arguments in response map,and how to substitute regex in xpath. Please have a look into the attached screenshots also. Hope this helps you.


sceershot1.png (225.3 KiB)
screenshot3.jpg (340.7 KiB)
Untitled.jpg (147.0 KiB)
2 comments
10 |950

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

sreenath avatar image sreenath commented ·

Hi,

 

We can create a separate customer query to retireve all the ipaddresses for all the vlan interfaces. But this will create a queries for all the interfaces that has a different vlan values. 2 or more vlan with same name are grouped into the single query.

 

Attached is the sample response map for your reference.

 

Hope it helps!

0 Likes 0 ·
show_arp.ffrm (3.9 KiB)
vlan_address.JPG (55.9 KiB)
mallikarjunarao avatar image mallikarjunarao sreenath commented ·

I think this xpath  would be helpful

 

mapped/Tabular/table1/table/row[Interface='Vlan66' or Interface='Vlan101' or Interface='Vlan155' ]/Address

0 Likes 0 ·

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.