watir-webdriver

How to enter password in a popup using watir?

送分小仙女□ 提交于 2019-12-03 03:47:43
I'm writing some watir test cases: browser.goto "http://egauge2592.egaug.es/" browser.link(:href,"/settings.html").click browser.text_field(:index,4).set("some text") browser.button(:id,"save_button").click then a 'Authentication Required' dialogue opens, asking for username and password . No matter how I tried, I couldn't access the text fields. I tried send_keys and JavaScript. I also tried Watir.autoit but it says undefined method. I'm using watir on a Ubuntu machine with the FireFox browser. How to fill in username and password fields of that dialogue box? I was able to enter username with

watir-webdriver wait for page load

丶灬走出姿态 提交于 2019-12-02 19:15:48
Using watir-webdriver , how do i wait for a page to load after i click a link? At the moment i am doing: sleep n But this is not ideal as the page response varies so much. Is there a method to test whether the page is ready or whether there is a certain element in the page. I understand in the normal watir gem there is Watir::Waiter.wait_until or something similar, but I cannot see this in the webdriver version. marc I don't know if they're the best way, but this is how I'm handling this for waiting for updating div to clear: while browser.div(:id=>"updating_div").visible? do sleep 1 end This

Watir browser process doesn't start properly (Windows)

寵の児 提交于 2019-12-02 12:01:41
I've built a simple script in Linux, but now I'm trying to get it to work on windows. The code is: require 'watir-webdriver' puts "Press enter when ready to continue" gets browser = Watir::Browser.start "http://www.google.com" # do stuff It works exactly as expected on Ubuntu. But when I try it on Windows, the Firefox process starts, but then dies before you even see a Firefox window. This is a fresh install of Ruby on this Windows installation, I've never used it before on this machine. What could be the problem? Edit: Command line trace, as requested. C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems

How to get index of parent element using Watir Webdriver?

為{幸葍}努か 提交于 2019-12-02 09:15:50
问题 I have this HTMLcode: <div class="A"> <div class="B"> Text1 </div> </div> <div class="A"> <div class="B"> Text2 </div> </div> So i need to find index of div class='A' where i find some text. I use Watir Webdriver and now i have this code: if @ff.div(:class=>'A').div(:text=>'Text1') then ind=@ff.div(:class=>'A').index end but of course this doesn't work saying 'undefined local variable or method `index''. 回答1: There's no way to get the index using the webdriver since they are relative to the

How to not wait for something with Watir-Webdriver

*爱你&永不变心* 提交于 2019-12-02 06:48:53
So I'm writing a watir-webdriver script, and my app is using javascript to present a modal window that I want to interact with. When I click the element that presents the modal window, watir-webdriver just sits there until eventually it times out and i see a Timeout::Error on the console window. This is before attempting to interact with the new window at all. I'm assuming it's polling the DOM for some change and not getting it, how do I tell it to move on without waiting? The answer ended up being, and then handling the necessary waiting manually element.focus element.send_keys :return Ruby 1

How to get index of parent element using Watir Webdriver?

喜夏-厌秋 提交于 2019-12-02 06:28:08
I have this HTMLcode: <div class="A"> <div class="B"> Text1 </div> </div> <div class="A"> <div class="B"> Text2 </div> </div> So i need to find index of div class='A' where i find some text. I use Watir Webdriver and now i have this code: if @ff.div(:class=>'A').div(:text=>'Text1') then ind=@ff.div(:class=>'A').index end but of course this doesn't work saying 'undefined local variable or method `index''. There's no way to get the index using the webdriver since they are relative to the collection of matched elements. What you can try to do is collect the elemetns text as Array and then get the

Unable to start browser from Jenkins CI

 ̄綄美尐妖づ 提交于 2019-12-02 05:52:26
问题 I am unable to start the browser on the CI server (localhost on Linux in my case) when triggering a cucumber test via invoking a rake task after build from Jenkins. Jenkins console log is as below. I am pretty sure everything is set up properly, as I can run it successfully on the server via command line. 01:26:43 [cucumber] $ /usr/local/rvm/scripts/gems/ruby-2.3.0/bin/rake schedule_win_job:features --trace 01:26:43 ** Invoke schedule_win_job:features (first_time) 01:26:43 ** Execute schedule

How do I turn off the logging for PhantomJS in Watir-WebDriver?

…衆ロ難τιáo~ 提交于 2019-12-02 05:11:54
问题 I see a lot of logging information for PhantomJS in my ruby (1.8) watir code, i.e INFO messages. How do I turn it off ? I got the Java code from google search but not ruby code. Java PhantomJSDriver disable all logs in console PhantomJS is launching GhostDriver... [INFO - 2015-01-27T10:00:00.000Z] GhostDriver - Main - running on port 8910 [INFO - 2015-01-27T10:00:00.000Z] Session [30344df0-a7de-11e4-9220-5bf7aac4a098] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,

Watir Webdriver(0.9.1) No Longer Opens an Instance of Firefox

烂漫一生 提交于 2019-12-02 04:56:23
问题 While using Watir Webdriver v0.9.1 for rails (along with Selenium Webdriver 2.53.1), Firefox was opening when browser = Watir::Browser.new :firefox was called. Now however, it fails on that line with unable to bind to locking port 7054 within 45 seconds @ /Users/andmcadams/.rvm/gems/ruby-2.0.0-p648/gems/selenium-webdriver-2.53.1/lib/selenium/webdriver/common/socket_lock.rb:59:in `lock' /Users/andmcadams/.rvm/gems/ruby-2.0.0-p648/gems/selenium-webdriver-2.53.1/lib/selenium/webdriver/common

How to disable download window in firefox with watir-webdriver?

空扰寡人 提交于 2019-12-02 01:18:55
I don't want to handle download window in Firefox or IE. I want to auto download the excel file without any download window. I have tried to set several configuration parameters for Firefox, but it didn't work. In my test I'm trying to download excel file profile = Selenium::WebDriver::Firefox::Profile.new profile['browser.download.lastDir'] = 'C:\\Downloads' profile['browser.download.folderList'] = 2 profile['browser.download.dir'] = 'C:\\Downloads' profile['download.prompt_for_download'] = false profile['browser.download.manager.showWhenStarting'] = false profile['browser.download.manager