watir-webdriver

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

select from menu after right click watir-webdriver

左心房为你撑大大i 提交于 2019-12-11 18:04:24
问题 I am using watir-webdriver, I am able to right click on an element using this code snippet: s = @browser.span :text => 'Inbox' s.right_click After this I am doing this to select an item from the new menu that pops up: @@browser.send_keys :down @@browser.send_keys :enter But that does not work. Am I missing anything here? Thanks a lot for your help 回答1: First try changing @@browser to @browser. 来源: https://stackoverflow.com/questions/9709650/select-from-menu-after-right-click-watir-webdriver

select checkbox with hidden input type

瘦欲@ 提交于 2019-12-11 17:50:51
问题 Folks, I am using watir-webdriver, I have a piece in my HTML DOM which gets generated on the fly when I enter some credentials, this piece has a bunch of checkboxes, the number of checkboxes vary, I have to select one checkbox, below is an example of this, here I want to select the second checkbox(the one that has value "BS" for the input type hidden but the value for input type checkbox is same for all): <li class="dir"> <input type="checkbox" value="1" onclick="$(this).next('.should_destroy

Chromedriver crashes when lauched from watir-webdriver

本秂侑毒 提交于 2019-12-11 16:12:34
问题 I have the following gems and I also have the latest Chrome driver 2.9 version. builder (2.1.2) bundler (1.6.0.pre.2) childprocess (0.4.1) coderay (1.1.0) cucumber (0.8.7) data_magic (0.17) diff-lcs (1.1.3) faker (1.2.0) ffi (1.9.3 x86-mingw32) gherkin (2.1.4 i386-mingw32) i18n (0.6.9) json_pure (1.4.6) method_source (0.8.2) multi_json (1.8.4) page-object (0.9.6) page_navigation (0.9) pry (0.9.12.6 i386-mingw32) rubyzip (1.1.0) selenium-webdriver (2.39.0) slop (3.4.7) term-ansicolor (1.0.7)

Watir-Webdriver Frame Attributes Not Congurent with Other Sources

微笑、不失礼 提交于 2019-12-11 14:32:35
问题 I have an issue where if I return the some attributes of a frame they do not match those in Firebug for example. The reason is that I am looking for a way to identify the purpose of a frame. For example on www.cnet.com they load 19 frames in total and some of these are HTML with JavaScript. I want to inspect some of the frames but not all. Using Firebug I see some interesting attributes regarding the frame and I want filter the frame based on some of these attributes. I have the following

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 webdriver; window.close is closing entire browser?

馋奶兔 提交于 2019-12-11 06:53:25
问题 I am running a test where I copy/paste a link into a new tab . Once I am finished with it, I am looking to close it, then continue running other tests within the spec. The issue at the moment is that when I use window.close , it is closing the entire browser instance, not just that particular window. Here is my general code: # Method for the window def this_window page = @browser.window(:title, 'Foobar') return page end # Helper method for copy/paste in new tab def copy_paste_in_new_tab