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.
4,212
questions
0
votes
0
answers
37
views
Class methods vs Instances when using Page object model in ruby
I hope you are having a great day!
I'm wandering something, when using the POM (Page object model) we always create new instances of our classes, like the following simple example:
class LoginPage
...
0
votes
1
answer
33
views
How to convert a string to an object reference in ruby
I want to take in a page name in a gherkin step then set it as an object reference (I think that's what it's called.) Then I can use that to interact with page elements. Is there an easier way to do ...
0
votes
0
answers
27
views
Watir Click JS Button
I can't seem to get past a button in a landing page. Here is the JS element with parent nodes:
<div class="modal-body-content callfor-popup">
<h3>Welcome | Bienvenue</h3>...
0
votes
0
answers
34
views
Watir Raising Error, "Net::ReadTimeout: Net::ReadTimeout with #<TCPSocket:(closed)>" When Attempting To Create New Browser
I am working on a rails application that pulls data from a REST endpoint and then scrapes a production website that consumes said endpoint to ensure the contents is present and displaying correctly. I ...
1
vote
2
answers
168
views
Accessing browser dev tools and capturing network traffic using Watir
Have a requirement to capture network traffic from the browser while running automation test cases.
Came across below post but not sure if it has been included as part of Watir 7.
Appreciate if there ...
0
votes
1
answer
31
views
Watir Set value of input type="text"
I am trying to set an email into this span but I'm having trouble selecting it and updating it. The span id is created dynamically but the class is not
<div class="input input-lg form-input&...
0
votes
1
answer
36
views
Watir Invisible Button Breaking Ruby Script
I'm using Watir to load a page. It loads items, and has a LOAD MORE button at the bottom if there are further products.
In the HTML the button exists even if there are no more items to load, but it's ...
0
votes
0
answers
26
views
Correct formatting of no_proxy noProxy in browser constructor in watir
Is this the correct way to use no_proxy/noProxy?
it seems to work in firefox but not chrome, using actual chrome version 99.
The WATIR proxy documentation does not cover this.
proxy_object = nil
...
0
votes
1
answer
55
views
Ruby + watir: format cookie for web crawler
I have started building a web scraper to get some data for an API, however the url requires a 'continue as guest' for each daily visit. This is the cookie I from the request header:
web_site=...
0
votes
1
answer
44
views
How to open a Chrome window with Watir
I can't manage to make Watir run properly.
I followed all the instructions step by step, installing Watir and the Chrome drivers, and checked that the drivers and Chrome are the same version, v98.0.
...
0
votes
1
answer
18
views
Watir: Problems trying to get the value of a field that's contained within an iframe
I'm trying to verify the text within a field that's held in an iframe using the shown in the image below.
When I run it I get this syntax error:
/opt/homebrew/lib/ruby/gems/3.0.0/gems/watir-6.19.1/lib/...
1
vote
1
answer
75
views
Locating table cell using the header cell text
I have table kind of appearance as shown below but it's not a single table. Header is in one table and rows are in another table.
The header has Primary, Language and the add button which is one ...
0
votes
1
answer
35
views
Parsing Watir Results
I'm using Watir for getting data from published items, 12 on a single page. Structured as presented below, I am expecting 12 items to show up, much like how Nokogiri parses results. I am using the :...
0
votes
1
answer
23
views
Ruby Watir Gem Won't See Updated Div
I have a scrape on a JS driven HTML page that updates found products on the same page. I want to grab the products and parse them out. I want to then move onto the next page, which I have already ...
0
votes
0
answers
15
views
Watir-webdriver, how to stop FQDN redirect to the host name only
Im an using Mac and there is an known issue wherein I am not able to access the application with just the host name and so I have to use the Full name like host.x.y.z.com. When manually opening this ...
0
votes
1
answer
49
views
WATIR - How can I locate an element using more than one identifier
My test is trying to check whether or not an error message or a success message is displayed.
The CSS for the two messages is:
span id="APEX_SUCCESS_MESSAGE" data-template-id="...
0
votes
1
answer
56
views
Enter text in browser watir, ruby
I'm using watir to automate a task. After being logged in, i need to enter a text, my cursor is already on the message window so no need to locate the element, just need to type my text and send(:...
0
votes
0
answers
38
views
How do you click a button in a browser popup window
I'm new to using Watir and have a problem. Within my browser page there is an option to add a note. This brings up a window within the browser which has the following id:
span id="ui-id-2" ...
1
vote
1
answer
308
views
Failing Selenium tests on chrome in concurrency starting from Chrome Browser version 95
we are using:
Selenium: 3
Chrome Version : 95
The problem:
We have a selenium test suit ( written in Watir + Ruby) which runs in concurrency of 25 on a ubuntu amazon EC2 node.
Starting from chrome ...
0
votes
1
answer
36
views
watir goto method as param
I have the following code:
class Test
def initialize(browser)
@browser = browser
end
def init
@browser.element(css: ".app").wait_until(&:present?)
end
end
Run like this:...
0
votes
1
answer
71
views
Unable to change drop-down selection in Ruby Watir
I am trying to select values one by one in a dropdown and having difficulty.
selenium-webdriver (4.0.3)
watir (7.0.0)
ChromeDriver 94.0.4606.81
The dropdown is md-select which on click displays a ...
1
vote
1
answer
44
views
Is is possible to initialize a new driver in already opened chrome browser page?
Is is possible to initialize a new driver in already opened chrome browser page?
If it does, can anyone please mention how?
Thanks
0
votes
1
answer
60
views
How to work with Spotify using HTTP requests in Ruby
At first I need to make a new playlist in my spotify account then I need to add some songs and then to change order of the songs in playlist. How can I do this using HTTP requests in ruby with Watir ...
0
votes
0
answers
56
views
How to authorize to spotify with Ruby , Watir
Please help , im trying to make authorize to spotify to add new playlist.
In order i need to do:
Task
I cant get the authorization to spotify logic. How Can I authorize spotify in ruby using watir?
my ...
0
votes
1
answer
162
views
Ruby Watir: Avoid the "Im not a robot" check
I'm using watir to load a page the following way:
Watir.default_timeout = Rails.cache.read(:wati_timeout) || 5
options = Selenium::WebDriver::Chrome::Options.new
options.headless!
options.add_argument(...
0
votes
0
answers
84
views
How to authorize to spotify with Ruby + RestClient
I need to authorize and parse some data from my account.
When I try to accest authorize link im getting a set of error which I dont know how to handle.
require 'json'
require 'watir'
require 'bundler'
...
0
votes
2
answers
35
views
Ruby Watir Form Pulldown Not Found
Does anybody have any insight as to how to trigger a selection in a pulldown using Watir? I can't seem to get this to find that first field. I've tried class (deprecated apparently), id, and name.
...
0
votes
1
answer
163
views
watir with ruby 3 and rails 6 : wrong number of arguments
I update my app to ruby 3 from ruby 2 and update gem (with Rails 6+) :
gem 'headless'
gem 'watir'
gem 'webdrivers'
gem 'watir-scroll'
gem 'webdriver-user-agent'
(bonus question : I don't know if &...
0
votes
0
answers
75
views
Ruby Cucumber Watir : : Skipping the background step from hooks
Here goes the situation:
I have a feature file that has a Background, Some normal Scenarios and a cleanup scenario. My goal is to make sure that when the cleanup step runs, it run without having to ...
0
votes
1
answer
211
views
indexing not reliable on WindowCollection
I have upgraded to recent WATIR(7.0.0.beta5) and when I am executing the following line
@browser.windows.last.use
I am getting this error
"indexing not reliable on WindowCollection"
This ...
1
vote
1
answer
129
views
Watir Error - Unable to run Watir code example
On running the following script from http://watir.com/guides/form-example/, I get an error:
# Require the gems we want to use
require 'watir'
require 'webdrivers'
require 'faker'
# Initialize the ...
0
votes
1
answer
191
views
How to set zoom levels in chrome browser using watir webdriver(ruby watir- set specific zoom level / zoom out /zoom in)
I didn't get to know how to set the browser capabilities in watir, so got this online and tried the following but it didn't work for me.
My problem is, i was suppose to reduce the zoom level to 75% ...
0
votes
0
answers
72
views
how to upload file using watir
I'm new at automation test, but I want to make automation testing upload a photo using watir but the photo can't uploaded and not show any error, I'm using ruby v2.7.4p191 and watir v.6.19.1.
this is ...
0
votes
2
answers
127
views
Rails 6 : How to associate a user to a created post when post is created through web scraping controller action
This question is a bit complicated to ask and probably more difficult to understand so I will do my best to add context to explain my goal.
My app allows logged-in users to run a web scraping function ...
1
vote
0
answers
110
views
Watir/Selenium - cannot reach injected Angular page elements
I have to test website which is written in Angular (ng- html tags are present) with Watir (which is a Ruby gem based on Selenium). But the body of the page is somehow split into 'static' html and '...
0
votes
0
answers
419
views
Running ChromeDriver with "host-resolver-rules" works locally but fails on Heroku
I've been using this setup for a long time and recently needed to introduce the use of the host-resolver-rules switch as on Heroku it's not currently possible to modify the etc/hosts file.
Running the ...
0
votes
1
answer
88
views
Unable to click on available date using selenium ruby
I'm not able to click on available date in the calendar. Past dates are greyed out so trying to get today's date and click on it. I have tried execute script, click() and perform() but none of them ...
0
votes
0
answers
87
views
Not able to scrape linked-in profile in production using Ruby Gems(Ruby on Rails application)
I am using the following ruby code to scrape LinkedIn public profile using following ruby gems
1) Using 'mechanize' gem
require 'rubygems'
require 'mechanize'
require 'nokogiri'
...
0
votes
1
answer
171
views
How to configure Safari webdriver to use .pac file
I am working on automation repo with Ruby and Watir framework. I found a ways to set the pac file for chrome and firefox webfrivers.
Examples:
chrome: args << "--proxy-pac-url=#{...
1
vote
0
answers
53
views
Watir Caching on AWS EC2 instance for Rails App
I want to cache otp entries with watir
I tried this code in my local ;
args = %w[--disable-extension headless no-sandbox --disable-dev-shm-usage disable-infobars --disable-gpu]
@bw = Watir::Browser....
0
votes
0
answers
36
views
Watir Scraping Rails - Set date of input that exists? but is not present
Good morning everybody,
I have been trying to scrape this page: https://www.aftnet.be/MyAFT/Competitions/Tournaments but I have run into some problems.
Collapsed Search Form
Search Form
If you click &...
0
votes
0
answers
72
views
Chrome Browser started with Selenium is missing 'privacy sandbox' setting
When my app starts Chrome browser (v91.0) with Selenium, when I go to the settings, it is missing the 'Privacy Sandbox' setting. Please help how can I get that setting to show in the settings. See ...
0
votes
0
answers
66
views
Receiving (Errno::ECONNREFUSED) and (Net::ReadTimeout) when starting CLI Application After ChromeDriver Update
I am trying to refactor some code in a CLI scraper application. This application scrapes a site using Nokogiri and Watir gems. When I tried to run it, I needed to update the webdriver as I was now ...
0
votes
1
answer
60
views
How can I generate a cookie file from Watir cookies
I am trying to download a file from Watir but I don't want to use the loop sleep approach.
I would rather at the last moment of the interaction, recreate the session Watir has on the webpage and use ...
0
votes
0
answers
60
views
Rake on jenkins runs without errors but abort in the end
In our company we are using ruby + watir for our test automation on a jenkins. We use the rake command to execute these tests and they are passing without an error but the rake always abort.
Here the ...
1
vote
1
answer
144
views
Problem setting default download directory in Watir after update
We recently updated our Watir version from 6.8 to 6.19 in anticipation of the 7.0 beta. Since then, our browser configuration that sets the default directory for chrome has stopped working. Our method ...
0
votes
0
answers
83
views
Rake aborted with zero failed test cases
For my product I use rake for the test-case-execution based on Watir and Selenium. The execution is handled by Jenkins.
In the last two runs my test-suite has ran successful (0 errors/failures) anyway ...
0
votes
0
answers
77
views
Controlling two chrome instances through Cucumber scenario, driven by Watir Webdriver
I am working on a web application, where I receive a phone call, which is initiated by another web application. To achieve this, I need to open two chrome browsers having two different URLs. I am ...
0
votes
0
answers
159
views
how to generate allure reports using page-object and watir
I have used the configuration mentioned in the allure-ruby-commons in the below link
https://github.com/allure-framework/allure-ruby/tree/master/allure-ruby-commons
But am unable to generate allure ...
1
vote
2
answers
226
views
Rails Watir: Wait for 5 seconds before reading element text
I have a website that has a <h1> element.
This element has value x as innerhtml at page load and value y after z seconds.
I don't know what the values of x and y are, because they change ...