watir-webdriver

How to send text to a CKEditor WYSIWYG editor box using Watir-WebDriver

筅森魡賤 提交于 2019-12-06 08:59:46
问题 I have a watir-webdriver script that sets a CKEditor box using the code below, but this only works with Firefox on Mac OSX when I focus on the screen. For example, if I focus away and let this script run in the background, the text is not entered (but no exception or error is raised). Anyone know how to always ensure it is set? require "watir-webdriver" b = Watir::Browser.new :firefox b.goto "http://ckeditor.com/demo" b.frame(:title => 'Rich text editor, editor1, press ALT 0 for help.').send

Cucumber headless xvfb ubuntu

巧了我就是萌 提交于 2019-12-06 06:54:31
问题 I'm trying to setup a Jenkins build server on Amazon EC2. I'm planning on running my cucumber test suite in headless mode. I was successfully able to run headless in IRB require 'watir-webdriver' require 'headless' headless = Headless.new headless.start b = Watir::Browser.new(:chrome) b.goto("www.google.com") b.title b.close headless.destroy but if I add the following to my env.rb if ENV['HEADLESS'] require 'headless' headless = Headless.new headless.start at_exit do headless.destroy end end

Multiple concurrent browser tests with watir-webdriver through different browsers

南楼画角 提交于 2019-12-06 05:46:37
问题 so I'm working on a website here and I would like to run multiple browser tests at one time. What I mean by this is it should perform my smoke tests on ie, firefox and chrome at the same time and report back each browser results. I'm currently only testing with ie with rpsec and watir-webdriver but would like to automate for the other 2 browsers. Are there any existing gems out there (I haven't been able to find any), if not what would be the best way to go around solving this issue? 回答1: You

`marshal data too short` error message while installing watir-webdriver on Windows XP

自作多情 提交于 2019-12-06 05:45:22
问题 I have a clean installation of Windows XP (Professional, Version 2002, Service Pack 3) in VMware Fusion virtual machine (3.1.2 332101). (Host machine is MacBook Pro, Mac OS 10.6.7.) XP installation has 512 MB RAM and is fully updated, except I left Internet Explorer at version 6. I have installed Ruby and RubyGems: C:\Documents and Settings\zeljko>gem env RubyGems Environment: - RUBYGEMS VERSION: 1.6.2 - RUBY VERSION: 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32] - INSTALLATION DIRECTORY:

why must I sleep or wait using watir-webdriver and firefox?

落爺英雄遲暮 提交于 2019-12-06 04:47:25
问题 Well i wanted to comment on watir-webdriver wait for page load>this topic but since i have 1 rep I cannot. I'm upgrading my watir scripts to watir-webdriver and the first test i ran on Firefox yielded: Selenium::WebDriver::Error::NoSuchElementError: Unable to locate element: {"method":"tag name","selector":"body"} when all I was doing was logging into my app (which worked fine), clicking the Build Info link, and doing a: @browser.text This happened consistently. After reading on here, I put a

How do I read text from non visible elements with Watir (Ruby)?

半世苍凉 提交于 2019-12-06 04:16:17
问题 There is a div on a page that is not visible but has some value I want to capture. Calling text on it returns me an empty string. How do I get the value displayed without having to deal with the raw html? Can I force .text to return me the actual value regardless of the visiblity of the text in the browser? irb(main):1341:0> d.first.visible? => false irb(main):1344:0> d.first.html => "<div class=\"day\">7</div>" irb(main):1345:0> d.first.text => "" PS: There are many many divs (the page is

Is there a chrome switch to suppress 'external protocol request'?

a 夏天 提交于 2019-12-06 01:41:45
问题 Is there a chrome switch to suppress 'external protocol request' ? I am automating an application using selenium - ruby - watir webdriver. I searched over net for solutions to bypass this window and conversation: http://productforums.google.com/forum/#!topic/chrome/K22hXwRy6zQ gives an overview on how we can do that manually. But for Selenium-Chrome-Ruby, I need to do this by probably setting a chrome switch (List of chorme switch:= http://src.chromium.org/svn/trunk/src/chrome/common/chrome

watir-webdriver change proxy while keeping browser open

狂风中的少年 提交于 2019-12-05 18:50:17
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, when wanting to connect to the same page multiple times using different proxies, I have to create a

Testing already Open Browser with Watir-Webdriver [duplicate]

时间秒杀一切 提交于 2019-12-05 05:41:27
问题 This question already has answers here : Is there any way to attach an already running browser to selenium webdriver in java? [duplicate] (2 answers) Closed 5 years ago . I do not want to open a new browser by @browser = Watir::Browser.new (:ie) but i want to work with manually opened browser using Watir-Webdriver. How would I do that ? I thought it may be something like this browser(:title => "Browser Title").text_field( :id => 'Field Id').set 'abc' it seems like I need to create an Object

Auto Download files in watir

∥☆過路亽.° 提交于 2019-12-05 05:05:00
问题 How to auto download the excel files from the browser in one click on the link, without going through the "save as" and other windows in watir. I am trying to keep it OS independent, so would not be interested in using win32ole gem. 回答1: for this task I tweaking my profile preferences my code looks like this: chrome driver: profile = Selenium::WebDriver::Chrome::Profile.new profile['download.default_directory'] = download_directory profile['download.prompt_for_download'] = false browser =