[Wtr-general] Identifying a tab to click on

Paul Carvalho tester.paul at gmail.com
Sun Dec 3 10:20:48 EST 2006


Maybe you're being too specific?

Did you try just: $ie.span(:index, 1).click

Or, based on the id tag, does this work: $ie.span(:id, 'firstTab').click


On 03/12/06, Neil Daniell <neridan at paradise.net.nz> wrote:
>
>  I am trying to use Watir to click on secondTab but cannot seem to get the following to work:
> $ie = IE.new
> ....
> $ie.div(:index, 1).table(:index,1)[1][2].span(:index, 1).click
> Can someone indicate to me how I can fix this?
> Is it possible to select an element via the class?
>
> Page source:(jsp)
>
> <div class="TabGroup">
> <table width="100%" cellpadding="0" cellspacing="0">
> 	<tr>
> 		<td nowrap="true" width="99">
> 			<span id="firstTab" class="TabSelected" style="background-image:url(images/tabs/firstTab.gif)"
> 				  onclick="if (PageUI.isLoaded()) selectTab(0);"
> 				  onfocus="this.click();"
> 				  title="First Tab"><pre style="display:none"/></span>
> 		</td>
> 		<td nowrap="true" width="99">
> 			<%-- Show the Second Tab --%>
> 			<span id="secondTab" class="Tab" style="background-image:url(images/tabs/secondTab.gif)"
> 				  onclick="if (PageUI.isLoaded()) selectTab(1);"
> 				  onfocus="this.click();"
> 				  title="Second Tab"><pre style="display:none"/></span>			
> 		</td>
> 	</tr>
> 	<tr>
> 		<td colspan="3" id="TabGroupLine" class="TabGroupLine" style="background: #BDE8FF;"/>
> 	</tr>
> </table>
> </div>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061203/69d080f4/attachment.html 


More information about the Wtr-general mailing list