[Wtr-general] click with autoit on OK button
i have this code: $ie1.radios.each do |chk| chk.focus if $ie1.button(:index,2).exist? then $autoit.BlockInput(1) $ie1.button(:index,2).click $autoit.Send({Enter}) $autoit.BlockInput(0) end button(:index,2) is a remove button and it shoul remove the selected radio; the problem is that when i want to remove that radio a small window appears with title Microsoft Internet Explorer and with 2 buttons OK and CANCEL for remove item; the OK button is selected so all i have to do is to send ENTER key with autoit, but that small window blocks my script (wont execute the next command SEND({ENTER})) untill a button will be pressed. Also i cant work with the main window unless the small window is closed. How can i press the OK button? How can the script execute SEND command and not pause untill the small window will be close? ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] general questions when trying Watir
We are trying to find some tools to help us in web automation testing. Selenium WET Watir are all reviewed. Finally we choose Watir 'coz it's pure scriptable. Using Selenium and WET will make our scripts highly rely on IDE, which is not what we want to. But there's several problems these days really puzzled me. I tried to search the archive mail list. But didn't find anything useful. Q1: how do you write your scripts? If I want to set my username passwd in a login form's text_field, is there any other way except for dig into the html to see what the name of text_filed is? Q2: Working with Ajax sometimes, I can't even find the object in VIEW/source. does watir support Ajax testing? will it work with several web sites like igoogle or liferay? Q3: I can't have attach work properly for me. if i got a link like this : a href=http://www.google.com; target=_blank. and ie is my current page driver. ie2= Watir::IE.attach(:url,'http://www.google.com') if i did this, will the link in ie be clicked and a new window generated? According to the User Guide, I think it should be the right way to work. But i tried several times, it didn't work. seems it can't find the object with url www.google.com. anybody know what's going wrong ? thanks Jaordzz ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] ruby2exe and autoit
You need to register AutoIt. In a command window, navigate to the directory where you've put AutoIt and type: regsvr32 AutoItX3.dll -Charley On 7/5/07, mihai [EMAIL PROTECTED] wrote: i have a script in wich im using an autoit control: $autoit= WIN32OLE.new(AutoItX3.Control) i want to test my script on another PC; so im making an exe with ruby2exe for my script and when im executing the .exe on another PC im getting this error: C:\DOCUME~1\QA_BLA~1\eee\eee.test.exe.2\app\test.rb:9:in `initia lize': unknown OLE server: `AutoItX3.Control' (WIN32OLERuntimeError) HRESULT error code:0x800401f3 Invalid class string from C:\DOCUME~1\QA_BLA~1\eee\eee.test.e xe.2\app\test.rb:9:in `new' from C:\DOCUME~1\A_BLA~1\eee\eee.test.exe.2\app\blazent_test.rb :9 from C:\DOCUME~1\A_BLA~1\eee\eee.test.exe.2\bootstrap.rb:77:in `load' from C:\DOCUME~1\A_BLA~1\eee\eee.test.exe.2\bootstrap.rb:77 i have try to copy AutoItX3.dll in the directory where the .exe is or in windows/system32 but the error still appears. What can i do? ___ 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] Receiving extensive warning messages while trying to run Watir Ruby scripts
It's likely that you have multiple Watir requires with different casing somewhere in your files: require 'watir' and require 'Watir' That'd be my first guess. Check your scripts for requires. -Charley On 7/4/07, Lavanya Lakshman [EMAIL PROTECTED] wrote: I have installed 1.8.5 version of ruby along with 1.4.1 version of Watir before and didnt have any issues, until recently I was required to have a completely new setup on a different machine. Ruby I have installed from (http://rubyforge.org/frs/?group_i d=167) 1.8.25-21 version. While running any of the Watir scripts, I am receiving the following warning messages: E:\PROVISGlobalAdminScript.rb c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1039: warning: already ini tialized constant REVISION c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1042: warning: already ini tialized constant VERSION c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1045: warning: already ini tialized constant READYSTATE_COMPLETE c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1048: warning: already ini tialized constant DEFAULT_TYPING_SPEED c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1051: warning: already ini tialized constant DEFAULT_SLEEP_TIME c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1054: warning: already ini tialized constant DEFAULT_HIGHLIGHT_COLOR c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1901: warning: already ini tialized constant TO_S_SIZE c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:2217: warning: already ini tialized constant TAG c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:2225: warning: already ini tialized constant TAG c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:2232: warning: already ini tialized constant TAG ___ 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] Best Combination - for Modal Dialog/Vista
Thanks the unit tests are of course the obvious resource, sorry. But trying them I am now confused. I am running the following test with the subsequent error. I have run out of brain. I cannot attach the 'Another' modal dialog. Can I borrow some brain? Environment Ruby 1.8.2-15 MS Vista watir-1.5.1.1166 Test code $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ require 'unittests/setup' require 'watir/dialog' class TC_Dialog_Test Test::Unit::TestCase include Watir def setup $ie.goto($htmlRoot + 'modal_dialog.html') end def teardown begin sleep 0.4 # XXX dialog.button('OK').click rescue end end def test_modal_text $ie.text_field(:name, 'modal_text').set('Some Text I Entered') $ie.button(:value, 'Close').click end def test_another_modal $ie.button(:value, 'Another Modal').click $ie2 = IE.attach(:title, /Pass/) end #TODO def test_modal_with_frames $ie.button(:value, 'Modal with Frames').click end end Result ruby modal_dialog_unit_test.rb Loaded suite modal_dialog_unit_test Started E.. Finished in 5.266 seconds. 1) Error: test_another_modal(TC_Dialog_Test): Watir::Exception::NoMatchingWindowFoundException: Unable to locate a window with title of (?-mix:Pass) c:/ruby182/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1630:in `attach_browser_window' c:/ruby182/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1507:in `attach_init' c:/ruby182/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1500:in `attach' modal_dialog_unit_test.rb:26:in `test_another_modal' 3 tests, 0 assertions, 0 failures, 1 errors Exit code: 1 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How do I attach to a mailto window
watir doesnt support doing this itself. You could probably write something to do this using auto-it. But an easier way is to probably test it once manually, and then save the link details. and instead of clicking the link, just make sure it hasnt changed from when you manually tested it Paul - Original Message - From: marty [EMAIL PROTECTED] To: wtr-general@rubyforge.org Sent: Thursday, July 05, 2007 8:25 AM Subject: [Wtr-general] How do I attach to a mailto window In the HTML code I have a link with a href of mailto. When I click on it in Watir, it brings up a window for the email message. I would like to attach to that window just to verify that the link worked properly. How do I do this? Html code: a href=mailto:'[EMAIL PROTECTED]'xxx/a Watir code so far: ie.link(:text, /xxx/).click ie1=IE.attach(:url, //) --- Need HELP here ___ 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 do I attach to a mailto window
Yep - if you really read your method, you're asking watir to attach an IE instance itself to an MS Outlook window with the url ofthere won't be a url because it's an MS Outlook window. The simplest solution I can think of without delving into AutoIT would be to set your default mail client to gmail (using Gmail Notifier or similar), or any other web-based mail client that supports being set as the default. Then you could continue to use Ruby/Watir for your assertions. Adam -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Rogers Sent: Thursday, July 05, 2007 11:13 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] How do I attach to a mailto window watir doesnt support doing this itself. You could probably write something to do this using auto-it. But an easier way is to probably test it once manually, and then save the link details. and instead of clicking the link, just make sure it hasnt changed from when you manually tested it Paul - Original Message - From: marty [EMAIL PROTECTED] To: wtr-general@rubyforge.org Sent: Thursday, July 05, 2007 8:25 AM Subject: [Wtr-general] How do I attach to a mailto window In the HTML code I have a link with a href of mailto. When I click on it in Watir, it brings up a window for the email message. I would like to attach to that window just to verify that the link worked properly. How do I do this? Html code: a href=mailto:'[EMAIL PROTECTED]'xxx/a Watir code so far: ie.link(:text, /xxx/).click ie1=IE.attach(:url, //) --- Need HELP here ___ 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] How to detect installed version of Watir
Open a command prompt, type: ruby -e require 'watir'; puts Watir::IE::VERSION; -Charley On 7/5/07, Nadine Whitfield [EMAIL PROTECTED] wrote: Hi- there may already be a thread about this, but I could not find it. I recently used the Windows .exe (rather than Gem) to install Watir on my computer. I'm pretty sure it's +not+ the newest version available. How do I find out which version I installed? Thanks ___ 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 detect installed version of Watir
Hi, Type the following at a command prompt: ruby -e 'require watir;puts Watir::IE::VERSION' George ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Modal Dialog/Vista -- undefined method `hwnd'
Interesting. I think I have worked out my understanding problems but now I get this problem. Maybe I need an older rev of Ruby 1.8.2? Environment Ruby 1.8.2-15 MS Vista watir-1.5.1.1166 Error Message NoMethodError: IE#modal_dialog not supported with the current version of Ruby (1.8.2). See http://jira.openqa.org/browse/WTR-2 for details. undefined method `hwnd' for #Watir::Frame:0x30a0580 c:/ruby182/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2815:in `initialize' c:/ruby182/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:351:in `new' c:/ruby182/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:351:in `modal_dialog' Michael Kernaghan Quality Control Tester Meridian Systems [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 604-609-0833 #103 Read what IDC believes to be the key to the success of engineering, construction RE industries. IDC Analyst Connection Integrated Project and Portfolio Management: Improving Efficiency, Lowering Risk for Engineering, Construction and Real Estate Firms Visit www.meridiansystems.com/performance http://www.meridiansystems.com/performance ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Embedded Browser and/or SmartCleint
I am trying again: Does anybody know anything about getting the DOM or attaching with Watir when the IE browser is embedded in an application, such as with Microsoft smartclient? When the application in question is running, it is obviously just a wrapper around IE and it displays the same web pages I find on the main site via my regular browser. But soon some of those pages may be made inaccessible except through this client application. I already have a lot of automation written for this site. It could be a lifesaver if I could just find a way to attach to the embedded DOM. This is important. I could really use any help or ideas that are out there. Lonny Eachus ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Permission denied when access frame contents
um and WET will make our scripts highly rely on IDE, which is not what we want to. But there's several problems these days really puzzled me. I tried to search the archive mail list. But didn't find anything useful. Q1: how do you write your scripts? If I want to set my username passwd in a login form's text_field, is there any other way except for dig into the html to see what the name of text_filed is? Q2: Working with Ajax sometimes, I can't even find the object in VIEW/source. does watir support Ajax testing? will it work with several web sites like igoogle or liferay? Q3: I can't have attach work properly for me. if i got a link like this : a href="" class="moz-txt-link-rfc2396E" href="http://www.google.com">"http://www.google.com" target="_blank". and ie is my current page driver. ie2= Watir::IE.attach(:url,'http://www.google.com') if i did this, will the link in ie be clicked and a new window generated? According to the User Guide, I think it should be the right way to work. But i tried several times, it didn't work. seems it can't find the object with url "www.google.com". anybody know what's going wrong ? thanks Jaordzz -- next part -- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070705/e94a90d1/attachment-0001.html -- Message: 8 Date: Thu, 5 Jul 2007 14:30:40 +0200 From: " ?eljko Filipin " [EMAIL PROTECTED] Subject: Re: [Wtr-general] general questions when trying Watir To: wtr-general@rubyforge.org Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset="utf-8" Hi Jaordzz, Comments are inline. On 7/5/07, salamond [EMAIL PROTECTED] wrote: Q1: how do you write your scripts? If I want to set my username passwd in a login form's text_field, is there any other way except for dig into the html to see what the name of text_filed is? I use Firebug (https://addons.mozilla.org/en-US/firefox/addon/1843) for Firefox, but there is also Internet Explorer Developer Toolbar ( http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038displaylang=en ) Q2: Working with Ajax sometimes, I can't even find the object in VIEW/source. does watir support Ajax testing? will it work with several web sites like igoogle or liferay? Yes. If you have a problem with something, let us know. Q3: I can't have attach work properly for me. if i got a link like this : a href="" class="moz-txt-link-rfc2396E" href="http://www.google.com">"http://www.google.com" target="_blank". and ie is my current page driver. ie2= Watir::IE.attach(:url,'http://www.google.com' http://www.google.com%27) if i did this, will the link in ie be clicked and a new window generated? Try this. ie.link(:href, "http://www.google.com").click Zeljko -- next part -- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070705/c14b39ea/attachment-0001.html -- Message: 9 Date: Thu, 05 Jul 2007 08:15:50 -0600 From: Paul Rogers [EMAIL PROTECTED] Subject: Re: [Wtr-general] Recovery System in WATIR To: wtr-general@rubyforge.org Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; format=flowed; charset=iso-8859-1; reply-type=original what are you trying to recover from? - Original Message - From: "Lavanya Lakshman" [EMAIL PROTECTED] To: wtr-general@rubyforge.org Sent: Wednesday, July 04, 2007 9:43 PM Subject: [Wtr-general] Recovery System in WATIR Hi All, Whenever we consider any tool for automation, the first and the foremost critical part is the recovery system. Unfortunately I didn't get much info related to this on the website. I would appreciate your thoughts and experience related to this. Thanks and Regards, Lavanya Lakshman ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -- Message: 10 Date: Thu, 05 Jul 2007 09:25:02 CDT From: marty [EMAIL PROTECTED] Subject: [Wtr-general] How do I attach to a "mailto" window To: wtr-general@rubyforge.org Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=ISO-8859-1 In the HTML code I have a link with a href of mailto. When I click on it in Watir, it brings up a window for the email message. I would like to attach to that window just to verify that the link worked properly. How do I do this? Html code: a href="" class="moz-txt-link-abbreviated" href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]'xxx/a Watir code so far: ie.link(:text, /xxx/).click ie1=IE.attach(:url, //) --- Need HELP here --
Re: [Wtr-general] How do I attach to a mailto window
Thanks. This was an easy change and it works great. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] NoMethodError for verify method in assertions.rb
Hi all! I'm trying to use the verify method from assertions.rb, but I keep getting the following error: undefined method 'verify' for main:Object (NoMethodError) I've added require watir/assertions to the beginning of my script, but still can't use the verify method. Is anyone else using this successfully? Thanks! -Tiffany ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Embedded Browser and/or SmartCleint
My guess is that you could attach to the embedded browser if you can get a handle to the ie instance and then attach to the handle using ie.attach(:hwnd, handle). You may be able to get a handle by navigating through windows, simalarly to the way it's set up in Watir by using Shell.Application, iterating through windows and finding a window that matches either your title, url or class name. Check out each on class IE for an example. I haven't done this before but that would be the general tack I'd take. There are likely better ways, but that'd be my first route. Otherwise you could find the window with Winclicker based on the title and class and pump that into ie.attach or find the child window that's serving the content and use that. Not having done it this is where I'd start and poking around on msdn, there are some good articles on hosting a browser control which might prove useful. Codeproject also has some examples of that. win32ole_pp has been of help to me here and there for getting better insight into the ole objects and supported methods. -Charley On 7/5/07, Lonny Eachus [EMAIL PROTECTED] wrote: I am trying again: Does anybody know anything about getting the DOM or attaching with Watir when the IE browser is embedded in an application, such as with Microsoft smartclient? When the application in question is running, it is obviously just a wrapper around IE and it displays the same web pages I find on the main site via my regular browser. But soon some of those pages may be made inaccessible except through this client application. I already have a lot of automation written for this site. It could be a lifesaver if I could just find a way to attach to the embedded DOM. This is important. I could really use any help or ideas that are out there. Lonny Eachus ___ 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] Modal Dialog/Vista -- undefined method `hwnd'
I think the error message may be misleading. I think the problem may actually be caused by the use of frames. Can you show us the code that is failing? Bret Michael Kernaghan wrote: Interesting. I think I have worked out my understanding problems but now I get this problem. Maybe I need an older rev of Ruby 1.8.2? / Environment / Ruby 1.8.2-15 MS Vista watir-1.5.1.1166 Error Message NoMethodError: IE#modal_dialog not supported with the current version of Ruby (1.8.2). See http://jira.openqa.org/browse/WTR-2 for details. undefined method `hwnd' for #Watir::Frame:0x30a0580 c:/ruby182/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2815:in `initialize' c:/ruby182/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:351:in `new' c:/ruby182/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:351:in `modal_dialog' Michael Kernaghan Quality Control Tester Meridian Systems [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 604-609-0833 #103 * * *Read what IDC believes to be the key to the success of engineering, construction RE industries. * IDC Analyst Connection “Integrated Project and Portfolio Management: Improving Efficiency, Lowering Risk for Engineering, Construction and Real Estate Firms” Visit www.meridiansystems.com/performance http://www.meridiansystems.com/performance ___ 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] NoMethodError for verify method in assertions.rb
Tiffany Fodor wrote: Hi all! I'm trying to use the verify method from assertions.rb, but I keep getting the following error: undefined method 'verify' for main:Object (NoMethodError) I've added require watir/assertions to the beginning of my script, but still can't use the verify method. Is anyone else using this successfully? You will also need to add an Include Watir::Assertions to your test code. If you show us your test code, we can show you where it goes. Bret ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Recovery System in WATIR
Lavanya Lakshman wrote: Whenever we consider any tool for automation, the first and the foremost critical part is the recovery system. Unfortunately I didn't get much info related to this on the website. I would appreciate your thoughts and experience related to this. I agree. Watir has many features that make it easy to create recovery systems. I created an extensive recovery system for the automation system we used at DataCert. Bret ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] NoMethodError for verify method in assertions.rb
I just added that line to the rest of the require/include statements at the beginning of my script and it did the trick. Thanks so much! -Tiffany ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general