[Wtr-general] Selecting multiple terms with watir
Hi all, How could we find the multiple items in the select list using watir?? manually i use ctrl and click on the item for selecting multiple items. So is there a way to do with watir?? - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6629messageID=18976#18976 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Selecting multiple terms with watir
Just select multiple items. ie.select_list(:index, 1).select(first) ie.select_list(:index, 1).select(second) After you select the second item, the first item will stay selected, it will not be unselected (in multiple select list). -- Zeljko Filipin zeljkofilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Print statements
Thanks Paul! As usual you were most helpful. I am looking forward to figuring this out and trying your suggested technique. Take care, Carl ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Selecting multiple terms with watir
I am sure there is a more elegant way and WATIR can emulate a shift-key, but I do the following: ie2.selectBox( :name Thing).select(My thing) ie2.selectBox( :name , thingAvailable).select(002) ie2.selectBox( :name , thingAvailable).select(002) ie2.selectBox( :name , thingAvailable).select(002) ie2.image(:src , /transferto_button.gif/).click Good luck! Carl ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] VBScript Fails with Watir
Hi Paul, Thank you for your reply. The problem i'm facing are not the expected end of statement errors. These do not appear with Watir and my application. The problem is a VBScript error where the document.all does not support the value property. In my two examples I was able to reproduce this were you not able to reproduce it? I've narrowed down the problem to the document.all call during one of Watir's click function sending an DispHTMLElementCollection with only one HTMLInputElement in it. the DispHTMLElementCollection does not have a value property and thus the error. Were you able to reproduce this problem? Thank you. FV - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6554messageID=18983#18983 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Watir.. close, but not close enough
Indeed. Watir's strength for us was that we couldn't afford a huge application and all the time and training that entails, and Watir allowed us to put together a pretty comprehensive set of tests for our few websites. Creating a general-purpose framework would probably make it as complex as just using native watir/ruby anyway! It's bad enough with the number of tricks I have to play with my simple Login() function to cater for the places where it uses fields called username, usrname or user for the same thing. In which case it soon becomes easier and clearer to just use ie.text_field(:name, username).set(myuser) ie.text_field(:name, password).set(mypass) ie.button(:name, submit).click - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6532messageID=18986#18986 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Is this watir's limitation?
I'm not sure I understand. Watir works on the browser, like and end-user. It doesn't care if it's ASP, flat HTML, PHP or whatever. It just sees the output. Even if you're using ASP, you'll still have a frame src= structure to follow, and at some point some HTML to click on. General rule-of-thumb seems to be that if a user can browse it, Watir can test it. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6623messageID=18987#18987 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Confused over download links
I answered my own question I think :) First of all, I had to get 1.5.1, which took a bit of finding! Now the example I found on Wikipedia works require 'watir/winclicker' require 'watir/contrib/enabled_popup.rb' ie.link(:url, someaddress).click_no_wait hwnd = ie.enabled_popup(5) if (hwnd) w = WinClicker.new w.makeWindowActive(hwnd) w.clickWindowsButton_hwnd(hwnd, Cancel) end - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6632messageID=18990#18990 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Is there an ie.goto equivalent of ie.link.click_no_wait?
I need to test that direct visits to a URL do not allow a download to happen, but because there's no link on a page for me to test, I can't use the click_no_wait method. Is there an equivalent way of visiting a URL directly, and then catch any popups? Alternatively, I notice that after a few seconds I get a wait_until timeout error, is there a way of catching this and handling it? This is what I want to achieve: ie.goto(url) if i_got_download_popup then click cancel in the popup display warning else display success notice end Thanks - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6633messageID=18991#18991 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Is this watir's limitation?
Ive worked on some applications where doing a view source from the browser didnt work. I think this was because the server was ziping the html ( I think in apache its mod_deflate) This was in the days before watir and it was a real pain to automate it. If you use irb and the ie.html methods ( or ie.frame(...).html ) you should be able to get the html Paul - Original Message - From: Cylindric [EMAIL PROTECTED] Date: Wednesday, February 21, 2007 6:24 am Subject: Re: [Wtr-general] Is this watir's limitation? I'm not sure I understand. Watir works on the browser, like and end-user. It doesn't care if it's ASP, flat HTML, PHP or whatever. It just sees the output. Even if you're using ASP, you'll still have a frame src= structure to follow, and at some point some HTML to click on. General rule-of-thumb seems to be that if a user can browse it, Watir can test it. --- -- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6623messageID=18987#18987 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Is this watir's limitation?
You might try looking at the DOM that's output with IE developer toolbar: http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038displaylang=en This is what Watir and the end user are seeing. The asp code is still sending html output to the browser. Microsoft uses a lot of asp to create their pages and frame contents: require 'watir' include Watir ie = IE.start('http://support.microsoft.com/kb/196340') puts ie.frame(:index, 1).html That'll output the html from the asp page in the first frame. -Charley On 2/21/07, Cylindric [EMAIL PROTECTED] wrote: I'm not sure I understand. Watir works on the browser, like and end-user. It doesn't care if it's ASP, flat HTML, PHP or whatever. It just sees the output. Even if you're using ASP, you'll still have a frame src= structure to follow, and at some point some HTML to click on. General rule-of-thumb seems to be that if a user can browse it, Watir can test it. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6623messageID=18987#18987 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Print statements
Howdy, I had a little bit of trouble getting breakpoint to work, but was finally successful. The real interesting part is my print statements are now working. I think I will really like this troubleshooting approach. Thanks again! I am in the process of migrating our testing framework over to Watir 1.5. My script works flawlessly on Watir 1.4.1, but the script becomes suspended on Watir 1.5.1.1145 after clicking on an image in a pop-up. It appears to me that the attached window is not closing properly after the last line of code is executed for the pop-up. Any suggestions or opinions would be most welcome. It is not obvious to me why this script does not work in Watir 1.5.1. Here is the error I am getting by entering the next line of code in IRB. ie2.image(:src , /ps_save_button.gif/).click WIN32OLERuntimeError: Unknown property or method `document' HRESULT error code:0x80010108 The object invoked has disconnected from its clients. from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:1655:in `method_missing' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:1655:in `document' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:1146:in `each_element' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:1155:in `locate' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:1112:in `locate_tagged_element' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:3402:in `locate' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:2295:in `assert_exists' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:2526:in `enabled?' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:2301:in `assert_enabled' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:2471:in `click!' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:2457:in `click' Here is all of the code relating to the pop-up: # Activates a drop down @ie.link(:text, NEW...).click # Activates the Pop Up @ie.link(:text, something).click # sleep 10 # Attachs to the pop-up window ie2 = IE.attach(:title, something) wait = Waiter.new wait.wait_until{ie2.selectBox(:name, 'Type').exists?} ie2.selectBox( :name , Type).select(thing 1) ie2.radio(:id, do this).set ie2.text_field(:name, add this).set(24) ie2.selectBox( :name , locations).select(001-TX-AUS) ie2.image(:src , /ps_transferto_button.gif/).click # Clicking on image saves the selections # breakpoint ie2.image(:src , /ps_save_button.gif/).click # Assertions verifies the Pop Up closes and the application has been updated with a new image assert( @ie.image(:src , /ps_icon_local_loop.gif/ ).exists? ) Carl L. Shaulis Convergys - Senior Analyst 512-634-0607 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Is this watir's limitation?
Thank you very much. It works now. I still don't understand why it didn't work before. One mistake I was doing was, using frame index from 0 instead of 1 but frame name didn't work either. Only difference between yesterday and today is new build. Anyway it works now. Thanks a bunch. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6623messageID=19018#19018 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Print statements
ie2.image(:src , /ps_save_button.gif/).click WIN32OLERuntimeError: Unknown property or method `document' HRESULT error code:0x80010108 The object invoked has disconnected from its clients. from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:1655:in `method_missing' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:1655:in `document' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:1146:in `each_element' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:1155:in `locate' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:1112:in `locate_tagged_element' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:3402:in `locate' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:2295:in `assert_exists' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:2526:in `enabled?' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:2301:in `assert_enabled' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:2471:in `click!' from C:/apps/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145 /./watir.rb:2457:in `click' This looks like a known bug, that is fixed in 1158. Note that there is also a similar bug in this version, but which is fixed in trunk/HEAD -- time for a new dev gem, i know! ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Problem with wrapper created around Watir.rb
Ajitesh Srinetra wrote: Hi all In My testcases I created a wrapper around Watir.rb def login(ie,username,password) ie.text_field(:name, ranger_user[name]).set(username) ie.text_field(:name, ranger_user[password]).set(password) ie.button(:name, commit).click sleep 2 return ie.frame(ifr_content)#returns the iframe object end where login is the function called in my testcase . After that whenever the screen refreshes the object is lost.And all other funtctions start failing. Do we need to modify the refresh method for this or there is any other workaround. Show us more code and i'll show you how to make it work. Specifically, you need to show some test code that uses the login method you've defined here. Bret ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Nested Frames
Hi Guys, I am currently trying to use Watir (1.5.1.1158) to test Web applications in our organization. The web application i am trying to build test around have a number of Frames and IFrames and in a number of cases heavily nested. I am currently facing problems where the wait command is not able to determine if a sub-frames have loaded consequently causing some of the tests to fail. This problem was raised a while ago in the following post: http://rubyforge.org/pipermail/wtr-general/2005-May/001724.html But no conclusive answer was agreed upon. I have used the code provided in the post to try and meet my needs. Is there a better or more stable way of handling heavily nested frames. Thanks for you help Cheers, Akhil ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Watir.. close, but not close enough
John Lolis wrote: I don't feel that its a problem Watir needs to solve. If the community really did want some framework I think it would be a project separate from Watir. I'm not even sure a project like that would work. Every application that needs testing is probably going to need a slightly different approach. If someone attempts to write a 'be all end all' framework its probably going to end up very complex and hard to understand (see most commercial testing packages). To some degree I agree. However, our user's guide tells people how to use Watir with Test::Unit and so a lot of people group them together. Indeed, we've had so many complaints about the poor fit of this unit testing framework for system acceptance testing that I've included Watir::TestCase in the recent versions of Watir 1.5. Namely, this TestCase executes its test methods in the order defined and also supplies verify methods that work like assert, but don't abort a test case when they fail. These were the two most common complaints with Test::Unit itself by Watir users. But i do agree that there is a value to keeping Watir small and flexible and it seems to me that it would probably be better to migrate this new TestCase subclass to some other project. It could still be used by Watir users, but they would be free to use whatever test harness they wanted: Test::Unit or Rspec or this new thing or maybe something they built themselves. Bret ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general