If the id is changing dynamically for a particular xpath then we can use the below xpath functions:
- contains :
contains :
xpath Syntax: //html tag[contains(text()/@attribute, 'Expected Value')]
Following-Siblings:
xpath Syntax: //html tag[contains(text()/@attribute, 'Expected Value')]
- Following-Siblings:
Xpath Syntax : //html tag/following-siblings::html tag e.g : //img[@src = 'image2.jpg']/following-siblings::input[@type = 'button']
Xpath Syntax : //html tag/following-siblings::html tag ex: //img[@src = 'image2.jpg']/following-siblings::input[@type = 'button']
- Preceding-Siblings : syntax will be same as
following-Siblings
- The descendant function which is used to identify the grand child node by skipping all
following-Siblings 5. Descendent function which is used to identify the grand child node by skipping all sub,sub,sub node from the current HTML tag.
sub, node from the current HTML tag.