Questions tagged [watir]

Watir (pronounced water) stands for Web Application Testing in Ruby. Watir is an open-source (BSD) family of Ruby libraries for automating web browsers. It is distributed as a Ruby GEM named 'Watir'. Watir was primarily developed by Bret Pettichord and Paul Rogers.

Watir (Web Application Testing in Ruby, pronounced water), is an open-source (BSD) family of Ruby libraries for automating web browsers. It drives Internet Explorer, Firefox, Chrome, Opera and Safari, and is available as a RubyGems gem.

You can find more about Watir at the Watir web site and the Watir Google group.

2629 questions
146
votes
5 answers

How to find out which JavaScript events fired?

I have a select list: When I select Closed the page reloads. In this case it shows closed tickets (instead of opened).…
Željko Filipin
  • 56,372
  • 28
  • 94
  • 125
31
votes
10 answers

Unable to find the chromedriver executable

Unable to find the chromedriver executable. Please download the server from http://code.google.com/p/chromedriver/downloads/list and place it somewhere on your PATH. More info at http://code.google.com/p/selenium/wiki/ChromeDriver.…
21
votes
3 answers

Setting browser window size in Watir-webdriver

How can you specify the size of the browser window opened when you call the following with watir-webdriver? browser = Watir::Browser.new(:firefox)
Alastair Montgomery
  • 1,756
  • 5
  • 21
  • 44
21
votes
3 answers

How to remove all non - ASCII characters from a string in Ruby

I seems to be a very simple and much needed method. I need to remove all non ASCII characters from a string. e.g © etc. See the following example. #coding: utf-8 s = " Hello this a mixed string © that I made." puts s.encoding puts…
Nick
  • 261
  • 1
  • 2
  • 4
20
votes
2 answers

How do I change the page load Timeouts in Watir-Webdriver (timeout in .click method)

I have the following code browser.link(:text => 'Generate Report').click browser.radio(:value => 'byTotalValue').wait_until_present(180) which requests that a report be generated and then waits for the report by looking for an element on the…
user1142012
  • 323
  • 1
  • 3
  • 7
19
votes
7 answers

How to use watir-webdriver to wait for page load

Using watir-webdriver, how do I wait for a page to load after I click a link? At the moment I am using: sleep n But this is not ideal as the page response varies so much. Is there a way to test whether the page is ready or whether there is a…
user138095
19
votes
9 answers

Disable chrome download multiple files confirmation

I developed a crawler with ruby watir-webdriver that downloads some files from a page. My problem is that when I click to download the second file, Chrome opens a bar in the top asking for confirmation that I am downloading multiple files from this…
17
votes
2 answers

no such file to load -- ffi_c (LoadError)

This problem is bugging me for a couple of days now... Whenever I'm using the .bring_to_front method require "rubygems" require "watir" browser = Watir::Browser::new browser.bring_to_front I get this error: (...)rubygems/custom_require.rb:36:in…
drake10k
  • 415
  • 1
  • 5
  • 21
17
votes
3 answers

How do I use Watir::Waiter::wait_until to force Chrome to wait?

I'm trying to tell my watir script to wait for an ajax-injected login box to open up. I am using watir-webdriver, and testing in Chrome. I cannot get wait_until to work, as commented in the below (simplified) script. require "rubygems" require…
karim79
  • 339,989
  • 67
  • 413
  • 406
16
votes
5 answers

Compile ruby script into exe?

Is it possible to compile a ruby script into an .exe on Windows? I have searched everywhere and I've tried the following (It looked like RubyScript2EXE, Shoes and Crate all seemed dead or abandoned.): http://ocra.rubyforge.org/…
Jonathan Jeffus
  • 201
  • 1
  • 2
  • 6
16
votes
3 answers

Can watir-webdriver capture console errors?

I am wondering if watir-webdriver as the ability to log the output of any console errors? This would be equivalent to manually opening the console in a browser and watching for JS errors as a page loads. Can I capture this through watir-webdriver…
negativebase
  • 169
  • 1
  • 6
16
votes
4 answers

How to specify the location of the chromedriver binary

Earlier I had put the Chrome binary, "chromedriver.exe", in the "C:/Windows" directory and Watir was picking it from there. Now I have to move my project to another machine so I can't hardcode the executable path. I also want the binary to be kept…
paul
  • 4,333
  • 16
  • 71
  • 144
15
votes
3 answers

Is drag-and-drop possible in watir-webdriver?

I would like to drag-and-drop one element to the position of another, triggered from within a watir-webdriver script. By "drag-and-drop" I mean picking up a draggable element and releasing it on another. By "possible" I mean any method for drag/drop…
kinofrost
  • 768
  • 6
  • 16
15
votes
4 answers

Heroku: unable to connect to chromedriver 127.0.0.1:9515 when using Watir/Selenium

This runs locally (without specifying driver_path), but not on Heroku. Code: Selenium::WebDriver::Chrome.driver_path = ENV['GOOGLE_CHROME_SHIM'] browser = Watir::Browser.new :chrome I've confirmed below values in heroku rails…
tim_xyz
  • 11,573
  • 17
  • 52
  • 97
15
votes
7 answers

how to scroll a web page using watir

I am trying to scroll a web page to find and click on a content that is lazily loaded when the page is scrolled. I am using following command require 'watir-webdriver' @browser = Watir::new :firefox @browser.send_keys :space I am using web-driver…
amjad
  • 2,876
  • 7
  • 26
  • 43
1
2 3
99 100