Home page

Tuesday, May 21, 2019

Practice XPath-1

Purpose: Get result if different parents values(answers & views) are matching based on given input.

URL: https://sqa.stackexchange.com/

//*[@title='0 answers']/../../../div[@class='views']//span[@title='7 views']

//*  selects all elements in the document
[@title='0 answers']  find title which contains value = 0 answers
/.. go to Parent
/.. go to Grand parent
/.. go to Grand grand parent
/div go to tag div
[@class='views'] find class = views
//span[@title='7 views'] go to child title = 7 views

No comments:

Post a Comment