[Wtr-general] Identifying a tab to click on

Neil Daniell neridan at paradise.net.nz
Sun Dec 3 03:33:53 EST 2006


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/0f001d66/attachment.html 
-------------- next part --------------
An embedded message was scrubbed...
From: "Daniell, Neil" <DaniellN at anz.com>
Subject: main.jsp
Date: Thu, 30 Nov 2006 17:18:18 +1300
Size: 4399
Url: http://rubyforge.org/pipermail/wtr-general/attachments/20061203/0f001d66/attachment.mht 


More information about the Wtr-general mailing list