watir

Setting a text field that has a JQuery mask on it

久未见 提交于 2020-01-11 14:10:23
问题 Using watir-webdriver, I am trying to set the value for a text field. browser.text_field(:id, "phoneNumbers_value_input").set("5555551234") When I run that command, I can see that watir found the field because the cursor is set on that field however no text is entered. I have also tried the send_keys and append commands but nothing seemed to work. No exception is thrown from these methods. The only difference I could find between this field and the other fields on the page(which all work fine

Can't connect to Tor-Firefox via Watir

拜拜、爱过 提交于 2020-01-11 09:30:10
问题 I am having issues connecting to Tor via Ruby - Watir webdriver. I use the Tor Browser Bundle. The problem is that when I try to connect via Watir (Selenium) I cannot seem to open Tor instead of regular Firefox. Looking at similar issues I've tried the following: require 'watir-webdriver' profile = Selenium::WebDriver::Firefox::Profile.new profile['network.proxy.socks'] = '127.0.0.1' #the proxy tor uses profile['network.proxy.socks_port'] = 9150 #I cannot use 9050, 9150 works when I use Tor

JRuby: Watir is hanging when launching browser

爱⌒轻易说出口 提交于 2020-01-11 09:22:27
问题 I have Windows 7 Enterprise and I am trying to run JRuby. I've set my environment variables for Ruby (1.9.3), Java (jdk - 1.6.7), and JRuby (1.7preview). I have a network drive but I created a HOME system variable which seems to be working because I can download gems for both Ruby & JRuby successfully and they are saved to my local drive. When I try to launch a browser (ie, firefox, chrome) it seems to hang for JRuby, but not Ruby. Here is the trace for JRuby after it's been trying to execute

Firefox 4 with watir webdriver: Need help using helperApps.neverAsk to save CSV without prompting

邮差的信 提交于 2020-01-11 03:18:46
问题 I learned how to use Firefox 4 with watir and webdriver (on Win7 x64), setting profile items. Example: profile = Selenium::WebDriver::Firefox::Profile.new profile["browser.download.useDownloadDir"] = true profile["browser.download.dir"] = 'D:\\FirefoxDownloads' profile["browser.helperApps.neverAsk.saveToDisk"] = "application/csv" driver = Selenium::WebDriver.for :firefox, :profile => profile browser = Watir::Browser.new(driver) What I try to do with the example below, is setting CSV files to

How do I change the page load Timeouts in Watir-Webdriver (timeout in .click method)

て烟熏妆下的殇ゞ 提交于 2020-01-09 12:51:40
问题 I have the following code browser.link(:text => 'Generate Report').click browser.radio(:value => 'byTotalValue').wait_until_present(180) which requests that a report be generated and then waits for the report by looking for an element on the report page. The report can take upwards of 2 minutes to appear. What is happening is a Timeout::Error is being raised from the click method after 60 seconds. I suspect that Watir-Webdriver has implemented some form of wait for page load within the click

Accessing a div element in an array of li elements

孤街醉人 提交于 2020-01-07 08:26:16
问题 I am trying to access a div in an li array <ul> <li class="views-row views-row-1 views-row-odd views-row-first"> <div class="news-item"> </li> <li class="views-row views-row-2 views-row-even"> <li class="views-row views-row-3 views-row-odd"> <div class="news-item"> <div class="image"> <div class="details with-image"> <h2> <p class="standfirst">The best two-seat </p> <div class="meta"> <div class="pub-date">26 April 2012</div> <div class="topic-bar clearfix"> <div class="topic car_review"

How to control test execution speed in watir-webdriver with the Watir::Browser#speed= method? [duplicate]

戏子无情 提交于 2020-01-06 21:58:46
问题 This question already has answers here : Is there a way to slow down execution of Watir Webdriver under Cucumber? (2 answers) Closed 4 years ago . Is there any way to control test execution speed in watir? How can I slow down the speed of test execution? Someone suggested me to use following method browser.speed = :slow but, there is no such method for the Watir::Browser class with the browser driver I'm currently using. 回答1: Speed Defaults to Slow According to the documentation, Watir:

Is it possible to web scrape an Android app through an emulator on PC, using Watir with Ruby on Rails?

牧云@^-^@ 提交于 2020-01-06 04:43:05
问题 So I know that was a mouthful, so to expand a bit I'm hoping to get text data from an Android app. I've read a little that I would need an Android emulator on my PC to do so. But I have no idea how to use Watir (the current web scraper I've been using successfully) to scrape data from an emulator. 回答1: What you need to use to interact with a native mobile application is Appium. There is a Ruby binding for Appium that you can use. There is currently not a Watir API for Appium, though it is on

Accessing a nested element 3 levels deep using page objects

Deadly 提交于 2020-01-05 10:32:35
问题 Using the Page Object model and gem I want to access an element that is nested 3 layers deep. I've successfully accessed nested elements that are 2 elements deep but for 3 the same method isn't working. 3 elements defined in my Page Object: div(:serv_info, :class => "service-info") div(:validate_method, :class => "validate-method") div(:scar_input_group, :class => "input-group") So I tried to chain those 3 elements to access the div class input-container input-left-half round like this: div(

Masked Text Box issue

走远了吗. 提交于 2020-01-05 07:50:33
问题 i m using the rad masked control for phone field. telerik:RadMaskedTextBox ID="txtPhone1" runat="server" EnableAjaxSkinRendering="False" Mask="(###) ###-####" Skin="Hay" ZeroPadNumericRanges="False" MaxLength="20" TabIndex="30" Width="200px"></telerik:RadMaskedTextBox when i m trying to add phone using watir, using this code browser.text_field(:id => 'ctl00_ContentPlaceHolder1_Registration2_txtPhone1_text').set '7893457889' only last value has been added. kindly help me out. how to fill