Re: [wtr-general] Re: Differences between Watir, FireWatir, Webdriver ?

2010-08-15 Thread Jari Bakken
On Sat, Aug 14, 2010 at 5:33 PM, Chan Nguyen  wrote:
> 1) var/lib/gems/1.8/gems/watir-webdriver-0.0.6/lib/watir-webdriver/
> base_element.rb:186:in `text': undefined method `text' for
> #
> (NoMethodError)

This is a known issue in watir-webdriver (we have a failing spec for
it). You can track this issue to follow its progress:

http://github.com/jarib/watir-webdriver/issues/issue/17

-- 
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


[wtr-general] Re: Differences between Watir, FireWatir, Webdriver ?

2010-08-14 Thread Chan Nguyen
Thanks Pallavi and Chris for clear explanation,
I actually found out that webdriver are more consistent with watir
then firewatir.
firewatir does not regconize "frame nested" element and it run very
slow comparing with webdriver.
Here are the errors:

--
/var/lib/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/element.rb:907:in
`assert_exists': Unable to locate element, using :id,
"cblModules_0" (Watir::Exception::UnknownObjectException)
from /var/lib/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/elements/
radio_check_common.rb:153:in `clear'
---

And this script is the one that I run again 'watir' and 'webdriver'
without any issues

---
main_frame = browser.frame( :id, "Main_Body" )
puts "5. Uncheck all options ( 15 totals )"
0.upto( 15 ) do |number|
main_frame.checkbox( :id, "cblModules" + "_" + number.to_s ).clear
end
---

The only difference that I found right now is the way 'watir' and
'webdriver' handling text is different.
This works well with 'watir'

0) if main_frame.contains_text( "str" )

But with webdriver, it failed no matter what I tried:

1) main_frame.text.include( "str" )

or

2) browser.text.include( "str" )

* Errors :
0) undefined method `contains_text' for #
(NoMethodError)
1) var/lib/gems/1.8/gems/watir-webdriver-0.0.6/lib/watir-webdriver/
base_element.rb:186:in `text': undefined method `text' for
#
(NoMethodError)
2) /var/lib/gems/1.8/gems/watir-webdriver-0.0.6/lib/watir-webdriver/
base_element.rb:312:in `assert_exists': unable to locate element,
using {:tag_name=>"a", :text=>"Customize Home Page"}
(Watir::Exception::UnknownObjectException)
from /var/lib/gems/1.8/gems/watir-webdriver-0.0.6/lib/watir-webdriver/
base_element.rb:195:in `click'

Whole script:
-
puts "4. Click on 'Customize Home Page' link"
browser.link( :text, "Customize Home Page" ).click

main_frame = browser.frame( :id, "Main_Body" )
puts "5. Uncheck all options ( 15 totals )"
0.upto( 15 ) do |number|
main_frame.checkbox( :id, "cblModules" + "_" + number.to_s ).clear
end

module_array = [ "24-Hour Market Watch",
 "Agent Tools",
 "Appointments and Tasks",
 "Client Portal Activity",
 "Listing Locator",
 "Newly Matched Listings",
 "Office Tools",
 "Prospect Management",
 "Staff Tools",
 "Support Center",
 "Weather",
 "Your Listings",
 "Your Office Listings",
 "Your Recent Searches",
 "Your Saved Hotsheets",
 "Your Saved Searches" ]



puts "6. Check each individual module and check to see whether it
appear in 'Home Page'"
0.upto( 15 ) do |number|
main_frame.checkbox( :id, "cblModules" + "_" + number.to_s ).set
browser.button( :id, "btnSave" ).click
if browser.text.include?( module_array[ number ] )
puts " -> Test " + module_array[ number ] + " passed."
else
puts " -> Test " + module_array[ number ] + " failed."
end
browser.link( :text, "Customize Home Page" ).click
end



On Aug 14, 8:32 am, Chris  wrote:
> > ps: Why don't people make them become consistent and unique for all
> > browsers ( IE, FF, Safari... )?
>
> Unlurking for a minute because this is an interesting question.
>
> IE has a proprietary API published by Microsoft.  Microsoft also has a
> long history of jacking anyone who emulates their public APIs by
> changing them so as to make critical applications no longer function
> with MS products.  So no one is interested in emulating the
> proprietary IE API.
>
> Firefox runs so many places that it is essentially an OS unto itself.
> To drive FF via its API, you have to pretty much turn it into a telnet
> server and turn the tests running in the browser into little telnet
> clients.
>
> Safari has its own Mac-specific API, and shares a rendering engine
> w

[wtr-general] Re: Differences between Watir, FireWatir, Webdriver ?

2010-08-14 Thread Chris



> ps: Why don't people make them become consistent and unique for all
> browsers ( IE, FF, Safari... )?

Unlurking for a minute because this is an interesting question.

IE has a proprietary API published by Microsoft.  Microsoft also has a
long history of jacking anyone who emulates their public APIs by
changing them so as to make critical applications no longer function
with MS products.  So no one is interested in emulating the
proprietary IE API.

Firefox runs so many places that it is essentially an OS unto itself.
To drive FF via its API, you have to pretty much turn it into a telnet
server and turn the tests running in the browser into little telnet
clients.

Safari has its own Mac-specific API, and shares a rendering engine
with Chrome.

The *watir projects attempted to address each individual API from
within the Watir framework itself.  And they did a good job.  But
Simon Stewart had this crazy idea to do it independently himself.  And
when Simon went to work for Google, google took over some of the
maintenance of that code, called Webdriver.  Today, I don't think
anyone would argue that the Webdriver library is better than what
exists in the Watir framework.

Webdriver is robust enough now to be very useful, and both the
Selenium and Watir projects are migrating to using Webdriver as the
only browser engine.  Webdriver itself could use a lot more
documentation than it has, and I actually wanted to work on that this
summer, but my life didn't allow it.

-- 
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