it sounds almost like the frame has come disconnected and you need to re-attach. Remember that the objects in your code are pointing at objects in the DOM of the browser. when you create an object in your code like 'main_frame' it's pointing to a specific instance of the object in the DOM that was identified by the parameters you used. It does NOT use those parameters like an alias and go 'find' the object each time. If that prior instance of the frame is destroyed and recreated, your main_frame object could be pointing at the old one that is no longer around. If you are changing pages or things are being reloaded as a result of your actions, maybe (guessing here, but worth a shot) that could be what's happening. In that case after the new page is loaded, you need to re-connect your 'main_frame' object to the NEW instance of the frame inside the browser. So you might need to repeat the
main_frame = browser.frame( :id, "Main_Body" ) to reestablish the connection to the frame A decent test for that might be to see if a simple action like main_frame.flash works earlier in the script but not at the point where things break down. or perhaps as Charley indicated, it's something in IE's cross site scripting (XSS) security stuff is preventing access to the contents of the frame? I presume you are using IE, would there be potential to switch to firefox? it doesn't have the same style of XSS mitigation that IE does, and that might make a difference if the problem is caused by code across multiple sites. Also you asked about other tools, potentially you might look at Selenium Webdriver.. although if it depends on the same API as the others, (which is highly likely) then it may not make a difference either as this really feels like it's down at the IE API / Win32OLE level. Lastly, be aware that in your sample code, all the text values for the select list choices have a leading space, so if you are selecting by the displayed text, you'll need to include that (some earlier examples folks gave you in this thread failed to do that, but the later ones took it into account) On Aug 20, 8:10 am, Basim Baassiri <ba...@baassiri.ca> wrote: > I just tried my suggestion with success with the following > pagehttp://overlay-retail-test-files.overlay.tv/watir/watir-group-frame.html > > Chan, you'll need to provide either the minimum html that causes the ruby > exception or a link to the page > > > > On Thu, Aug 19, 2010 at 6:04 PM, Chan Nguyen <atbl1...@gmail.com> wrote: > > Hi Basim, > > > Great thanks for your answer, but it still does not work. The same > > error occurred: > > C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/frame.rb:52:in > > `method_missing': document (WIN32OLERuntimeError) > > I also tried Telerik WebUI Test Studio, it does not recognize frame > > either. Our web service system is huge, I was so excited to start at > > the beginning. But now I feel so lost and frustrated, I feel like > > making even 50% of the system automation is impossible task. :( ! > > > On Aug 19, 2:18 pm, Basim Baassiri <ba...@baassiri.ca> wrote: > > > Have you tried reading the documentation for select_list > > > > Can you try something like this? > > > browser.frame( :id, "Main_Body" ).select_list( > > > :name, "Property_Type_ComboBox" ).select( "Mobile/Floating Home" ) > > > or > > > browser.frame( :id, "Main_Body" ).select_list( > > > :name, "Property_Type_ComboBox" ).select_value( "MOBL" ) > > > > Basim > > > > On Thu, Aug 19, 2010 at 5:05 PM, Chan Nguyen <atbl1...@gmail.com> wrote: > > > > I'm so frustrated with iframe using Watir. I really don't want to give > > > > up on 'watir' but it seems too difficult to get the job done :( ! I > > > > really need an advice, please help. What's other alternative for Web > > > > Testing Automation? > > > > > On Aug 19, 9:38 am, Chan Nguyen <atbl1...@gmail.com> wrote: > > > > > Hi everyone, > > > > > I run into an issue when accessing a ComboBox through frame, I got > > > > > this error message : > > > C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/frame.rb:52:in > > > > > `method_m > > > > > issing': document (WIN32OLERuntimeError) > > > > > OLE error code:80070005 in <Unknown> > > > > > Access is denied. > > > > > > HRESULT error code:0x80020009 > > > > > Exception occurred. > > > > > from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ > > > > > frame.rb:52 > > > > > :in `document' > > > > > from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ > > > > > container.r > > > > > b:800:in `locate_input_element' > > > > > from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ > > > > > input_eleme > > > > > nts.rb:5:in `locate' > > > > > from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ > > > > > element.rb: > > > > > 53:in `assert_exists' > > > > > from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ > > > > > input_eleme > > > > > nts.rb:62:in `select_item_in_select_list' > > > > > from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ > > > > > input_eleme > > > > > nts.rb:46:in `set' > > > > > from Listing.rb:28 > > > > > > But I really don't know why, since the "nested frame" worked for one > > > > > page, that page does have the same "iframe". While it failed badly on > > > > > the other page: > > > > > > The ruby code: > > > > > main_frame = browser.frame( :id, "Main_Body" ) > > > > > main_frame.select_list( :name, > > > > > "Property_Type_ComboBox" ).set( "MOBL" ) > > > > > > And the HTML source from FireBug: > > > > > <select onchange="apnFormat()" name="Property_Type_ComboBox"> > > > > > <option value=""> </option> > > > > > <option selected="" value="RESI"> Residential</option> > > > > > <option value="MOBL"> Mobile/Floating Home</option> > > > > > <option value="LOTL"> Lots & Land</option> > > > > > <option value="MFM5"> Multi Unit 5+</option> > > > > > <option value="COMI"> Commercial</option> > > > > > <option value="BUSO"> Business Opportunity</option> > > > > > </select> > > > > > > Any idea? Thanks in advance! > > > > > -- > > > > Before posting, please readhttp://watir.com/support. In short: search > > > > before you ask, be nice. > > > > > You received this message because you are subscribed to > > > >http://groups.google.com/group/watir-general > > > > To post: watir-general@googlegroups.com > > > > To unsubscribe: > > > > watir-general+unsubscr...@googlegroups.com<watir-general%2bunsubscr...@goog > > > > legroups.com> > > <watir-general%2bunsubscr...@googlegroups.com<watir-general%252Bunsubscribe > > @googlegroups.com> > > > -- > > Before posting, please readhttp://watir.com/support. In short: search > > before you ask, be nice. > > > You received this message because you are subscribed to > >http://groups.google.com/group/watir-general > > To post: watir-general@googlegroups.com > > To unsubscribe: > > watir-general+unsubscr...@googlegroups.com<watir-general%2bunsubscr...@goog > > legroups.com> -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com