Vishal - Normally, I get this error when the table I'm accessing changes during iteration. For example, if you are iterating through a table and some interaction with it adds a row.
I can't tell if that's what you are doing here. It seems like you left some things out in the code below (where does x get set?, why are you iterating through the table rows if you never refer to row?). But if you are modifying the table in your while loop or in sel_trading_partner then I would expect you to get that error. Alan -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Vishal Sent: Wednesday, November 04, 2009 3:08 AM To: Watir General Subject: [wtr-general] Exception thrown while iterating table I am encountering exception while iterating table. Below are the details. Let me know if anymore information is required Code: table3.each do |row| if table3[x][1].text =="Booking ID" while (input = f.gets) $ie.text_field(:index,2).set(input) $ie.button(:value,"Search").click report_page() end end if table3[x][1].text == "Booking Trading Partner Role and Code" sel_trading_partner() end x+=1 end -------------------------------------------------------------------------------------------------------------------------------------------------- Exception : d:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/table.rb:159:in `invoke': u nknown property or method `rows' (WIN32OLERuntimeError) HRESULT error code:0x80070005 Access is denied. from d:/ruby/lib/ruby/gems/1.8/gems/ watir-1.6.2/lib/wati r/table.rb:159:in `_row' from d:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ table.rb:91:in `each' from d:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ table.rb:90:in `upto' from d:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ table.rb:90:in `each' ---------------------------------------------------------------------------------------------------------------------------------------------------- HTML Code: <TABLE col=2 width="100%" cellspacing=2 cellpadding=0> <COLGROUP> <COL width=1> <COL width=100%> </COLGROUP> <TR><TD colspan=2 class=rightPad> <input type=submit class=formbutton value="Search" name="Booking_Query449.My_Criteria_Panel3.layout0.override0.SearchButtons5" > <input type=submit class=formbutton value="Clear" name="Booking_Query449.My_Criteria_Panel3.layout0.override0.SearchButtons5" id="resetButton" onClick="this.hasFocus=true" > <input type=submit class=formbutton value="Export to File" name="Booking_Query449.My_Criteria_Panel3.layout0.override0.SearchButtons5" > </TD> </TR> <TR><TD class=rightPad> <FONT class="inputLabel"> Booking ID </FONT></TD><TD class=rightPad><INPUT TYPE=TEXT VALUE="" NAME="Booking_Query449.My_Criteria_Panel3.layout0.override1.Booking_ID5"></ TD> </TR> <TR><TD class=rightPad> <BR></TD><TD class=rightPad> <BR></TD> </TR> <TR><TD class=rightPad> <FONT class="inputLabel"> Booking Trading Partner Role and Code </FONT></TD><TD class=rightPad><TABLE BORDER=1><TR valign='top'><TD><a name="go"></a> <TABLE BORDER=0 CELLSPACING=4> <TR> <TD VALIGN=CENTER > <SELECT NAME="Booking_Query449.My_Criteria_Panel3.layout0.override2.Trading_Partner5.tpAndRole10.roleList0" SIZE="1"> <OPTION VALUE=-1> <OPTION VALUE=0>Bill To</OPTION> <OPTION VALUE=1>Carrier</OPTION> <OPTION VALUE=2>Consignee</OPTION> <OPTION VALUE=3>Forwarder</OPTION> <OPTION VALUE=4>Market</OPTION> <OPTION VALUE=5>NVO</OPTION> <OPTION VALUE=6>Ship From</OPTION> <OPTION VALUE=7>Ship To</OPTION> <OPTION VALUE=8>Supplier Contact</OPTION> </SELECT> </TD> <TD VALIGN=CENTER > <input type=submit class=formbutton value="Get Role-Codes" name="Booking_Query449.My_Criteria_Panel3.layout0.override2.Trading_Partner5.tpAndRole10.fetchTradePartners1" > </TD> </TR> </TABLE></TD><TD> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to [email protected] Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---
