watir

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:/

Is there any way to automate the testing of flash within web pages using Watir-Webdriver?

一个人想着一个人 提交于 2019-12-11 10:59:15
问题 I am attempting to test several web pages built in Flex, and need to automate clicking on several videos through the Flash interface. I'm using Ruby and Watir-Webdriver, but I'm not sure how to interact with Flash using them. Has anyone figured this out? I've tried using Sikuli, but have found it to be a little clunky and not very fast. Any ideas would be greatly appreciated. 回答1: I will quote myself: It is important to say that Watir CAN NOT control browser plugins like Java applets, Adobe

Trouble attaching to a javascript window with Watir

我只是一个虾纸丫 提交于 2019-12-11 10:17:28
问题 I am new to Watir, and am working on developing a testing tool for my work. I have run into a problem that I cannot seem to solve, even after checking several sites. The javascript window creation is below: (the window created holds a pdf in a window, so the only "buttons" are the minimize, maximize, close) <a id="LogIn_HyperLink2" class="ms-WPTitle" onclick="javascript:var win = new Window({className: 'spread', title: 'Security Statement', top:0, left:1, width:750, height:365, url:'-

Is there have method to stop page loading in watir-webdriver

♀尐吖头ヾ 提交于 2019-12-11 08:22:09
问题 Recently, in a test of my web application test by watir-webdriver, when a link click and a new page open. But the new is keep loading in a long time. And is there have a way to stop it and make browser.ready_state = 'complete' to continue the code follow it. 回答1: Can you provide more information? If it's a timeout, the timeout class works. begin Timeout::timeout(10) do end 回答2: It would be helpful to see your code, but here's a stab at it: @browser.my_button.when_present.click The when

Watir/Selenium - browser.goto keep getting TimeOut error on Chrome and Firefox

你说的曾经没有我的故事 提交于 2019-12-11 07:54:24
问题 Got a very annoying problem with Watir webdriver.. I have debugged a little, and found out I always get TimeOut::Error on a simple @browser.goto line, even I can visually see the page has loaded fully... The scenario is like this: Open a browser, goto a url, click a few links, and then suddenly at one point, the script stops continue browsing, waiting about 30+ seconds and throw errors. Tried both Chrome and FF: Chrome is much worse, normally a 2nd or 3nd link clicking will trigger; for FF,

Watir Radio Button not found

杀马特。学长 韩版系。学妹 提交于 2019-12-11 05:55:31
问题 I want to set this radio button in Watir but it is not finding it: HTML: <input type="RADIO" style="-moz-user-focus: normal;" tabindex="2421" handlenativeevents="false" value="3G" $9a="$9b" $89="isc_RadioItem_3" id="isc_1HV" name="network"> Ruby: if BROWSER.radio(:value => '3G').exists? BROWSER.radio(:value => '3G').set end Could it be because our code contains uppercase RADIO? (Generated by SmartGWT) Any workarounds for this? 回答1: Another alternative. If it's not responding to radio because

A better way of iterating and filling data in HTML table using Watir

こ雲淡風輕ζ 提交于 2019-12-11 05:30:38
问题 I have a table which might contain up to 50 rows and has 9 columns. However the code I am using to fill out data in the table its taking so long. Is there a faster way of doing it? Here is my code table = $browser.div(:id => "market").table(:id => 'tableTradeIndMarket') i = 3 + rand(1..table.rows.length-4) table.rows[i].cells[4].select_list.select 'Buy' table.rows[i].cells[5].select_list.select 'Market' table.rows[i].cells[6].text_field.set ($share) table.rows[i+1].cells[4].select_list.select

Locating elements without a specific class name

孤人 提交于 2019-12-11 05:25:53
问题 This is in the same vein as this question I asked before - Watir webdriver; counting elements with changing class names. I was able to add the specific number of elements based on using the class name asset-card selectable . Currently, I am looking to click on more elements to add them to the existing set. Here is my dilemma: When an element is not clicked, the class name is: image-card asset-card selectable When an element is clicked, selected is appended to the class name: image-card asset

How to save complete html page with frames/iframes included?

谁都会走 提交于 2019-12-11 05:16:53
问题 During the web scraping I want to save current page's html to a file for later debug. browser.html helps in most cases, but when the page contains an iframe/frame, it's content is not returned in browser.html , I have to get it separately with something like browser.iframe.html There are also cases when inside an iframe is another iframe. I can find every frame recursively and save its content, but separated files won't be very useful because I don't know the exact structure of the page. For

In IE9, how can I use watir-webdriver to get past the invalid certificate screen?

时光总嘲笑我的痴心妄想 提交于 2019-12-11 03:10:15
问题 This is the screen with the "There is a problem with this website's security certificate." header. Here is the code for the link I'm trying to click: <tr> <td > </td> <td id="continueToSiteAlign" align="left" valign="middle"> <h4 id="continueToSite"> <img src="red_shield.png" ID="ImgOverride" border="0" alt="Not recommended icon" class="actionIcon"><A href='' ID="overridelink" NAME="overridelink" >Continue to this website (not recommended).</A> </h4> </td> </tr> In IE8 with watir, the code