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?