[wtr-general] Re: Check focus

2011-09-07 Thread Litha K
I tried the following: require 'watir-webdriver' b=Watir::Browser.new :chrome b.goto 'http://www.google.co.uk' b.execute_script('return document.activeElement').inspect and this doesn't seem to work: #Watir::Input:0x6c948b9ebda204ee located=false selector={:element=(webdriver element)} Any

Re: [wtr-general] Re: Check focus

2011-09-07 Thread brett sykes
Well, if you look at the return value, it is a Watir::Input object. Try interrogating the object to figure out what it's properties are. I'll give you a hint - it is the search field. Brett On Wed, Sep 7, 2011 at 9:21 AM, Litha K litha...@googlemail.com wrote: I tried the following:

[wtr-general] Re: Check focus

2011-09-07 Thread Litha K
There are over 400 methods returned for this object. I can check name or id of the search field? Thanks, Kay On Sep 7, 8:07 pm, brett sykes brettcsy...@gmail.com wrote: Well, if you look at the return value, it is a Watir::Input object. Try interrogating the object to figure out what it's

[wtr-general] Re: Check focus

2011-09-06 Thread Litha K
I am using watir-webdriver. when I do b.methods.sort, it doesn't show the method show_active and hence I get the message - NoMethodError: undefined method `show_active' for #Watir::Browser:0x1b46594 The test is actually to check where the focus is even before set 'something' in the text

Re: [wtr-general] Re: Check focus

2011-09-06 Thread brett sykes
That is correct, I am referring to the show_active method in Watir. This method isn't available in watir-webdriver. If you can't find a comparable method in watir-webdriver, then you can always try something like this: require 'watir-webdriver' b = Watir::Browser.new :ie b.goto