Skip to content

Tag: xpath

Integrating regex in selenium xpath?

Hello I just start using selenium with java framework : I have this case : I need to count all the check boxes in my view which contains multiple pages (1,2,3) and in each web page i have a bunch of check boxes with the same xpath with different number see the exemple below: xpath fir the second checkbox in

How to get dynamic numbers using xpath?

How do I get dynamically changing numbers in the span block ? Method: I can’t figure out how to do this. My method xpatch which returns the value: How can I get dynamically changing numbers in such blocks for further comparison? Answer byRaetUSD is a webelement you should call getText to get the text or you can call if element

Cannot write dynamic xpath for element in page

This is the Url: I want to select “casual dresses”, but when I tried the “Women” WebElement is selected instead. How can I write the dyanmic xpath to select “casual dresses”? Answer You have to wait until page is loaded, then hover over Women title, the wait until the menu is open and then click on the Casual Dress

Is there a way to convert an element link to XPath

I have written a Jsoup class file to scrape a page and grab the hrefs for every element on the page. What I would like to do from there is to extract the Xpath for each of the elements from their hrefs. Is there a way to do this in JSoup? If not is what is the best way to