Reputation: 1177
This issue seems very easy and I have found some threads about it but those solutions don't work when we have multiple tabs more the 2 tabs to select from.
So in this case when I use (goal is to select the tab "Routing"):
...
casper.then(function() {
test.assertTextExists("Test", "Test - tab");
this.click('a.menu1itemUnSel[tabindex="4"]');
});
...
It will select the first not selected tab "Data" and not tab "Routing"!
How can I solve this issue?
Upvotes: 0
Views: 58
Reputation: 61892
Again, CSS selectors are your friend for example with a specific attribute selector matching the content of the attribute:
this.click('a.menu1itemUnSel[href*="tabIndex.value=\'3\'"]');
or
var i = 3;
this.click('a.menu1itemUnSel[href*="tabIndex.value=\''+i+'\'"]');
Upvotes: 2