I am trying to convert old Selenium scripts and I've been able to do everything else except for interacting with a Javascript Table our site uses to select regions. I've included a image and the HTML code from the page. Hopefully someone can find the flaw that I'm having trying identifying the object and to open it.
*Actions I'm trying to do in RSpec*
it "Test to Try and change Region" do
@browser.div(:id, "regionTR").fire_event "onmouseover"
@browser.element_by_xpath("//div[@id='twtreeRegion4466']/div[2]").click
end
*Error received:* unable to locate object
*I have also tried *
@browser.element_by_xpath(:xpath, ".//*[@id='a-reg']").click
@browser.element_by_xpath(:xpath, ".//*[@id='a-reg']").fire_event
"onmouseover"
@browser.div(:id, "a-reg").click
@browser.div(:id, "a-reg").fire_event "onmouseover"
**Reference the selenium script that I'm trying convert uses the following
and is able interact with the objects*
selenium.clickAt("a-reg", "");
selenium.click("//div[@id='twtreeRegion4466']/div[2]");
*HTML CODE SNIPPET*
<tr>
<td class="left">
<td class="right">
<table>
<tbody>
<tr>
<td id="regionTR" align="left" title="Click to select the region" style="">
<div id="btn-reg">
<a style="display:block; width:300px; height:17px; text-decoration: none;
cursor:pointer;" onkeydown="javascript:regionMenuKeypress(event);"
href="javascript:void(0);">
<table class="regionDropdown" cellspacing="0" cellpadding="0"
style="table-layout: fixed;">
<tbody>
<tr>
<td class="leftfilter"></td>
<td id="a-reg" class="middlefilter">Baden-Württemberg</td>
<td class="rightfilter"></td>
</tr>
</tbody>
</table>
</a>
</div>
<div id="regionMenu" class="filterbox" align="left" style="display:none;">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]
<<attachment: regiondropdown.JPG>>
