This is what I would try given the html you sent. 

$ie.table( :index, 1 )[1][3].click

 

If this table is nested inside other tables you will need to get the index number by counting the tables—starting at the top-most table—by doing a:

  1. Right click in the web page and select ‘View Source’
  2. DO ctrl + f and put <table in the ‘find what’ field
  3. Click enter (or find next) and count the tables until the table you want appears—that is you table index number (it is 1 based).

 

Inside your desired table:

-- the <tr> tags are the first bracket [the nth <tr> inside your table]

-- the <td> tags are the second bracket [the nth <td> inside your table]

 

$ie.table( :index, 1 )[1][3].click

You can use the flash method to figure out where you are on the page to debug.

$ie.table( :index, 1 )[1][3].flash

 

You could also use the fireEvent method if the click does not work for you.

$ie.table( :index, 1 )[1][3].fireEvent(“OnClick”)

 

Hope this helps,

 

--Mark

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Solis
Sent: Wednesday, January 25, 2006 9:01 PM
To: [email protected]
Subject: [Wtr-general] Another _javascript_ Question

 

All,

 

I've been trying desperately for over week to figure out how to click on _javascript_ button to no avail. I have tried just about everybody's suggestions. Mark Cain's solution posted last week looked very promising, but can't get it to work. Here is the code that contains the buttons (cancel & update) I need to click on:

 

<table cellpadding="0" cellspacing="0" border="0" width="300">   
<tr
<td>
    <img src="/images/admin/form_top_left.gif">
</td>    
<td background="">"/images/admin/form_top_tile.gif">
    <img src="">"/images/admin/spacer.gif" width="10" height="48">
</td>    
<td>
    <a >"return validate_form('ADMINPayModelUpdate','enable')" 
        >"imgswap('enablealltop', 'form_top_enableall_over'); 
        return false;" >"imgswap('enablealltop', 'form_top_enableall_up'); return false;">
    <img NAME="enablealltop" src="">"/images/admin/form_top_enableall_up.gif" value="Enable all" border="0"></a>
    <a >"return validate_form('ADMINPayModelUpdate','disable')" 
        >"imgswap('disablealltop', 'form_top_disableall_over'); return false;" 
        >"imgswap('disablealltop', 'form_top_disableall_up'); return false;">
    <img border="0" NAME="disablealltop" src="">"/images/admin/form_top_disableall_up.gif" value="Disable all">
    </a>
</td>    
<td background="">"/images/admin/form_top_tile.gif">
    <img src="">"/images/admin/spacer.gif" width="226" height="48">
</td>    
<td>
    <a href="">"_javascript_:document.ADMINPayModel.reset()" 
        >"return validate_form('ADMINPayModelUpdate','cancel')" 
        >"imgswap('canceltop', 'form_top_cancel_over'); return false;" 
        >"imgswap('canceltop', 'form_top_cancel_up'); return false;">
    <img NAME="canceltop" src="">"/images/admin/form_top_cancel_up.gif" border="0">
    </a>
    <a href="">"#" >"return validate_form('ADMINPayModelUpdate','update')" 
            >"imgswap('updatetop', 'form_top_update_over'); return false;" 
            >"imgswap('updatetop', 'form_top_update_up'); return false;">
     <img NAME="updatetop" src="">"/images/admin/form_top_update_up.gif" value="Update" border="0">
    </a>
</td>    
<td background="">"/images/admin/form_top_tile.gif">
    <img src="">"/images/admin/spacer.gif" width="6" height="48">
</td>    
<td>
    <img src="">"/images/admin/form_top_right.gif">
</td>   
</tr
</table>
Thanks
!
David 
 


Do you Yahoo!?
With a free 1 GB, there's more in store with Yahoo! Mail.

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to