watir

Ruby Watir Gem, Timing Out on Form Input

杀马特。学长 韩版系。学妹 提交于 2019-12-12 02:16:21
问题 I'm practicing webscraping using Watir, Mechanize and Nokigiri gems. I'm running into an issue with my Watir script. My plan is to get a list of prices from flights via http://tripadvisor.com/. When I run the script, the Chrome browser opens as it should, the script proceeds to fill out the first parts of the form, origin and destination and then it halts. Here is the error message I'm getting: This code has slept for the duration of the default timeout waiting for an Element to be present.

Watir webdriver and extjs finding element

烈酒焚心 提交于 2019-12-12 01:02:09
问题 I am doing an acceptance test using watir-webdriver using ruby I wanna ask if watir webdriver is support for ExtJs or not? I am trying to find element that generated dynamically by ExtJS. I am trying doing some thing like @browser = Watir::Browser.new :chrome #Some step go to page @cbo = @browser.execute_script "return Ext.getCmp('cboCategory')" but It didn't work Please give me some advises. Thank you. 回答1: ExtJS pages are hard to test, especially on finding elements. Here are some of the

Why am I not able to login to Quora using an automation package like Selenium or Watir?

戏子无情 提交于 2019-12-11 22:03:03
问题 I am able to login into Facebook and other websites ? Selenium is not even filling out the username or password ? from selenium import webdriver from selenium.webdriver.common.keys import Keys driver = webdriver.Firefox() driver.get("https://www.quora.com/") elem = driver.find_element_by_name("email") elem.send_keys("my_email") elem_pass = driver.find_element_by_name("pass") elem_pass.send_keys("password") elem.send_keys(Keys.RETURN) driver.close() The Ruby-Watir Code require 'rubygems'

Element not visible error for button element in Watir

痴心易碎 提交于 2019-12-11 21:13:36
问题 I'm using watir to perform automated testing for an application and trying to click on a submit button once I select options for select list and fill up the form.However on clicking the button, it throws element not found error The html snippet for button tag <button type="submit" class="md-primary md-raised md-button md-default- theme" ng-transclude=""><span class="ng-binding ng-scope">Submit</span><div style="" class="md-ripple-container"> </div> </button> The ruby script require "watir"

Using watir to click table element without id

自古美人都是妖i 提交于 2019-12-11 19:35:31
问题 I have a dynnamic table that I would like to use watir to select a edit button. It doesn't have a traditional watir id that I can select (example: browser.img(:title, "iconname")) and there may be multiple edit icons to choose from. In the past I would get the correct element by querying the database. However this does not have a database entry to help me select the correct edit link this time. In the code below what I am trying to select is from the section where it shows "autogenerated3" I

How to create chrome profile via Ruby Selenium Binding(or WATIR)

被刻印的时光 ゝ 提交于 2019-12-11 17:59:07
问题 I know how to create profile for Firefox require 'watir' options = Selenium::WebDriver::Firefox::Options.new options.profile = "default" @driver = Selenium::WebDriver.for :firefox, options: options @b = Watir::Browser.new @driver But when I do same thing for Chrome it's not creating, Infact I realized that options(please look above) object doesn't even have the method profile= so I try adding profile like as given below(I saw how people are creating in Java Selenium Binding so I have done the

how get the value of a script tag

不羁岁月 提交于 2019-12-11 16:34:32
问题 In my page code, there is this script tag: <script> var oid = "182384"; document.getElementById('container').innerHTML = oGrid; oGrid.setShowSid(false); oGrid.calcSize(); setupAllTabs(); var toolbar = setupMenuButtons("btnbar"); initForm(toolbar); </script> How can I get the value of oid with watir or ruby? 回答1: browser.script.html will output the code within the <script> tag. For example: require 'watir' browser = Watir::Browser.new browser.goto("http://www.some_site_with_script.com")

How to click on onbeforeunload prompt in Watir test?

南楼画角 提交于 2019-12-11 15:46:27
问题 I have a webpage that has an onbeforeunload script that prompts the user when they take an action that would navigate away from the current page. How do I interact with this popup using Watir? My current approach looks like this: $ie.link(:text, 'Dashboard').click_no_wait hwnd = $ie.enabled_popup(10) assert(hwnd, 'The expected \'leave this page?\' popup was not shown') win = WinClicker.new win.makeWindowActive(hwnd) win.clickWindowsButton_hwnd(hwnd, "OK") The problem is that if I use "click

How to run parrellel tests with RSpec and Watir on a Windows machine?

徘徊边缘 提交于 2019-12-11 15:05:05
问题 I am trying to run this watir code in Rspec and also I am trying to run the testcases in parallel. But it runs one after another. Is there anyway I can achieve the parallel run? require 'rspec' require 'watir' a=[] 2.times do a<<Thread.new do describe 'My behaviour' do it 'should do something' do b = Watir::Browser.new b.goto 'www.google.com' b.text_field(name: 'q').set 'Rajagopalan' b.close end end end end a.each(&:join) But if I run the same code without Rspec, it runs in parrellel. For an

Failed WATIR installation Server 2003

走远了吗. 提交于 2019-12-11 12:36:21
问题 I had to rebuild my box and I currently am unable to install Watir. gem install watir ERROR: Error installing watir: activesupport requires Ruby version >= 1.8.7. Which would be fine if Watir was able to use Ruby 1.8.7 . I am using ruby -v ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] gem -v 1.3.7 I am not sure when this started to occur, but the documentation on the site is lacking. 回答1: On Windows XP (Professional, Version 2002, Service Pack 3, fully pathched) I have installed