watir-webdriver

Selenium::WebDriver::Error::MoveTargetOutOfBoundsError: Element cannot be scrolled into view:[object HTMLSpanElement]

社会主义新天地 提交于 2019-12-12 14:14:29
问题 Something strange is happening on this page: require "watir-webdriver" b = Watir::Browser.new b.goto "http://mideastunes.com/" b.div(class: "feat-container").element(css: "a span").present? => true b.div(class: "feat-container").element(css: "a span").click Selenium::WebDriver::Error::MoveTargetOutOfBoundsError: Element cannot be scrolled into view:[object HTMLSpanElement] from /Users/zeljko/.rvm/gems/ruby-1.9.2-p290@gretel/gems/selenium-webdriver-2.19.0/lib/selenium/webdriver/remote/response

how to exactly match using :class selector in watir-webdriver

蓝咒 提交于 2019-12-12 14:05:00
问题 Regarding the backwards-incompatible change of Watir 0.5.x Finding elements by :class now matches partial class attributes. How do I get the old behavior? I.e. to match exact class name. It is breaking my code, in one case: # expand all multiple records while $browser.div(:class => "expander").exists? $browser.div(:class => "expander").click end because once .click ed, the div 's class becomes "expander hasChildren" (and possibly other classes, depending on table row's color and content). Is

Best practice to keep common steps of cucumber

无人久伴 提交于 2019-12-12 11:05:20
问题 I'm using cucumber-watir-webdriver with for automation purposes. I have the following directory structure: |features -|feature1 --|1.feature --|step_definitions ---|1.rb -feature2 --|2.feature --|step_definitions ---|2.rb and so on. I need to know what is best practice to reduce redundancy in 1.rb and 2.rb . feature1 and feature2 are completely different so I cannot combine both in one directory. Also there is some part where feature line is same but execution in steps is different so it will

how to click a link in a table based on the text in a row

邮差的信 提交于 2019-12-12 09:22:14
问题 Using page-object and watir-webdriver how can I click a link in a table, based on the row text as below: The table contains 3 rows which have names in the first column, and a corresponding Details link in columns to the right: DASHBOARD .... Details EXAMPLE .... Details and so on. <div class="basicGridHeader"> <table class="basicGridTable">ALL THE DETAILS: ....soon </table> </div> <div class="basicGridWrapper"> <table class="basicGridTable"> <tbody id="bicFac9" class="ide043"> <tr id="id056">

Watir-Webdriver - Unable to locate a button with id, name, text, value

烈酒焚心 提交于 2019-12-12 05:57:28
问题 I am very new to web automation and watir-webdriver. i am trying a script to launch a web and submit the login form. I was able to identify the username and password text fields with the 'id' tag. but the login button doesn't have any of the id, name, text and value keys. i have tried looking all the sources, they all have atleast any one key to search the button. but as i am not seeing that in my web application, could someone help me how to search the button and click it. Here's a portion

Show searched links url in command line with watir

陌路散爱 提交于 2019-12-12 05:19:07
问题 I am new in Ruby and now i'm trying to use watir. So i need to display all founded urls in my command line. Here is the beginning of my code: browser = Watir::Browser.new puts "1. Entering Google" browser.goto "http://www.google.com" search_text = "text" puts " 2. enter "+ search_text +" in the search text field." browser.text_field(:name, "q").set search_text puts "3. click the 'Google Search' button." browser.button(:name, "btnG").click puts " First 10 links: " Can someone help me? Thanks a

How to access href of array of links in a loop using watir-webdriver

我怕爱的太早我们不能终老 提交于 2019-12-12 04:26:17
问题 I've got an array of certain <a> elements like this: array = browser.as(:class => 'foo') I try to go to the links like this: $i = 0 while $i < num do browser.goto array[$i].href . . . $i += 1 end Which works the for the first loop, but not for the second. Why is this happening? If I do puts array[1].href puts array[2].href puts array[-1].href before browser.goto array[$i].href it shows all the links on the first loop in terminal window. 回答1: Someone who knows this better than I do will need

Unable to run automation on firefox Jenkins

倾然丶 夕夏残阳落幕 提交于 2019-12-12 03:45:48
问题 I'm having trouble running the automation project on a recently installed Jenkins on a Ubuntu server. I'm having the following error: Selenium::WebDriver::Error::WebDriverError: unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055) /var/lib/gems/2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/firefox/launcher.rb:90:in `connect_until_stable' /var/lib/gems/2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/firefox/launcher.rb:55:in `block in launch' /var

chrome browser closes automatically after the program finishes in ruby using watir

故事扮演 提交于 2019-12-12 03:34:12
问题 I am using chrome 56, chrome driver 2.27(latest release) with selenium web driver 3.1.0. Referring to the issue(https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/1811) where chrome closes all the instances once the program finishes and it does not give me a chance to debug. I just want to know if this is fixed then why it is still happening ? or i am missing something ? I am using the following code. Any help is appreciated. require "uri" require "net/http" require

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"