Define the xpath of the below html for selenium automation -
I have HTML which basically looks like the following
... .... .. & lt; Span class = "cat-name" & gt; Tanzanite Pendant & lt; / Span & gt; ..........
There is six more duration with the same class name. I only want to find out the above period.
I have tried many solutions but failed to detect the element.
Thank you, joke
above expression
xpath = // span [@ class = 'cat-name'] [n] xpath = // span [@ class = 'cat-name'] [6]
There is a higher priority than []. <<< p>
The aforementioned expression selects @ class = 'cat-name' with each class, which is the child of its sixth child - and apparently the parents of the input elements of the document that are not shown They do not have so many input kids.
Use (note bracket):
Xpath = (// span [@ class = 'cat-name']) [6]
< / Pre>This selects the 6th element input in the document which satisfies the conditions under circumstances.
Then you can use all six places below: Use only the first time in your question and it will work:
xp Ath = (// span [@ Class = 'cat-name']) [1] xpath = (// span [@ class = 'cat-name']) [2] xpath = (// span [@ class = 'cat-name'] ) [3] xpath = (// span [@ class = 'cat-name']) [4] xpath = (// span [@ class = 'cat-name']) [5] Xpath = (// span [@ Class = 'cat-name']) [6]
Comments
Post a Comment