watir-webdriver

selenium grid with cucumber

被刻印的时光 ゝ 提交于 2019-12-04 16:05:09
I am trying to setup selenium grid to achieve parallel execution of my tests. First, I'll explain the my current scenario. I have my fully functional test suite written in cucumber with watir webdriver I need to execute all my tests in multiple environments. I created a setup for selenium hub and node I can run my tests on a single node through hub My goal is to run my tests on multiple vm's simultaneously. I missing a part where I need to configure my tests to run in parallel. there are some examples about grid setup in the web, as I am using different framework I couldn't relate to my

watir-webdriver cookie jar saving and loading

淺唱寂寞╮ 提交于 2019-12-04 12:55:27
问题 I'm surprised there didn't seem to be much discussion on this. in Mechanize I can easily read an entire cookie jar from the browser, store it to a file, and load it in to a later session/run before loading that website's pages again. How can one do the same with watir-webdriver ? UPDATE Now with 0.5.2 I do see new methods browser.cookies.to_hash which would turn this question into "How to implement .from_hash or similar loader using eg. .clear and .add ?" However I'd be especially keen on

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

社会主义新天地 提交于 2019-12-04 12:06:36
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_keys "hello world" (Google Chrome works ok on Mac OSX, but I would like to run my tests against Firefox

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

人走茶凉 提交于 2019-12-04 10:34:17
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: C:/Ruby187/lib/ruby/gems/1.8 - RUBY EXECUTABLE: C:/Ruby187/bin/ruby.exe - EXECUTABLE DIRECTORY: C:

Multiple concurrent browser tests with watir-webdriver through different browsers

守給你的承諾、 提交于 2019-12-04 10:16:01
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? You should try WatirGrid . It won't make all the work for you but it will give you a platform to launch

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

会有一股神秘感。 提交于 2019-12-04 07:28:14
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 caching response and display them accordingly). I considered changing all the display:none in the page or

How to not wait for something with Watir-Webdriver

岁酱吖の 提交于 2019-12-04 05:30:42
问题 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? 回答1: The answer

How can we get Watir-Webdriver to work with the IE invalid cert screen?

懵懂的女人 提交于 2019-12-04 04:34:07
问题 We've probably all seen this screen when testing, all you need is a HTTPS site with a self signed cert and you get the "There is a problem with this website's security certificate" screen, which requires you to click a link to continue. With Watir this is no problem, I automate the screen as I would any other webpage, clicking the link according to its text or ID value. With Watir-Webdriver it's as if nothing inside the HTML can be recognized. and I'm not alone in this See this question It's

Watir Webdriver counting number of items in a UL list

£可爱£侵袭症+ 提交于 2019-12-04 02:50:20
I've done a few searches and I'm unable to find a suitable answer. Basically I have an unordered list which can be of a varying length. I want to iterate through the list, do some other things and then come back and select the next item on the list. I can do this fine when I define the amount of times my loop should iterate as I know the amount of items in the list. However I don't want to define this for each test, I want to grab the number of items in the list and then pop that into a variable that I can use to exit the loop and do the next thing I want. The HTML is like so: <ul id=

How to click on specific element in canvas by its coordinates (using WebDriver)?

无人久伴 提交于 2019-12-03 21:43:36
I have a canvas element on my page and I want to click on specific (x, y) coordinates in this canvas. I use watir-webdriver: element = browser.driver.find_element(:id, 'canvas') browser.driver.action.move_to(element).move_by(x, y).click().perform But this code just clicks on the center of the canvas, not the specified (x, y) coordinates. What is wrong with it? UPD: So now I use this code: element = browser.driver.find_element(:id, 'canvas') browser.driver.action.move_to(element, x, y).perform browser.driver.click.perform But it still clicks on the center of the canvas and not on specified (x,