firewatir

FireWatir TextField set : Very Slow

荒凉一梦 提交于 2020-01-30 06:40:05
问题 When calling the set method of a text_field in ruby, the text is being entered at a very slow rate in the browser, roughly at 1 character / second. Environment Information: Ubuntu 10.10 FireFox 3.6.13 JSSh 0.9 Ruby 1.9.2p136 FireWatir 1.7.1 Kindly advice. Thanks in advance. 回答1: It is a known bug: WTR-397 Workaround is to use watir-webdriver or to use value= instead of set . Example: browser.text_field(how => what).value= "string" 回答2: solve slow key type issue on firewatir: need to edit the

FireWatir TextField set : Very Slow

纵然是瞬间 提交于 2020-01-30 06:38:26
问题 When calling the set method of a text_field in ruby, the text is being entered at a very slow rate in the browser, roughly at 1 character / second. Environment Information: Ubuntu 10.10 FireFox 3.6.13 JSSh 0.9 Ruby 1.9.2p136 FireWatir 1.7.1 Kindly advice. Thanks in advance. 回答1: It is a known bug: WTR-397 Workaround is to use watir-webdriver or to use value= instead of set . Example: browser.text_field(how => what).value= "string" 回答2: solve slow key type issue on firewatir: need to edit the

How do I prevent Watir from auto closing firefox?

大兔子大兔子 提交于 2019-12-25 19:39:21
问题 I am automating test cases using Ruby and Watir. One of my methods opens the web browser, but as soon as my script leaves the "open browser" method and goes to the next method (filling out forms within the browser), the browser auto closes. When I automate using the IE browser it will not close until it hits the IE.close statement, but with firefox it closes automatically. Is there any way to avoid this? Code: require 'rubygems' require 'watir-webdriver' require 'rexml/document' def

Mouse movement / mouseover and JavaScript evaluation in watir

两盒软妹~` 提交于 2019-12-22 09:21:22
问题 I have a JavaScript-heavy Rails app which I am testing in watir. I have two specific testing requirements: I need to be able to simulate moving the mouse to a specific area of the screen (or at least triggering the onmouseover event for a div) Evaluating a snippet of JavaScript once the above has happened to see if a flag is set correctly I haven't been able to figure out how to do this in watir. Any ideas on how to do this? 回答1: For the first question: browser.div(:id, "some-id").fire_event

Ruby Watir: Clicking OK on JavaScript Alerts?

扶醉桌前 提交于 2019-12-21 09:17:48
问题 Seems none of the code I've tried has any affect. My intention is to close any and all JavaScript prompts that may come up by hitting the "OK" button. Problem is, my script has no affect on the prompts that come up. In other words, it does nothing. Here's what I have: fx = FireWatir::Firefox.start(somepage) fx.startClicker("OK") fx.button(:id, "OK").click fx.button(:id, "CONFIRM").click The HTML: <script type="text/javascript"> alert("Alert!"); window.confirm("Confirm?"); </script> The text

How to use watir-webdriver to wait for page load

谁都会走 提交于 2019-12-20 09:37:34
问题 Using watir-webdriver, how do I wait for a page to load after I click a link? At the moment I am using: sleep n But this is not ideal as the page response varies so much. Is there a way 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 don't see this in the webdriver version. 回答1: I don't know if they're the best way, but this is how I'm handling this for

how to open pop up window table using selenium webdriver?

六眼飞鱼酱① 提交于 2019-12-13 04:15:53
问题 there is text label on a webpage, and I am trying to click on that to open a pop-up window,but not getting opened. here is the HTML code: <td width="40%"> <div id="EmpId.outline"> <input type="hidden" name="EmpId" value="" id="popupEmpId"> <input type="text" name="EmpCode" value="" readonly="readonly" class="textMedium250" id="popupEmpCode" autocomplete="off"> <a href="#f2"><label onclick="checkForPopup('EmpPopupDiv','Select a Emp',640,true,refreshConditionOptions);"> + Search for a Emp<

Run web testing framework watir on firefox / linux

帅比萌擦擦* 提交于 2019-12-11 11:34:27
问题 I'm developing a website on fedora linux. I want to run test. So I choose watir & ruby development to test. So I wan to install watir on my system but I have errors : I ran this script cat << EOF > /etc/yum.repos.d/ruby.repo [ruby] name=ruby for Fedora \$releasever - \$basearch - Base baseurl=http://mirror.nl.ergo-project.org/repositories/custom-f13-ruby/x86_64/ failovermethod=priority enabled=1 gpgcheck=0 [ruby-extra] name=ruby extra for Fedora \$releasever - \$basearch - Base baseurl=http:/

Mouse movement / mouseover and JavaScript evaluation in watir

空扰寡人 提交于 2019-12-05 22:14:18
I have a JavaScript-heavy Rails app which I am testing in watir. I have two specific testing requirements: I need to be able to simulate moving the mouse to a specific area of the screen (or at least triggering the onmouseover event for a div) Evaluating a snippet of JavaScript once the above has happened to see if a flag is set correctly I haven't been able to figure out how to do this in watir. Any ideas on how to do this? For the first question: browser.div(:id, "some-id").fire_event "onmouseover" I have no idea how to solve the second question. You could ask at watir-general . You can look

Ruby Watir: Clicking OK on JavaScript Alerts?

99封情书 提交于 2019-12-04 03:01:55
Seems none of the code I've tried has any affect. My intention is to close any and all JavaScript prompts that may come up by hitting the "OK" button. Problem is, my script has no affect on the prompts that come up. In other words, it does nothing. Here's what I have: fx = FireWatir::Firefox.start(somepage) fx.startClicker("OK") fx.button(:id, "OK").click fx.button(:id, "CONFIRM").click The HTML: <script type="text/javascript"> alert("Alert!"); window.confirm("Confirm?"); </script> The text in the prompts can change, my intention is to hit OK regardless of what is inside the alert/confirm