Watir-webdriver combined with java

Is it possible to use watir-webdriver in conjunction with java in jUnit test cases? Do I have to execute some java methods for processing data in a database in order to simulate various situations and check the web interface of a website using watir-webdriver?

I wrote jUnit test cases in which I would like to use watir-webdriver for UI test scripts.

I read about jruby, which allows you to embed ruby ​​methods in java code and vice versa, but could not find real examples of how to implement watir webdriver in junit tests.

Share your experience!

+4
source share
1 answer

Instead of looking to see if Watir works in JRuby, you could just try it out like me:

$ ruby -v jruby 1.7.1 (1.9.3p327) 2012-12-03 30a153b on Java HotSpot(TM) 64-Bit Server VM 1.6.0_37-b06-434-11M3909 [darwin-x86_64] $ gem install watir ... Successfully installed watir-4.0.2 $ irb > require "watir" => true > browser = Watir::Browser.new :firefox => #<Watir::Browser:0x4fcd5906 url="about:blank" title=""> > browser.goto "google.com" => "http://www.google.hr/" 

If this is not clear, Vatyr works great on JRuby.

+2
source

All Articles