[wtr-general] how to locate a table which has no attribute
hi all: I am using watir-webdriver with ruby 1.8.6 on windows.I want to click a td element but which's Upper strata table element has no attribute.I try to like that but failed: @utable=ie.div(:id,mainContainer).table(:index,2) @utable.[](2).[](1).[](7).[](1).click Please could someone let me know how we do this Many thanks in advance. that is the html page: http://paste.ubuntu.org.cn/i87169 -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Help on Watir scripts
Hi, I am new to Watir and I would like to ask if there is any way in Watir to access the elements in a partial view? The element does not exist when you look into the page's View Source. It does, however, exist when you look into the firebug. Here's my Page Source looks like.. div id=accordionIndex class=overflowDesactivate usersDivIE6 div id=UserScreenDiv class=divUserScreeen style=height:522px; ---some elements not shown here--- /div /div Here's what in the DOM.. div id=accordionIndex class=overflowDesactivate usersDivIE6 div id=UserScreenDiv class=divUserScreeen style=height:522px; link id=pathSearch href=/Account/UserSearch/ link id=pathSearchPager href=/Account/ UserSearch/ ---some parts here--- /div /div Somehow, I want to access the links in the DOM.. by the way here's my WATIR script and it fails.. require 'watir' test_site = 'https://www.mysite.com' ie = Watir::IE.new ie.goto(test_site) ie.link(:text, User Management).click if assert(ie.link(:id, pathSearch).exists?) puts 'OK' end then i get this message from WATIR.. 1) Failure: test_user_mgt(TC_TOM_suite) [TOM_test_suite.rb:42]: Failed assertion, no message given. it seems that WATIR did not see the links element under div because they are part of a partial view.. I need advice in this one.. Thank you very much! Best Regards, Jog -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Watir 2.0 Released
On Wed, Aug 10, 2011 at 5:15 PM, Jarmo jarm...@gmail.com wrote: Today is the day when Watir 2.0 is released. And if you want to link somewhere, there is a blog post too: http://watir.com/2011/08/11/watir-2-0/ Jarmo, thanks for the new release! :) Željko -- watir.com - community manager watir.com/book - author watirpodcast.com - host -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Watir 2.0.0.rc2 released
These problems should now be fixed in version 2.0.1 Jarmo On Aug 10, 6:29 pm, Jarmo Pertman jarm...@gmail.com wrote: Thanks. The next release will try to focus for Ruby 1.9.2. I suspect that this problem is related with the browser.close problem in 1.9.2 too. Jarmo On Aug 9, 10:14 pm, Dmitriy Korobskiy dkro...@gmail.com wrote: On 7/27/11 11:02 AM, Jarmo Pertman wrote: Don't use Ruby 1.9.2 right now since it is related with other bugs related with 1.9.2. Didn't want to fix those at the moment to avoid even bigger changes. Jarmo I found one regression where the code works in Watir 2.0.0.rc3/Ruby 1.8.x, but stops working in Ruby 1.9.x. Just want to report it, so you can add it to the list if it has not been reported before. BTW, it works in Watir 1.9.2/Ruby 1.9.x. The regression is in links() collection and link() locators: they apparently stop working. The following code should dump a bunch of links. In Watir 2.0.0.rc3/1.9.x, links() collection is returned empty. # Windows only # require 'watir' browser = Watir::IE.new_window browser.goto(http://google.com;) if browser.url.include?(google.com) puts Navigated to Google end for link in browser.links puts #{link.text} #{link.to_s} end begin browser.close rescue = e puts WARNING: Error in closing the browser:\n#{e.message}\n#{e.backtrace} end -- DK AIM: DKroot1, Skype: DKroot -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Watir 2.0.0.rc2 released
On 8/11/11 5:46 AM, Jarmo Pertman wrote: These problems should now be fixed in version 2.0.1 Jarmo Yep, they are fixed. Thanks a bunch! On Aug 10, 6:29 pm, Jarmo Pertmanjarm...@gmail.com wrote: Thanks. The next release will try to focus for Ruby 1.9.2. I suspect that this problem is related with the browser.close problem in 1.9.2 too. Jarmo On Aug 9, 10:14 pm, Dmitriy Korobskiydkro...@gmail.com wrote: On 7/27/11 11:02 AM, Jarmo Pertman wrote: Don't use Ruby 1.9.2 right now since it is related with other bugs related with 1.9.2. Didn't want to fix those at the moment to avoid even bigger changes. Jarmo I found one regression where the code works in Watir 2.0.0.rc3/Ruby 1.8.x, but stops working in Ruby 1.9.x. Just want to report it, so you can add it to the list if it has not been reported before. BTW, it works in Watir 1.9.2/Ruby 1.9.x. The regression is in links() collection and link() locators: they apparently stop working. The following code should dump a bunch of links. In Watir 2.0.0.rc3/1.9.x, links() collection is returned empty. # Windows only # require 'watir' browser = Watir::IE.new_window browser.goto(http://google.com;) if browser.url.include?(google.com) puts Navigated to Google end for link in browser.links puts #{link.text} #{link.to_s} end begin browser.close rescue = e puts WARNING: Error in closing the browser:\n#{e.message}\n#{e.backtrace} end -- DK AIM: DKroot1, Skype: DKroot -- DK AIM: DKroot1, Skype: DKroot -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] How to change select_list box value ?
Hi, I am new here. Have a problem that can't select another option value Source code: select name=defaultLicensingPeriod size=1 class=origDhtmlDropDownSearch style=display: none; option value=M1 selected=selected1 month/option option value=M22 months/option option value=M33 months/option /select Tried: $ie.frame(:name,mainFrame).select_list(:name, 'defaultLicensingPeriod').option(:text, '2 months').value #= 'M2' $ie.frame(:name,mainFrame).select_list(:name, 'defaultLicensingPeriod').select('2 months') Can you help, what is wrong? BR, Dmitri -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] How to send text to a CKEditor WYSIWYG editor box using Watir-WebDriver?
I've just posted my question to StackOverflow. If anyone has any ideas, I'd appreciate it. http://stackoverflow.com/q/7025823/503158 -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] How to change select_list box value ?
Try with, select_list(:how,what).set(ur desired option) On Thu, Aug 11, 2011 at 5:44 PM, Dmitri Karusar flysteppe...@gmail.comwrote: Hi, I am new here. Have a problem that can't select another option value Source code: select name=defaultLicensingPeriod size=1 class=origDhtmlDropDownSearch style=display: none; option value=M1 selected=selected1 month/option option value=M22 months/option option value=M33 months/option /select Tried: $ie.frame(:name,mainFrame).select_list(:name, 'defaultLicensingPeriod').option(:text, '2 months').value #= 'M2' $ie.frame(:name,mainFrame).select_list(:name, 'defaultLicensingPeriod').select('2 months') Can you help, what is wrong? BR, Dmitri -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Thanks Regards Asif Iquebal Sarkar Bhubaneswar, Orissa -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: How to change select_list box value ?
No luck with: $ie.frame(:name,mainFrame).select_list(:name,defaultLicensingPeriod).set(2 months) The thing is All select_menus on my page have same span class: span class=containerinput type=text/span -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: how to locate a table which has no attribute
The code is incorrectly specifying the index as a string not an integer. Thus @utable=ie.div(:id,mainContainer).table(:index,2) should be @utable=ie.div(:id,mainContainer).table(:index, 2) Joe On Aug 10, 7:44 pm, lifeng jiang jiangsqu...@gmail.com wrote: hi all: I am using watir-webdriver with ruby 1.8.6 on windows.I want to click a td element but which's Upper strata table element has no attribute.I try to like that but failed: @utable=ie.div(:id,mainContainer).table(:index,2) @utable.[](2).[](1).[](7).[](1).click Please could someone let me know how we do this Many thanks in advance. that is the html page:http://paste.ubuntu.org.cn/i87169 -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Is possible to instance a new firefox session with timeout to open the browser?
Usually this should time out in 60 seconds. Try running the script with $DEBUG = true (or pass -d to ruby on the command line) and paste the full output here. 2011/8/10 Fabrício Ferrari de Campos ffc.fabri...@gmail.com Hi, I'm using 'watir-webdriver' and sometimes when I open a new firefox session (Watir::Browser.new(:firefox, :profile = default)), the firefox is started, but remains with the blank page (http://cl.ly/ 3Z020Y143N1D1X221D00). And only when I kill the process or close the firefox manually, the unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055) exception occurs. Is there someway I can pass a timeout when I initialize de browser? Regards, Fabrício Ferrari de Campos -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Need Javascript Tree Help: Clicking on the plus/minus icons to expand
Very interesting I was playing around with the jstree some more, but when I iterate through the INS tags and click each one, it appears to click some of them but not all of them... Let's say I have 12 nodes, and I iterate through them and click each icon, it appears that the last 3 nodes are expanded properly... then when I refresh, and run the script again... the last 6 nodes are expanded properly... and if I do it once more... the last 4 are expanded There doesn't seem to be anything in the html that differs the icons... The code I am using is as follows: $browser.ins(:class = jstree-icon, :index = i).click where i is incremented in a loop to click each element On Aug 10, 2:56 pm, andy thai a28t...@gmail.com wrote: That is indeed the same jstree I am working with! That was a very detailed response that you gave, I like how you explained everything so clearly. But yes, clicking the link next to the icon won't help me, and the only way I can think of to interact with the icon is through the INS tags. I'm able to locate the right icon by extending Watir to accept INS tags (see original post) I'm not able to get the .click method to work on the ins tags... Is there something I missed when adding INS to watir? On Aug 6, 8:49 am, Chuck van der Linden sqa...@gmail.com wrote: stike that, I think I found an example of the tree control you are using, http://www.jstree.com/demo If this is your baby, then the link that follows the icon is other stuff on the same line, clicking that isn't likely to help you. it looks like you need to find a way to click the ins element (which is really just a text formatting tag that you'd normally never interact with) This Jquery stuff amazes me, in that little area there really isn't an icon. What's there is a non-blank-white-space (basically a space character) with a background image. The background image itself has a bunch of icons in it, and they control which one you see by setting an 'offset'. Basically it's like they have a one character 'window' over the background, and they slide the background around under the window to show you the individual little 'icon'. Clicking that spot, renders new tree stuff, and changes the class of the LI container which shifts the offset of the background image so you see a different arrow. It's largely powered by CSS, which is reacting to the class on the LI container element and INS tag inside that list item. There's a ton of javascript also that switches the classes around etc depending on what's there (closed or open (branches) leaf and last leaf) and updates the DOM on the fly and then CSS renders according to the classes.. I think this is the first time I've seen something setup to actually react to clicking on a ins tag. (if it happened more often Watir would no doubt already support it as a stock element type) On Aug 6, 4:30 am, Chuck van der Linden sqa...@gmail.com wrote: Within each list item container, I see the ins element and also a link (a) element. I suspect they are perhaps superimposed. Have you tried clicking on the link elements? (doing it by title looks like it would be ideal, but that's not supported by default so you will probably have to use class, or specify the list item if the ID values are at all predictable, and then click the link inside it. browser.li(:id, '233_1455').link(:index, 1).click #index would be 0 for watir-webdriver or watir2.0 On Aug 5, 11:45 am, andy thai a28t...@gmail.com wrote: Hi, I have a javascript tree problem where I need to search for a particular node. To do this I need to expand each branch in order to see the contents under the node clicked. The problem I am having is that the plus and minus icons aren't images like in the example provided in http://wiki.openqa.org/display/WTR/ JavaScript. An example of the html is: div class=myTree style=border: none; div id=233 class=asyncNavTree jstree jstree-0 jstree-focused jstree-default style= li id=233_1238 class=jstree-closed ins class=jstree-iconnbsp;/ins a class=treeNodeLink sectionPopupInit title=node1 /li li id=233_1455 class=jstree-closed ins class=jstree-iconnbsp;/ins a class=treeNodeLink sectionPopupInit title=node2 /li li id=233_5416 class=jstree-open ins class=jstree-iconnbsp;/ins a class=treeNodeLink selectedTreeNode sectionPopupInit jstree- clicked title=node3 /li li id=401_1685 class=jstree-closed ins class=jstree-iconnbsp;/ins a class=treeNodeLink sectionPopupInit title=node4 /li From using FireBug, the icon I want to click directs me to the line ins class=jstree-iconnbsp;/ins I attempted to extend watir to support this, module Watir class Ins NonControlElement TAG =
[wtr-general] Need file_field assistance
Hey Everyone Before the inclusion of rautomation in WATIR 1.9 I was able to do the following without much of a problem file = File.expand_path(File.dirname(__FILE__) + '/files/ testdoc.doc').gsub!('/','\\') browser.file_fields.each do |file_field| file_field.set(file) end There was a page with a set of fields that we looped through. For some reason the Open dialog box gets stuck and kills the rest of the test suite. Does anyone have a suggestion for a work around or a new way of doing this? Is this a known bug withing WATIR and rautomation? Thank you for your help. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com