watir

“Watir::Exception::NoMatchingWindowFoundException: browser window was closed” error when using IE 11 x64 with Page-Object

假装没事ソ 提交于 2019-12-08 03:00:21
问题 I'm running tests in Ruby Mine 2.7.1 using Page-Object + Rspec. Environment: Windows 7 x64, Ruby 1.9.3 p551, IE 11. Gems: watir , rspec , bundler , page-object When i run tests in Chrome or Firefox everything is ok. But when i try to run them in IE, the IE window with correct page gets opened and after that i get an error specified in Subject: "Watir::Exception::NoMatchingWindowFoundException: browser window was closed" The point is that the browser is actually open at that moment and shows a

Is there a way to determine if an element is clickable in Chrome Browser using Selenium and Watir?

二次信任 提交于 2019-12-08 02:47:06
问题 As I understand it, this question is really only relevant when performing web test automation using Chrome browser due to the manner in which a click event is implemented with Selenium Webdriver and Chromedriver. To preface, I use and am aware of finding an element through the use of the Watir element function "present?", which as I understand is essentially a combination of "visible?" and "exists?". I could also, at need find an element with Webdriver element functions to identify if an

watir print/put all visible links

北战南征 提交于 2019-12-08 01:59:27
问题 $browser.links.each do |link| puts link.attribute_value("class") end How do I get all the visible/existing links in the put statement? 回答1: You can also write it by using shorter syntax like this: puts $browser.links.find_all(&:present?).map(&:class_name) 回答2: This will output value of class attribute for all existing links on the page: $browser.links.each {|link| puts link.attribute_value("class")} This will output value of class attribute for all visible links on the page: $browser.links

Chrome browser opens and closes using watir webdriver

半腔热情 提交于 2019-12-07 23:00:03
问题 I have the following code: require "rubygems" require "watir-webdriver" browser = Watir::Browser.new(:chrome) browser.goto "http://google.com" When i run this code, the browser opens the site google.com and then closes automatically Why does it close automatically? My chrome version is 12.0.742.68 回答1: The Chrome driver will close all browser instances when your program exits. It's a known issue, and its priority was fortunately bumped today - look for a fix soon. 来源: https://stackoverflow

How to access the <body> tags using watir

倖福魔咒の 提交于 2019-12-07 21:49:06
问题 I am trying to compose an email through watir. So when I trying to access it, it has the <body> tag. Can anyone suggest how to access it? My system configurations IE-8Inter code here Windows-7 I did the following require 'rubygems' require 'watir' @ie.text_field(:id,':13r').set 'sample' HTML CODE <iframe tabIndex="1" class="Am Al editable" id=":13s" src="" frameBorder="0" style="padding-bottom: 0px; background-color: white; padding-left: 0px; padding-right: 0px; height: 248px; overflow:

How to backup browser state after Watir automation

自闭症网瘾萝莉.ら 提交于 2019-12-07 19:46:42
问题 Summary of tools: watir-webdriver 1.8.17 Mac OS X 10.7.3 Chrome 18.0.1025.151 I'm currently using Watir WebDriver to automate Chrome sessions across a number of websites. I need to backup the state of the web browser (cookies, cache, etc.) at certain points throughout the session. Originally, I figured I could do this with Ruby's file IO library by copying ~/Library/Application Support/Google/Chrome/Default at the necessary points. However, it does not appear that Chrome sessions created with

Script running on chrome showing errors

◇◆丶佛笑我妖孽 提交于 2019-12-07 19:10:29
问题 I used steps to run chrome script provided on this links its showing error I Installed chrome driver as steps suggested in below link but its not working https://github.com/zeljkofilipin/watirbook/blob/master/installation/windows.md#chrome-with-watir-webdriver My PC configuration Win 7 & 64bit C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.9-x86-mingw32/lib/ffi/platform.rb:27 : Use RbConfig instead of obsolete and deprecated Config. Started ChromeDriver port=54035 version=20.0.1133.0 log=D:

Watir implicit_wait doesn't seem to work

◇◆丶佛笑我妖孽 提交于 2019-12-07 17:53:53
问题 We are currently using watir-webdriver (0.6.2) with firefox to run acceptance tests. Our tests take a long time to run, and often fail with timeout errors. We wanted to decrease the timeout time, for them to fail faster. We tried: browser = Watir::Browser.new("firefox") browser.driver.manage.timeouts.implicit_wait=3 However, we are still experiencing 30s timeouts. We couldn't find any documentation or question regarding this issue. Does anyone know how to configure Watir waiting timeouts

How to access a new browser tab

主宰稳场 提交于 2019-12-07 13:44:27
问题 Watir noob here. I'm attempting to connect to and manipulate a newly spawned browser tab, but am a little confused about how to recognize the new tab. Here's what I have: Windows 7 (32 bit) IE 10 Ruby 1.9.3-p392/TDM-32.4.5.2 LOCAL GEMS watir (4.0.2 x86-mingw32) watir-classic (3.6.0) watir-webdriver (0.6.3) Basic gist of the Script: require 'rubygems' require 'Watir' ie=Watir::Browser.new ... First part of the script on the original browser tab is completed. The original browser tab generates

watir-webdriver change proxy while keeping browser open

心不动则不痛 提交于 2019-12-07 13:24:21
问题 I am using the Watir-Webdriver library in Ruby to check some pages. I know I can connect through a proxy using profile = Selenium::WebDriver::Firefox::Profile.new#create a new profile profile.proxy = Selenium::WebDriver::Proxy.new(#create proxy data for in the profile :http => proxyadress, :ftp => nil, :ssl => nil, :no_proxy => nil ) browser = Watir::Browser.new :firefox, :profile => profile#create a browser window with this profile browser.goto "http://www.example.com" browser.close However,