How to select an Aria-Controls type element

Asked

Viewed 61 times

0

aria-controls

I have been trying in every way to execute the Weddriver Click() method on the button element

//*[@id="pedigree-controls"]/div[2]/div/div/button (destacado em azul (dropbtn))

However, for some reason, perhaps because it is an Aria-Controls and contains a span class="visually-Hidden" I can’t.

Does anyone know any way to get to that element?

Driver.FindElement(By.CssSelector("li[aria-controls='pedigree_select']")).Clicks();
  • I don’t know about Selenium but jQuery can’t have quotes in pedigree_select. It would work like this: $("li[aria-controls=pedigree_select]") maybe in your case this might help.

1 answer

0


I solved it! I could find the element but not perform any action on it (click for example). This was happening because the page was built with Polymer and consequently I had to treat the Divs per layer until I reached the element.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.