Tell me more ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

Is it possible to use Watir WebDriver in conjunction with Java? I have to execute some Java methods for dealing with data in DB in order to simulate different situations and test website UI using watir-webdriver.

I've read about JRuby, but could not find anything about whether it works with Watir WebDriver.

Please share your experience!

share|improve this question
Welcome to SQA, mihijs. I do not have any experience with Watir, but a Google search turned up [Watij][watij.com/]. Selenium/Webdriver has a Java API too. – user246 Dec 17 '12 at 14:48

1 Answer

Instead of searching if Watir works on JRuby, you could have just tried it, like I did:

$ 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/"

In case it is not clear, Watir works just fine on JRuby.

share|improve this answer
The question was whether it works with Java, not JRuby. The approach itself is fine, though: "just try it!" – dzieciou Dec 17 '12 at 13:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.