Get all the elements using path and then iterate over them, filtering entries by a call to "isDisplayed".
Simon (from a phone)
Hi,
I would like to fetch only those web element which are visible on page using xpath. But in the page source there is no "style" tag present. So how would i get those elements?
I'm using driver.findelement(By.xpath("")). I can get visible elements by driver.findelement(By.xpath("")).isDisplayed() but I don't want to use isDisplayed() method.
I just want to pass xpath of those elements which are visible on page. Below is sample html code of my webpage.
<div class="sdf">
<a rel="nofollow" id="Link_5" href="/abc-html" title="xyz" class="PQR">Button Name</a>
</div>
--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/tlE7btyyfXwJ.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/d/optout.