One way I can think of - not necessarily the best, based on some posts
I've seen there seems to be the concept of cell in 1.5 that I haven't
been able to try. But for what it's worth I think this would work.
if ie.table(:index, 2).exists?
row_count=ie.table(:index, 2).row_count
unless row_count == nil
for i in 1..row_count
#assumes you're looking for data that is displayed in the
browser as text, use a different attribute if not
#could also use regexp ie.table(:index, 2)[i][1].text ~=
/ColumnData/
if (ie.table(:index, 2)[i][1].text == 'Column1Data' and
ie.table(:index, 2)[i][2].text == 'Column2Data')
ie.table(:index, 2)[i][3].click
break
end
end
end
else
puts "table not found"
end
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of MR
> Sent: Wednesday, September 06, 2006 9:38 AM
> To: [email protected]
> Subject: [Wtr-general] Click Link In Table Based on Row and
> Column Numbers
>
> This is a rephrased question because i realized what i was
> asking before didn't capture what i was trying to do.
> Basically, I need to click on a link that may or may not
> exist in a table. The table doesn't have an ID, but I do know
> that it is the second table on the page. I need to indentify
> the possible link by contents in the same row. For example, I
> want to search the table for rows that contain 'Column1Data'
> and 'Column2Data' in columns 1 and 2. Once I find this data,
> I want to click on a link in the same row, but in column
> three IF it exists. This link may not exist.
>
> Thanks again
>
> This is in reference to this thread:
> http://forums.openqa.org/thread.jspa?threadID=3965&tstart=0
> ---------------------------------------------------------------------
> Posted via Jive Forums
> http://forums.openqa.org/thread.jspa?threadID=3981&messageID=1
> 0937#10937
> _______________________________________________
> Wtr-general mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
>
The content contained in this electronic message is not intended to
constitute formation of a contract binding TWTC. TWTC will be
contractually bound only upon execution, by an authorized officer, of
a contract including agreed terms and conditions or by express
application of its tariffs.
This message is intended only for the use of the individual or entity
to which it is addressed. If the reader of this message is not the
intended recipient, or the employee or agent responsible for
delivering the message to the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this
message is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to
the sender of this E-Mail or by telephone.
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general