Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98819

How to retrieve an element within several tags by tag name for selenium automated testing

$
0
0

I'm creating an automated selenium test using org.openqa.selenium.By to grab certain elements on the webpage that is loaded but I get nothing back when I'm searching for some elements. This is probably because the element I'm searching for is within several HTML tags? I put this code in the browser console just to see if I could see the tag I'm looking for listed but I only get back a list of top level element tags.

var all = document.getElementsByTagName("*");

for (var i=0, max=all.length; i < max; i++) {
     console.log(all.item(i))
}

Would anyone know of a better way to get an element using selenium since just By.tagname(tagname) doesn't work?


Viewing all articles
Browse latest Browse all 98819

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>