Actually the statement below about identifiers/locators isn't correct. 
 This is a ruby syntax thing and not a watir one.

b.goto("google.com")

b.text_field(:name => "q").exists?
# This is the same as above
b.text_field(:name,"q").exists?
# You have to use this sytax is you're using multiple locators
b.text_field(:name => "q",:id => "gbqfq").exists?

The beauty of using the watir gem is that it will make the decision about 
which underlying gem to use watir-classic or watir-webdriver when you ask 
it for the browser.  Once you've invoked one or the other though, you're 
stuck with that driver for that ruby process.

require 'watir'

# This will use watir-classic
b = Watir::Browser.new :ie

# This will use watir-webdriver
b = Watir::Browser.new :chrome

On Wednesday, January 23, 2013 5:17:10 PM UTC-5, enroxorz wrote:
>
> So WATIR (in it's current state) is a combination of both watir-classic 
> and watir-webdriver. 
>
> watir-classic is a re-working of the old WATIR API to better conform to 
> watir-webdriver, so stuff like browser.text_field(:id, 'whatever').set 
> ('xxx') wont work in the newer watir-classic api (the identifier is 
> now browser.text_field(:id => 'whatever').set ('xxx'), again to conform 
> with watir-webdriver api, allowing interchangeability between the two 
> without a lot of hassle).
>
> screen_capture is not part of the screenshot class, which is basically 
> just browser.screenshot.save('/path/to/image.png'). The big change is that 
> it does all the hwnd stuff in the back end. Really cool stuff.
>
> What I recommend is update your scripts to conform with 
> watir-classic/watir-webdriver. If you are using more than just IE, then 
> really look at watir-webdriver. If you are at a shot that's website is only 
> IE compatible then watir-classic is a dream.
>
> I hope that helps.
>
> On Wednesday, January 23, 2013 2:52:02 PM UTC-5, [email protected]:
>>
>> Just trying to get some general info. I'm starting from scratch and 
>> installed Watir Classic. I have a collegue who had scripts running using 
>> Watir 1.9.1. he installed Watir Classic and none of the scripts work. 
>> Things like require 'watir/screen_capture' and require 'watir/logger' were 
>> not liked. In general it looks like Watir and Watir Classic are not 
>> compatable?  Is it recommended that only watir classic be used?
>>  
>> Thanks,
>> Richard
>>
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]



Reply via email to