page-object-gem

Changing default timeout of element level waits in page_object gem

 ̄綄美尐妖づ 提交于 2019-12-12 02:40:07
问题 Is there a way to make a global change to the default timeout for the element level waits in the page-object gem? We use the default 5 seconds but need to change it once in a while depending on the environment. Our main test environment runs on several servers so responds times are very fast. However we have one or two environments that run on one server only and respond times are a little slow. I would like to change this value based on the environment. I realize this is not ideal but it is

How to get element with css in PageObject

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 11:31:40
问题 In the project on which I add tests, I have some elements complicated to "get". The html of my textarea : <div class="quote"> <div class="clearfix"> <div class="icon"></div> <div class="text"> <span class="yui3-widget yui3-inputwidget yui3-textareawidget yui3-textareawidget-focused" style=""> <span class="yui3-textareawidget-content"> <textarea name="" placeholder=""></textarea> </span> </span> </div> <div class="author"> (...) other text_field </div> </div> </div> </div> For the moment, I

Accessing nested divs using page object model

允我心安 提交于 2019-12-10 10:07:57
问题 I am having trouble accessing the nested divs. here is my scenario. I need to access the total in inner div. Can some one please shed some light here. <div id="RequestSend"> <div class="title"> Requests Sent </div> <div class="total"> 10 </div> </div> <div id="RequestReceived"> <div class="title"> Requests Received </div> <div class="total"> 20 </div> </div> I tried the following, but did not succeed. Approach 1: prof.rb ======= div(:total_count, {:class => 'total'}) div(:request_send, {:id =

Is “enabled?” method available on Watir and/or Page-Objects for a link?

独自空忆成欢 提交于 2019-12-08 11:42:43
问题 Yesterday i was working on determining is this link was or not enabled, waiting until enabled in order to click it. I'm using Cucumber + Ruby + Watir + Page-Object gem. The link is very similar to: <a id="the_link" href="#" disabled="disabled">Proceed with your order</a> Once you fill some fields, the link is enabled and the source changes to: <a id="the_link" href="#">Proceed with your order</a> The idea is to wait until the link is enabled in this way, which works with buttons: def click_on

“Watir::Exception::NoMatchingWindowFoundException: browser window was closed” error when using IE 11 x64 with Page-Object

假装没事ソ 提交于 2019-12-08 03:00:21
问题 I'm running tests in Ruby Mine 2.7.1 using Page-Object + Rspec. Environment: Windows 7 x64, Ruby 1.9.3 p551, IE 11. Gems: watir , rspec , bundler , page-object When i run tests in Chrome or Firefox everything is ok. But when i try to run them in IE, the IE window with correct page gets opened and after that i get an error specified in Subject: "Watir::Exception::NoMatchingWindowFoundException: browser window was closed" The point is that the browser is actually open at that moment and shows a

How to get element with css in PageObject

被刻印的时光 ゝ 提交于 2019-12-06 08:19:47
In the project on which I add tests, I have some elements complicated to "get". The html of my textarea : <div class="quote"> <div class="clearfix"> <div class="icon"></div> <div class="text"> <span class="yui3-widget yui3-inputwidget yui3-textareawidget yui3-textareawidget-focused" style=""> <span class="yui3-textareawidget-content"> <textarea name="" placeholder=""></textarea> </span> </span> </div> <div class="author"> (...) other text_field </div> </div> </div> </div> For the moment, I use this line to set value @browser.element(:css => ".quote textarea").send_keys "test" In PageObject, I

“Watir::Exception::NoMatchingWindowFoundException: browser window was closed” error when using IE 11 x64 with Page-Object

China☆狼群 提交于 2019-12-06 06:37:02
I'm running tests in Ruby Mine 2.7.1 using Page-Object + Rspec. Environment: Windows 7 x64, Ruby 1.9.3 p551, IE 11. Gems: watir , rspec , bundler , page-object When i run tests in Chrome or Firefox everything is ok. But when i try to run them in IE, the IE window with correct page gets opened and after that i get an error specified in Subject: "Watir::Exception::NoMatchingWindowFoundException: browser window was closed" The point is that the browser is actually open at that moment and shows a correct page. (See the screencast showing what happens: http://screencast.com/t/06prRy3OMLM ) Test

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

China☆狼群 提交于 2019-12-04 19:33:09
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"> <td class="bicRowFac10"> <span> <label class="bicDeco5"> <b>DASHBOARD:</b> ---> Based on this text <

PageObject with Ruby - set text in a text field only works in the main file

淺唱寂寞╮ 提交于 2019-12-02 12:38:18
问题 I'm automating a site that has a page with a list of options selected by a radio button. When selecting one of the radios, a text field and a select list are presented. I created a file (test_contracting.rb) that is the one through which I execute the test (ruby test_contracting.rb) and some other classes to represent my page. On my class ContractPage, I have the following element declaration: checkbox(:option_sub_domain, :id => "option_sub_domain") text_field(:domain, :id => "domain_text")

Page-object gem: Identifying object with same properties based on their visibility

邮差的信 提交于 2019-12-02 07:51:24
问题 I have a text box with the following html. The id is dynamic and I cannot use it.I fill some text in the text box. <input type="text" id="117841" class="NEdit" title="MyText" maxlength="20" style="position: absolute; overflow: hidden; font-style: normal; font-weight: normal; font-family: arial; font-size: 12px; text-transform: uppercase; width: 184px; left: 28px; top: 0px; height: 14px;"> There is a Add button and when I click that a New Tab is created. In the new tab, I will have a text box