On Thursday, January 24, 2013 6:20:38 PM UTC+2, Dan wrote:

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

 
Actually this statement isn't correct either.

  b.text_field(:name => "q").exists?

is actually same as:
  b.text_field({:name => "q"}).exists?

In other words - it is a method invocation with one argument (a Hash).

On the other hand, this syntax:
  b.text_field(:name,"q").exists?

Is a method call with two separate arguments (a Symbol and a String).

Watir supports both syntaxes and converts into Hash one internally for 
backward compatibility. This is done in watir-classic in format_specifiers 
method 
at 
https://github.com/watir/watir-classic/blob/master/lib/watir-classic/supported_elements.rb#L184-L191.
 
There is some similar solution in watir-webdriver too.

Using always a Hash syntax is a recommended way.
 

Answering the original question, watir is a meta-gem, which will install 
and load the gem which works on your platform (watir-classic on Windows and 
watir-webdriver on unix systems by default).

So, install Watir and then start using watir-webdriver or watir-classic 
depending of your OS and needs.

Jarmo Pertman
-----
IT does really matter - http://itreallymatters.net

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

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com



Reply via email to