Ah, so after you browse to the main test page, a new window is opened that contains the content you need to access?
In that case you are entering the world of popups and attaching. :) See more info here: http://wiki.openqa.org/display/WTR/Pop+Ups In short, you can use Watir::Browser.attach (or Watir::IE.attach if you are only using IE) to attach to the new window and interact with it. Thanks Bill On Thu, Oct 8, 2009 at 4:26 AM, venkat <[email protected]> wrote: > Hi Bill, > The select element is not present as per the error message. > So after troubleshooting what i understood is.... > > when i clicked on login button, the next page is opening up in a new window > rather than opening in the same window, so my script is not verifying the > elements in the newly opened window which has the SELECT element. > > To go to that page I too have to handle that in my watir script that if i > click on LOGIN button the my watir script should go to the next of the login > functionality which has select element. > > i have written the script like this to go to the 'next to login' page which > is opening in a new window with url contains .(here i have not mentioned the > sessionid after /Managejurisdictions.do/sessionid_.........) > ie.goto("http://mysite/EJusticeWeb_trunk/ManageJurisdictions.do") > > but it fails becos the 'next to login' page has url with some dynamic > sessionid included so that page is breaking....i don't know how to redirect > to that 'next to login' page by wrinting watir script. > > > Please help me. > > thanks, > venky > > > > > > On Thu, Oct 8, 2009 at 2:54 PM, Bill Agee <[email protected]> wrote: > >> Is the error still happening when locating the select list? It seems to >> work for me with the HTML you pasted - maybe something else is amiss. >> >> ie.select_list(:name , "jurisdiction").select("Development") >> >> What happens when you run this? >> >> ie.select_list(:name , "jurisdiction").exists? >> >> >> >> On Wed, Oct 7, 2009 at 10:42 PM, venkat <[email protected]> wrote: >> >>> I can't figure it out, could you please help me. Following is the html >>> for Select list item. >>> >>> <select id="jurisdiction" name="jurisdiction" tabindex=""> >>> >>> <option value="345"> >>> Calhoun County, MI >>> </option> >>> >>> <option value="346" >>> >>> selected="true"> >>> Development >>> </option> >>> >>> <option value="344"> >>> Midland County Test, MI >>> </option> >>> >>> <option value="351"> >>> Montgomery County, TX >>> </option> >>> >>> </select> >>> >>> and this is the html for SELECT BUTTON >>> <tr> >>> <td valign="top" align="left"><input >>> name="btn1" type="button" class="Button75" onclick="gotoAction();" >>> onmouseover="this.className='Button75 Button75_over'" >>> onmouseout="this.className='Button75'" value="Select" /></td> >>> </tr> >>> >>> THANKS >>> >>> On Tue, Oct 6, 2009 at 10:39 PM, Bill Agee <[email protected]>wrote: >>> >>>> The exception from Watir indicates the problem is this line: >>>> >>>> ie.select_list( :name , "jurisdiction").select("Development") >>>> >>>> As the error says, there's no select list found with the name >>>> "jurisdiction". The HTML for that element should show the way to fix the >>>> problem - if you can't figure it out just post the HTML for that one >>>> element. >>>> >>>> Thanks >>>> Bill >>>> >>>> >>>> >>>> On Tue, Oct 6, 2009 at 2:53 AM, venkat <[email protected]> wrote: >>>> >>>>> Hi, >>>>> >>>>> Thanks for responding back, actually my application is running fine. >>>>> >>>>> Exactly Error shown is the following: >>>>> >>>>> >ruby y.rb >>>>> >>>>> >>>>> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5.rc1/lib/watir/element.rb:56:in >>>>> `assert_exists': Unable to locate element, using :name, "jurisdiction" >>>>> (Watir::Exception::UnknownObjectException) >>>>> >>>>> >>>>> from >>>>> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5.rc1/lib/watir/input_elements.rb:62:in >>>>> `select_item_in_select_list' >>>>> >>>>> >>>>> from >>>>> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5.rc1/lib/watir/input_elements.rb:46:in >>>>> `select' >>>>> >>>>> from y.rb:23 >>>>> >>>>> >Exit code: 1 >>>>> >>>>> >>>>> >>>>> My watir script y.rb is the following: >>>>> >>>>> >>>>> >>>>> require 'rubygems' >>>>> >>>>> require "watir" >>>>> >>>>> require 'test/unit' >>>>> >>>>> require 'win32ole' >>>>> >>>>> require 'watir/contrib/ie-new-process' >>>>> >>>>> test_site = "http://xyz/home.do" >>>>> >>>>> ie = Watir::IE.new_process >>>>> >>>>> ie.set_fast_speed >>>>> >>>>> ie.goto test_site >>>>> >>>>> ie.text_field(:name, 'userName').set('darin') >>>>> >>>>> ie.text_field(:name, 'password').set('Tester123') >>>>> >>>>> ie.button(:value, 'Log in').click >>>>> >>>>> sleep (20) >>>>> >>>>> ie.goto('http://xyz/ManageJurisdictions.do') >>>>> >>>>> sleep (20) >>>>> >>>>> ie.select_list( :name , "jurisdiction").select("Development") >>>>> >>>>> sleep (20) >>>>> >>>>> ie.button(:value, 'btn1').click >>>>> >>>>> sleep (20) >>>>> >>>>> ie.link(:text,"LogOut").click >>>>> >>>>> ie.close() >>>>> >>>>> >>>>> >>>>> I want to perform 3 actions in the page. >>>>> >>>>> Select item from the drop down list box --> development >>>>> >>>>> Click on SELECT button >>>>> >>>>> Click on Logout >>>>> >>>>> (FYI: Logout has the following properties: >>>>> >>>>> Name - Value >>>>> >>>>> Href - xyz. >>>>> >>>>> OnClick - logOutFunction() >>>>> >>>>> OnClick - gotoActionUrl('Login.do?dispatchto=logout') >>>>> >>>>> >>>>> >>>>> Please help me.... >>>>> >>>>> >>>>> >>>>> thanks, >>>>> >>>>> venky >>>>> >>>>> >>>>> On Mon, Oct 5, 2009 at 6:04 PM, Anna Gabutero <[email protected]>wrote: >>>>> >>>>>> >>>>>> On Mon, Oct 05, 2009 at 05:46:10PM +0530, venkat wrote: >>>>>> > Hi, >>>>>> > I got the following error and my script fails to identify the list >>>>>> item, >>>>>> > can't click the Select button and Logout too fails. Can anyone >>>>>> please help >>>>>> > me. >>>>>> > >>>>>> > HTTP Status 500 - >>>>>> > >>>>>> >>>>>> This is a problem with the application you're testing, not a problem >>>>>> with Watir. Read this for more information: >>>>>> http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html >>>>>> >>>>>> >>>>>> - Anna >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>> >>>> >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
