0

Ok, I have an iframe with 3 tabs. On each of these tabs there is an element with the same ID, class but different value. How am I supposed to locate each of them separately?

nvldk
  • 125
  • 2
  • 14

1 Answers1

0

First, make sure you know how to deal with iframes with Selenium and that it isn't a first blocker for you.

Then to answer your question, you can either:

  • use an xpath selector:

    • *[@id="tabid"][1] will select the first element with the id tabid.
    • *[@id="tabid"][2] will select the second element with the id tabid.
    • etc.
  • use a CSS selector:

    • #tabid:nth-child(1)
    • #tabid:nth-child(2)
    • etc.
Community
  • 1
  • 1
Stéphane Bruckert
  • 21,706
  • 14
  • 92
  • 130