Re: [Wtr-general] Handling Popup
Tried that too, didn't work. It's somewhat interesting because with QuickTest Pro, it identified that dialog as winDialog and I'd thought the winClicker solution would work... but it didn't. On 6/11/07, Hayato Iriumi <[EMAIL PROTECTED]> wrote: I just went through exactly the same issue. Try to use click_no_wait and see what happens. On 6/11/07, TT Blue <[EMAIL PROTECTED]> wrote: > I'm new to Watir as well as Ruby, and I need help handling a pop-up dialog. > > I've searched both the mailing list as well as the trying all that I've > found, but I couldn't get it to click on the "OK" pop-up button. > == > require 'watir' > require 'watir\enabled_popup' > #require 'watir/WinClicker' >def startClicker( button , waitTime= 9, user_input=nil ) > # get a handle if one exists > hwnd = $ie.enabled_popup(waitTime) > if (hwnd) # yes there is a popup > w = WinClicker.new > if ( user_input ) > w.setTextValueForFileNameField ( hwnd, "#{user_input}" ) > end > # I put this in to see the text being input it is not necessary to > work > sleep 3 > # "OK" or whatever the name on the button is > w.clickWindowsButton_hwnd( hwnd, "#{button}" ) > # > # this is just cleanup > w=nil > end > end > > switch_role.role.select("my role") > startClicker( "OK", 3, "") > == > when I tried code block above, I get this error message: > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require': no such file to load -- watir\contrib\enabled_popup > (LoadError) > from > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require' > from CMSlogin.rb:2 > > when I try this code block: > > require 'watir/WinClicker' > def sstartClicker( button , waitTime = 3) > w = WinClicker.new > longName = $ie.dir.gsub("/" , "\\" ) > shortName = w.getShortFileName(longName) > c = "start ruby #{shortName }\\watir\\clickJSDialog.rb #{button } #{ > waitTime} " > puts "Starting #{c}" > w.winsystem(c) > w=nil > end > > switch_role.role.select("my role") > startClicker( "OK", 3) > > This just waits forever and does not click on the OK button. > > == > > Can someone please help? > > > > > ___ > 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 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Need to fetch the ID
Hi Zeljko, I have a quesion on the code you sent me. Kindly find the question below the code. This will extract 1303. irb> m = /id=(1303)/.match(ie.link(:text, "RE: Check Copy Request").href) => # Q: Here I mention the id but I want to fetch automatically because the id keep changing for every message replied. Hope my explaination is fine. irb> m[1] => "1303" ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Handling Popup
I just went through exactly the same issue. Try to use click_no_wait and see what happens. On 6/11/07, TT Blue <[EMAIL PROTECTED]> wrote: > I'm new to Watir as well as Ruby, and I need help handling a pop-up dialog. > > I've searched both the mailing list as well as the trying all that I've > found, but I couldn't get it to click on the "OK" pop-up button. > == > require 'watir' > require 'watir\enabled_popup' > #require 'watir/WinClicker' >def startClicker( button , waitTime= 9, user_input=nil ) > # get a handle if one exists > hwnd = $ie.enabled_popup(waitTime) > if (hwnd) # yes there is a popup > w = WinClicker.new > if ( user_input ) > w.setTextValueForFileNameField ( hwnd, "#{user_input}" ) > end > # I put this in to see the text being input it is not necessary to > work > sleep 3 > # "OK" or whatever the name on the button is > w.clickWindowsButton_hwnd( hwnd, "#{button}" ) > # > # this is just cleanup > w=nil > end > end > > switch_role.role.select("my role") > startClicker( "OK", 3, "") > == > when I tried code block above, I get this error message: > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require': no such file to load -- watir\contrib\enabled_popup > (LoadError) > from > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require' > from CMSlogin.rb:2 > > when I try this code block: > > require 'watir/WinClicker' > def sstartClicker( button , waitTime = 3) > w = WinClicker.new > longName = $ie.dir.gsub("/" , "\\" ) > shortName = w.getShortFileName(longName) > c = "start ruby #{shortName }\\watir\\clickJSDialog.rb #{button } #{ > waitTime} " > puts "Starting #{c}" > w.winsystem(c) > w=nil > end > > switch_role.role.select("my role") > startClicker( "OK", 3) > > This just waits forever and does not click on the OK button. > > == > > Can someone please help? > > > > > ___ > 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
[Wtr-general] Handling Popup
I'm new to Watir as well as Ruby, and I need help handling a pop-up dialog. I've searched both the mailing list as well as the trying all that I've found, but I couldn't get it to click on the "OK" pop-up button. == require 'watir' require 'watir\enabled_popup' #require 'watir/WinClicker' def startClicker( button , waitTime= 9, user_input=nil ) # get a handle if one exists hwnd = $ie.enabled_popup(waitTime) if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) w.setTextValueForFileNameField( hwnd, "#{user_input}" ) end # I put this in to see the text being input it is not necessary to work sleep 3 # "OK" or whatever the name on the button is w.clickWindowsButton_hwnd( hwnd, "#{button}" ) # # this is just cleanup w=nil end end switch_role.role.select("my role") startClicker( "OK", 3, "") == when I tried code block above, I get this error message: c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- watir\contrib\enabled_popup (LoadError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from CMSlogin.rb:2 when I try this code block: require 'watir/WinClicker' def sstartClicker( button , waitTime = 3) w = WinClicker.new longName = $ie.dir.gsub("/" , "\\" ) shortName = w.getShortFileName(longName) c = "start ruby #{shortName }\\watir\\clickJSDialog.rb #{button } #{ waitTime} " puts "Starting #{c}" w.winsystem(c) w=nil end switch_role.role.select("my role") startClicker( "OK", 3) This just waits forever and does not click on the OK button. == Can someone please help? ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Scheduler
Adding "&auto=true" to the end of the URL does the trick. Thanks all. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Concurrent tests, different regions...
eisdrache wrote: > I understand what you are saying about the global variables, but in this case > they are a necessary evil as I am using the following code in order to handle > javascript pop-ups: > > def startClicker( button , waitTime= 9, user_input=nil ) > hwnd = $ie.enabled_popup(waitTime) > if (hwnd) > w = WinClicker.new > if ( user_input ) >w.setTextValueForFileNameField( hwnd, "#{user_input}" ) > end > sleep 3 > w.clickWindowsButton_hwnd( hwnd, "#{button}" ) > w=nil > end > end Using this code with multiple threads will eventually fail unpredictably. You need to pass in the ie object as a parameter to avoid this. Bret ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] WATiR contract work in San Francisco
Experienced test engineer needed to work on Customer Facing Ecommerce applications. Requires significant commercial automation work using the WATiR framework. Immediate, long term contract situation. Very solid team, positive environment. Calls or email are good. Bob Lepesh, JD Strategies. 650-941-2900 [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, June 11, 2007 2:30 AM To: wtr-general@rubyforge.org Subject: Wtr-general Digest, Vol 43, Issue 13 Send Wtr-general mailing list submissions to wtr-general@rubyforge.org To subscribe or unsubscribe via the World Wide Web, visit http://rubyforge.org/mailman/listinfo/wtr-general or, via email, send a message with subject or body 'help' to [EMAIL PROTECTED] You can reach the person managing the list at [EMAIL PROTECTED] When replying, please edit your Subject line so it is more specific than "Re: Contents of Wtr-general digest..." ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Running tests from a webserver -- any new information?
A while ago I posted about the option of running Watir tests from a centralized webserver or desktop. The point would be for others to be able to run the tests and view results without installing Ruby, Watir and dependent libraries and alleviate associated technical problems. I'm the "automation QA guy" at my company, so this would help the rest of my team run tests alongside manual tests, or to support small patches that need a lot of regression testing when I'm away. In case I'm still being vague, the application would list available tests (locally or in SVN -- wouldn't matter), allow the user to click a test to launch it on the host machine, and then display results onscreen. At the time, I believe on person replied and sent a snippet of code out that did work, but was difficult to configure due to the fact it was written by someone else to fill their different needs. Does anyone else use this approach, or know of any applications that make the process easier? I've never written active web code, so it's new ground for me. Thanks, Adam ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Modal dialog
click_no_wait seems to do it. Thank you very much for your help! ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] mouse right click?
the code in that page uses the javascript event object, which we've had problems with in watir. I think you will be able to make this work by: simulate right click see if the menuitem div is visible click it based on its text something like this may be what you need ie.link(:index,1).fireEvent("onContextMenu") if ie.div(:text , "Message Formur").style.visibility != "hidden" ie.div(:text , "message forum").click end - Original Message - From: mihai <[EMAIL PROTECTED]> Date: Monday, June 11, 2007 4:11 am Subject: Re: [Wtr-general] mouse right click? > with java script it works; but i have this problem, this is the > site : http://www.dynamicdrive.com/dynamicindex1/contextmenu.htm > right click to select all and it appers a java menu; how do i > click, for example, on Message Forum in that menu? > ___ > 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] How to capture mail box icon
On 6/11/07, sapna <[EMAIL PROTECTED]> wrote: I need to check if it is opened/closed and then open the closed mail. Sapna, This will click a link if mail is closed. You will have to replace ":how" and "what" with something appropriate. ie.link(:how, what).click if ie.image(:how, what).src =~ /mailclosed/ Zeljko ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Need to fetch the ID
On 6/11/07, sapna <[EMAIL PROTECTED]> wrote: RE: Check Copy Request Sapna, To find id of that link you have to know some other attribute of that link. I will assume that you know text "RE: Check Copy Request" This is how you can get href attribute of that link. irb> ie.link(:text, "RE: Check Copy Request").href => "file:///C:/AppsUIWeb/SelfService/MessageDetail.aspx?id=1303&messageToUser=True" This will extract 1303. irb> m = /id=(1303)/.match(ie.link(:text, "RE: Check Copy Request").href) => # irb> m[1] => "1303" For more information see class MatchData ( http://phrogz.net/ProgrammingRuby/ref_c_matchdata.html) Zeljko ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] mouse right click?
with java script it works; but i have this problem, this is the site : http://www.dynamicdrive.com/dynamicindex1/contextmenu.htm right click to select all and it appers a java menu; how do i click, for example, on Message Forum in that menu? ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How to capture mail box icon
Can u guid me how to use this code. I need to check if it is opened/closed and then open the closed mail. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Link description from file
found the solution: use the following code: [code] object = 'test.html' ie.link(:href,/#{object}/).click [/code] ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Need to fetch the ID
Hi, I had posted this question earlier but did not get any information. So wanted to put the question again. Need help on this. Below is the HTML code. 1> I want to check whether the mail is read or unread depending on the mail icon(first line of HTML) 2> Want to fetch the id generated (id=1303) depending on which I will click on the message link and that would take me to read message window. 6/8/2007 RE: Check Copy Request Thanks in advance. Regards Sapna ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How to capture mail box icon
Hi Sapna, This is how you can find out if mail box is open or closed. Let me know if you do not know how to use this code. irb> ie.image(:index, 1).src =~ /mailclosed/ => 46 irb> ie.image(:index, 1).src =~ /mailopen/ => nil Zeljko ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general