0

I have 5 tabs in a page and upon clicking the tab, it needs to perform some function. But how do I know which tab is selected and if a tab enabled, click on the tab and perform the necessary function. If it's is not enabled , it will check for the next one.

Mharlin
  • 1,697
  • 16
  • 24

1 Answers1

0

It depends on how the tabs are defined in the HTML/javascript.

You should use something like Firefox's Firebug plugin or Chrome's 'Inspect Element' to look find the responsible HTML tags and then use Selenium's selectors (e.g. XPath) to look for them.

For instance if the tabs were generated with JQuery-UI, the tabs container is a <ul> tag with class ui-tabs-nav, and the active tab is an <li> with class ui-state-active.

Selenium can select these elements with XPath in order to perform actions on them.

shamp00
  • 11,106
  • 4
  • 38
  • 81