I have a Test which search for <span class="legend">
. On a previous level I have a fieldset which contains several values. Here is my problem. I don't get the locator for this fieldset.
First of all I get a list with all class=legend
objects:
List<WebElement> groupList = driver.findElements(By.className("legend"));
This works perfectly, I have a list with several Webelements.
Now I want to iterate this list and save every value from the fieldset of the previous level only. The problem is that Selenium does not find the id of the fieldset.
I tried tempGroupElement.getAttribute("id")
to get the id but it does not work.
Any idea?