[Wtr-general] Variable Number and Type of Method Parameters?
I am testing an application whose UI controls are often difficult to specify. Sometimes I can uniquely identify a control with one attribute, and sometimes I need 3 or 4. Sometimes I can't see the difference between multiple controls, so I need to use an index value as one of those 3 or 4 attributes. With WATIR, can I specify a control by using a variable number and kind of parameters? I have a watered-down-not-thread-safe-has-synchronization-problems Perl tool (that I would like to toss) emulated from WATIR where I can say: $browser-link( innerText = 'Modify', nameProp = qr(modifyProductContract), outerHTML = qr((Pro|Select|Value) Service), index = 4 )-click; I see that I can use regex's with WATIR (very good), so I just need to make sure that I can pass in any number of control attributes and values before I embrace WATIR. If I can, how do I do it? A hash? Something else? Thanks. Andrew McFarlane ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Variable Number and Type of Method Parameters?
Hi,I think XPath extenstion to WATiR would be helpful in this case. Please download the tar ball from HEAD and read the supporting document in the 'docs' directory.Regards,Angrez On 1/20/06, Andrew McFarlane [EMAIL PROTECTED] wrote: I am testing an application whose UI controls are often difficult tospecify.Sometimes I can uniquely identify a control with one attribute,and sometimes I need 3 or 4.Sometimes I can't see the difference between multiple controls, so I need to use an index value as one of those 3 or 4attributes.With WATIR, can I specify a control by using a variable numberand kind of parameters?I have a watered-down-not-thread-safe-has-synchronization-problems Perl tool (that I would like to toss) emulated from WATIR where I can say:$browser-link( innerText = 'Modify', nameProp =qr(modifyProductContract), outerHTML = qr((Pro|Select|Value) Service),index = 4 )-click; I see that I can use regex's with WATIR (very good), so I just need to makesure that I can pass in any number of control attributes and values before Iembrace WATIR.If I can, how do I do it?A hash?Something else? Thanks.Andrew McFarlane___Wtr-general mailing listWtr-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] Variable Number and Type of Method Parameters?
Not sure if you guys realize it but there is an xml library available in Ruby called REXML and from there you can use it in your WATIR scripts. I don't know if you saw my last post but I had written a small testing framework on top of Ruby and WATIR that utilizes REXML so that I can store my controls in an XML file and reference them from there. If you get a chance you might want to take a look to see how you can use the REXML library. Sergio From: [EMAIL PROTECTED] on behalf of Angrez Singh Sent: Fri 1/20/2006 12:35 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Variable Number and Type of Method Parameters? Hi, I think XPath extenstion to WATiR would be helpful in this case. Please download the tar ball from HEAD and read the supporting document in the 'docs' directory. Regards, Angrez On 1/20/06, Andrew McFarlane [EMAIL PROTECTED] wrote: I am testing an application whose UI controls are often difficult to specify. Sometimes I can uniquely identify a control with one attribute, and sometimes I need 3 or 4. Sometimes I can't see the difference between multiple controls, so I need to use an index value as one of those 3 or 4 attributes. With WATIR, can I specify a control by using a variable number and kind of parameters? I have a watered-down-not-thread-safe-has-synchronization-problems Perl tool (that I would like to toss) emulated from WATIR where I can say: $browser-link( innerText = 'Modify', nameProp = qr(modifyProductContract), outerHTML = qr((Pro|Select|Value) Service), index = 4 )-click; I see that I can use regex's with WATIR (very good), so I just need to make sure that I can pass in any number of control attributes and values before I embrace WATIR. If I can, how do I do it? A hash? Something else? Thanks. Andrew McFarlane ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general winmail.dat___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Variable Number and Type of Method Parameters?
Hi Sergio,The XPath extension internally uses REXML only to find the elements in IE DOM. Regards,AngrezOn 1/20/06, Sergio Pinon [EMAIL PROTECTED] wrote:Not sure if you guys realize it but there is an xml library available in Ruby called REXML and from there you can use it in your WATIR scripts. I don't know if you saw my last post but I had written a small testing framework on top of Ruby and WATIR that utilizes REXML so that I can store my controls in an XML file and reference them from there. If you get a chance you might want to take a look to see how you can use the REXML library. SergioFrom: [EMAIL PROTECTED] on behalf of Angrez SinghSent: Fri 1/20/2006 12:35 AMTo: wtr-general@rubyforge.orgSubject: Re: [Wtr-general] Variable Number and Type of Method Parameters?Hi,I think XPath extenstion to WATiR would be helpful in this case. Please download the tar ball from HEAD and read the supporting document in the 'docs' directory. Regards,AngrezOn 1/20/06, Andrew McFarlane [EMAIL PROTECTED] wrote:I am testing an application whose UI controls are often difficult to specify.Sometimes I can uniquely identify a control with one attribute,and sometimes I need 3 or 4.Sometimes I can't see the difference betweenmultiple controls, so I need to use an index value as one of those 3 or 4 attributes.With WATIR, can I specify a control by using a variable numberand kind of parameters?I have a watered-down-not-thread-safe-has-synchronization-problems Perl tool(that I would like to toss) emulated from WATIR where I can say: $browser-link( innerText = 'Modify', nameProp =qr(modifyProductContract), outerHTML = qr((Pro|Select|Value) Service),index = 4 )-click;I see that I can use regex's with WATIR (very good), so I just need to make sure that I can pass in any number of control attributes and values before Iembrace WATIR.If I can, how do I do it?A hash?Something else?Thanks.Andrew McFarlane ___Wtr-general mailing listWtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general___Wtr-general mailing listWtr-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] Variable Number and Type of Method Parameters?
I dont understand. Youre saying that WATIR uses REXML to allow Xpath expressions against the IE DOM? Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Angrez Singh Sent: Friday, January 20, 2006 10:56 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Variable Number and Type of Method Parameters? Hi Sergio, The XPath extension internally uses REXML only to find the elements in IE DOM. Regards, Angrez On 1/20/06, Sergio Pinon [EMAIL PROTECTED] wrote: Not sure if you guys realize it but there is an xml library available in Ruby called REXML and from there you can use it in your WATIR scripts. I don't know if you saw my last post but I had written a small testing framework on top of Ruby and WATIR that utilizes REXML so that I can store my controls in an XML file and reference them from there. If you get a chance you might want to take a look to see how you can use the REXML library. Sergio From: [EMAIL PROTECTED] on behalf of Angrez Singh Sent: Fri 1/20/2006 12:35 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Variable Number and Type of Method Parameters? Hi, I think XPath extenstion to WATiR would be helpful in this case. Please download the tar ball from HEAD and read the supporting document in the 'docs' directory. Regards, Angrez On 1/20/06, Andrew McFarlane [EMAIL PROTECTED] wrote: I am testing an application whose UI controls are often difficult to specify.Sometimes I can uniquely identify a control with one attribute, and sometimes I need 3 or 4.Sometimes I can't see the difference between multiple controls, so I need to use an index value as one of those 3 or 4 attributes.With WATIR, can I specify a control by using a variable number and kind of parameters? I have a watered-down-not-thread-safe-has-synchronization-problems Perl tool (that I would like to toss) emulated from WATIR where I can say: $browser-link( innerText = 'Modify', nameProp = qr(modifyProductContract), outerHTML = qr((Pro|Select|Value) Service), index = 4 )-click; I see that I can use regex's with WATIR (very good), so I just need to make sure that I can pass in any number of control attributes and values before I embrace WATIR. If I can, how do I do it?A hash?Something else? Thanks. Andrew McFarlane ___ 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 Have Watir Run Unattended?
Title: How to Have Watir Run Unattended? I know this may be a little bit of extra work but here is what we do and it works fine. We use CruiseControl.Net which is a service that runs on our build machine and runs at timed intervals or we can force it as well. But then from CruiseControl we have a Nant build kickoff that executes our build scripts which one of the things that is done in that is to execute our WATIR scripts. Hope this helps. But as you can see it can be done and with minimal setup really. CruiseControl and Nant are both very easy to setup and get running. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gordon, John Sent: Friday, January 20, 2006 2:30 PM To: wtr-general@rubyforge.org Subject: [Wtr-general] How to Have Watir Run Unattended? Hi all, Does anyone know how to set up Watir to run unattended? Im having troubles trying to do this using a Scheduled Task. Requirements: 1) Execute a Watir script without having to have a user login to the computer to execute it (e.g via a Service or Scheduled task). 2) Have the script notify the developers when testing fails (via email or updating a web page). Im trying to set up a Watir script to serve as a heart beat of sorts for my web site. The idea is that I have a watir script constantly running that tests a website and notifies our development team (via email or a status web page) when the scripts fail. I thought I would do it by creating a Windows Scheduled task that would periodically call my Watir Script. Im getting an error when I execute this scheduled task, however. The error is: Failed to create WIN32OLE object from `InternetExplorer.Application' HRESULT error code:0x80070005 Access is denied. The script runs fine when I execute it via a command prompt. The user the Scheduled Task is running under is an admin account, so that should be fine too. The only thing Im doing in the script is calling IE.new(); thats where the error occurs. Im wondering if the problem is due to IE being a GUI app and scheduled tasks dont display GUIs. I tested this by creating a Scheduled Task to simply instantiate an instance of IE; it worked without errors. Heres the test Im running: require 'watir' require 'test/unit' require 'ftools' class TC_MyCompany Test::Unit::TestCase include Watir def test_hello_world @ie = IE.new() #BOOM!! Error happens here. @ie.close() t = Time.now time_stamp = t.strftime(Printed on %m/%d/%Y at %I:%M%p) File.open('E:\Watir\hello.txt', w+) { |msg_file| msg_file.write(successfully opened IE at #{time_stamp}) } rescue File.open('E:\Watir\hello.txt', w+) { |msg_file| msg_file.write($!) } end end Thanks for any help you can offer! John ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How to Have Watir Run Unattended?
Does anyone know how to set up Watir to run unattended? I'm having troubles trying to do this using a Scheduled Task. Hi, I started looking into this a month ago and sidetracked. However, it appeared that a scheduled task *would* work, but not if the computer (desktop) was locked. I don't remember the error message, but it appeared to be that the browser wouldn't launch if the desktop was locked, so it may be the same thing you saw. Since setting a computer to never lock is a security issue, we think we've going to have such a machine in the server room, where it's physically secure. hope this helps. Paul Czyzewski ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] How is it possible to specify to look for a specific text in a sp ecific tag?
Title: How is it possible to specify to look for a specific text in a specific tag? I am fairly new to watir and think it is a great tool. I have following code that fails to execute. if ie.contains_text(:id, current :text, Groups) puts Login Failed!: else puts Login Passed! How is it possible to specify to look for a specific text in a specific tag? Thanks, Bernd ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] How to click a button that has no id or name attribute
Title: How to click a button that has no id or name attribute input class=rec_butt type=submit value=Login I have this input button that I like to click. Unfortunate it has not id or name attribute attached to it. How can I click the button? --Bernd *** Bernd Paatsch Software Quality Assurance Engineer Active Voice LLC e-mail: [EMAIL PROTECTED] Phone: (206) 441-4700 x1026 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How to click a button that has no id or name at tribute
Title: How to click a button that has no id or name attribute My mistake. I had a typo in the code. ie.button(:value, "Login").click works just fine. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, BerndSent: Friday, January 20, 2006 5:02 PMTo: wtr-general@rubyforge.orgSubject: [Wtr-general] How to click a button that has no id or name attribute input class=rec_butt type=submit value=Login I have this input button that I like to click. Unfortunate it has not id or name attribute attached to it. How can I click the button? --Bernd *** Bernd Paatsch Software Quality Assurance Engineer Active Voice LLC e-mail: [EMAIL PROTECTED] Phone: (206) 441-4700 x1026 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How to click a button that has no id or name attribute
Title: How to click a button that has no id or name attribute You can just click the button by using the value attribute: browser.button(:value, Login).click; That should work just fine. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd Sent: Friday, January 20, 2006 5:02 PM To: wtr-general@rubyforge.org Subject: [Wtr-general] How to click a button that has no id or name attribute input class=rec_butt type=submit value=Login I have this input button that I like to click. Unfortunate it has not id or name attribute attached to it. How can I click the button? --Bernd *** Bernd Paatsch Software Quality Assurance Engineer Active Voice LLC e-mail: [EMAIL PROTECTED] Phone: (206) 441-4700 x1026 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How is it possible to specify to look foraspec ifictext in a sp ecific tag?
Title: How is it possible to specify to look for a specific text in a specific tag? So if you have the control reference already then what you would do is: control_text = ie_browser.[control reference].text; if (control_text.index([text you are looking for]) != nil) The text is in the control. else The text is not in the control end Should be good with that. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd Sent: Friday, January 20, 2006 4:59 PM To: 'wtr-general@rubyforge.org' Subject: Re: [Wtr-general] How is it possible to specify to look foraspec ifictext in a sp ecific tag? Could you give me an example? I am fairly new to web testing. Thanks. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon Sent: Friday, January 20, 2006 4:29 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] How is it possible to specify to look for aspecifictext in a sp ecific tag? And actually an even easier way would be to get the Text property of the control and then do a check that way as well. There are several options that you have available. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd Sent: Friday, January 20, 2006 3:58 PM To: 'wtr-general@rubyforge.org' Subject: [Wtr-general] How is it possible to specify to look for a specifictext in a sp ecific tag? I am fairly new to watir and think it is a great tool. I have following code that fails to execute. if ie.contains_text(:id, current :text, Groups) puts Login Failed!: else puts Login Passed! How is it possible to specify to look for a specific text in a specific tag? Thanks, Bernd ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general