From angrez at gmail.com Sat Apr 1 01:24:02 2006 From: angrez at gmail.com (Angrez Singh) Date: Sat, 1 Apr 2006 11:54:02 +0530 Subject: [Wtr-general] firewatir question In-Reply-To: <442D9792.1030004@meyer-pollans.net> References: <442D9792.1030004@meyer-pollans.net> Message-ID: Hi Warren, $ ruby checkbox_xpath_test.rb > Loaded suite checkbox_xpath_test > Started > ....... > Finished in -43.812 seconds. > > 7 tests, 45 assertions, 0 failures, 0 errors > > Can this be correct? Yes, this is correct. Current version of FireWatir is slow. > Is there something that I need to configure (or unconfigure) on firefox? > I just installed it (1.5.0.1) and the firewatir extension. No, you don't need to do anything else. mozilla_all_tests.rb is running now - there are 14 dots on the line > below "Started" - it doesn't look like anything is changing in the > firefox window - it's changed from buttons to checkboxes. > > What have I missed? Nothing, it will take a lot of time to run all the FireWatir test cases. You can view the previous posts regarding this. Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060401/a9f202cb/attachment.html From ati.ozgur at gmail.com Sat Apr 1 03:06:09 2006 From: ati.ozgur at gmail.com (Atilla Ozgur) Date: Sat, 1 Apr 2006 11:06:09 +0300 Subject: [Wtr-general] Help using Screen Capture In-Reply-To: <38c139080603311828vad5a37dw954551a4c565125@mail.gmail.com> References: <38c139080603311828vad5a37dw954551a4c565125@mail.gmail.com> Message-ID: Can you try sending down key via autoit then capturing screen. I am not whether there is an auto scroll feature that > exists in Watir...Can someone please let me know?? > > > From oblomov.consulting at googlemail.com Sat Apr 1 05:38:38 2006 From: oblomov.consulting at googlemail.com (George Hawthorne) Date: Sat, 1 Apr 2006 11:38:38 +0100 Subject: [Wtr-general] Ruby and Watir version from IRB In-Reply-To: <20060331232417.91612.qmail@web80322.mail.yahoo.com> References: <20060331232417.91612.qmail@web80322.mail.yahoo.com> Message-ID: <880925dd0604010238k6436fd33vead5da6a8410ec46@mail.gmail.com> Hi Guru, Nice to finally come across a question on this list that I can answer... irb(main):002:0> require "watir" irb(main):003:0> Watir::IE::VERSION irb(main):004:0> print `ruby --version` George On 01/04/06, Guru Subramanyam wrote: > Hi, > > Is there a way to find out the version of Ruby and > Watir from within the IRB? > > Thanks > Guru From chesschintan at gmail.com Sat Apr 1 06:28:59 2006 From: chesschintan at gmail.com (Chintan Trivedi) Date: Sat, 1 Apr 2006 16:58:59 +0530 Subject: [Wtr-general] Ideas on improving firewatir performance. Code included Message-ID: Hi, FireWatir release was like "freedom of soul". I needed something like watir to run on my linux system and firewatir solved that problem. However, while working with firewatir, I found it to be very slow. Initially it was tough to figure out as to what could be the problem. From the code it seemed like there was lot of communication happening between firewatir and jssh server. eg. Say for accessing a textbox, firewatir will first ask the browser about the textbox element and then send the events. Similarly for each and every element user requests for, will make firewatir to talk with the browser. Keeping this in mind I created a sample code which deals with this issue. Its available for download from http://www.geocities.com/chesschintan/rufire.tgz The code first downloads whole html page and uses htmltokenizer to create various textboxes, buttons and other elements. This reduces a lot of overhead. Though it has one drawback. That is if after opening a page using ff.goto(), the user manually opens another page using firefox then the code would fail. However its a kinda very rare case. Second noticable thing was the way firewatir implemented read_socket(). This seemed to be a major cause decreasing the performance. However while testing, jssh protocol was found to be kinda misbehaving. Simple socket.gets() or socket.recv() doesnt work. May be thatz the reason which tempted author to implement read_socket() in a reliable manner sacrificing bit of performance. But socket.sysread() is a beautiful socket method which worked for me. After doing the above two changes code worked with charm even beating (watir) IE performance. Rufire supports only textbox, radio, buttons and checkbox elements. Its not a complete code. I made it just for the sake of testing with above two changes. You can copy test.html available in the .tgz to localhost webserver and test using test.rb file. Currently it lacks one feature of knowing whether hml page has been loaded in browser or not. Add a sleep statement with good value in Firefox.goto() just in case you wanna test it against a heavy website. Thanks Chintan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060401/3711ec70/attachment.html From zeljko.filipin at gmail.com Sat Apr 1 12:11:04 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Sat, 1 Apr 2006 19:11:04 +0200 Subject: [Wtr-general] Files as argument when running a suite In-Reply-To: <20060331233841.97917.qmail@web50908.mail.yahoo.com> References: <20060331233841.97917.qmail@web50908.mail.yahoo.com> Message-ID: Try yaml, I am using it. http://yaml4r.sourceforge.net/ On 4/1/06, Deepa Mallapareddy wrote: > > Hi all, > > I have to give a config file( file with variables like username and > pwd and URL ) as an argument when running a suite. and I should be able to > use the variables in this entire test suite Im eunning. > > Can you please suggest > > Any input on this will be appreciated. > > Thanks in Advance! > Deepa > > > Whatever you can do or dream you can, begin it. Boldness has genius, > power, and magic in it. > --Johann Wolfgang von Goethe * * > *------------------------------------------------------------------------* > Deepa Mallapareddy, > 4981,Catoctin Drive, > Apt#15,San Diego > CA - 92115 > > ------------------------------ > How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call > rates. > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -- http://www.testingreflections.com/blog/3071 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060401/ab04eb63/attachment.html From PGarigue at EXTEND.COM Sat Apr 1 13:39:32 2006 From: PGarigue at EXTEND.COM (Pierre Garigue) Date: Sat, 1 Apr 2006 13:39:32 -0500 Subject: [Wtr-general] Files as argument when running a suite Message-ID: I use this to debug my hand-witten yaml file. I run this in SCiTE so that I see all the results in the 'result frame' ---------------------------------------------------------- require 'yaml' require 'pp' #used to debug the yaml structure tree = YAML::load( File.open('your_file_goes_here.yml' ) ) #print the yaml file puts "\nthis is the yaml file\n" puts tree.to_yaml #print the tree puts "\nthis is the structue from this yaml\n\n" pp tree ------------------------------------ cheer Pierre -----Original Message----- From: Zeljko Filipin [mailto:zeljko.filipin at gmail.com] Sent: Saturday, April 01, 2006 12:11 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Files as argument when running a suite Try yaml, I am using it. http://yaml4r.sourceforge.net/ On 4/1/06, Deepa Mallapareddy < phanideepam at yahoo.com> wrote: Hi all, I have to give a config file( file with variables like username and pwd and URL ) as an argument when running a suite. and I should be able to use the variables in this entire test suite Im eunning. Can you please suggest Any input on this will be appreciated. Thanks in Advance! Deepa Whatever you can do or dream you can, begin it. Boldness has genius, power, and magic in it. --Johann Wolfgang von Goethe ------------------------------------------------------------------------ Deepa Mallapareddy, 4981,Catoctin Drive, Apt#15,San Diego CA - 92115 _____ How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call rates. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -- http://www.testingreflections.com/blog/3071 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060401/1846dc68/attachment.html From jbe at mjolner.dk Mon Apr 3 17:00:43 2006 From: jbe at mjolner.dk (=?iso-8859-1?Q?J=F8rgen_Bang_Erichsen?=) Date: Mon, 3 Apr 2006 23:00:43 +0200 Subject: [Wtr-general] W3C validation problems Message-ID: Hi, Inspired by http://redgreenblu.com/svn/projects/assert_valid_markup/lib/assert_valid_markup.rb I would like to have an easy way to validate the html on the page IE is currently showing. Unfortunately, I have a problem with the html that ie.document.body.parentelement.outerhtml outputs :-( Take a look at the following example: require 'test/unit' require 'watir' require 'net/http' require 'cgi' require 'xmlsimple' class ValidationExample < Test::Unit::TestCase include Watir def test_w3c_validate ie = IE.new ie.goto 'validator.w3.org/' html = ie.document.body.parentelement.outerhtml response = Net::HTTP.start('validator.w3.org').post2('/check', "fragment=#{CGI.escape(html)}&output=xml") markup_is_valid = response['x-w3c-validator-status']=='Valid' message = markup_is_valid ? '' : XmlSimple.xml_in(response.body)['messages'][0]['msg'].collect{ |m| "Invalid markup: line #{m['line']}: #{CGI.unescapeHTML(m['content'])}" }.join("\n") assert markup_is_valid, message ie.close end end When I run the example I get stuff like: Invalid markup: line 1: no document type declaration; implying "" Invalid markup: line 1: there is no attribute "XML:LANG" Invalid markup: line 1: there is no attribute "XMLNS" The html returned by ie.document.body.parentelement.outerhtml is The W3C Markup Validation Service but if I view the source from IE itself it is something like The W3C Markup Validation Service ... The DOCTYPE line and several quotes are missing. Is there any way to get the unmodified html for the current page? If people are doing automatic validation any other way I am open to suggestions. Best regards, J?rgen From Mark_Cain at rl.gov Mon Apr 3 17:18:18 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Mon, 3 Apr 2006 14:18:18 -0700 Subject: [Wtr-general] W3C validation problems Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04E020F76A3@EX5V.rl.gov> You should be able to do: ie = IE.new ie.goto 'http://validator.w3.org/' ie.html --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of J?rgen Bang Erichsen Sent: Monday, April 03, 2006 2:01 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] W3C validation problems Hi, Inspired by http://redgreenblu.com/svn/projects/assert_valid_markup/lib/assert_valid_markup.rb I would like to have an easy way to validate the html on the page IE is currently showing. Unfortunately, I have a problem with the html that ie.document.body.parentelement.outerhtml outputs :-( Take a look at the following example: require 'test/unit' require 'watir' require 'net/http' require 'cgi' require 'xmlsimple' class ValidationExample < Test::Unit::TestCase include Watir def test_w3c_validate ie = IE.new ie.goto 'validator.w3.org/' html = ie.document.body.parentelement.outerhtml response = Net::HTTP.start('validator.w3.org').post2('/check', "fragment=#{CGI.escape(html)}&output=xml") markup_is_valid = response['x-w3c-validator-status']=='Valid' message = markup_is_valid ? '' : XmlSimple.xml_in(response.body)['messages'][0]['msg'].collect{ |m| "Invalid markup: line #{m['line']}: #{CGI.unescapeHTML(m['content'])}" }.join("\n") assert markup_is_valid, message ie.close end end When I run the example I get stuff like: Invalid markup: line 1: no document type declaration; implying "" Invalid markup: line 1: there is no attribute "XML:LANG" Invalid markup: line 1: there is no attribute "XMLNS" The html returned by ie.document.body.parentelement.outerhtml is The W3C Markup Validation Service but if I view the source from IE itself it is something like The W3C Markup Validation Service ... The DOCTYPE line and several quotes are missing. Is there any way to get the unmodified html for the current page? If people are doing automatic validation any other way I am open to suggestions. Best regards, J?rgen _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From guru_sc at yahoo.com Mon Apr 3 17:25:43 2006 From: guru_sc at yahoo.com (Guru Subramanyam) Date: Mon, 3 Apr 2006 14:25:43 -0700 (PDT) Subject: [Wtr-general] Sourcing .rb files from within IRB Message-ID: <20060403212543.9004.qmail@web80307.mail.yahoo.com> Hi, Is there a way to source .rb files from within IRB? Thanks much Guru From bret at pettichord.com Mon Apr 3 22:26:27 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 3 Apr 2006 20:26:27 -0600 Subject: [Wtr-general] Sourcing .rb files from within IRB In-Reply-To: <20060403212543.9004.qmail@web80307.mail.yahoo.com> References: <20060403212543.9004.qmail@web80307.mail.yahoo.com> Message-ID: >load 'file.rb' On 4/3/06, Guru Subramanyam wrote: > > Hi, > > Is there a way to source .rb files from within IRB? > > Thanks much > Guru > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060403/756e503d/attachment.html From bret at pettichord.com Mon Apr 3 22:30:25 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 3 Apr 2006 20:30:25 -0600 Subject: [Wtr-general] Help using Screen Capture In-Reply-To: <38c139080603311828vad5a37dw954551a4c565125@mail.gmail.com> References: <38c139080603311828vad5a37dw954551a4c565125@mail.gmail.com> Message-ID: If Snagit isn't good enough, then there is no way you're going to get Watir's little two-bit screen capture to solve your problem. Bret On 3/31/06, Padhma N wrote: > > Hi All, > > Sorry for my repost. I am still stuck up on this particular thing and > thought I can try my luck again here.. > > Is there an autoscroll feature in Watir? I need to use screen_capture on > my web page but the webpage is kinda long that it has be scrolled down to > see the entire web page. The screen_capture functioanlity in Watir captures > only the visible page. I am not whether there is an auto scroll feature that > exists in Watir...Can someone please let me know?? > > Any suggestion will be really helpful. > > Thanks, > Padhma > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060403/95229fcd/attachment.html From bret at pettichord.com Mon Apr 3 22:35:17 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 3 Apr 2006 20:35:17 -0600 Subject: [Wtr-general] Files as argument when running a suite In-Reply-To: <20060331233841.97917.qmail@web50908.mail.yahoo.com> References: <20060331233841.97917.qmail@web50908.mail.yahoo.com> Message-ID: require 'config.rb' If that doesn't work, then you'll need to explain more what you want to do. Bret On 3/31/06, Deepa Mallapareddy wrote: > > Hi all, > > I have to give a config file( file with variables like username and > pwd and URL ) as an argument when running a suite. and I should be able to > use the variables in this entire test suite Im eunning. > > Can you please suggest > > Any input on this will be appreciated. > > Thanks in Advance! > Deepa > > > Whatever you can do or dream you can, begin it. Boldness has genius, > power, and magic in it. > --Johann Wolfgang von Goethe * * > *------------------------------------------------------------------------* > Deepa Mallapareddy, > 4981,Catoctin Drive, > Apt#15,San Diego > CA - 92115 > > ------------------------------ > How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call > rates. > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060403/a7bc735e/attachment.html From paul.rogers at shaw.ca Mon Apr 3 23:26:08 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 03 Apr 2006 21:26:08 -0600 Subject: [Wtr-general] W3C validation problems In-Reply-To: Message-ID: <026001c65797$837db650$6600a8c0@NewDell> If I remember correctly, the html you will see using that method is Ies version of the html, not what it has actually received. So if you right click and then do a view source, and then in watir do a ie.document.body.parentelement.outerhtml You are likely to see different things I don?t think there was a way to find the 'raw' html Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of J?rgen Bang Erichsen Sent: 03 April 2006 15:01 To: wtr-general at rubyforge.org Subject: [Wtr-general] W3C validation problems Hi, Inspired by http://redgreenblu.com/svn/projects/assert_valid_markup/lib/assert_valid _markup.rb I would like to have an easy way to validate the html on the page IE is currently showing. Unfortunately, I have a problem with the html that ie.document.body.parentelement.outerhtml outputs :-( Take a look at the following example: require 'test/unit' require 'watir' require 'net/http' require 'cgi' require 'xmlsimple' class ValidationExample < Test::Unit::TestCase include Watir def test_w3c_validate ie = IE.new ie.goto 'validator.w3.org/' html = ie.document.body.parentelement.outerhtml response = Net::HTTP.start('validator.w3.org').post2('/check', "fragment=#{CGI.escape(html)}&output=xml") markup_is_valid = response['x-w3c-validator-status']=='Valid' message = markup_is_valid ? '' : XmlSimple.xml_in(response.body)['messages'][0]['msg'].collect{ |m| "Invalid markup: line #{m['line']}: #{CGI.unescapeHTML(m['content'])}" }.join("\n") assert markup_is_valid, message ie.close end end When I run the example I get stuff like: Invalid markup: line 1: no document type declaration; implying "" Invalid markup: line 1: there is no attribute "XML:LANG" Invalid markup: line 1: there is no attribute "XMLNS" The html returned by ie.document.body.parentelement.outerhtml is The W3C Markup Validation Service but if I view the source from IE itself it is something like The W3C Markup Validation Service ... The DOCTYPE line and several quotes are missing. Is there any way to get the unmodified html for the current page? If people are doing automatic validation any other way I am open to suggestions. Best regards, J?rgen _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From Eli.Smith at nextaction.net Tue Apr 4 13:58:17 2006 From: Eli.Smith at nextaction.net (Eli Smith) Date: Tue, 4 Apr 2006 11:58:17 -0600 Subject: [Wtr-general] SciTE Repeats Input Chars in IRB Message-ID: Greetings, Rubyists. Ruby newbie here with an SciTE question. How do I stop SciTE from repeating my input chars in IRB? I can't figure out which bit to flip off but it's got me crazed. The suggestions at http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/143959 didn't solve it. adTHANKSvance, ~Eli-> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060404/b9896914/attachment.html From BPaatsch at activevoice.com Tue Apr 4 14:17:52 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Tue, 4 Apr 2006 13:17:52 -0500 Subject: [Wtr-general] Validating all php generated html code? Message-ID: Hello Watir team. I got a new interesting assignment, to validate all html code of all our products. Doing this manual would take me a very long time. Thus I seek an automated solution and wonder if anybody has done something similar? Here is what I think needs to be done: 1. Generate each html page possible (the html code is created by MySQL and php scripts). It would be great to have a web crawler clicking each link at the web-site and saving the generated html-file. 2. Validating all the html files Has anybody done something like this? Any ideas regarding what tools to use? Any recommendations, ideas, etc? Thanks for your help. Bernd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060404/fa8da30e/attachment.html From jkohl at telusplanet.net Tue Apr 4 14:27:15 2006 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Tue, 4 Apr 2006 11:27:15 -0700 Subject: [Wtr-general] Validating all php generated html code? In-Reply-To: References: Message-ID: <1144175235.4432ba8381545@webmail.telusplanet.net> If you're looking at pure HTML validation, I'd look at doing this at the HTTP layer. If I'm not mistaken, most web browsers (IE included) fill in missing closing tags. You will probably see IE's version of the HTML, not necessarily what the PHP scripts are actually generating. Someone who knows more can correct me if I'm wrong. :-) -Jonathan Quoting "Paatsch, Bernd" : > Hello Watir team. > > I got a new interesting assignment, to validate all html code of all our > products. Doing this manual would take me a very long time. Thus I seek an > automated solution and wonder if anybody has done something similar? Here is > what I think needs to be done: > > 1. Generate each html page possible (the html code is created by MySQL and > php scripts). It would be great to have a web crawler clicking each link at > the web-site and saving the generated html-file. > 2. Validating all the html files > > Has anybody done something like this? Any ideas regarding what tools to use? > Any recommendations, ideas, etc? > > Thanks for your help. > Bernd > > > From tester.paul at gmail.com Tue Apr 4 14:33:50 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 4 Apr 2006 14:33:50 -0400 Subject: [Wtr-general] SciTE Repeats Input Chars in IRB In-Reply-To: References: Message-ID: <37c405480604041133r6cc67233x4ea4581c0f204a5d@mail.gmail.com> Hello Eli, there's a lot of information you didn't offer to allow us to help you better. What version of Ruby are you using (so we know the version of SciTE)? What version of Watir? How are you executing the scripts? Which "input chars" are being echoed? Can you include a sample of your code and the corresponding annoying output? Help us out a bit here. ;-) Cheers. Paul. On 04/04/06, Eli Smith wrote: > > Greetings, Rubyists. > > Ruby newbie here with an SciTE question. > > How do I stop SciTE from repeating my input chars in IRB? > > I can't figure out which bit to flip off but it's got me crazed. > > The suggestions at > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/143959 didn't > solve it. > > > > adTHANKSvance, > > ~Eli-> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060404/8bae7c00/attachment.html From klancaster1957 at gmail.com Tue Apr 4 15:28:26 2006 From: klancaster1957 at gmail.com (Keith Lancaster) Date: Tue, 04 Apr 2006 14:28:26 -0500 Subject: [Wtr-general] SciTE Repeats Input Chars in IRB In-Reply-To: <37c405480604041133r6cc67233x4ea4581c0f204a5d@mail.gmail.com> Message-ID: I ran into the same problem with SciTE. The echoing happens in the command window as I recall, and has nothing to do with Watir. I?m also pretty sure it happens regardless of Ruby version. What most folks recommend is using SciTe as an editor, but running your code in a regular command window (assuming you are running Windows). Just open a command prompt and type irb. HTH, Keith On 4/4/06 1:33 PM, "Paul Carvalho" wrote: > Hello Eli, there's a lot of information you didn't offer to allow us to help > you better. > > What version of Ruby are you using (so we know the version of SciTE)? What > version of Watir? > > How are you executing the scripts? Which "input chars" are being echoed? Can > you include a sample of your code and the corresponding annoying output? > > Help us out a bit here. ;-) > > Cheers. Paul. > > > On 04/04/06, Eli Smith > wrote: >> Greetings, Rubyists. >> >> Ruby newbie here with an SciTE question. >> >> How do I stop SciTE from repeating my input chars in IRB? >> >> I can't figure out which bit to flip off but it's got me crazed. >> >> The suggestions at >> http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/143959 didn't >> solve it. >> >> >> >> adTHANKSvance, >> >> ~Eli-> >> > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060404/5218b12c/attachment.html From Eli.Smith at nextaction.net Tue Apr 4 15:39:22 2006 From: Eli.Smith at nextaction.net (Eli Smith) Date: Tue, 4 Apr 2006 13:39:22 -0600 Subject: [Wtr-general] SciTE Repeats Input Chars in IRB Message-ID: Fair enough, Paul. Lemme spill my guts. I'm using Ruby 1.8.2, Watir 1.4.1, and SciTE 1.59 on a Winserver 2003 with SP1. To see the problem: 1. Start SciTE on Windows. 2. Select Tools > Run irb from the menu system. 3. Type into the command window provided. Each character entered it displayed twice. Guess what this is? rreeqquuiirree ''wwaattiirr'' Makes you wanna start a command prompt! Any known workarounds? I like the near-IDE SciTE provides. ~Eli-> ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Carvalho Sent: Tuesday, April 04, 2006 12:34 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] SciTE Repeats Input Chars in IRB Hello Eli, there's a lot of information you didn't offer to allow us to help you better. What version of Ruby are you using (so we know the version of SciTE)? What version of Watir? How are you executing the scripts? Which "input chars" are being echoed? Can you include a sample of your code and the corresponding annoying output? Help us out a bit here. ;-) Cheers. Paul. On 04/04/06, Eli Smith wrote: Greetings, Rubyists. Ruby newbie here with an SciTE question. How do I stop SciTE from repeating my input chars in IRB? I can't figure out which bit to flip off but it's got me crazed. The suggestions at http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/143959 didn't solve it. adTHANKSvance, ~Eli-> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060404/ecd8454c/attachment.html From tester.paul at gmail.com Tue Apr 4 16:09:14 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 4 Apr 2006 16:09:14 -0400 Subject: [Wtr-general] SciTE Repeats Input Chars in IRB In-Reply-To: References: Message-ID: <37c405480604041309r6cb1cfb0hf659aea20bb5a5e5@mail.gmail.com> Ah, now I see. I am using Ruby 1.8.4-16 with SciTE 1.67. There is *no* "Run irb" under the Tools menu. I guess it didn't work so they took it out. Sorry. Looks like you'll have to CMD-prompt it to work around this problem. Cheers. Paul. On 04/04/06, Eli Smith wrote: > > Fair enough, Paul. Lemme spill my guts. > > I'm using Ruby 1.8.2, Watir 1.4.1, and SciTE 1.59 on a Winserver 2003 with > SP1. > > To see the problem: > > 1. Start SciTE on Windows. > 2. Select Tools > Run irb from the menu system. > 3. Type into the command window provided. > > Each character entered it displayed twice. Guess what this is? > > rreeqquuiirree ''wwaattiirr'' > > > > Makes you wanna start a command prompt! > > Any known workarounds? I like the near-IDE SciTE provides. > > > > ~Eli-> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060404/8834decc/attachment.html From Mark_Cain at rl.gov Tue Apr 4 17:07:08 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Tue, 4 Apr 2006 14:07:08 -0700 Subject: [Wtr-general] SciTE Repeats Input Chars in IRB Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04E020F76A6@EX5V.rl.gov> You can type: Cmd Echo off Cd \ruby\bin Irb Ruby code here But this is just a command window inside SciTE. It is a much better experience via a command window. If you want an IRB window inside your editor, download the latest version if FreeRide and it has one built in. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Eli Smith Sent: Tuesday, April 04, 2006 12:39 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] SciTE Repeats Input Chars in IRB Fair enough, Paul. Lemme spill my guts. I'm using Ruby 1.8.2, Watir 1.4.1, and SciTE 1.59 on a Winserver 2003 with SP1. To see the problem: 1. Start SciTE on Windows. 2. Select Tools > Run irb from the menu system. 3. Type into the command window provided. Each character entered it displayed twice. Guess what this is? rreeqquuiirree ''wwaattiirr'' Makes you wanna start a command prompt! Any known workarounds? I like the near-IDE SciTE provides. ~Eli-> ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Carvalho Sent: Tuesday, April 04, 2006 12:34 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] SciTE Repeats Input Chars in IRB Hello Eli, there's a lot of information you didn't offer to allow us to help you better. What version of Ruby are you using (so we know the version of SciTE)? What version of Watir? How are you executing the scripts? Which "input chars" are being echoed? Can you include a sample of your code and the corresponding annoying output? Help us out a bit here. ;-) Cheers. Paul. On 04/04/06, Eli Smith wrote: Greetings, Rubyists. Ruby newbie here with an SciTE question. How do I stop SciTE from repeating my input chars in IRB? I can't figure out which bit to flip off but it's got me crazed. The suggestions at http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/143959 didn't solve it. adTHANKSvance, ~Eli-> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060404/d519182c/attachment.html From Eli.Smith at nextaction.net Tue Apr 4 18:20:06 2006 From: Eli.Smith at nextaction.net (Eli Smith) Date: Tue, 4 Apr 2006 16:20:06 -0600 Subject: [Wtr-general] SciTE Repeats Input Chars in IRB Message-ID: Thanks for the input, all. And I see your point, Mark. I'll have to get more comfortable in Windows non-UNIX command line. So it sounds like the preference is for editing with SciTE (or editor of choice) and execution from the command line. I think my environment needs some work. ~Eli-> ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Tuesday, April 04, 2006 3:07 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] SciTE Repeats Input Chars in IRB You can type: Cmd Echo off Cd \ruby\bin Irb Ruby code here But this is just a command window inside SciTE. It is a much better experience via a command window. If you want an IRB window inside your editor, download the latest version if FreeRide and it has one built in. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Eli Smith Sent: Tuesday, April 04, 2006 12:39 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] SciTE Repeats Input Chars in IRB Fair enough, Paul. Lemme spill my guts. I'm using Ruby 1.8.2, Watir 1.4.1, and SciTE 1.59 on a Winserver 2003 with SP1. To see the problem: 1. Start SciTE on Windows. 2. Select Tools > Run irb from the menu system. 3. Type into the command window provided. Each character entered it displayed twice. Guess what this is? rreeqquuiirree ''wwaattiirr'' Makes you wanna start a command prompt! Any known workarounds? I like the near-IDE SciTE provides. ~Eli-> ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Carvalho Sent: Tuesday, April 04, 2006 12:34 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] SciTE Repeats Input Chars in IRB Hello Eli, there's a lot of information you didn't offer to allow us to help you better. What version of Ruby are you using (so we know the version of SciTE)? What version of Watir? How are you executing the scripts? Which "input chars" are being echoed? Can you include a sample of your code and the corresponding annoying output? Help us out a bit here. ;-) Cheers. Paul. On 04/04/06, Eli Smith wrote: Greetings, Rubyists. Ruby newbie here with an SciTE question. How do I stop SciTE from repeating my input chars in IRB? I can't figure out which bit to flip off but it's got me crazed. The suggestions at http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/143959 didn't solve it. adTHANKSvance, ~Eli-> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060404/46011b03/attachment.html From tester.paul at gmail.com Tue Apr 4 18:46:45 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 4 Apr 2006 18:46:45 -0400 Subject: [Wtr-general] SciTE Repeats Input Chars in IRB In-Reply-To: References: Message-ID: <37c405480604041546h4f8a38dcle599646a845c624f@mail.gmail.com> Hi Eli, you can execute your scripts from within SciTE too. Just press [F8] to see the output pane and press [F5] to run the script. The output pane shows you the output that you would normally see in a command window. No need to run it separately. Hope this helps. Paul. On 04/04/06, Eli Smith wrote: > > Thanks for the input, all. And I see your point, Mark. I'll have to get > more comfortable in Windows non-UNIX command line. > > So it sounds like the preference is for editing with SciTE (or editor of > choice) and execution from the command line. I think my environment needs > some work. > > ~Eli-> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060404/61ed009c/attachment.html From bret at pettichord.com Tue Apr 4 19:02:16 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 4 Apr 2006 18:02:16 -0500 Subject: [Wtr-general] SciTE Repeats Input Chars in IRB In-Reply-To: References: Message-ID: I think this has been said before, but i bears repeating. The Ruby breakpoint package is a great "debugger" What you do is add code like this: require 'breakpoint'; breakpoint And then when that line is executed, you get dropped into IRB at that context. Install breakpoint thus: gem install ruby-breakpoint When you use this technique to definitely don't want to be using F5 to run your scripts in Scite. Bret On 4/4/06, Eli Smith wrote: > > Thanks for the input, all. And I see your point, Mark. I'll have to get > more comfortable in Windows non-UNIX command line. > > So it sounds like the preference is for editing with SciTE (or editor of > choice) and execution from the command line. I think my environment needs > some work. > > > > ~Eli-> > > > ------------------------------ > > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Cain, Mark > *Sent:* Tuesday, April 04, 2006 3:07 PM > > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] SciTE Repeats Input Chars in IRB > > > > You can type: > > > > Cmd > > Echo off > > Cd \ruby\bin > > Irb > > Ruby code here > > > > But this is just a command window inside SciTE. It is a much better > experience via a command window. If you want an IRB window inside your > editor, download the latest version if FreeRide and it has one built in. > > > > > > *--Mark* > > > ------------------------------ > > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Eli Smith > *Sent:* Tuesday, April 04, 2006 12:39 PM > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] SciTE Repeats Input Chars in IRB > > > > Fair enough, Paul. Lemme spill my guts. > > I'm using Ruby 1.8.2, Watir 1.4.1, and SciTE 1.59 on a Winserver 2003 with > SP1. > > To see the problem: > > 1. Start SciTE on Windows. > 2. Select Tools > Run irb from the menu system. > 3. Type into the command window provided. > > Each character entered it displayed twice. Guess what this is? > > rreeqquuiirree ''wwaattiirr'' > > > > Makes you wanna start a command prompt! > > Any known workarounds? I like the near-IDE SciTE provides. > > > > ~Eli-> > > > ------------------------------ > > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Paul Carvalho > *Sent:* Tuesday, April 04, 2006 12:34 PM > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] SciTE Repeats Input Chars in IRB > > > > Hello Eli, there's a lot of information you didn't offer to allow us to > help you better. > > What version of Ruby are you using (so we know the version of SciTE)? > What version of Watir? > > How are you executing the scripts? Which "input chars" are being echoed? > Can you include a sample of your code and the corresponding annoying output? > > > Help us out a bit here. ;-) > > Cheers. Paul. > > On 04/04/06, *Eli Smith* wrote: > > Greetings, Rubyists. > > Ruby newbie here with an SciTE question. > > How do I stop SciTE from repeating my input chars in IRB? > > I can't figure out which bit to flip off but it's got me crazed. > > The suggestions at > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/143959 didn't > solve it. > > > > adTHANKSvance, > > ~Eli-> > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060404/67e1418f/attachment.html From bret at pettichord.com Tue Apr 4 19:29:04 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 4 Apr 2006 18:29:04 -0500 Subject: [Wtr-general] Validating all php generated html code? In-Reply-To: <1144175235.4432ba8381545@webmail.telusplanet.net> References: <1144175235.4432ba8381545@webmail.telusplanet.net> Message-ID: I agree. Watir is not the right tool for this. Perl's Mechanize or something similar in Ruby would probably be the thing to use. Bret On 4/4/06, jkohl at telusplanet.net wrote: > > If you're looking at pure HTML validation, I'd look at doing this at the > HTTP > layer. If I'm not mistaken, most web browsers (IE included) fill in > missing > closing tags. You will probably see IE's version of the HTML, not > necessarily > what the PHP scripts are actually generating. > > Someone who knows more can correct me if I'm wrong. :-) > > -Jonathan > > Quoting "Paatsch, Bernd" : > > > Hello Watir team. > > > > I got a new interesting assignment, to validate all html code of all our > > products. Doing this manual would take me a very long time. Thus I seek > an > > automated solution and wonder if anybody has done something similar? > Here is > > what I think needs to be done: > > > > 1. Generate each html page possible (the html code is created by MySQL > and > > php scripts). It would be great to have a web crawler clicking each link > at > > the web-site and saving the generated html-file. > > 2. Validating all the html files > > > > Has anybody done something like this? Any ideas regarding what tools to > use? > > Any recommendations, ideas, etc? > > > > Thanks for your help. > > Bernd > > > > > > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060404/52871cf5/attachment.html From phanideepam at yahoo.com Tue Apr 4 20:21:41 2006 From: phanideepam at yahoo.com (Deepa Mallapareddy) Date: Tue, 4 Apr 2006 17:21:41 -0700 (PDT) Subject: [Wtr-general] Files as argument when running a suite In-Reply-To: Message-ID: <20060405002141.60336.qmail@web50914.mail.yahoo.com> Thanks a lot Bret ... This did not work My problem was to : Have a config file where in the user specifies few Global Variables like Username and pwd and the path which he wants to be tested and My requirement was ....to give the Config file as an argument coz User might want to test on different Config files but Require 'config.rb' dint work I have found out a work arround I have stored the variables in a file and then started reading them line by line and using them in my file .... ie Alltest.rb config.txt instead of writing config.rb Thought of sharing. I dont know whether it is appropriate way of doing but works Bret Pettichord wrote: require 'config.rb' If that doesn't work, then you'll need to explain more what you want to do. Bret On 3/31/06, Deepa Mallapareddy < phanideepam at yahoo.com> wrote: Hi all, I have to give a config file( file with variables like username and pwd and URL ) as an argument when running a suite. and I should be able to use the variables in this entire test suite Im eunning. Can you please suggest Any input on this will be appreciated. Thanks in Advance! Deepa Whatever you can do or dream you can, begin it. Boldness has genius, power, and magic in it. --Johann Wolfgang von Goethe ------------------------------------------------------------------------ Deepa Mallapareddy, 4981,Catoctin Drive, Apt#15,San Diego CA - 92115 --------------------------------- How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call rates. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Whatever you can do or dream you can, begin it. Boldness has genius, power, and magic in it. --Johann Wolfgang von Goethe ------------------------------------------------------------------------ Deepa Mallapareddy, 4981,Catoctin Drive, Apt#15,San Diego CA - 92115 --------------------------------- Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060404/9a3a988c/attachment.html From Sean.Gallagher at ticketmaster.com Wed Apr 5 00:51:19 2006 From: Sean.Gallagher at ticketmaster.com (Sean Gallagher) Date: Tue, 4 Apr 2006 21:51:19 -0700 Subject: [Wtr-general] Files as argument when running a suite Message-ID: <71D28C8451BFD5119B2B00508BE26E640B63F356@pasmail3.office.tmcs> Deepa, Check out YAML --it's already included with Ruby. (and works really well!) More info here http://yaml4r.sourceforge.net/ including a good cookbook. http://yaml4r.sourceforge.net/cookbook/ I am using YAML to solve a similar problem. Good luck! Sean -- http://testmethods.net/ > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Deepa > Mallapareddy > Sent: Tuesday, April 04, 2006 5:22 PM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Files as argument when running a suite > > Thanks a lot Bret ... > > This did not work > > > My problem was to : > Have a config file where in the user specifies few Global > Variables like Username and pwd and the path which he wants > to be tested > > and My requirement was ....to give the Config file as an > argument coz User might want to test on different Config files > > but Require 'config.rb' dint work > > > I have found out a work arround I have stored the variables > in a file and then started reading them line by line and > using them in my file .... > > ie > > Alltest.rb config.txt > > instead of writing config.rb > > Thought of sharing. I dont know whether it is appropriate way > of doing but works > > Bret Pettichord wrote: > > require 'config.rb' > > If that doesn't work, then you'll need to explain more > what you want to do. > > Bret > > > On 3/31/06, Deepa Mallapareddy < phanideepam at yahoo.com > > wrote: > > Hi all, > > I have to give a config file( file with > variables like username and pwd and URL ) as an argument when > running a suite. and I should be able to use the variables > in this entire test suite Im eunning. > > Can you please suggest > > Any input on this will be appreciated. > > Thanks in Advance! > Deepa > > > Whatever you can do or dream you can, begin it. > Boldness has genius, power, and magic in it. > --Johann Wolfgang von Goethe > > -------------------------------------------------------------- > ---------- > > Deepa Mallapareddy, > 4981,Catoctin Drive, > Apt#15,San Diego > CA - 92115 > > ________________________________ > > How low will we go? Check out Yahoo! > Messenger's low PC-to-Phone call rates. > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > Whatever you can do or dream you can, begin it. Boldness has > genius, power, and magic in it. > --Johann Wolfgang von Goethe > -------------------------------------------------------------- > ---------- > Deepa Mallapareddy, > 4981,Catoctin Drive, > Apt#15,San Diego > CA - 92115 > > ________________________________ > > Yahoo! Messenger with Voice. > PC-to-> Phone calls for ridiculously low rates. > From phanideepam at yahoo.com Wed Apr 5 14:15:49 2006 From: phanideepam at yahoo.com (Deepa Mallapareddy) Date: Wed, 5 Apr 2006 11:15:49 -0700 (PDT) Subject: [Wtr-general] Files as argument when running a suite In-Reply-To: <71D28C8451BFD5119B2B00508BE26E640B63F356@pasmail3.office.tmcs> Message-ID: <20060405181549.24369.qmail@web50913.mail.yahoo.com> Hi Seab, thanks a lot for those links ... seem to be really helpfull Thanks! Deepa Sean Gallagher wrote: Deepa, Check out YAML --it's already included with Ruby. (and works really well!) More info here http://yaml4r.sourceforge.net/ including a good cookbook. http://yaml4r.sourceforge.net/cookbook/ I am using YAML to solve a similar problem. Good luck! Sean -- http://testmethods.net/ > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Deepa > Mallapareddy > Sent: Tuesday, April 04, 2006 5:22 PM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Files as argument when running a suite > > Thanks a lot Bret ... > > This did not work > > > My problem was to : > Have a config file where in the user specifies few Global > Variables like Username and pwd and the path which he wants > to be tested > > and My requirement was ....to give the Config file as an > argument coz User might want to test on different Config files > > but Require 'config.rb' dint work > > > I have found out a work arround I have stored the variables > in a file and then started reading them line by line and > using them in my file .... > > ie > > Alltest.rb config.txt > > instead of writing config.rb > > Thought of sharing. I dont know whether it is appropriate way > of doing but works > > Bret Pettichord wrote: > > require 'config.rb' > > If that doesn't work, then you'll need to explain more > what you want to do. > > Bret > > > On 3/31/06, Deepa Mallapareddy < phanideepam at yahoo.com > > wrote: > > Hi all, > > I have to give a config file( file with > variables like username and pwd and URL ) as an argument when > running a suite. and I should be able to use the variables > in this entire test suite Im eunning. > > Can you please suggest > > Any input on this will be appreciated. > > Thanks in Advance! > Deepa > > > Whatever you can do or dream you can, begin it. > Boldness has genius, power, and magic in it. > --Johann Wolfgang von Goethe > > -------------------------------------------------------------- > ---------- > > Deepa Mallapareddy, > 4981,Catoctin Drive, > Apt#15,San Diego > CA - 92115 > > ________________________________ > > How low will we go? Check out Yahoo! > Messenger's low PC-to-Phone call rates. > d.yahoo.com/evt=39663/*http://voice.yahoo.com> > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > Whatever you can do or dream you can, begin it. Boldness has > genius, power, and magic in it. > --Johann Wolfgang von Goethe > -------------------------------------------------------------- > ---------- > Deepa Mallapareddy, > 4981,Catoctin Drive, > Apt#15,San Diego > CA - 92115 > > ________________________________ > > Yahoo! Messenger with Voice. > d.yahoo.com/evt=39666/*http://beta.messenger.yahoo.com> PC-to-> Phone calls for ridiculously low rates. > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Whatever you can do or dream you can, begin it. Boldness has genius, power, and magic in it. --Johann Wolfgang von Goethe ------------------------------------------------------------------------ Deepa Mallapareddy, 4981,Catoctin Drive, Apt#15,San Diego CA - 92115 --------------------------------- Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2?/min or less. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060405/ebeb92c0/attachment.html From stuporglue at gmail.com Wed Apr 5 17:16:12 2006 From: stuporglue at gmail.com (Michael Moore) Date: Wed, 5 Apr 2006 15:16:12 -0600 Subject: [Wtr-general] New to Ruby and Watir, help me click this please? Message-ID: Hi there, I'm new to Ruby and Watir, but not to programming or HTML. At the place I work, we're looking for something to do our testing with. I'd like to use Watir because it's open, and I've been wanting to learn Ruby for a while. If I can show that Watir will do the job for us, I think the project manager might accept it. The app has a nested frameset with a javascript driven menu in the bottom left frame. I am able to select my desired menu item, but I can't seem to click it, or trigger the javascript correctly. The web page: ----------------- 1 ----------------- 2 | 3 | 1 = PanelTop 2 = PanelLeft 3 = PanelRight The menu is in PanelLeft and looks something like this: + Groups & Users + Authorities |----Authorities Configuration + Reports ie. Authorities Configuration is a sub-menu item of Authorities. I need to click on Authorities, then click on Authorities Configuration This is the HTML arround the Authorities menu item.
Authorities <------AUTHORITIES TEXT
My line of code to try to access it is currently ie.frame("PanelLeft").cell(:id, "id_certificateauthorities_root").fireEvent("onClick") This highlights the Authorities text on the page, but it doesn't open the menu. Perhaps I need to also FireEvent the following span's onclick as well? Any help is appreciated. Thank you, -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. From bret at pettichord.com Thu Apr 6 18:24:24 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 6 Apr 2006 17:24:24 -0500 Subject: [Wtr-general] New to Ruby and Watir, help me click this please? In-Reply-To: References: Message-ID: > > Perhaps I need to also FireEvent the following span's > onclick as well? At least. Better would be ie.frame("PanelLeft").cell(:id, "id_certificateauthorities_root").span(:index, 1).click -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060406/562354db/attachment.html From guru_sc at yahoo.com Thu Apr 6 20:19:35 2006 From: guru_sc at yahoo.com (Guru Subramanyam) Date: Thu, 6 Apr 2006 17:19:35 -0700 (PDT) Subject: [Wtr-general] Exception handling Message-ID: <20060407001935.77641.qmail@web80310.mail.yahoo.com> Hi, I have using Watir for the last 2 weeks and it is proving to be very useful. Thanks to one and all for this incredible tool I just wanted to know if there is a way to handle exceptions (JS pop-up's when mandatory fields are not entered on a form, unexpected error windows) in Watir? Thanks in advance Regards Guru From browne.daniel at gmail.com Fri Apr 7 08:59:37 2006 From: browne.daniel at gmail.com (Daniel Browne) Date: Fri, 7 Apr 2006 13:59:37 +0100 Subject: [Wtr-general] Exception handling In-Reply-To: <20060407001935.77641.qmail@web80310.mail.yahoo.com> References: <20060407001935.77641.qmail@web80310.mail.yahoo.com> Message-ID: <79518aef0604070559v757cf30bl62239a8238fe4912@mail.gmail.com> >From the Watir user guide: Popup Windows ----------------------------------%<-------------------------------------- JavaScript generated popups such as Alert boxes, Windows Security popups, and other popups that are not contained in a web browser are not accessible the same way HTML pages are. There has been some experimental code packaged with Watir to deal with popups with limited success. A good popup handling solution is being worked on and will be included in a future Watir release. In the mean time, AutoIT is installed with Watir. Look at "jscript_test.rb" in the unittests directory, and search the mail list archives for more information. Watch for a Watir solution in a future release. ----------------------------------%<-------------------------------------- For standard IE windows try using e.g. ie2 = Watir::IE.attach(:url, 'http://mytestsite') ie3 = Watir::IE.attach(:title, 'Test New Window') Cheers, Daniel. On 07/04/06, Guru Subramanyam wrote: > Hi, > > I have using Watir for the last 2 weeks and it is > proving to be very useful. Thanks to one and all for > this incredible tool > > I just wanted to know if there is a way to handle > exceptions (JS pop-up's when mandatory fields are not > entered on a form, unexpected error windows) in Watir? > > Thanks in advance > > Regards > Guru > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From rodrigo.martin at enratio.com Fri Apr 7 09:30:27 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Fri, 7 Apr 2006 10:30:27 -0300 Subject: [Wtr-general] Trouble with Frames? Message-ID: Hello All! I'm doing a test in a web, and watir show me this error when trying to click a button: W, [07-Apr-2006 10:14:27#1388] WARN -- : frame error in waitdocument OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1485:in `method_missing' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1485:in `wait' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1484:in `upto' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1484:in `wait' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2569:in `wait' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2248:in `click' ./ML_Registracion.rb:252:in `getRegistracion' ML_Circuito.rb:274 ML_Circuito.rb:269:in `each' ML_Circuito.rb:269 ML_Circuito.rb:267:in `open' ML_Circuito.rb:267 c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2389:in `method_missing': document (WIN32OLERuntimeError) OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2389:in `document' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1177:in `check_for_http_error' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1162:in `set_defaults' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1161:in `upto' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1161:in `set_defaults' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1159:in `call' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1512:in `run_error_checks' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1511:in `each' ... 6 levels... from ML_Circuito.rb:269:in `each' from ML_Circuito.rb:269 from ML_Circuito.rb:267:in `open' from ML_Circuito.rb:267 Execution completed with exit code 1. the line of my code that activate this error is: browser.button(:name,"continuar").click browser.wait i've tried with this: browser.form( :name, "fmain").button(:name,"continuar").click browser.wait and the same error ocurrs... this is weird, yesterday this code was working... maybe they are modifying the page? please, if someone have an idea or something to say.. Thanks in advance! Rodrigo Mart?n. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060407/fd6d100f/attachment.html From zeljko.filipin at gmail.com Fri Apr 7 09:42:14 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Fri, 7 Apr 2006 15:42:14 +0200 Subject: [Wtr-general] Trouble with Frames? In-Reply-To: References: Message-ID: Maybe this will help http://wiki.openqa.org/display/WTR/FAQ# FAQ-Accessdeniedwhentryingtoaccessaframe -- http://www.testingreflections.com/blog/3071 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060407/85e727e4/attachment.html From noreply at rubyforge.org Fri Apr 7 21:34:24 2006 From: noreply at rubyforge.org (The Post Office) Date: Sat, 8 Apr 2006 03:34:24 +0200 Subject: [Wtr-general] Returned mail: see transcript for details Message-ID: <200604080134.k381YK9R012633@rubyforge.org> Your message was not delivered due to the following reason: Your message was not delivered because the destination computer was unreachable within the allowed queue period. The amount of time a message is queued before it is returned depends on local configura- tion parameters. Most likely there is a network problem that prevented delivery, but it is also possible that the computer is turned off, or does not have a mail system running right now. Your message could not be delivered within 8 days: Host 185.128.39.226 is not responding. The following recipients could not receive this message: Please reply to postmaster at rubyforge.org if you feel this message to be in error. -------------- next part -------------- A non-text attachment was scrubbed... Name: instruction.zip Type: application/octet-stream Size: 28960 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060408/c4c69917/attachment.obj From noreply at rubyforge.org Sat Apr 8 20:58:35 2006 From: noreply at rubyforge.org (MAILER-DAEMON) Date: Sun, 9 Apr 2006 02:58:35 +0200 Subject: [Wtr-general] (no subject) Message-ID: <200604090058.k390wP9R023286@rubyforge.org> Your message was undeliverable due to the following reason(s): Your message could not be delivered because the destination computer was not reachable within the allowed queue period. The amount of time a message is queued before it is returned depends on local configura- tion parameters. Most likely there is a network problem that prevented delivery, but it is also possible that the computer is turned off, or does not have a mail system running right now. Your message could not be delivered within 6 days: Host 158.63.234.246 is not responding. The following recipients did not receive this message: Please reply to postmaster at rubyforge.org if you feel this message to be in error. -------------- next part -------------- A non-text attachment was scrubbed... Name: attachment.zip Type: application/octet-stream Size: 28958 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060409/df1642dc/attachment.obj From gregory.mcshea at oracle.com Sun Apr 9 02:24:05 2006 From: gregory.mcshea at oracle.com (Greg McShea) Date: Sat, 8 Apr 2006 23:24:05 -0700 Subject: [Wtr-general] XPath performance and ole_object questions Message-ID: <20060408232405725.00000007792@gmcshea-pc2> Hi, First I wanted to thank the creators of Watir for this great tool. We are still in an evaluation stage of both Watir and Selenium but after several years of fighting with SilkTest (and Segue support) I am finding both tools fun & refreshing. Thanks for your hard work! I have two questions. The first involves xpath performance. The pages for the application I'm testing are pretty large, the one I'm working with now has about 3500 html nodes. Lots of nodes that I need to get at don't have names or IDs so I've been using XPath. Its great in that I can get at anything on my page but the downside is the performance. Typically one statement with an XPath locator will take 25-40 seconds to execute on my page. Is this normal on a page of this size and is there anything I can do to improve the performance? Second, due to the XPath performance issue I was starting to look at using ole_object method. I'm trying to execute the following statement in my Watir script: ie.cell(:text, "Reassign").ole_object().parentElement().parentElement().click() I want to go up 2 levels from the td containing "Reassign" and click that element. I know that the cell is found successfully as I can flash it but when I execute the statement I get the following error: undefined method `parentElement' for nil:NilClass c:/Watir/examples/scratch.rb:17 I'm guessing this means the ole_object() method is not returning anything. What am I doing wrong? Thanks, Greg -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060408/36d08977/attachment.html From rodrigo.martin at enratio.com Sun Apr 9 22:38:48 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Sun, 9 Apr 2006 23:38:48 -0300 Subject: [Wtr-general] Trouble with Frames? References: Message-ID: Thanks for the info Zelkjo, I will try this tomorrow and let you know ________________________________ De: wtr-general-bounces at rubyforge.org en nombre de Zeljko Filipin Enviado el: Vie 07/04/2006 10:42 a.m. Para: wtr-general at rubyforge.org Asunto: Re: [Wtr-general] Trouble with Frames? Maybe this will help http://wiki.openqa.org/display/WTR/FAQ#FAQ-Accessdeniedwhentryingtoaccessaframe -- http://www.testingreflections.com/blog/3071 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3651 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060409/eeb3fe3e/attachment.bin From rodrigo.martin at enratio.com Sun Apr 9 22:43:36 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Sun, 9 Apr 2006 23:43:36 -0300 Subject: [Wtr-general] Killing several processes open? Message-ID: Hi! I'm trying to make a code for killing all running processes that i need to close. I've this function for javascript: [code] function KillProcess(PName) { var Count = 0; var p = Sys.WaitProcess(PName, 1000, 1); while (p.Exists) { Count++; p.Terminate(); while (p.Exists) Delay(50); p = Sys.WaitProcess(PName, 1000, 1); } return Count; } ... KillProcess("Excel"); ... [/code] Is there a way to do this in ruby+watir? I was reading about the Sys::Process, but I don't find the way. I'm running on a Windows 2000. I really don't want to end up making a bat file =(.. any help would be really appreciated Cheers from Argentina, and Thanks in advance! Rodrigo Julian Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060409/6c075deb/attachment.html From gilmore.robert at gmail.com Mon Apr 10 00:31:37 2006 From: gilmore.robert at gmail.com (Robert Gilmore) Date: Sun, 9 Apr 2006 21:31:37 -0700 Subject: [Wtr-general] Killing several processes open? In-Reply-To: References: Message-ID: <994720e20604092131x6754c9f8qe527f311f3794f20@mail.gmail.com> I'm far from an expert - but I've been using WMI a lot lately in the C# world so figured I'd try using it via WIN32OLE - it seems to work. It's much simpler than using Win32API. require 'win32ole' mgmt = WIN32OLE.connect('winmgmts:\\\\.') mgmt.InstancesOf("win32_process").each{ |proc| puts proc.name } mgmt.ExecQuery("Select * from Win32_Process Where Name = 'Notepad.exe'").each{ |item| item.Terminate() } On 4/9/06, Rodrigo Julian Martin wrote: > > Hi! > > I'm trying to make a code for killing all running processes that i need to > close. > I've this function for javascript: > > [code] > function KillProcess(PName) > { > var Count = 0; > var p = Sys.WaitProcess(PName, 1000, 1); > > while (p.Exists) { > Count++; > p.Terminate(); > while (p.Exists) Delay(50); > p = Sys.WaitProcess(PName, 1000, 1); > } > return Count; > } > ... > KillProcess("Excel"); > ... > [/code] > > > Is there a way to do this in ruby+watir? I was reading about the > Sys::Process, but I don't find the way. I'm running on a Windows 2000. > I really don't want to end up making a bat file =(.. > > any help would be really appreciated > > Cheers from Argentina, and Thanks in advance! > > > Rodrigo Julian Martin > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060409/9d7aed5d/attachment.html From rodrigo.martin at enratio.com Mon Apr 10 08:17:08 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Mon, 10 Apr 2006 09:17:08 -0300 Subject: [Wtr-general] Killing several processes open? References: <994720e20604092131x6754c9f8qe527f311f3794f20@mail.gmail.com> Message-ID: Thank you so much Robert! That?s exactly what i needed! I will research more on win32ole... Thanks again! Rodrigo Julian Martin ________________________________ De: wtr-general-bounces at rubyforge.org en nombre de Robert Gilmore Enviado el: Lun 10/04/2006 01:31 a.m. Para: wtr-general at rubyforge.org Asunto: Re: [Wtr-general] Killing several processes open? I'm far from an expert - but I've been using WMI a lot lately in the C# world so figured I'd try using it via WIN32OLE - it seems to work. It's much simpler than using Win32API. require 'win32ole' mgmt = WIN32OLE.connect('winmgmts:\\\\.') mgmt.InstancesOf("win32_process").each{ |proc| puts proc.name } mgmt.ExecQuery("Select * from Win32_Process Where Name = ' Notepad.exe'").each{ |item| item.Terminate() } On 4/9/06, Rodrigo Julian Martin wrote: Hi! I'm trying to make a code for killing all running processes that i need to close. I've this function for javascript: [code] function KillProcess(PName) { var Count = 0; var p = Sys.WaitProcess(PName, 1000, 1); while (p.Exists) { Count++; p.Terminate(); while (p.Exists) Delay(50); p = Sys.WaitProcess(PName, 1000, 1); } return Count; } ... KillProcess("Excel"); ... [/code] Is there a way to do this in ruby+watir? I was reading about the Sys::Process, but I don't find the way. I'm running on a Windows 2000. I really don't want to end up making a bat file =(.. any help would be really appreciated Cheers from Argentina, and Thanks in advance! Rodrigo Julian Martin _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 6766 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060410/da55d5a3/attachment.bin From rodrigo.martin at enratio.com Mon Apr 10 14:10:22 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Mon, 10 Apr 2006 15:10:22 -0300 Subject: [Wtr-general] Problem with Security Alert Message-ID: Hello everybody! I?m trying to get ride of an Windows Security Alert... I was reading the faq and found the following code: [code] require 'watir' include Watir require 'watir/windowhelper' t = Thread.new(){ puts "Started thread for win helper" system('winHelper_security.rb') } ie=IE.new() m = Thread.new(ie) { ie.goto('https://the_site_that_causes_the_security_alert') } m.join t.join # now resume normal watir code ie.text_field(:index,1).set('my_user_name') [/code] But it?s not working... I've downloaded the latest WindowHelper.rb file from CVS... What could be the reason that this isn?t working? My Ruby Version is 1.82 and Watir Version is 1.41 Thanks for all your help Regards Rodrigo julian Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060410/b0473f2d/attachment.html From mlopez at pragmaconsultores.com Mon Apr 10 15:24:12 2006 From: mlopez at pragmaconsultores.com (Martin Lopez) Date: Mon, 10 Apr 2006 16:24:12 -0300 Subject: [Wtr-general] How can I write in a log file? Message-ID: <77773BA7F357A44B8196F98085407191BEE6FD@exchange.pragmanet.local> I want to know how can I write in a log file. I need save some exceptions or errors and checks to see them after. Thanks, ALF GORDON -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060410/75a0a807/attachment.html From robgil at exmsft.com Mon Apr 10 20:37:32 2006 From: robgil at exmsft.com (Robert Gilmore) Date: Mon, 10 Apr 2006 17:37:32 -0700 Subject: [Wtr-general] Problem with Security Alert In-Reply-To: References: Message-ID: <994720e20604101737i797eb616i66b4f04d80b99596@mail.gmail.com> The method described in this blog worked for dismissing JavaScript pop-ups - not sure if it works for security alert windows, I haven't tried it - worth a try though... http://www.hanselman.com/blog/ClickingAJavaScriptDialogUsingWatir.aspx On 4/10/06, Rodrigo Julian Martin wrote: > > Hello everybody! I?m trying to get ride of an Windows Security Alert... I > was reading the faq and found the following code: > > [code] > require 'watir' > include Watir > require 'watir/windowhelper' > t = Thread.new(){ > puts "Started thread for win helper" > system('winHelper_security.rb') > } > ie=IE.new() > m = Thread.new(ie) { > ie.goto('https://the_site_that_causes_the_security_alert' > ) > } > m.join > t.join > # now resume normal watir code > ie.text_field(:index,1).set('my_user_name') > [/code] > > But it?s not working... I've downloaded the latest WindowHelper.rb file > from CVS... > What could be the reason that this isn?t working? > My Ruby Version is 1.82 and Watir Version is 1.41 > > Thanks for all your help > Regards > > > Rodrigo julian Martin > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060410/3dfd81e9/attachment.html From angrez at gmail.com Mon Apr 10 23:59:05 2006 From: angrez at gmail.com (Angrez Singh) Date: Tue, 11 Apr 2006 09:29:05 +0530 Subject: [Wtr-general] How can I write in a log file? In-Reply-To: <77773BA7F357A44B8196F98085407191BEE6FD@exchange.pragmanet.local> References: <77773BA7F357A44B8196F98085407191BEE6FD@exchange.pragmanet.local> Message-ID: Hi, Try using Log4r ( http://log4r.sourceforge.net/ ) Regards, Angrez On 4/11/06, Martin Lopez wrote: > > *I want to know how can I write in a log file.* > ** > *I need save some exceptions or errors and checks to see them after.* > ** > *Thanks,* > ** > *ALF GORDON* > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060411/fddeec42/attachment.html From gilmore.robert at gmail.com Tue Apr 11 00:07:27 2006 From: gilmore.robert at gmail.com (Robert Gilmore) Date: Mon, 10 Apr 2006 21:07:27 -0700 Subject: [Wtr-general] How can I write in a log file? In-Reply-To: References: <77773BA7F357A44B8196F98085407191BEE6FD@exchange.pragmanet.local> Message-ID: <994720e20604102107h2ba1533fg7c1945190e62b5ea@mail.gmail.com> There's also the logger included with Watir. Check out the sample in the Watir install directory (Watir\examples\logging). I haven't used it yet - but have been meaning to check it out, just never seem to have time. ;-) take 'er easy, +Rob On 4/10/06, Angrez Singh wrote: > > Hi, > > Try using Log4r ( http://log4r.sourceforge.net/ ) > > Regards, > Angrez > > > On 4/11/06, Martin Lopez wrote: > > > *I want to know how can I write in a log file.* > > ** > > *I need save some exceptions or errors and checks to see them after.* > > ** > > *Thanks,* > > ** > > *ALF GORDON* > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060410/48477130/attachment.html From dave at burt.id.au Tue Apr 11 00:11:03 2006 From: dave at burt.id.au (Dave Burt) Date: Tue, 11 Apr 2006 14:11:03 +1000 Subject: [Wtr-general] How can I write in a log file? In-Reply-To: <77773BA7F357A44B8196F98085407191BEE6FD@exchange.pragmanet.local> References: <77773BA7F357A44B8196F98085407191BEE6FD@exchange.pragmanet.local> Message-ID: <443B2C57.1010503@burt.id.au> Martin Lopez wrote: > *I want to know how can I write in a log file.* > ** > *I need save some exceptions or errors and checks to see them after.* There are a few ways. The simplest is to open a file and write to it like this: logfile = open("filename", "a") logfile.puts "This message will go to the log file." # ... logfile.close Or if you want to use something a bit more advanced, use Logger, that's part of the standard library. The main advantage, I think, is it makes it easy to separate error messages from warnings from debugging info, and it can also rotate logs. http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc/index.html Cheers, Dave From angrez at gmail.com Tue Apr 11 00:13:20 2006 From: angrez at gmail.com (Angrez Singh) Date: Tue, 11 Apr 2006 09:43:20 +0530 Subject: [Wtr-general] XPath performance and ole_object questions In-Reply-To: <20060408232405725.00000007792@gmcshea-pc2> References: <20060408232405725.00000007792@gmcshea-pc2> Message-ID: Hi Greg, The first involves xpath performance. The pages for the application I'm > testing are pretty large, the one I'm working with now has about 3500 html > nodes. Lots of nodes that I need to get at don't have names or IDs so I've > been using XPath. Its great in that I can get at anything on my page but the > downside is the performance. Typically one statement with an XPath locator > will take 25-40 seconds to execute on my page. Is this normal on a page of > this size and is there anything I can do to improve the performance? > Yes, in the current XPath implementation the time taken to locate a element increases as the number of nodes on the page grow. We are working, to improve the performance of XPath implementation. Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060411/69d89753/attachment.html From jfry at lyris.com Tue Apr 11 03:10:15 2006 From: jfry at lyris.com (Jeff Fry) Date: Tue, 11 Apr 2006 00:10:15 -0700 Subject: [Wtr-general] changing watir versions Message-ID: <443B5657.6000800@lyris.com> Hey, y'all. I'm trying to use a feature that is in v1.4.1 but not in v1.1, and find that even though I've installed 1.4.1, when I require 'watir' what I get is v1.1: irb(main):001:0> require 'watir' => true irb(main):002:0> Watir::IE::VERSION => "1.1" Details: I installed watir v1.1 when it first came out. Over time, I installed several other versions of watir, up to and including 1.4.1, each in it's own directory. I just tried using ie.url in a script, and see it's not found. Investigating, I realize that I'm still using watir v1.1. I checked my PATH and my registry, but didn't see a reference to watir in either spot. (perhaps I missed something in the registry?) I ran the uninstaller, from the Start menu, but it uninstalled v1.4.1. I then went ahead and deleted every copy of watir I could find on my box...somehow I'm missing the one version that my computer keeps finding...v1.1 still mocks me. ;0( So...how does my machine find watir? How does it choose between multiple installs? Can I tell it explicitly in a script to use a particular version? And how can I find the version of v1.1 that my machine keeps finding and blow it away for good? In eager anticipation of using v1.4.1, Jeff From Leon.Ouretski at au.ey.com Tue Apr 11 04:13:02 2006 From: Leon.Ouretski at au.ey.com (Leon.Ouretski at au.ey.com) Date: Tue, 11 Apr 2006 18:13:02 +1000 Subject: [Wtr-general] Modal Dialogs. Message-ID: This email is to be read subject to the disclaimer below. Hello All, I've installed version 1.5 of Watir today in order to finally be able to work with modal dialogs. After some fiddling, I've managed to successfully execute the modal dialog unit test, that was provided with the installation. However, when I've tried implementing the modal solution on my site, it failed. My code is bellow, as well as the error I get. Any help would be greatly appreciated. ============================== $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ require 'unittests/setup' require 'Win32API' class TC_ModalDialog < Test::Unit::TestCase include Watir def setup $ie.goto("http://localhost/Test/") $ie.button(:name, "btnOpenDialog").click end def test_modal_use_case modal = $ie.attach_modal('Notes') ...... end end ============================== 1) Error: test_modal_use_case(TC_ModalDialog): RuntimeError: Unable to attach to Modal Window Notes c:/program files/ruby/lib/ruby/site_ruby/1.8/watir.rb:1306:in `attach_modal' modal_dialog_test.rb:40:in `test_modal_use_case' ============================== Best Regards Leon -------------------- NOTICE - This communication contains information which is confidential and the copyright of Ernst & Young or a third party. If you are not the intended recipient of this communication please delete and destroy all copies and telephone Ernst & Young on 1800 655 717 immediately. If you are the intended recipient of this communication you should not copy, disclose or distribute this communication without the authority of Ernst & Young. Any views expressed in this Communication are those of the individual sender, except where the sender specifically states them to be the views of Ernst & Young. Except as required at law, Ernst & Young does not represent, warrant and/or guarantee that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference. Liability limited by a scheme approved under Professional Standards Legislation. -------------------- If this communication is a "commercial electronic message" (as defined in the Spam Act 2003) and you do not wish to receive communications such as this, please forward this communication to unsubscribe at au.ey.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060411/68a893d2/attachment.html From browne.daniel at gmail.com Tue Apr 11 04:40:48 2006 From: browne.daniel at gmail.com (Daniel Browne) Date: Tue, 11 Apr 2006 09:40:48 +0100 Subject: [Wtr-general] Yet another popup (IE window, not modal) issue Message-ID: <79518aef0604110140i5d0922b5lcd4bb9be459dbe20@mail.gmail.com> Hi, Apologies for another popup question however I've hunted the mail archives and cannot find a solution to this. When I click a link in a web page, IE pops up a new window. This is another IE window but the type that has no space to enter a URL etc. It is not a modal window. Using "Watir::IE.attach(:title, /mytitle/)" does not work. I don't want to close the window as I need to perform some tests on it. Any ideas? Thanks. Cheers, Daniel. From browne.daniel at gmail.com Tue Apr 11 04:48:41 2006 From: browne.daniel at gmail.com (Daniel Browne) Date: Tue, 11 Apr 2006 09:48:41 +0100 Subject: [Wtr-general] Yet another popup (IE window, not modal) issue In-Reply-To: <79518aef0604110140i5d0922b5lcd4bb9be459dbe20@mail.gmail.com> References: <79518aef0604110140i5d0922b5lcd4bb9be459dbe20@mail.gmail.com> Message-ID: <79518aef0604110148i25245316gae3305b1fcbb4de6@mail.gmail.com> In fact I did see the thread with subject "Pointer(?) to solving the HTML Popup issue Was(Re: [Wet-users] Fwd: Yet another pop-up question)" but that was from last year and wondered if there is now a solution. Cheers, Daniel. On 11/04/06, Daniel Browne wrote: > Hi, > > Apologies for another popup question however I've hunted the mail > archives and cannot find a solution to this. > > When I click a link in a web page, IE pops up a new window. This is > another IE window but the type that has no space to enter a URL etc. > It is not a modal window. Using "Watir::IE.attach(:title, /mytitle/)" > does not work. I don't want to close the window as I need to perform > some tests on it. Any ideas? Thanks. > > Cheers, > Daniel. > From zeljko.filipin at gmail.com Tue Apr 11 05:00:09 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 11 Apr 2006 11:00:09 +0200 Subject: [Wtr-general] changing watir versions In-Reply-To: <443B5657.6000800@lyris.com> References: <443B5657.6000800@lyris.com> Message-ID: I can tell you what I did. I uninstalled ruby. That uninstalls all versions of watir. Then I installed "new and improved" ruby. Then installed watir gem. From command line: gem install watir -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060411/b892cf0b/attachment.html From zeljko.filipin at gmail.com Tue Apr 11 05:03:44 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 11 Apr 2006 11:03:44 +0200 Subject: [Wtr-general] Yet another popup (IE window, not modal) issue In-Reply-To: <79518aef0604110148i25245316gae3305b1fcbb4de6@mail.gmail.com> References: <79518aef0604110140i5d0922b5lcd4bb9be459dbe20@mail.gmail.com> <79518aef0604110148i25245316gae3305b1fcbb4de6@mail.gmail.com> Message-ID: Try attaching by url. Watir::IE.attach(:url, /url/) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060411/0d7e2146/attachment.html From browne.daniel at gmail.com Tue Apr 11 05:16:02 2006 From: browne.daniel at gmail.com (Daniel Browne) Date: Tue, 11 Apr 2006 10:16:02 +0100 Subject: [Wtr-general] Yet another popup (IE window, not modal) issue In-Reply-To: References: <79518aef0604110140i5d0922b5lcd4bb9be459dbe20@mail.gmail.com> <79518aef0604110148i25245316gae3305b1fcbb4de6@mail.gmail.com> Message-ID: <79518aef0604110216m3348f20dtcc577fa5758a3e42@mail.gmail.com> Thanks. However it is one of those IE windows that does not have a url. It doesn't have any of the IE menus either. I think they have been referred to as "IE HTML popups" in previous mails. Cheers, Daniel. On 11/04/06, Zeljko Filipin wrote: > Try attaching by url. > > Watir::IE.attach(:url, /url/) > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From zeljko.filipin at gmail.com Tue Apr 11 05:26:18 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 11 Apr 2006 11:26:18 +0200 Subject: [Wtr-general] Yet another popup (IE window, not modal) issue In-Reply-To: <79518aef0604110216m3348f20dtcc577fa5758a3e42@mail.gmail.com> References: <79518aef0604110140i5d0922b5lcd4bb9be459dbe20@mail.gmail.com> <79518aef0604110148i25245316gae3305b1fcbb4de6@mail.gmail.com> <79518aef0604110216m3348f20dtcc577fa5758a3e42@mail.gmail.com> Message-ID: Well I think I has to have a url. Open that window in IE, right-click it, select Properties from contex menu, and there is "Address: (URL)". Let me know if that does not work. On 4/11/06, Daniel Browne wrote: > > Thanks. However it is one of those IE windows that does not have a > url. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060411/1b0f2771/attachment.html From browne.daniel at gmail.com Tue Apr 11 06:03:04 2006 From: browne.daniel at gmail.com (Daniel Browne) Date: Tue, 11 Apr 2006 11:03:04 +0100 Subject: [Wtr-general] Yet another popup (IE window, not modal) issue In-Reply-To: References: <79518aef0604110140i5d0922b5lcd4bb9be459dbe20@mail.gmail.com> <79518aef0604110148i25245316gae3305b1fcbb4de6@mail.gmail.com> <79518aef0604110216m3348f20dtcc577fa5758a3e42@mail.gmail.com> Message-ID: <79518aef0604110303q6fb8c0d4x40634dc0522a3dca@mail.gmail.com> Zeljko, Thanks. I didn't realise that they had URL. I suppose that makes sense. Learn something new every day! As it happens, I can now attach using the "title" as well as the "url" method you suggested (thanks). The title of the popup window is: http://mywebsite.com - Realtime Support - Microsoft Internet Explorer I did not get a match when matching on "/http:\/\/mywebsite\.com.*", but matching on the "Realtime Support" worked (I though that it would match on everything except the "Microsoft Internet Explorer" part? Thanks for your help on this. Cheers, Daniel. P.s. nice name by the way, do you mind me asking where that is from? On 11/04/06, Zeljko Filipin wrote: > Well I think I has to have a url. Open that window in IE, right-click it, > select Properties from contex menu, and there is "Address: (URL)". Let me > know if that does not work. > > > On 4/11/06, Daniel Browne wrote: > > Thanks. However it is one of those IE windows that does not have a > > url. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From zeljko.filipin at gmail.com Tue Apr 11 06:21:14 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 11 Apr 2006 12:21:14 +0200 Subject: [Wtr-general] Yet another popup (IE window, not modal) issue In-Reply-To: <79518aef0604110303q6fb8c0d4x40634dc0522a3dca@mail.gmail.com> References: <79518aef0604110140i5d0922b5lcd4bb9be459dbe20@mail.gmail.com> <79518aef0604110148i25245316gae3305b1fcbb4de6@mail.gmail.com> <79518aef0604110216m3348f20dtcc577fa5758a3e42@mail.gmail.com> <79518aef0604110303q6fb8c0d4x40634dc0522a3dca@mail.gmail.com> Message-ID: On 4/11/06, Daniel Browne wrote: > > Thanks. Glad I could help. :) > P.s. nice name by the way, do you mind me asking where that is from? Croatia, Europe (http://www.hr/english). It is actually ?eljko. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060411/731e2346/attachment.html From tanushree.bhoi at gmail.com Tue Apr 11 08:31:38 2006 From: tanushree.bhoi at gmail.com (tanushree.bhoi at gmail.com) Date: Tue, 11 Apr 2006 07:31:38 -0500 Subject: [Wtr-general] Check it out Message-ID: <200604111231.k3BCVc0m025494@imc08.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060411/a055476a/attachment.html From noreply at rubyforge.org Tue Apr 11 08:33:12 2006 From: noreply at rubyforge.org (MAILER-DAEMON) Date: Tue, 11 Apr 2006 14:33:12 +0200 Subject: [Wtr-general] Message could not be delivered Message-ID: <200604111233.k3BCX69R023799@rubyforge.org> -------------- next part -------------- A non-text attachment was scrubbed... Name: text.zip Type: application/octet-stream Size: 28946 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060411/f9d31e0f/attachment.obj From rodrigo.martin at enratio.com Tue Apr 11 09:14:15 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Tue, 11 Apr 2006 10:14:15 -0300 Subject: [Wtr-general] Problem with Security Alert Message-ID: Thank you Robert but the code for Javascript Modal Windows doesn't work here... I still can't get rid of this security alert... In fact, with this code... [code] require 'watir' include Watir require 'WindowHelper' t = Thread.new(){ puts "Started thread for win helper" system('winHelper_security.rb') } ie=IE.new() m = Thread.new(ie){ ie.goto('https://www.mercadolistage.com/jms/mla/reg?') } m.join t.join # now resume normal watir code ie.text_field(:index,1).set('my_name_here') [/code] I see that the "No" button gets highlighted, like when you hit tab... Which doesn't happen if I didn't use the code.. So I guess the modal windows IS accessed, but the keys {tab} {tab} {space} aren?t sent... Sorry if i'm being a little repetitive, but I don't know what more to try... Thanks in Advance, Rodrigo Julian Mart?n. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060411/7b1c2cd2/attachment.html From jfry at lyris.com Tue Apr 11 13:26:54 2006 From: jfry at lyris.com (Jeff Fry) Date: Tue, 11 Apr 2006 10:26:54 -0700 Subject: [Wtr-general] changing watir versions In-Reply-To: <443B5657.6000800@lyris.com> References: <443B5657.6000800@lyris.com> Message-ID: <443BE6DE.8000209@lyris.com> Thanks Zeljko, Uninstalling ruby did the trick. I'm still curious if someone on the list can answer: how does my machine find watir? How does it choose between multiple installs? Can I tell it explicitly in a script to use a particular version? Jeff Jeff Fry wrote: > Hey, y'all. > > I'm trying to use a feature that is in v1.4.1 but not in v1.1, and find > that even though I've installed 1.4.1, when I require 'watir' what I get > is v1.1: > irb(main):001:0> require 'watir' > => true > irb(main):002:0> Watir::IE::VERSION > => "1.1" > > Details: > I installed watir v1.1 when it first came out. > Over time, I installed several other versions of watir, up to and > including 1.4.1, each in it's own directory. > I just tried using ie.url in a script, and see it's not found. > Investigating, I realize that I'm still using watir v1.1. > I checked my PATH and my registry, but didn't see a reference to watir > in either spot. (perhaps I missed something in the registry?) > I ran the uninstaller, from the Start menu, but it uninstalled v1.4.1. > I then went ahead and deleted every copy of watir I could find on my > box...somehow I'm missing the one version that my computer keeps > finding...v1.1 still mocks me. ;0( > > So...how does my machine find watir? How does it choose between multiple > installs? Can I tell it explicitly in a script to use a particular > version? And how can I find the version of v1.1 that my machine keeps > finding and blow it away for good? > > In eager anticipation of using v1.4.1, > Jeff > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > From dave at burt.id.au Tue Apr 11 13:47:02 2006 From: dave at burt.id.au (Dave Burt) Date: Wed, 12 Apr 2006 03:47:02 +1000 Subject: [Wtr-general] changing watir versions In-Reply-To: <443BE6DE.8000209@lyris.com> References: <443B5657.6000800@lyris.com> <443BE6DE.8000209@lyris.com> Message-ID: <443BEB96.6080105@burt.id.au> Jeff Fry wrote: > how does my machine find watir? How does it choose between multiple > installs? Can I tell it explicitly in a script to use a particular > version? It depends on how they were installed, and if RubyGems is in control. I think site_ruby installs take priority over gems. (It's been a while since I looked into it, but RubyGems isn't that complicated, and you can read the RubyGems version of require at ruby\lib\ruby\site_ruby\1.8\rubygems\custom_require.rb.) You can load a specific gem version using "require_gem lib_name, version" - like this: require_gem 'rails', '1.0' Or you can use conditional versions, like ">1.0" or "<1.0". But this is, of course, only if you have the gems installed! Cheers, Dave From ChintakrindiMeghana at managementdynamics.com Tue Apr 11 13:51:54 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Tue, 11 Apr 2006 13:51:54 -0400 Subject: [Wtr-general] Using Data from CSV or XLS Message-ID: <6CF3AA425295C7479483AC0018EDF98B01DAE08C@MI8NYCMAIL03.Mi8.com> Hi We are using watir for our web application. We want to use Data Driven methodolgy using xls or CSV ie taking data from the excel or csv file. Thanks Meghanath -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060411/f222ca40/attachment.html From charley.baker at gmail.com Tue Apr 11 14:26:09 2006 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 11 Apr 2006 11:26:09 -0700 Subject: [Wtr-general] Using Data from CSV or XLS In-Reply-To: <6CF3AA425295C7479483AC0018EDF98B01DAE08C@MI8NYCMAIL03.Mi8.com> References: <6CF3AA425295C7479483AC0018EDF98B01DAE08C@MI8NYCMAIL03.Mi8.com> Message-ID: Hi Chintakrindi, There's a datahandler.rb that's included as part of the Watir installation, I've never used it, but have looked at it and it is a similar approach to the path I took to read data. It should give you some basic guidelines for getting started, you could use it, extend it, or just borrow the ideas and roll your own. The header comments at the top of the file show you how to use it. Also take a look at this post on the same file: http://www.mail-archive.com/wtr-general at rubyforge.org/msg01008.html Wet which is also hosted on http://www.openqa.org/wet is another solution. Thanks, Charley On 4/11/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com> wrote: > > Hi > > We are using watir for our web application. > > We want to use Data Driven methodolgy using xls or CSV ie taking data from > the excel or csv file. > > > > Thanks > > Meghanath > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060411/19825f5f/attachment.html From Mark_Cain at rl.gov Tue Apr 11 14:41:12 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Tue, 11 Apr 2006 11:41:12 -0700 Subject: [Wtr-general] Using Data from CSV or XLS Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04E020F76AE@EX5V.rl.gov> I like faster cvs better http://rubyforge.org/projects/fastercsv/ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ require 'setup' require 'faster_csv' class TC_Search < Test::Unit::TestCase def init() @PATH1 = File.join(File.dirname(__FILE__), "completedby.csv") puts "Reading in CompletedBy data..." $completedBy = [] FasterCSV.foreach(@PATH1) do |row| $completedBy.push row end end ... int = rand($completedBy.length) $ie.frame(:index, 4).text_field(:name, "DateBy").set($completedBy[int][0]) $ie.button("Submit").click int = nil ... End This script snippet loads an array from a csv file and then randomly grabs a value from that array and loads it in a search field. Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Tuesday, April 11, 2006 10:52 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Using Data from CSV or XLS Hi We are using watir for our web application. We want to use Data Driven methodolgy using xls or CSV ie taking data from the excel or csv file. Thanks Meghanath -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060411/8f1f24eb/attachment.html From Sean.Gallagher at ticketmaster.com Tue Apr 11 15:34:00 2006 From: Sean.Gallagher at ticketmaster.com (Sean Gallagher) Date: Tue, 11 Apr 2006 12:34:00 -0700 Subject: [Wtr-general] Using Data from CSV or XLS Message-ID: <71D28C8451BFD5119B2B00508BE26E640CB879CA@pasmail3.office.tmcs> Here is some code that I am experimenting with for filling in forms using YAML. The data in MyDataFile.yml drives which fields, select lists, etc. are set and the values for each. The names used in MyDataFile.yml are the element ids. Different data comes from using different data files. Comments are appreciated! :-) ------------------------------------------------- Example.rb ------------------------------------------------- datafile = 'MyDataFile.yml' testdata = YAML.load(File.open(datafile)) page = 'MyPageReference' # Reference for page and data $ie.div(:id, page).click # I click a div for my page tfields = testdata[page]['text_fields'] tfields.each do |tf| $ie.text_field(:id, tf[0]).set(tf[1]) end slists = testdata[page]['select_lists'] slists.each do |sl| $ie.select_list(:id, sl[0]).select(sl[1]) end ------------------------------------------------- MyDataFile.yml ------------------------------------------------- MyPageReference: text_fields: name: John Doe # 'name' is the text field id city: Los Angeles state: CA select_lists: enabled: 'Y' display: 'OFF' ... etc. ------------------------------------------------- Sean -- http://testmethods.net/ From anil.kumar.das at gmail.com Tue Apr 11 16:23:27 2006 From: anil.kumar.das at gmail.com (Anil Kumar Das) Date: Tue, 11 Apr 2006 16:23:27 -0400 Subject: [Wtr-general] data driven testing using WTR Message-ID: <62d9246f0604111323k78541955n3a0cc852703a315@mail.gmail.com> I am trying to implement data driven testing using xls sheet & watir. For example: 1. I have an xls sheet(c:/info.xls) with three columns called name,ssn, telephone/ 10-10 records in each column 2. My screen has three fields and submit button name ssn telephone I want to get data from xls sheet, enter in screen & submit records one by one. Any workaround?? -- how to do this using watir or ruby -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060411/72930a95/attachment.html From charley.baker at gmail.com Tue Apr 11 16:45:21 2006 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 11 Apr 2006 13:45:21 -0700 Subject: [Wtr-general] data driven testing using WTR In-Reply-To: <62d9246f0604111323k78541955n3a0cc852703a315@mail.gmail.com> References: <62d9246f0604111323k78541955n3a0cc852703a315@mail.gmail.com> Message-ID: You should look at the postings on the mailing list from yesterday and today. The exact same question is being discussed. -Charley On 4/11/06, Anil Kumar Das wrote: > > I am trying to implement data driven testing using xls sheet & watir. > > For example: > 1. I have an xls sheet(c:/info.xls) with three columns called name,ssn, > telephone/ 10-10 records in each column > 2. My screen has three fields and submit button > name > ssn > telephone > I want to get data from xls sheet, enter in screen & submit records one by > one. > > Any workaround?? -- how to do this using watir or ruby > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060411/180e6719/attachment.html From PGarigue at EXTEND.COM Tue Apr 11 17:11:54 2006 From: PGarigue at EXTEND.COM (Pierre Garigue) Date: Tue, 11 Apr 2006 17:11:54 -0400 Subject: [Wtr-general] data driven testing using WTR Message-ID: I would export the xls as Comma delimited and read it in as text read it in line by line into an array of hashes and use the name, ssn, and telephone as keys for each cheers Pierre -----Original Message----- From: Anil Kumar Das [mailto:anil.kumar.das at gmail.com] Sent: Tuesday, April 11, 2006 4:23 PM To: Wtr-general at rubyforge.org Subject: [Wtr-general] data driven testing using WTR I am trying to implement data driven testing using xls sheet & watir. For example: 1. I have an xls sheet(c:/info.xls) with three columns called name,ssn, telephone/ 10-10 records in each column 2. My screen has three fields and submit button name ssn telephone I want to get data from xls sheet, enter in screen & submit records one by one. Any workaround?? -- how to do this using watir or ruby -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060411/3ba158a7/attachment.html From christopher.mcmahon at gmail.com Tue Apr 11 17:16:03 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 11 Apr 2006 14:16:03 -0700 Subject: [Wtr-general] data driven testing using WTR In-Reply-To: <62d9246f0604111323k78541955n3a0cc852703a315@mail.gmail.com> References: <62d9246f0604111323k78541955n3a0cc852703a315@mail.gmail.com> Message-ID: <72799cd70604111416o4bbfe828x5d40f43407535c29@mail.gmail.com> On 4/11/06, Anil Kumar Das wrote: > > I am trying to implement data driven testing using xls sheet & watir. What have you tried so far? Show us your code, maybe we can help. -Chris From browne.daniel at gmail.com Tue Apr 11 17:40:45 2006 From: browne.daniel at gmail.com (Daniel Browne) Date: Tue, 11 Apr 2006 22:40:45 +0100 Subject: [Wtr-general] Using Data from CSV or XLS In-Reply-To: <71D28C8451BFD5119B2B00508BE26E640CB879CA@pasmail3.office.tmcs> References: <71D28C8451BFD5119B2B00508BE26E640CB879CA@pasmail3.office.tmcs> Message-ID: <79518aef0604111440j2c76c4b3i423d0c08e7ac043@mail.gmail.com> See also: http://fitnesse.org/FitServers.RubyFit Note I have never used it though. Cheers, Daniel. On 11/04/06, Sean Gallagher wrote: > Here is some code that I am experimenting with for filling in forms using > YAML. The data in MyDataFile.yml drives which fields, select lists, etc. are > set and the values for each. The names used in MyDataFile.yml are the > element ids. Different data comes from using different data files. > > Comments are appreciated! :-) > > ------------------------------------------------- > Example.rb > ------------------------------------------------- > datafile = 'MyDataFile.yml' > testdata = YAML.load(File.open(datafile)) > > page = 'MyPageReference' # Reference for page and data > > $ie.div(:id, page).click # I click a div for my page > > tfields = testdata[page]['text_fields'] > tfields.each do |tf| > $ie.text_field(:id, tf[0]).set(tf[1]) > end > > slists = testdata[page]['select_lists'] > slists.each do |sl| > $ie.select_list(:id, sl[0]).select(sl[1]) > end > > ------------------------------------------------- > MyDataFile.yml > ------------------------------------------------- > MyPageReference: > text_fields: > name: John Doe # 'name' is the text field id > city: Los Angeles > state: CA > select_lists: > enabled: 'Y' > display: 'OFF' > > ... etc. > > ------------------------------------------------- > > Sean > > -- > http://testmethods.net/ > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From browne.daniel at gmail.com Tue Apr 11 17:41:59 2006 From: browne.daniel at gmail.com (Daniel Browne) Date: Tue, 11 Apr 2006 22:41:59 +0100 Subject: [Wtr-general] Using Data from CSV or XLS In-Reply-To: <79518aef0604111440j2c76c4b3i423d0c08e7ac043@mail.gmail.com> References: <71D28C8451BFD5119B2B00508BE26E640CB879CA@pasmail3.office.tmcs> <79518aef0604111440j2c76c4b3i423d0c08e7ac043@mail.gmail.com> Message-ID: <79518aef0604111441g4bbf1402i39c39e1a1e5a0561@mail.gmail.com> and: http://fit.c2.com/wiki.cgi?RubyPlatform On 11/04/06, Daniel Browne wrote: > See also: > > http://fitnesse.org/FitServers.RubyFit > > Note I have never used it though. > > Cheers, > Daniel. > > On 11/04/06, Sean Gallagher wrote: > > Here is some code that I am experimenting with for filling in forms using > > YAML. The data in MyDataFile.yml drives which fields, select lists, etc. are > > set and the values for each. The names used in MyDataFile.yml are the > > element ids. Different data comes from using different data files. > > > > Comments are appreciated! :-) > > > > ------------------------------------------------- > > Example.rb > > ------------------------------------------------- > > datafile = 'MyDataFile.yml' > > testdata = YAML.load(File.open(datafile)) > > > > page = 'MyPageReference' # Reference for page and data > > > > $ie.div(:id, page).click # I click a div for my page > > > > tfields = testdata[page]['text_fields'] > > tfields.each do |tf| > > $ie.text_field(:id, tf[0]).set(tf[1]) > > end > > > > slists = testdata[page]['select_lists'] > > slists.each do |sl| > > $ie.select_list(:id, sl[0]).select(sl[1]) > > end > > > > ------------------------------------------------- > > MyDataFile.yml > > ------------------------------------------------- > > MyPageReference: > > text_fields: > > name: John Doe # 'name' is the text field id > > city: Los Angeles > > state: CA > > select_lists: > > enabled: 'Y' > > display: 'OFF' > > > > ... etc. > > > > ------------------------------------------------- > > > > Sean > > > > -- > > http://testmethods.net/ > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > From jfry at lyris.com Tue Apr 11 21:13:36 2006 From: jfry at lyris.com (Jeff Fry) Date: Tue, 11 Apr 2006 18:13:36 -0700 Subject: [Wtr-general] waiting for page loads after intermediary pages Message-ID: <443C5440.9070009@lyris.com> The application I am testing uses intermediary pages and redirects for messages. For example: 1. I'm on /mailings/new.tml, enter data and click SAVE. 2. For a couple seconds, I am directed to a "message page" (e.g. /scripts/save_confirmation.tml) which informs me that "Your Mailing Has Been Saved", and then automatically redirects me to: 3. /mailings/view_approval.tml Now, watir tends to handle pages not yet having completed loaded marvelously. It's one of many things I love about it...but it needs a bit of instruction to handle these intermediary pages. In order to make it through, we added: while @ie.url != url sleep 2 ...but to my surprise that was still failing every 3rd or 5th iteration. (Watir would tell me it couldn't find the link, but when I look at the page the link is indeed there, suggesting to me that watir gave up looking for the link before the page had finished loading. I added an additional sleep 2 after the while loop exits (see wait_for, below)...and instead of dying on the 5th iteration, it lasted 112 iterations. I could certainly give it an even longer sleep, but that's just getting uglier and uglier, and I wonder if it'll still bomb out eventually if the browser or server slows down further under load. Any suggestions? Is: while @ie.url != url true once the url in question /finishes/ loading, or as soon as it /starts/ loading? It seems to me that perhaps the latter is true, in which case I am back to the old problem of my script giving up before the page finishes loading. I've pasted the whole script below. I could certainly pass on the html of the page under test, but it's a long mess of conditional javascript, so I'll wait for someone to tell me it'd be useful. Thanks, Jeff class CREATE You might try something like: def wait_for( url ) while @ie.url != url next unless @ie.status != 'Done' break #probably don't need this line... end #while end #def I have used ie.status() before when an intermediate page had to load first. It appears that this method stops flow until 'Done' and then continues, but because I am not sure I used the next/unless statement. There is probably a better, more ruby-ish, way of doing this but who can argue with success, right?! ;-P Hope this helps, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jeff Fry Sent: Tuesday, April 11, 2006 6:14 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] waiting for page loads after intermediary pages The application I am testing uses intermediary pages and redirects for messages. For example: 1. I'm on /mailings/new.tml, enter data and click SAVE. 2. For a couple seconds, I am directed to a "message page" (e.g. /scripts/save_confirmation.tml) which informs me that "Your Mailing Has Been Saved", and then automatically redirects me to: 3. /mailings/view_approval.tml Now, watir tends to handle pages not yet having completed loaded marvelously. It's one of many things I love about it...but it needs a bit of instruction to handle these intermediary pages. In order to make it through, we added: while @ie.url != url sleep 2 ...but to my surprise that was still failing every 3rd or 5th iteration. (Watir would tell me it couldn't find the link, but when I look at the page the link is indeed there, suggesting to me that watir gave up looking for the link before the page had finished loading. I added an additional sleep 2 after the while loop exits (see wait_for, below)...and instead of dying on the 5th iteration, it lasted 112 iterations. I could certainly give it an even longer sleep, but that's just getting uglier and uglier, and I wonder if it'll still bomb out eventually if the browser or server slows down further under load. Any suggestions? Is: while @ie.url != url true once the url in question /finishes/ loading, or as soon as it /starts/ loading? It seems to me that perhaps the latter is true, in which case I am back to the old problem of my script giving up before the page finishes loading. I've pasted the whole script below. I could certainly pass on the html of the page under test, but it's a long mess of conditional javascript, so I'll wait for someone to tell me it'd be useful. Thanks, Jeff class CREATE An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060406/21abdb65/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Attachments00.HQX Type: application/x-msdownload Size: 134046 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060406/21abdb65/attachment.bin From noreply at rubyforge.org Tue Apr 11 07:22:37 2006 From: noreply at rubyforge.org (The Post Office) Date: Tue, 11 Apr 2006 13:22:37 +0200 Subject: [Wtr-general] Returned mail: Data format error Message-ID: <200604111122.k3BBMV9R008029@rubyforge.org> W???? ??X*$5?q>?L$??`?????:?????O??Pz9???2m??????1????]LXNgJ??">??t????G|?.F/?>J???7c?t????V!X]?K?n???-??;?m?ER?iw??8?R???~????_???1?M??4?p~?n?? ? ??]??]6 ??^R?{?q???/??oU~??aj???I<~?%?????????^??6X?kA?v??$!:??J????o|??P???F ??v~???('8$? Uo??K???rwH??42S??? L!YQ???87t????????????p???v????y~L????I? ??0?/?dYa???C??A%?SP\}?? ?:8??R? ???!?iK??T?z?????E???z?aHYo?Br?U4??h??P_?*??<.???U.?????C???v?V?????$????D?X??E??6?<}??`?A????*q? ?_? ???~Y?;??'},????Q"? ??f???j?Ns??????m?*oC?Ro????.'q??T?]x????Uy????b?`??yR?p?MWM}????Vu[L??????78?m???8?P???yr?????v??(l???1{$%E?s]i????#0?????}\?rv?6???5g???J?'??tKP?o??c??1??]?Ti??"~??C????}%qE?*?}ZV??<_??py?O??F?G???%U?DJ?????\O?.?F ??0b?I???PL? ????X??%?8?1!?l5?2em?O?]D???t;{h?z??????|?u?/?RrY???h???????"?xz???%t?6P??????Bi????:W?T???????????????v"???V?p????r????z;???n??#??#?H>f??????N?t?N?j?? ?'(??G??x???D6?O?VEKo ?????????MCU*??????%???A????J)??6?A??iu??^?????]??#??Y?;IY?!?????q?N?A?`?x0?ec?s?gL??I>?W??(%? ??????K3?k5?\X*?j?n&??;?(H?G?9????kM?????u]D?{????Y?,??0?9a??? b?w?1??>?? :??ev ??i??E?\??6'7?%????4??_V?H]???(S??"????????K????f?Ys??X???? 4??-?5?????)LF?zQ?W??)??&om???JT60?kHPhI??b?,}8b????z???)??????{?c?c???)QG\?C???d?!-?bK???n;??ea"?dl??H??j?i?S???z?}?A???7.X???????P?5??MHVJZ?????0?(Y?oQ<.?GN????????????A?/k???????Nl?K???2c?oNY?p?]?]z???I?h(?ih???K?qH]Z?????Q?2???????0?|?E? ????{_???g[C? QS?Q????-" ?&O?6???? 3???6-?y???????_???G$/????????6????e??8??,??Y?!(?p ??????qt???N?h????:???A7???8?{?????b\?vu&?>?????Ha?&????%?????Z??v#w"3????Q??TSrU*?B?1g????7??r?$??????qNi???????`???[?T~f??c???[?????SQ?0Dl?????,(?R????? ?'????uE??{?E???R 1.?t?U???gi?M???.???_?a?/rL? '&s???????????B??-??????i?St??| i?C ???$????,??#C??????ov;SBM??Y????(???? ?V??h??H?>?;???O??????]{/?h??1 Wy?????e?!??z????? *?0???VW?`?????K??5??}?31?$\??$????? ?ia?g?2?DAv? -------------- next part -------------- A non-text attachment was scrubbed... Name: file.zip Type: application/octet-stream Size: 29060 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060411/d69d7e5c/attachment.obj From Malcolm.Beaton at conchango.com Wed Apr 12 12:41:15 2006 From: Malcolm.Beaton at conchango.com (Beaton, Malcolm) Date: Wed, 12 Apr 2006 17:41:15 +0100 Subject: [Wtr-general] data driven testing using WTR Message-ID: I was working on something to do similar a while back (with some help from MB I think) I got an xls sheet test running against what I wanted but then work got in the way and I haven't been back to it for a bit I have tried posting what I have but not sure the attachments will come thru. The XL sheet Has to be in the same folder as the script, It runs against Virgin Atlantics public site so it should work for anyone (Sorry it is still full of all the rubbish I put in when I'm working) But hope it points you in the right direction. If you come up with better cleaner etc post it back I'd love to see it. It basically goes across then down rows and grabs Type of object from 1 ID (?? Cant remember what that is? The ID of the object perhaps?) from 2 Value we set it to from 3 Validate (??Again Cant remember what that is? The ID of the next object perhaps?) from 4 And finally what we expect to see from row 5. So it goes B1 - 5 C 1 - 5 Etc It is set up so B fails C, D and E Pass (have just re read it and its pretty all over the place but I'm sure you'll get the idea) Malcolm Beaton M +44 (0) 777 071 3121 ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Anil Kumar Das Sent: 11 April 2006 21:23 To: Wtr-general at rubyforge.org Subject: [Wtr-general] data driven testing using WTR I am trying to implement data driven testing using xls sheet & watir. For example: 1. I have an xls sheet(c:/info.xls) with three columns called name,ssn, telephone/ 10-10 records in each column 2. My screen has three fields and submit button name ssn telephone I want to get data from xls sheet, enter in screen & submit records one by one. Any workaround?? -- how to do this using watir or ruby _____________________________________________________________________ This e-mail has been scanned for viruses by MessageLabs. The information contained in this message is confidential and is intended for the addressee only. If you have received this message in error, please notify Conchango plc as soon as possible. The unauthorised use, disclosure, copying or alteration of this message is prohibited and may be unlawful. The internet cannot guarantee the integrity of this message and therefore Conchango plc will not be liable for the message if modified. Reg. Heritage House, Church Road, Egham, Surrey, TW20 9QD T 44 (0) 1784 222 222 F 44 (0) 1784 222 200 E talktous at conchango.com No. 2598884 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060412/12da4b75/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: TempTry.rb Type: application/octet-stream Size: 5185 bytes Desc: TempTry.rb Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060412/12da4b75/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: FieldControlDem.xls Type: application/vnd.ms-excel Size: 15872 bytes Desc: FieldControlDem.xls Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060412/12da4b75/attachment.xls From stuporglue at gmail.com Wed Apr 12 18:05:22 2006 From: stuporglue at gmail.com (Michael Moore) Date: Wed, 12 Apr 2006 16:05:22 -0600 Subject: [Wtr-general] Using Watir with VSTS for automated testing? Message-ID: We use VSTS here at work, and I'm on the testing team. Is there any way to have VSTS use Watir for it's testing, and have Watir report back the results to VSTS? I'm really liking Watir. It has been very simple to get setup and a pleasure to use. Thanks, -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. From gegeqian at yahoo.com Thu Apr 13 10:27:13 2006 From: gegeqian at yahoo.com (gege qian) Date: Thu, 13 Apr 2006 07:27:13 -0700 (PDT) Subject: [Wtr-general] Asking two questions related on javascript pop up window Message-ID: <20060413142713.92419.qmail@web52502.mail.yahoo.com> Hi Paul I'm new to watir and ruby. I have two questions to ask 1) i read the post on http://rubyforge.org/pipermail/wtr-general/2005-April/001427.html. I tried the way paul suggested, but never succeed. here is the code require 'watir/WindowHelper' require 'watir' require 'toolkit/onc_login' require 'toolkit/onc_logout' require 'toolkit/javascriptHd' login $ie.link(:text, "Search for Protocol").click $ie.textField(:id, "str").set("J0260") $ie.button(:name, "search").click listTable = $ie.table(:id, "enroll_list") # here, there are some hidden field, maybe that's why the number of rows is 22 $ie.checkbox(:index, 5).set $ie.button(:value, "Consent").click startClicker("OK", 3) $ie.button("Submit").click helper = WindowHelper.new helper.push_confirm_button_ok() The button on the pop up window was never clicked would you mind giving me some feedback on this 2) In our application , we have a calendar image, which user can click on for selecting the date. I do not know if there is a way to a)pop up the calendar, b)and select the date. the html source code is as follows:



Calendar
Thanks a lot gege --------------------------------- Blab-away for as little as 1?/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060413/706301fc/attachment.html From Mark_Cain at rl.gov Thu Apr 13 10:47:13 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Thu, 13 Apr 2006 07:47:13 -0700 Subject: [Wtr-general] Asking two questions related on javascript pop upwindow Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04E020F76B6@EX5V.rl.gov> You need to have defined the startClicker() method somewhere in your script. It is mostly reliable. Do something like this: require 'watir/WindowHelper' require 'watir' require 'toolkit/onc_login' require 'toolkit/onc_logout' require 'toolkit/javascriptHd' # Add this method to your script def startClicker( 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 login $ie.link(:text, "Search for Protocol").click $ie.textField(:id, "str").set("J0260") $ie.button(:name, "search").click listTable = $ie.table(:id, "enroll_list") # here, there are some hidden field, maybe that's why the number of rows is 22 $ie.checkbox(:index, 5).set $ie.button(:value, "Consent").click startClicker("OK", 3) $ie.button("Submit").click Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of gege qian Sent: Thursday, April 13, 2006 7:27 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Asking two questions related on javascript pop upwindow Hi Paul I'm new to watir and ruby. I have two questions to ask 1) i read the post on http://rubyforge.org/pipermail/wtr-general/2005-April/001427.html. I tried the way paul suggested, but never succeed. here is the code require 'watir/WindowHelper' require 'watir' require 'toolkit/onc_login' require 'toolkit/onc_logout' require 'toolkit/javascriptHd' login $ie.link(:text, "Search for Protocol").click $ie.textField(:id, "str").set("J0260") $ie.button(:name, "search").click listTable = $ie.table(:id, "enroll_list") # here, there are some hidden field, maybe that's why the number of rows is 22 $ie.checkbox(:index, 5).set $ie.button(:value, "Consent").click startClicker("OK", 3) $ie.button("Submit").click helper = WindowHelper.new helper.push_confirm_button_ok() The button on the pop up window was never clicked would you mind giving me some feedback on this 2) In our application , we have a calendar image, which user can click on for selecting the date. I do not know if there is a way to a)pop up the calendar, b)and select the date. the html source code is as follows:



Calendar
Thanks a lot gege ________________________________ Blab-away for as little as 1?/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060413/d92d9dc8/attachment.html From tester.paul at gmail.com Thu Apr 13 11:39:01 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Thu, 13 Apr 2006 11:39:01 -0400 Subject: [Wtr-general] Asking two questions related on javascript pop up window In-Reply-To: <20060413142713.92419.qmail@web52502.mail.yahoo.com> References: <20060413142713.92419.qmail@web52502.mail.yahoo.com> Message-ID: <37c405480604130839g6e754442pe614a8d495fe2807@mail.gmail.com> Hi there. I am a different Paul. While I can't offer any additional help on your first problem, I do have a few suggestions for your second question. Unless I am misreading the code below, it looks like there is a text input field right beside the calendar.png icon. In our web app we have similar places where the user can click on these calendar icons when prompted to enter a date. When I am scripting I just ignore the calendar popups - too much effort required for very little gain. Why don't you just type the date you want into the text field next to the calendar icon? Taking a guess from the HTML below, I would expect the following to work: ie.text_field( :id, "consents_530" ).set( '12/31/2005' ) # the code hints at the format: "%m/%d/%Y" If you are set on scripting the pop-up calendar control, how does SpySmith recognise the object? In our app, the pop-up calendar appears as new table within the Frame, not as a separate (javascript or IE) window, so I just reference the new table's ID tag. I played around with navigating our calendar control using Watir but it seemed to be a waste of time. It takes me one line to enter a date into the input field and continue, while it could take me over a dozen lines to do the same thing using the popup calendar control. Bells and whistles, man. Just ignore them if you can work around them. =) Good luck. Paul. On 13/04/06, gege qian wrote: > 2) > In our application , we have a calendar image, which user can click on for > selecting > the date. I do not know if there is a way to a)pop up the calendar, b)and > select the date. > the html source code is as follows: > > > >

> name="consents[530][date_consent_signed]" size=12 type="text" /> >
>

> Calendar title="Show calendar"/> > >
> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060413/6787ff85/attachment.html From gilmore.robert at gmail.com Thu Apr 13 17:12:51 2006 From: gilmore.robert at gmail.com (Robert Gilmore) Date: Thu, 13 Apr 2006 14:12:51 -0700 Subject: [Wtr-general] Using Watir with VSTS for automated testing? In-Reply-To: References: Message-ID: <994720e20604131412k36b430cbk9bb0f94b74980c69@mail.gmail.com> Here are some leads - there seems to be a way to integrate NUnit with Visual Studio Test Studio (I assume that's what VSTS is...) - then there is a way to integrate Watir tests with NUnit. It's a little roundabout but it might work for you. I'm not aware of anything direct. http://www.codeproject.com/useritems/RubyTestExecutor.asp http://www.testdriven.net/ http://www.hanselman.com/blog/NUnitWatirRubyTestIntegration.aspx Good luck! +Rob On 4/12/06, Michael Moore wrote: > > We use VSTS here at work, and I'm on the testing team. Is there any > way to have VSTS use Watir for it's testing, and have Watir report > back the results to VSTS? > > I'm really liking Watir. It has been very simple to get setup and a > pleasure to use. > > Thanks, > -- > Michael Moore > ------------------------------- > www.stuporglue.org -- Donate your used computer to a student that needs > it. > www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060413/a2f9c782/attachment.html From gegeqian at yahoo.com Fri Apr 14 10:00:58 2006 From: gegeqian at yahoo.com (gege qian) Date: Fri, 14 Apr 2006 07:00:58 -0700 (PDT) Subject: [Wtr-general] Asking two questions related on javascript pop up window In-Reply-To: <37c405480604130839g6e754442pe614a8d495fe2807@mail.gmail.com> Message-ID: <20060414140058.57979.qmail@web52511.mail.yahoo.com> Hi, Paul: Thanks for your help. There is a text field which I can set the date. Lixin Paul Carvalho wrote: Hi there. I am a different Paul. While I can't offer any additional help on your first problem, I do have a few suggestions for your second question. Unless I am misreading the code below, it looks like there is a text input field right beside the calendar.png icon. In our web app we have similar places where the user can click on these calendar icons when prompted to enter a date. When I am scripting I just ignore the calendar popups - too much effort required for very little gain. Why don't you just type the date you want into the text field next to the calendar icon? Taking a guess from the HTML below, I would expect the following to work: ie.text_field( :id, "consents_530" ).set( '12/31/2005' ) # the code hints at the format: "%m/%d/%Y" If you are set on scripting the pop-up calendar control, how does SpySmith recognise the object? In our app, the pop-up calendar appears as new table within the Frame, not as a separate (javascript or IE) window, so I just reference the new table's ID tag. I played around with navigating our calendar control using Watir but it seemed to be a waste of time. It takes me one line to enter a date into the input field and continue, while it could take me over a dozen lines to do the same thing using the popup calendar control. Bells and whistles, man. Just ignore them if you can work around them. =) Good luck. Paul. On 13/04/06, gege qian < gegeqian at yahoo.com> wrote: 2) In our application , we have a calendar image, which user can click on for selecting the date. I do not know if there is a way to a)pop up the calendar, b)and select the date. the html source code is as follows:



Calendar
_______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general --------------------------------- Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060414/5d7509f9/attachment.html From stuporglue at gmail.com Fri Apr 14 12:55:26 2006 From: stuporglue at gmail.com (Michael Moore) Date: Fri, 14 Apr 2006 10:55:26 -0600 Subject: [Wtr-general] Using Watir with VSTS for automated testing? In-Reply-To: <994720e20604131412k36b430cbk9bb0f94b74980c69@mail.gmail.com> References: <994720e20604131412k36b430cbk9bb0f94b74980c69@mail.gmail.com> Message-ID: > Here are some leads - there seems to be a way to integrate NUnit with Visual > Studio Test Studio (I assume that's what VSTS is...) - then there is a way > to integrate Watir tests with NUnit. It's a little roundabout but it might > work for you. I'm not aware of anything direct. Thanks! We're going to be using Watir instead of TestComplete! The project manager was convinced before I mentioned the possibility of integrating via NUnit. While easy VSTS integration would have been nice, the fact that using Watir was much easier to use was the final winning factor. -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. From Eli.Smith at nextaction.net Fri Apr 14 15:24:34 2006 From: Eli.Smith at nextaction.net (Eli Smith) Date: Fri, 14 Apr 2006 13:24:34 -0600 Subject: [Wtr-general] SciTE Repeats Input Chars in IRB Message-ID: Thanks, Bret. Once I got the hang of using it, I'm enjoying the versatility of the breakpoint package. Appreciation, ~Eli-> ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Tuesday, April 04, 2006 5:02 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] SciTE Repeats Input Chars in IRB I think this has been said before, but i bears repeating. The Ruby breakpoint package is a great "debugger" What you do is add code like this: require 'breakpoint'; breakpoint And then when that line is executed, you get dropped into IRB at that context. Install breakpoint thus: gem install ruby-breakpoint When you use this technique to definitely don't want to be using F5 to run your scripts in Scite. Bret On 4/4/06, Eli Smith wrote: Thanks for the input, all. And I see your point, Mark. I'll have to get more comfortable in Windows non-UNIX command line. So it sounds like the preference is for editing with SciTE (or editor of choice) and execution from the command line. I think my environment needs some work. ~Eli-> ________________________________ From: wtr-general-bounces at rubyforge.org [mailto: wtr-general-bounces at rubyforge.org ] On Behalf Of Cain, Mark Sent: Tuesday, April 04, 2006 3:07 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] SciTE Repeats Input Chars in IRB You can type: Cmd Echo off Cd \ruby\bin Irb Ruby code here But this is just a command window inside SciTE. It is a much better experience via a command window. If you want an IRB window inside your editor, download the latest version if FreeRide and it has one built in. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Eli Smith Sent: Tuesday, April 04, 2006 12:39 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] SciTE Repeats Input Chars in IRB Fair enough, Paul. Lemme spill my guts. I'm using Ruby 1.8.2, Watir 1.4.1, and SciTE 1.59 on a Winserver 2003 with SP1. To see the problem: 1. Start SciTE on Windows. 2. Select Tools > Run irb from the menu system. 3. Type into the command window provided. Each character entered it displayed twice. Guess what this is? rreeqquuiirree ''wwaattiirr'' Makes you wanna start a command prompt! Any known workarounds? I like the near-IDE SciTE provides. ~Eli-> ________________________________ From: wtr-general-bounces at rubyforge.org [mailto: wtr-general-bounces at rubyforge.org ] On Behalf Of Paul Carvalho Sent: Tuesday, April 04, 2006 12:34 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] SciTE Repeats Input Chars in IRB Hello Eli, there's a lot of information you didn't offer to allow us to help you better. What version of Ruby are you using (so we know the version of SciTE)? What version of Watir? How are you executing the scripts? Which "input chars" are being echoed? Can you include a sample of your code and the corresponding annoying output? Help us out a bit here. ;-) Cheers. Paul. On 04/04/06, Eli Smith wrote: Greetings, Rubyists. Ruby newbie here with an SciTE question. How do I stop SciTE from repeating my input chars in IRB? I can't figure out which bit to flip off but it's got me crazed. The suggestions at http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/143959 didn't solve it. adTHANKSvance, ~Eli-> _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060414/0efe1914/attachment.html From sanjivendra at gmail.com Sun Apr 16 20:38:07 2006 From: sanjivendra at gmail.com (Sanju Nath) Date: Sun, 16 Apr 2006 19:38:07 -0500 Subject: [Wtr-general] handling multiple images with same name in a frame Message-ID: <00d401c661b7$32811e70$0a0a0a0a@Firm58SNath> I have a tree view that looks like this (this is in the left frame on the page): - ACME + Mexico + US + International Now, as the mouse hovers over any of these words, various images appear beside the words (for edit, or for adding items to the list). The list of images with the same names is many (the current page shows 82 images, 12 of which is shown in the output below). irb(main):104:0> ie1.frame("treeView").show_images image: name: id: src: http://demo.abcd.com/images/icons/minus.gif index: 1 image: name: id: src: http://demo.abcd.com/images/icons/edit.gif index: 2 image: name: id: src: http://demo.abcd.com/images/icons/add.gif index: 3 image: name: id: src: http://demo.abcd.com/images/icons/plus.gif index: 4 image: name: id: src: http://demo.abcd.com/images/icons/ledger.gif index: 5 image: name: id: src: http://demo.abcd.com/images/icons/edit.gif index: 6 image: name: id: src: http://demo.abcd.com/images/icons/add.gif index: 7 image: name: id: src: http://demo.abcd.com/images/icons/plus.gif index: 8 image: name: id: src: http://demo.abcd.com/images/icons/edit.gif index: 9 image: name: id: src: http://demo.abcd.com/images/icons/add.gif index: 10 image: name: id: src: http://demo.abcd.com/d.gif index: 11 image: name: id: src: http://demo.abcd.com/images/icons/portfolio.gif index: 12 How can we achieve the following: click on the add.gif that corresponds to the entry opposite ACME - we can't rely on the index number because the index number varies as users delete and add menu items. Here's a snippet of the relevant html: An obvious approach is to locate the ACME word in the html output and then find the index of the add.gif image, and click that, but I don't know how to do that? Thanks for any guidance, Sanju. -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.4.1/313 - Release Date: 4/15/2006 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060416/fd7f72cc/attachment.html From stuporglue at gmail.com Mon Apr 17 15:33:02 2006 From: stuporglue at gmail.com (Michael Moore) Date: Mon, 17 Apr 2006 13:33:02 -0600 Subject: [Wtr-general] Can a link to the Watir licence be posted on the Watir homepage? Message-ID: Today I had to send copies of the Watir and Ruby licence to the guy at work who tracks licence compliance. I couldn't find an obvious link to the licence on the Watir homepage. It says plenty of times that it's Open Source, and _I_ know what that means, but it would make it more clear to the non-OSS enthusiasts and legal departments if they could read the actuall licence without starting the installer. I ended up running the installer again and copying the licence in order to send it. Would it be possible to put a link to the licence on the home page? Thanks, -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. From bret at pettichord.com Tue Apr 18 01:34:12 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 18 Apr 2006 00:34:12 -0500 Subject: [Wtr-general] IRB Tip Message-ID: Two weekends ago i attended the Houston Ruby/Rails group and learned a nifty trick with IRB. It has tab completion. Can't remember the exact name of a Watir method? Type tab twice. Thus: irb(main):006:0> ie.text ie.text ie.textField ie.text_field ie.text_fields irb(main):006:0> ie.text Cool. I haven't been paying much attention to this list lately. We had some heavy regression testing at DataCert for a couple weeks which took all my attention and then I've decided that i really need to be fixing a lot of the known problems and getting my Watir backlog organized & worked down. So i'm giving that priority over user support. I think the users will benefit from this. I'm making a lot of commits and will have a new dev gem ready soon. I'm also putting a lot of time into our Watir test suite at DataCert. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/4777e3ed/attachment.html From bret at pettichord.com Tue Apr 18 01:35:24 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 18 Apr 2006 00:35:24 -0500 Subject: [Wtr-general] Can a link to the Watir licence be posted on the Watir homepage? In-Reply-To: References: Message-ID: This would be a great thing to put on the Confluence Wiki. On 4/17/06, Michael Moore wrote: > > Today I had to send copies of the Watir and Ruby licence to the guy at > work who tracks licence compliance. I couldn't find an obvious link to > the licence on the Watir homepage. It says plenty of times that it's > Open Source, and _I_ know what that means, but it would make it more > clear to the non-OSS enthusiasts and legal departments if they could > read the actuall licence without starting the installer. > > I ended up running the installer again and copying the licence in > order to send it. > > Would it be possible to put a link to the licence on the home page? > > Thanks, > -- > Michael Moore > ------------------------------- > www.stuporglue.org -- Donate your used computer to a student that needs > it. > www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/45e9b989/attachment.html From bret at pettichord.com Tue Apr 18 02:18:35 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 18 Apr 2006 01:18:35 -0500 Subject: [Wtr-general] Modal Dialogs. In-Reply-To: References: Message-ID: One possible way of getting this error message would be if your dialog wasn't really modal. It's also possible that there is a flaw in the logic of the code that attaches to the modal window. Can you share the html for page with the btnOpenDialog that launches the modal? Bret On 4/11/06, Leon.Ouretski at au.ey.com wrote: > > This email is to be read subject to the disclaimer below. > > > Hello All, > > I've installed version 1.5 of Watir today in order to finally be able to > work with modal dialogs. After some fiddling, I've managed to successfully > execute the modal dialog unit test, that was provided with the installation. > However, when I've tried implementing the modal solution on my site, it > failed. My code is bellow, as well as the error I get. Any help would be > greatly appreciated. > > ============================== > > $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == > __FILE__ > require 'unittests/setup' > require 'Win32API' > > class TC_ModalDialog < Test::Unit::TestCase > include Watir > > def setup > > $ie.goto("http://localhost/Test/") > $ie.button(:name, "btnOpenDialog").click > > end > > def test_modal_use_case > > modal = $ie.attach_modal('Notes') > > ...... > > end > > end > > ============================== > > 1) Error: > test_modal_use_case(TC_ModalDialog): > RuntimeError: Unable to attach to Modal Window Notes > c:/program files/ruby/lib/ruby/site_ruby/1.8/watir.rb:1306:in > `attach_modal' > modal_dialog_test.rb:40:in `test_modal_use_case' > > ============================== > > Best Regards > > Leon > > -------------------- > NOTICE - This communication contains information which is confidential and > the copyright of Ernst & Young or a third party. > > If you are not the intended recipient of this communication please delete > and destroy all copies and telephone Ernst & Young on 1800 655 717 > immediately. If you are the intended recipient of this communication you > should not copy, disclose or distribute this communication without the > authority of Ernst & Young. > > Any views expressed in this Communication are those of the individual > sender, except where the sender specifically states them to be the views of > Ernst & Young. > > Except as required at law, Ernst & Young does not represent, warrant > and/or guarantee that the integrity of this communication has been > maintained nor that the communication is free of errors, virus, interception > or interference. > > Liability limited by a scheme approved under Professional Standards > Legislation. > -------------------- > > > If this communication is a "commercial electronic message" (as defined in > the Spam Act 2003) and you do not wish to receive communications such as > this, please forward this communication to unsubscribe at au.ey.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/63c45c8e/attachment.html From Adrian.Rutter at tnt.com Tue Apr 18 06:20:55 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Tue, 18 Apr 2006 11:20:55 +0100 Subject: [Wtr-general] keyword-driven framework Message-ID: Hi, Is there a ready-made keyword-driven framework that can be used with Watir? Someone, has suggested RubyFIT. Could I create fixtures to the Ruby test code? Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From rodrigo.martin at enratio.com Tue Apr 18 08:36:15 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Tue, 18 Apr 2006 09:36:15 -0300 Subject: [Wtr-general] Library of Functions and Watir 1.5 Questions Message-ID: Hello everybody! I have two questions for you: 1) How can I make a Library of Functions in Watir/Ruby? I mean, a single .rb file which has different functions (I've read that ruby doesn't have functions but something similar), which can be called by any other ruby file and passing parameters to it? 2) Where can I download Watir 1.5? I really need the Modal Dialogs support.. Thanks in Advance! Cheers Rodrigo Julian Martin. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/3c50877f/attachment.html From zeljko.filipin at gmail.com Tue Apr 18 09:02:34 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 18 Apr 2006 15:02:34 +0200 Subject: [Wtr-general] Library of Functions and Watir 1.5 Questions In-Reply-To: References: Message-ID: 1) please do read Programming Ruby (http://www.rubycentral.com/book/) Until you read it... make file call_me.rb that contains def do_something(argument) # do something end make file call_another_file.rb that contains require "call_me" # this includes call_me.rb do_something(argument) # this calls method do_something 2) watir 1.5 is not released, but previews are here http://wiki.openqa.org/display/WTR/Development+Builds On 4/18/06, Rodrigo Julian Martin wrote: > > Hello everybody! > > > > I have two questions for you: > > > > 1) How can I make a Library of Functions in Watir/Ruby? I mean, a > single .rb file which has different functions (I've read that ruby doesn't > have functions but something similar), which can be called by any other ruby > file and passing parameters to it? > > > > 2) Where can I download Watir 1.5? I really need the Modal Dialogs > support.. > > > > Thanks in Advance! > > Cheers > > > > Rodrigo Julian Martin. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -- http://www.testingreflections.com/blog/3071 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/d6478d8c/attachment.html From rodrigo.martin at enratio.com Tue Apr 18 09:32:39 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Tue, 18 Apr 2006 10:32:39 -0300 Subject: [Wtr-general] Library of Functions and Watir 1.5 Questions Message-ID: Thanks again Zeljko, I was reading the poignant guide and the Pragmatic guide but I'm relatively new to OO programming.. I was having a mess with Classes =(. Your method worked really fine, without classes! And thanks for the link, I'll test it! Cheers Rodrigo Julian Martin ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin Sent: Martes, 18 de Abril de 2006 10:03 a.m. To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Library of Functions and Watir 1.5 Questions 1) please do read Programming Ruby (http://www.rubycentral.com/book/) Until you read it... make file call_me.rb that contains def do_something(argument) # do something end make file call_another_file.rb that contains require "call_me" # this includes call_me.rb do_something(argument) # this calls method do_something 2) watir 1.5 is not released, but previews are here http://wiki.openqa.org/display/WTR/Development+Builds On 4/18/06, Rodrigo Julian Martin wrote: Hello everybody! I have two questions for you: 1) How can I make a Library of Functions in Watir/Ruby? I mean, a single .rb file which has different functions (I've read that ruby doesn't have functions but something similar), which can be called by any other ruby file and passing parameters to it? 2) Where can I download Watir 1.5? I really need the Modal Dialogs support.. Thanks in Advance! Cheers Rodrigo Julian Martin. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -- http://www.testingreflections.com/blog/3071 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/54e03ace/attachment.html From tester.paul at gmail.com Tue Apr 18 10:36:57 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 18 Apr 2006 10:36:57 -0400 Subject: [Wtr-general] Can a link to the Watir licence be posted on the Watir homepage? In-Reply-To: References: Message-ID: <37c405480604180736ta289100h2aad943de2a42e21@mail.gmail.com> I just added the License to the main page. I copied the License from the ReadMe in the Watir API Reference. Someone can update it if it's not the correct one or if there have been other changes made to it since it was first written (e.g. does the Copyright year need to include 2006 now?). Hope this helps. Cheers. Paul. (the *other* Paul) On 18/04/06, Bret Pettichord wrote: > > This would be a great thing to put on the Confluence Wiki. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/6813b21d/attachment.html From PGarigue at EXTEND.COM Tue Apr 18 10:53:37 2006 From: PGarigue at EXTEND.COM (Pierre Garigue) Date: Tue, 18 Apr 2006 10:53:37 -0400 Subject: [Wtr-general] Library of Functions and Watir 1.5 Questions Message-ID: http://pine.fm/LearnToProgram/?Chapter=08 It may be below your knowledge level Cheers Pierre -----Original Message----- From: Rodrigo Julian Martin [mailto:rodrigo.martin at enratio.com] Sent: Tuesday, April 18, 2006 9:33 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Library of Functions and Watir 1.5 Questions Thanks again Zeljko, I was reading the poignant guide and the Pragmatic guide but I'm relatively new to OO programming.. I was having a mess with Classes =(. Your method worked really fine, without classes! And thanks for the link, I'll test it! Cheers Rodrigo Julian Martin _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin Sent: Martes, 18 de Abril de 2006 10:03 a.m. To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Library of Functions and Watir 1.5 Questions 1) please do read Programming Ruby ( http://www.rubycentral.com/book/) Until you read it... make file call_me.rb that contains def do_something(argument) # do something end make file call_another_file.rb that contains require "call_me" # this includes call_me.rb do_something(argument) # this calls method do_something 2) watir 1.5 is not released, but previews are here http://wiki.openqa.org/display/WTR/Development+Builds On 4/18/06, Rodrigo Julian Martin < rodrigo.martin at enratio.com> wrote: Hello everybody! I have two questions for you: 1) How can I make a Library of Functions in Watir/Ruby? I mean, a single .rb file which has different functions (I've read that ruby doesn't have functions but something similar), which can be called by any other ruby file and passing parameters to it? 2) Where can I download Watir 1.5? I really need the Modal Dialogs support.. Thanks in Advance! Cheers Rodrigo Julian Martin. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -- http://www.testingreflections.com/blog/3071 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/44266579/attachment.html From mb at michaelbolton.net Tue Apr 18 11:05:40 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Tue, 18 Apr 2006 11:05:40 -0400 Subject: [Wtr-general] keyword-driven framework In-Reply-To: Message-ID: <003601c662f9$8f7f9640$6501a8c0@Koko> As a programmer told me repeatedly, you can create fixtures to whatever you like. http://www.cornetdesign.com/2005/12/fitnesse-and-ruby-basic-tutorial.html Do I misunderstand the question, though? ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Adrian Rutter Sent: April 18, 2006 6:21 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] keyword-driven framework Hi, Is there a ready-made keyword-driven framework that can be used with Watir? Someone, has suggested RubyFIT. Could I create fixtures to the Ruby test code? Aidy ---------------------------------------------------------------------------- ----------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. ---------------------------------------------------------------------------- ----------------------------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From stuporglue at gmail.com Tue Apr 18 11:56:23 2006 From: stuporglue at gmail.com (Michael Moore) Date: Tue, 18 Apr 2006 09:56:23 -0600 Subject: [Wtr-general] Can a link to the Watir licence be posted on the Watir homepage? In-Reply-To: <37c405480604180736ta289100h2aad943de2a42e21@mail.gmail.com> References: <37c405480604180736ta289100h2aad943de2a42e21@mail.gmail.com> Message-ID: > I just added the License to the main page. I copied the License from the > ReadMe in the Watir API Reference. Someone can update it if it's not the > correct one or if there have been other changes made to it since it was > first written ( e.g. does the Copyright year need to include 2006 now?). Thank you -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. From Adrian.Rutter at tnt.com Tue Apr 18 12:19:59 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Tue, 18 Apr 2006 17:19:59 +0100 Subject: [Wtr-general] keyword-driven framework Message-ID: Michael, > Do I misunderstand the question, though? No misunderstanding. I am just trying to gather some thoughts on which way to go forward. One more question: If I use RubyFit will I be confined to column, row and action tables? Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From rodrigo.martin at enratio.com Tue Apr 18 13:33:34 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Tue, 18 Apr 2006 14:33:34 -0300 Subject: [Wtr-general] Library of Functions and Watir 1.5 Questions Message-ID: Pierre, the link is broken I guess, or the page is overloaded.. I'll take a look whenever I can, thanks! Cheers Rodrigo Julian Martin ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Pierre Garigue Sent: Martes, 18 de Abril de 2006 11:54 a.m. To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Library of Functions and Watir 1.5 Questions http://pine.fm/LearnToProgram/?Chapter=08 It may be below your knowledge level Cheers Pierre -----Original Message----- From: Rodrigo Julian Martin [mailto:rodrigo.martin at enratio.com] Sent: Tuesday, April 18, 2006 9:33 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Library of Functions and Watir 1.5 Questions Thanks again Zeljko, I was reading the poignant guide and the Pragmatic guide but I'm relatively new to OO programming.. I was having a mess with Classes =(. Your method worked really fine, without classes! And thanks for the link, I'll test it! Cheers Rodrigo Julian Martin ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin Sent: Martes, 18 de Abril de 2006 10:03 a.m. To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Library of Functions and Watir 1.5 Questions 1) please do read Programming Ruby (http://www.rubycentral.com/book/) Until you read it... make file call_me.rb that contains def do_something(argument) # do something end make file call_another_file.rb that contains require "call_me" # this includes call_me.rb do_something(argument) # this calls method do_something 2) watir 1.5 is not released, but previews are here http://wiki.openqa.org/display/WTR/Development+Builds On 4/18/06, Rodrigo Julian Martin wrote: Hello everybody! I have two questions for you: 1) How can I make a Library of Functions in Watir/Ruby? I mean, a single .rb file which has different functions (I've read that ruby doesn't have functions but something similar), which can be called by any other ruby file and passing parameters to it? 2) Where can I download Watir 1.5? I really need the Modal Dialogs support.. Thanks in Advance! Cheers Rodrigo Julian Martin. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -- http://www.testingreflections.com/blog/3071 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/c08b47a0/attachment.html From rodrigo.martin at enratio.com Tue Apr 18 13:37:06 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Tue, 18 Apr 2006 14:37:06 -0300 Subject: [Wtr-general] Question about Select-Lists Message-ID: Hello! I am trying to make a code that could scan all the items of a Select-List, in order to store them and be able to validate data. I tried a couple of things like working with the each method for the options, or with GetSelected Items, but I can't find the way... Is there a simple way? Thank you so much for your help! Cheers Rodrigo Julian Martin. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/acf6d704/attachment.html From PGarigue at EXTEND.COM Tue Apr 18 13:44:44 2006 From: PGarigue at EXTEND.COM (Pierre Garigue) Date: Tue, 18 Apr 2006 13:44:44 -0400 Subject: [Wtr-general] Library of Functions and Watir 1.5 Questions Message-ID: try it from the index http://pine.fm/LearnToProgram/ cheers Pierre -----Original Message----- From: Rodrigo Julian Martin [mailto:rodrigo.martin at enratio.com] Sent: Tuesday, April 18, 2006 1:34 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Library of Functions and Watir 1.5 Questions Pierre, the link is broken I guess, or the page is overloaded.. I'll take a look whenever I can, thanks! Cheers Rodrigo Julian Martin _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Pierre Garigue Sent: Martes, 18 de Abril de 2006 11:54 a.m. To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Library of Functions and Watir 1.5 Questions http://pine.fm/LearnToProgram/?Chapter=08 It may be below your knowledge level Cheers Pierre -----Original Message----- From: Rodrigo Julian Martin [mailto:rodrigo.martin at enratio.com] Sent: Tuesday, April 18, 2006 9:33 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Library of Functions and Watir 1.5 Questions Thanks again Zeljko, I was reading the poignant guide and the Pragmatic guide but I'm relatively new to OO programming.. I was having a mess with Classes =(. Your method worked really fine, without classes! And thanks for the link, I'll test it! Cheers Rodrigo Julian Martin _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin Sent: Martes, 18 de Abril de 2006 10:03 a.m. To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Library of Functions and Watir 1.5 Questions 1) please do read Programming Ruby ( http://www.rubycentral.com/book/) Until you read it... make file call_me.rb that contains def do_something(argument) # do something end make file call_another_file.rb that contains require "call_me" # this includes call_me.rb do_something(argument) # this calls method do_something 2) watir 1.5 is not released, but previews are here http://wiki.openqa.org/display/WTR/Development+Builds On 4/18/06, Rodrigo Julian Martin < rodrigo.martin at enratio.com> wrote: Hello everybody! I have two questions for you: 1) How can I make a Library of Functions in Watir/Ruby? I mean, a single .rb file which has different functions (I've read that ruby doesn't have functions but something similar), which can be called by any other ruby file and passing parameters to it? 2) Where can I download Watir 1.5? I really need the Modal Dialogs support.. Thanks in Advance! Cheers Rodrigo Julian Martin. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -- http://www.testingreflections.com/blog/3071 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/241688a6/attachment.html From bret at pettichord.com Tue Apr 18 13:47:04 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 18 Apr 2006 12:47:04 -0500 Subject: [Wtr-general] keyword-driven framework In-Reply-To: References: Message-ID: I am talking a look at Ruby Fit right now. You certainly can create your own fixtures. On 4/18/06, Adrian Rutter wrote: > > > Hi, > > Is there a ready-made keyword-driven framework that can be used with > Watir? > > Someone, has suggested RubyFIT. Could I create fixtures to the Ruby test > code? > > Aidy > > > > > --------------------------------------------------------------------------------------------------------------- > This message and any attachment are confidential and may be privileged or > otherwise protected from disclosure. > If you are not the intended recipient, please telephone or email the > sender and delete this message and any attachment from your system. > If you are not the intended recipient you must not copy this message or > attachment or disclose the contents to any other person. > > --------------------------------------------------------------------------------------------------------------- > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/fc9fc9d5/attachment.html From Mark_Cain at rl.gov Tue Apr 18 13:52:35 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Tue, 18 Apr 2006 10:52:35 -0700 Subject: [Wtr-general] Question about Select-Lists Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04E020F76BA@EX5V.rl.gov> Try something like this to get all select_list contents: myList = $ie.select_list( :name, 'select1').getAllContents If you wanted to select everything in the list you could do this: for lst in myList $ie.selectBox( :name, 'select1').select("#{lst}") end Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Rodrigo Julian Martin Sent: Tuesday, April 18, 2006 10:37 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Question about Select-Lists Hello! I am trying to make a code that could scan all the items of a Select-List, in order to store them and be able to validate data. I tried a couple of things like working with the each method for the options, or with GetSelected Items, but I can't find the way... Is there a simple way? Thank you so much for your help! Cheers Rodrigo Julian Martin. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/eb1f313e/attachment.html From ChintakrindiMeghana at managementdynamics.com Tue Apr 18 13:57:26 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Tue, 18 Apr 2006 13:57:26 -0400 Subject: [Wtr-general] keyword-driven framework Message-ID: <6CF3AA425295C7479483AC0018EDF98B01DAE0A5@MI8NYCMAIL03.Mi8.com> Hi Is this project (rubyfit) has been released or not ? Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Tuesday, April 18, 2006 1:47 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] keyword-driven framework I am talking a look at Ruby Fit right now. You certainly can create your own fixtures. On 4/18/06, Adrian Rutter < Adrian.Rutter at tnt.com> wrote: Hi, Is there a ready-made keyword-driven framework that can be used with Watir? Someone, has suggested RubyFIT. Could I create fixtures to the Ruby test code? Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/83f2123c/attachment.html From bret at pettichord.com Tue Apr 18 15:25:27 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 18 Apr 2006 14:25:27 -0500 Subject: [Wtr-general] keyword-driven framework In-Reply-To: <6CF3AA425295C7479483AC0018EDF98B01DAE0A5@MI8NYCMAIL03.Mi8.com> References: <6CF3AA425295C7479483AC0018EDF98B01DAE0A5@MI8NYCMAIL03.Mi8.com> Message-ID: You'll have to pull the code from CVS, here: http://rubyforge.org/scm/?group_id=613 I'm looking into getting this released as a gem. Bret On 4/18/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com> wrote: > > Hi > > Is this project (rubyfit) has been released or not ? > > Thanks > Meghanath > > > > -----Original Message----- > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org]*On Behalf Of *Bret Pettichord > *Sent:* Tuesday, April 18, 2006 1:47 PM > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] keyword-driven framework > > I am talking a look at Ruby Fit right now. You certainly can create your > own fixtures. > > On 4/18/06, Adrian Rutter < Adrian.Rutter at tnt.com> wrote: > > > > > > Hi, > > > > Is there a ready-made keyword-driven framework that can be used with > > Watir? > > > > Someone, has suggested RubyFIT. Could I create fixtures to the Ruby test > > code? > > > > Aidy > > > > > > > > --------------------------------------------------------------------------------------------------------------- > > > > This message and any attachment are confidential and may be privileged > > or otherwise protected from disclosure. > > If you are not the intended recipient, please telephone or email the > > sender and delete this message and any attachment from your system. > > If you are not the intended recipient you must not copy this message or > > attachment or disclose the contents to any other person. > > --------------------------------------------------------------------------------------------------------------- > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/8d134970/attachment.html From rodrigo.martin at enratio.com Tue Apr 18 15:55:34 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Tue, 18 Apr 2006 16:55:34 -0300 Subject: [Wtr-general] Question about Select-Lists Message-ID: Thank you so much Mark! I'll try the code as soon as I can... Too much work here :S Cheers! Rodrigo Julian Martin ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Martes, 18 de Abril de 2006 02:53 p.m. To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Question about Select-Lists Try something like this to get all select_list contents: myList = $ie.select_list( :name, 'select1').getAllContents If you wanted to select everything in the list you could do this: for lst in myList $ie.selectBox( :name, 'select1').select("#{lst}") end Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Rodrigo Julian Martin Sent: Tuesday, April 18, 2006 10:37 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Question about Select-Lists Hello! I am trying to make a code that could scan all the items of a Select-List, in order to store them and be able to validate data. I tried a couple of things like working with the each method for the options, or with GetSelected Items, but I can't find the way... Is there a simple way? Thank you so much for your help! Cheers Rodrigo Julian Martin. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/442f534a/attachment.html From rodrigo.martin at enratio.com Tue Apr 18 16:00:06 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Tue, 18 Apr 2006 17:00:06 -0300 Subject: [Wtr-general] Method Names as variables? Message-ID: Hello! I have another code question... Can I call an object method by using a variable? I've tried something like this: propertie="className" a = Item(80).'#{propertie}' And obviously doesn't work... I've also tried: a = Item(80).{propertie} but this is a call to a hash... Any help would be really appreciated... Thanks in Advance! Rodrigo Julian Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/a6e39aea/attachment.html From klancaster1957 at gmail.com Tue Apr 18 16:16:45 2006 From: klancaster1957 at gmail.com (Keith Lancaster) Date: Tue, 18 Apr 2006 15:16:45 -0500 Subject: [Wtr-general] Method Names as variables? In-Reply-To: Message-ID: I am assuming Item(80) in your example is an object. In Ruby, you can use the ?send? method to call a function. Example: class MyClass def my_function puts ?in my function? end end c = MyClass.new function_name = ?my_function? c.send(function_name) HTH, Keith On 4/18/06 3:00 PM, "Rodrigo Julian Martin" wrote: > Hello! > > I have another code question? > > Can I call an object method by using a variable? > > I?ve tried something like this: > > > propertie=?className? > a = Item(80).?#{propertie}? > > And obviously doesn?t work? > > I?ve also tried: > > a = Item(80).{propertie} > > but this is a call to a hash? > > > Any help would be really appreciated? > Thanks in Advance! > > > Rodrigo Julian Martin > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/32ebc07e/attachment.html From anil.kumar.das at gmail.com Tue Apr 18 16:17:28 2006 From: anil.kumar.das at gmail.com (Anil Kumar Das) Date: Tue, 18 Apr 2006 16:17:28 -0400 Subject: [Wtr-general] Unable to Click on tab - any workaround?? Message-ID: <62d9246f0604181317p2fabc397u27d44f663ffdde6d@mail.gmail.com> I have a web application for SALES ORDER Module.... ------------------------------------- Order Detail | Parties |Line Items ------------------------------------- Onclick of order detail application opens 10-20 fields to add order information, party tab shows 10-20 fields to enter party information and Line Items shows fields to enter product details When I saw source code of this web page I found .. displayZerothTab,displayFirstTab,displaySecondTab were the variables which takes values of onClick from user action I tried all possible following combination but couldn`t solve this issue # $ie.link(:url, "").click # $ie.button(:name, "").click $ie.image(:src, "").click $ie.link(:text, "").click $ie.image(:text, "").click $ie.link(:scr,"").click $ie.link(:url, "").click $ie.attach(:title,"").click with displaySecondTab & Line Items (lebal of this tab) I was wondering if there is any workaround for clicking "Tab" like button,image,url etc in watir?? Waiting for reply -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/d7413316/attachment.html From rodrigo.martin at enratio.com Tue Apr 18 16:27:29 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Tue, 18 Apr 2006 17:27:29 -0300 Subject: [Wtr-general] Method Names as variables? Message-ID: Hello Keith! Thanks for the quick answer, but I'm afraid that this is not what I'm looking for... I have written a function which search objects from a page, passing a propertie and a value as parameters... This is the function: def ENRA_FindObjects(propertie, value) $vector_fobjects=nil $vector_fobjects=Array.new j=0 alldocs=nil alldocs=$browser.document.body.all count=$browser.document.body.all.length $vector_search=nil $vector_search=Array.new for i in 0..count-1 do if (todosdocs[i.to_s]."#{propertie}=="#{value}") $vector_search[j]=todosdocs[i.to_s] j+=1 end end return($vector_search) end So, I load a page with a browser, and execute this function with, let's say: array_objects=ENRA_FindObjects("className","button") I hope the question is more clear now... How can I write this properly? --> todosdocs[i.to_s]."#{propertie}=="#{value}" , In order that the propertie could be defined by a parameter? Thank you so much for your time... Cheers Rodrigo Julian Martin ________________________________ From: Keith Lancaster [mailto:klancaster1957 at gmail.com] Sent: Martes, 18 de Abril de 2006 05:17 p.m. To: wtr-general at rubyforge.org; Rodrigo Julian Martin Subject: Re: [Wtr-general] Method Names as variables? I am assuming Item(80) in your example is an object. In Ruby, you can use the "send" method to call a function. Example: class MyClass def my_function puts "in my function" end end c = MyClass.new function_name = "my_function" c.send(function_name) HTH, Keith On 4/18/06 3:00 PM, "Rodrigo Julian Martin" wrote: Hello! I have another code question... Can I call an object method by using a variable? I've tried something like this: propertie="className" a = Item(80).'#{propertie}' And obviously doesn't work... I've also tried: a = Item(80).{propertie} but this is a call to a hash... Any help would be really appreciated... Thanks in Advance! Rodrigo Julian Martin ________________________________ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/dc7c9733/attachment.html From mb at michaelbolton.net Tue Apr 18 17:03:22 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Tue, 18 Apr 2006 17:03:22 -0400 Subject: [Wtr-general] Method Names as variables? In-Reply-To: Message-ID: <013c01c6632b$87201c90$6501a8c0@Koko> You may be too bilingual; I see where alldocs is initialized, but I don't see where todosdocs is initialized. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Rodrigo Julian Martin Sent: April 18, 2006 4:27 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Method Names as variables? Hello Keith! Thanks for the quick answer, but I'm afraid that this is not what I'm looking for. I have written a function which search objects from a page, passing a propertie and a value as parameters. This is the function: def ENRA_FindObjects(propertie, value) $vector_fobjects=nil $vector_fobjects=Array.new j=0 alldocs=nil alldocs=$browser.document.body.all count=$browser.document.body.all.length $vector_search=nil $vector_search=Array.new for i in 0..count-1 do if (todosdocs[i.to_s]."#{propertie}=="#{value}") $vector_search[j]=todosdocs[i.to_s] j+=1 end end return($vector_search) end So, I load a page with a browser, and execute this function with, let's say: array_objects=ENRA_FindObjects("className","button") I hope the question is more clear now. How can I write this properly? --> todosdocs[i.to_s]."#{propertie}=="#{value}" , In order that the propertie could be defined by a parameter? Thank you so much for your time. Cheers Rodrigo Julian Martin _____ From: Keith Lancaster [mailto:klancaster1957 at gmail.com] Sent: Martes, 18 de Abril de 2006 05:17 p.m. To: wtr-general at rubyforge.org; Rodrigo Julian Martin Subject: Re: [Wtr-general] Method Names as variables? I am assuming Item(80) in your example is an object. In Ruby, you can use the "send" method to call a function. Example: class MyClass def my_function puts "in my function" end end c = MyClass.new function_name = "my_function" c.send(function_name) HTH, Keith On 4/18/06 3:00 PM, "Rodrigo Julian Martin" wrote: Hello! I have another code question. Can I call an object method by using a variable? I've tried something like this: propertie="className" a = Item(80).'#{propertie}' And obviously doesn't work. I've also tried: a = Item(80).{propertie} but this is a call to a hash. Any help would be really appreciated. Thanks in Advance! Rodrigo Julian Martin _____ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/b50a25e4/attachment.html From mb at michaelbolton.net Tue Apr 18 17:03:22 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Tue, 18 Apr 2006 17:03:22 -0400 Subject: [Wtr-general] Unable to Click on tab - any workaround?? In-Reply-To: <62d9246f0604181317p2fabc397u27d44f663ffdde6d@mail.gmail.com> Message-ID: <014101c6632b$8c3169f0$6501a8c0@Koko> I can't see how the empty double quotes are helping matters; you're not telling Watir which tabs you want to click (or you're telling it to click a tab with no name). The absence of the actual source code on which you're trying to work doesn't help either; you're not telling us the HTML that you're targeting (or you're asking us to solve a problem with no data). There's a pattern here. Tell Watir which tab you want to click, or show us the HTML source code that you'd like analyzed, and things might get better. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Anil Kumar Das Sent: April 18, 2006 4:17 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Unable to Click on tab - any workaround?? I have a web application for SALES ORDER Module.... ------------------------------------- Order Detail | Parties |Line Items ------------------------------------- Onclick of order detail application opens 10-20 fields to add order information, party tab shows 10-20 fields to enter party information and Line Items shows fields to enter product details When I saw source code of this web page I found .. displayZerothTab,displayFirstTab,displaySecondTab were the variables which takes values of onClick from user action I tried all possible following combination but couldn`t solve this issue # $ie.link(:url, "").click # $ie.button(:name, "").click $ie.image(:src, "").click $ie.link(:text, "").click $ie.image(:text, "").click $ie.link(:scr,"").click $ie.link(:url, "").click $ie.attach(:title,"").click with displaySecondTab & Line Items (lebal of this tab) I was wondering if there is any workaround for clicking "Tab" like button,image,url etc in watir?? Waiting for reply -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/4608c2eb/attachment.html From tester.paul at gmail.com Tue Apr 18 18:12:05 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 18 Apr 2006 18:12:05 -0400 Subject: [Wtr-general] Unable to Click on tab - any workaround?? In-Reply-To: <62d9246f0604181317p2fabc397u27d44f663ffdde6d@mail.gmail.com> References: <62d9246f0604181317p2fabc397u27d44f663ffdde6d@mail.gmail.com> Message-ID: <37c405480604181512p4a7206a2w1949843255121681@mail.gmail.com> Hi there, you've given us some information about the problem, but not enough to provide you with an exact answer. One thing that I would recommend to you would be to spend some more time looking at the objects on the page to try and understand exactly how the tabs are placed on the page. For example, in one of the web applications that I work with the tabs shown are actually laid out within two nested tables. By using IRB and various tries at "ie.table(:index, #).flash" I was able to find the table that holds the clickable tab graphics and links. I also discovered that there were extra, blank columns that I needed to avoid. My actual script code looks something like this: ---- # Find out how many Tabs are showing. (Column count - 2 ) / 2 = # Tabs tab_count = ($ie.frame('MainWindow').table(:index, 2).column_count - 2 ) / 2 tab_count.times do |x| # click the tabs to find the desired page # The clickable 'tabs' are in columns 2, 4, 6... $ie.frame('MainWindow').table(:index, 2)[1][2*(x+1)].click rescue true sleep 1 break if $ie.frame('MainWindow').span(:id, /foo/).text == 'bar' end ---- It took me a few minutes to work out the math, but the pattern was repeated throughout the application so it was time well spent. There might be different ways to do this, but that's what I came up with at the time. I'm just offering this as an example. You will need to figure out how your tabs are laid out on your application's web page and find a good way to script the steps. If there's one thing I've learned, it's that if I can click it with a mouse, I can automate it with Watir! Good luck! Paul. On 18/04/06, Anil Kumar Das wrote: > > I have a web application for SALES ORDER Module.... > > ------------------------------------- > Order Detail | Parties |Line Items > ------------------------------------- > Onclick of order detail application opens 10-20 fields to add order > information, party tab shows 10-20 fields to enter party information and > Line Items shows fields to enter product details > When I saw source code of this web page I found .. > displayZerothTab,displayFirstTab,displaySecondTab were the variables which > takes values of onClick from user action > > I tried all possible following combination but couldn`t solve this issue > # $ie.link(:url, "").click > # $ie.button(:name, "").click > $ie.image(:src, "").click > $ie.link(:text, "").click > $ie.image(:text, "").click > $ie.link(:scr,"").click > $ie.link(:url, "").click > $ie.attach(:title,"").click > > with displaySecondTab & Line Items (lebal of this tab) > > I was wondering if there is any workaround for clicking "Tab" like > button,image,url etc in watir?? > Waiting for reply > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/1d6b27f6/attachment.html From bret at pettichord.com Tue Apr 18 20:03:22 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 18 Apr 2006 19:03:22 -0500 Subject: [Wtr-general] Unable to Click on tab - any workaround?? In-Reply-To: <62d9246f0604181317p2fabc397u27d44f663ffdde6d@mail.gmail.com> References: <62d9246f0604181317p2fabc397u27d44f663ffdde6d@mail.gmail.com> Message-ID: I agree with what Paul and Michael have said. However, i think one thing you should understand is that Watir works with HTML elements. Tabs are not HTML elements themselves, but rather are made out of them using divs or links or spans or a combination of elements. Different applications do it differently, so you will need to figure out how your application creates tabs to use Watir with it. That means looking at and decyphering the HTML. Or maybe sending it to us, so we can help. Bret On 4/18/06, Anil Kumar Das wrote: > > I have a web application for SALES ORDER Module.... > > ------------------------------------- > Order Detail | Parties |Line Items > ------------------------------------- > Onclick of order detail application opens 10-20 fields to add order > information, party tab shows 10-20 fields to enter party information and > Line Items shows fields to enter product details > When I saw source code of this web page I found .. > displayZerothTab,displayFirstTab,displaySecondTab were the variables which > takes values of onClick from user action > > I tried all possible following combination but couldn`t solve this issue > # $ie.link(:url, "").click > # $ie.button(:name, "").click > $ie.image(:src, "").click > $ie.link(:text, "").click > $ie.image(:text, "").click > $ie.link(:scr,"").click > $ie.link(:url, "").click > $ie.attach(:title,"").click > > with displaySecondTab & Line Items (lebal of this tab) > > I was wondering if there is any workaround for clicking "Tab" like > button,image,url etc in watir?? > Waiting for reply > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/08ca462a/attachment.html From klancaster1957 at gmail.com Tue Apr 18 20:03:41 2006 From: klancaster1957 at gmail.com (Keith Lancaster) Date: Tue, 18 Apr 2006 19:03:41 -0500 Subject: [Wtr-general] Method Names as variables? In-Reply-To: Message-ID: It might be helpful if you described what it is you are trying to accomplish. I have a feeling that there are much easier ways to get what you are looking for than the approach you are taking. Then method I mentioned previously will in fact work for your line. It would look like this: if (todosdocs[i.to_s].send(propertie) == value That said, a couple of quick notes on the code example: 1. Other than the browser object, it does not appear from the code sample that there is a need to make other variables global (starting with $). 2. You can create the array vector_fobjects simply by saying vector_fobjects = [] You can certainly do Array.new instead, but there is no need to create the object first and set it to nil. The same goes for the vector_search variable. 3. As someone else noted, you have not initialized todosdocs anywhere Again without knowing exactly what you are trying for, you might try this: # assume you have $browser some defined and initialized someplace def ENRA_FindObjects(propertie, value) return_vector = [] all_objects = $browser.document.body.all all_objects.each do |obj| return_vector << obj if obj.send(propertie) == value end return_vector end HTH, Keith (You will of course need to test this ? I tried something similar in irb and it looked like it would work) On 4/18/06 3:27 PM, "Rodrigo Julian Martin" wrote: > Hello Keith! > Thanks for the quick answer, but I?m afraid that this is not what I?m looking > for? > I have written a function which search objects from a page, passing a > propertie and a value as parameters? > > This is the function: > > > def ENRA_FindObjects(propertie, value) > $vector_fobjects=nil > $vector_fobjects=Array.new > j=0 > alldocs=nil > alldocs=$browser.document.body.all > count=$browser.document.body.all.length > $vector_search=nil > $vector_search=Array.new > for i in 0..count-1 do > if (todosdocs[i.to_s].?#{propertie}=="#{value}") > $vector_search[j]=todosdocs[i.to_s] > j+=1 > end > end > return($vector_search) > end > > So, I load a page with a browser, and execute this function with, let?s say: > > array_objects=ENRA_FindObjects(?className?,?button?) > > I hope the question is more clear now? > > How can I write this properly? ? todosdocs[i.to_s].?#{propertie}=="#{value}" , > In order that the propertie could be defined by a parameter? > > > Thank you so much for your time? > Cheers > > Rodrigo Julian Martin > > > From: Keith Lancaster [mailto:klancaster1957 at gmail.com] > Sent: Martes, 18 de Abril de 2006 05:17 p.m. > To: wtr-general at rubyforge.org; Rodrigo Julian Martin > Subject: Re: [Wtr-general] Method Names as variables? > > I am assuming Item(80) in your example is an object. > > In Ruby, you can use the ?send? method to call a function. > > Example: > > class MyClass > def my_function > puts ?in my function? > end > end > > c = MyClass.new > function_name = ?my_function? > c.send(function_name) > > HTH, > Keith > > > > On 4/18/06 3:00 PM, "Rodrigo Julian Martin" > wrote: > Hello! > > I have another code question? > > Can I call an object method by using a variable? > > I?ve tried something like this: > > > propertie=?className? > a = Item(80).?#{propertie}? > > And obviously doesn?t work? > > I?ve also tried: > > a = Item(80).{propertie} > > but this is a call to a hash? > > > Any help would be really appreciated? > Thanks in Advance! > > > Rodrigo Julian Martin > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/930a67e4/attachment.html From klancaster1957 at gmail.com Tue Apr 18 21:00:02 2006 From: klancaster1957 at gmail.com (Keith Lancaster) Date: Tue, 18 Apr 2006 20:00:02 -0500 Subject: [Wtr-general] Method Names as variables? In-Reply-To: References: Message-ID: <6a0e5b50604181800s53fe9488sf755febf3c9e6a1c@mail.gmail.com> ok...so I'm a bit tired today. That's my only excuse... :-) (but the code sample should work) On 4/18/06, Keith Lancaster wrote: > > > 3. As someone else noted, you have not initialized todosdocs anywhere > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060418/f1071df7/attachment.html From bret at pettichord.com Wed Apr 19 02:25:57 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 19 Apr 2006 01:25:57 -0500 Subject: [Wtr-general] XPath performance and ole_object questions In-Reply-To: <20060408232405725.00000007792@gmcshea-pc2> References: <20060408232405725.00000007792@gmcshea-pc2> Message-ID: On 4/9/06, Greg McShea wrote: > > Second, due to the XPath performance issue I was starting to look at using > ole_object method. I'm trying to execute the following statement in my Watir > script: > ie.cell(:text, > "Reassign").ole_object().parentElement().parentElement().click() > > I want to go up 2 levels from the td containing "Reassign" and click that > element. > > I know that the cell is found successfully as I can flash it but when I > execute the statement I get the following error: > > undefined method `parentElement' for nil:NilClass > c:/Watir/examples/scratch.rb:17 > > I'm guessing this means the ole_object() method is not returning anything. > What am I doing wrong? > It could be that the call to ole_object() is returning nil, or that the first call to parentElement() is returning nil. When you say "up 2 levels" what do you mean? do you mean the table containing the row containing the cell? Another approach you can take is to do something like this: # click on the row containing the Reassign cell ie.rows.find {|r| r.cell(:text, "Reassign")}.click Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060419/35d99da9/attachment.html From Adrian.Rutter at tnt.com Wed Apr 19 03:59:24 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Wed, 19 Apr 2006 08:59:24 +0100 Subject: [Wtr-general] Application Map Message-ID: Is it possible to create a object\application map in watir\ruby? Using key-value pairs maybe? Cheers Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From Adrian.Rutter at tnt.com Wed Apr 19 06:41:02 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Wed, 19 Apr 2006 11:41:02 +0100 Subject: [Wtr-general] keyword-driven framework Message-ID: Hi, >From what I can see from Ruby, it is easy enough to reference Excel objects. I used to use a simple but effective framework with Rational Robot called the Control Synchronized Data Driven Testing. I will convert that with some modification and send it back for review. Some idea of what the framework does: http://www.scionlabs.com/using_rational_robot.zip Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From rodrigo.martin at enratio.com Wed Apr 19 09:01:14 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Wed, 19 Apr 2006 10:01:14 -0300 Subject: [Wtr-general] Method Names as variables? Message-ID: Hi Michael, yes, sorry for that... I've translated the variable names to english (I'm from Argentina), but I forgot that todosdocs... Cheers! ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Michael Bolton Sent: Martes, 18 de Abril de 2006 06:03 p.m. To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Method Names as variables? You may be too bilingual; I see where alldocs is initialized, but I don't see where todosdocs is initialized. ---Michael B. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Rodrigo Julian Martin Sent: April 18, 2006 4:27 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Method Names as variables? Hello Keith! Thanks for the quick answer, but I'm afraid that this is not what I'm looking for... I have written a function which search objects from a page, passing a propertie and a value as parameters... This is the function: def ENRA_FindObjects(propertie, value) $vector_fobjects=nil $vector_fobjects=Array.new j=0 alldocs=nil alldocs=$browser.document.body.all count=$browser.document.body.all.length $vector_search=nil $vector_search=Array.new for i in 0..count-1 do if (todosdocs[i.to_s]."#{propertie}=="#{value}") $vector_search[j]=todosdocs[i.to_s] j+=1 end end return($vector_search) end So, I load a page with a browser, and execute this function with, let's say: array_objects=ENRA_FindObjects("className","button") I hope the question is more clear now... How can I write this properly? --> todosdocs[i.to_s]."#{propertie}=="#{value}" , In order that the propertie could be defined by a parameter? Thank you so much for your time... Cheers Rodrigo Julian Martin ________________________________ From: Keith Lancaster [mailto:klancaster1957 at gmail.com] Sent: Martes, 18 de Abril de 2006 05:17 p.m. To: wtr-general at rubyforge.org; Rodrigo Julian Martin Subject: Re: [Wtr-general] Method Names as variables? I am assuming Item(80) in your example is an object. In Ruby, you can use the "send" method to call a function. Example: class MyClass def my_function puts "in my function" end end c = MyClass.new function_name = "my_function" c.send(function_name) HTH, Keith On 4/18/06 3:00 PM, "Rodrigo Julian Martin" wrote: Hello! I have another code question... Can I call an object method by using a variable? I've tried something like this: propertie="className" a = Item(80).'#{propertie}' And obviously doesn't work... I've also tried: a = Item(80).{propertie} but this is a call to a hash... Any help would be really appreciated... Thanks in Advance! Rodrigo Julian Martin ________________________________ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060419/69d2433c/attachment.html From rodrigo.martin at enratio.com Wed Apr 19 09:07:51 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Wed, 19 Apr 2006 10:07:51 -0300 Subject: [Wtr-general] Method Names as variables? Message-ID: Hello Keith! The sample code you wrote works just fine! I hadn't understand the .send until I saw it on your example.. And the tips for the Array creation and the iteration of all objects with .each |do| really like me.. As you can see from my code I'm more of structured programming, but I hope to develop a more Ruby style in my code... and definitively you and many more people in this list are helping! Sorry for my bad english, and thanks again! ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Keith Lancaster Sent: Martes, 18 de Abril de 2006 09:04 p.m. To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Method Names as variables? It might be helpful if you described what it is you are trying to accomplish. I have a feeling that there are much easier ways to get what you are looking for than the approach you are taking. Then method I mentioned previously will in fact work for your line. It would look like this: if (todosdocs[i.to_s].send(propertie) == value That said, a couple of quick notes on the code example: 1. Other than the browser object, it does not appear from the code sample that there is a need to make other variables global (starting with $). 2. You can create the array vector_fobjects simply by saying vector_fobjects = [] You can certainly do Array.new instead, but there is no need to create the object first and set it to nil. The same goes for the vector_search variable. 3. As someone else noted, you have not initialized todosdocs anywhere Again without knowing exactly what you are trying for, you might try this: # assume you have $browser some defined and initialized someplace def ENRA_FindObjects(propertie, value) return_vector = [] all_objects = $browser.document.body.all all_objects.each do |obj| return_vector << obj if obj.send(propertie) == value end return_vector end HTH, Keith (You will of course need to test this - I tried something similar in irb and it looked like it would work) On 4/18/06 3:27 PM, "Rodrigo Julian Martin" wrote: Hello Keith! Thanks for the quick answer, but I'm afraid that this is not what I'm looking for... I have written a function which search objects from a page, passing a propertie and a value as parameters... This is the function: def ENRA_FindObjects(propertie, value) $vector_fobjects=nil $vector_fobjects=Array.new j=0 alldocs=nil alldocs=$browser.document.body.all count=$browser.document.body.all.length $vector_search=nil $vector_search=Array.new for i in 0..count-1 do if (todosdocs[i.to_s]."#{propertie}=="#{value}") $vector_search[j]=todosdocs[i.to_s] j+=1 end end return($vector_search) end So, I load a page with a browser, and execute this function with, let's say: array_objects=ENRA_FindObjects("className","button") I hope the question is more clear now... How can I write this properly? --> todosdocs[i.to_s]."#{propertie}=="#{value}" , In order that the propertie could be defined by a parameter? Thank you so much for your time... Cheers Rodrigo Julian Martin ________________________________ From: Keith Lancaster [mailto:klancaster1957 at gmail.com] Sent: Martes, 18 de Abril de 2006 05:17 p.m. To: wtr-general at rubyforge.org; Rodrigo Julian Martin Subject: Re: [Wtr-general] Method Names as variables? I am assuming Item(80) in your example is an object. In Ruby, you can use the "send" method to call a function. Example: class MyClass def my_function puts "in my function" end end c = MyClass.new function_name = "my_function" c.send(function_name) HTH, Keith On 4/18/06 3:00 PM, "Rodrigo Julian Martin" wrote: Hello! I have another code question... Can I call an object method by using a variable? I've tried something like this: propertie="className" a = Item(80).'#{propertie}' And obviously doesn't work... I've also tried: a = Item(80).{propertie} but this is a call to a hash... Any help would be really appreciated... Thanks in Advance! Rodrigo Julian Martin ________________________________ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ________________________________ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060419/b3e149a7/attachment.html From Mark_Cain at rl.gov Wed Apr 19 10:06:40 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Wed, 19 Apr 2006 07:06:40 -0700 Subject: [Wtr-general] XPath performance and ole_object questions Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04E020F76BF@EX5V.rl.gov> The error you are getting could also be cause by mal-formed HTML in your page. For instance if all your html tags do not have corresponding ending tags then it may work fine in IE but anything remotely XML/XSL-ish will not work. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Tuesday, April 18, 2006 11:26 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] XPath performance and ole_object questions On 4/9/06, Greg McShea wrote: Second, due to the XPath performance issue I was starting to look at using ole_object method. I'm trying to execute the following statement in my Watir script: ie.cell(:text, "Reassign").ole_object().parentElement().parentElement().click() I want to go up 2 levels from the td containing "Reassign" and click that element. I know that the cell is found successfully as I can flash it but when I execute the statement I get the following error: undefined method `parentElement' for nil:NilClass c:/Watir/examples/scratch.rb:17 I'm guessing this means the ole_object() method is not returning anything. What am I doing wrong? It could be that the call to ole_object() is returning nil, or that the first call to parentElement() is returning nil. When you say "up 2 levels" what do you mean? do you mean the table containing the row containing the cell? Another approach you can take is to do something like this: # click on the row containing the Reassign cell ie.rows.find {|r| r.cell(:text, "Reassign")}.click Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060419/24865dc9/attachment.html From anil.kumar.das at gmail.com Wed Apr 19 10:15:53 2006 From: anil.kumar.das at gmail.com (Anil Kumar Das) Date: Wed, 19 Apr 2006 10:15:53 -0400 Subject: [Wtr-general] Unable to Click on tab - any workaround?? In-Reply-To: <014101c6632b$8c3169f0$6501a8c0@Koko> References: <62d9246f0604181317p2fabc397u27d44f663ffdde6d@mail.gmail.com> <014101c6632b$8c3169f0$6501a8c0@Koko> Message-ID: <62d9246f0604190715h614497cr6d10c7fed9eb0534@mail.gmail.com> Michael, little confusion, I didn`t try with "" (empty), the exact name in source code is "displaySecondTab" and label of this tab displaying on web page is "Line Items" Provided one of this value "displaySecondTab" or "Line Items" in empty space in various combination, exactly like mentioned below: $ie.link(:url, "displaySecondTab").click $ie.button(:name, "displaySecondTab").click $ie.image(:src, "displaySecondTab").click $ie.link(:text, "displaySecondTab").click $ie.image(:text, "displaySecondTab").click $ie.link(:scr,"displaySecondTab").click $ie.link(:url, "displaySecondTab").click $ie.attach(:title,"displaySecondTab").click $ie.link(:url, "Line Items").click $ie.button(:name, "Line Items").click $ie.image(:src, "Line Items").click $ie.link(:text, "Line Items").click $ie.image(:text, "Line Items").click $ie.link(:scr,"Line Items").click $ie.link(:url, "Line Items").click $ie.attach(:title,"Line Items").click On 4/18/06, Michael Bolton wrote: > > I can't see how the empty double quotes are helping matters; you're not > telling Watir which tabs you want to click (or you're telling it to click a > tab with no name). The absence of the actual source code on which you're > trying to work doesn't help either; you're not telling us the HTML that > you're targeting (or you're asking us to solve a problem with no > data). There's a pattern here. Tell Watir which tab you want to click, or > show us the HTML source code that you'd like analyzed, and things might get > better. > > ---Michael B. > > > > > ------------------------------ > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Anil Kumar Das > *Sent:* April 18, 2006 4:17 PM > *To:* wtr-general at rubyforge.org > *Subject:* [Wtr-general] Unable to Click on tab - any workaround?? > > > > I have a web application for SALES ORDER Module.... > > ------------------------------------- > Order Detail | Parties |Line Items > ------------------------------------- > Onclick of order detail application opens 10-20 fields to add order > information, party tab shows 10-20 fields to enter party information and > Line Items shows fields to enter product details > When I saw source code of this web page I found .. > displayZerothTab,displayFirstTab,displaySecondTab were the variables which > takes values of onClick from user action > > I tried all possible following combination but couldn`t solve this issue > # $ie.link(:url, "").click > # $ie.button(:name, "").click > $ie.image(:src, "").click > $ie.link(:text, "").click > $ie.image(:text, "").click > $ie.link(:scr,"").click > $ie.link(:url, "").click > $ie.attach(:title,"").click > > with displaySecondTab & Line Items (lebal of this tab) > > I was wondering if there is any workaround for clicking "Tab" like > button,image,url etc in watir?? > Waiting for reply > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -- ----------------------------------------------------------------- Diamond was also an ordinary coal before it passed burning tests..! Some goals are so worthy it's glorious even to fail...!! -------------------------------------------------------------------- Regards, Anil Kumar Das -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060419/2b73d14c/attachment.html From klancaster1957 at gmail.com Wed Apr 19 11:13:28 2006 From: klancaster1957 at gmail.com (Keith Lancaster) Date: Wed, 19 Apr 2006 10:13:28 -0500 Subject: [Wtr-general] Method Names as variables? In-Reply-To: References: Message-ID: <6a0e5b50604190813t58950b05s9d4ee8b35959ad91@mail.gmail.com> Glad to help. Have fun with Ruby - its a great language and a good one for learning object-oriented programming. Keith On 4/19/06, Rodrigo Julian Martin wrote: > > Hello Keith! > > The sample code you wrote works just fine! > > > > I hadn't understand the .send until I saw it on your example.. > > And the tips for the Array creation and the iteration of all objects with > .each |do| really like me.. > > As you can see from my code I'm more of structured programming, but I hope > to develop a more Ruby style in my code? and definitively you and many more > people in this list are helping! > > > > Sorry for my bad english, and thanks again! > > > ------------------------------ > > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Keith Lancaster > *Sent:* Martes, 18 de Abril de 2006 09:04 p.m. > > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] Method Names as variables? > > > > It might be helpful if you described what it is you are trying to > accomplish. I have a feeling that there are much easier ways to get what you > are looking for than the approach you are taking. > > Then method I mentioned previously will in fact work for your line. It > would look like this: > > if (todosdocs[i.to_s].send(propertie) == value > > > That said, a couple of quick notes on the code example: > > 1. Other than the browser object, it does not appear from the code > sample that there is a need to make other variables global (starting with > $). > 2. You can create the array vector_fobjects simply by saying > > vector_fobjects = [] > You can certainly do Array.new instead, but there is no need to create > the object first and set it to nil. The same goes for the vector_search > variable. > 3. As someone else noted, you have not initialized todosdocs anywhere > > Again without knowing exactly what you are trying for, you might try this: > > # assume you have $browser some defined and initialized someplace > def ENRA_FindObjects(propertie, value) > return_vector = [] > all_objects = $browser.document.body.all > all_objects.each do |obj| > return_vector << obj if obj.send(propertie) == value > end > return_vector > end > > HTH, > Keith > > (You will of course need to test this ? I tried something similar in irb > and it looked like it would work) > > > > On 4/18/06 3:27 PM, "Rodrigo Julian Martin" > wrote: > > Hello Keith! > Thanks for the quick answer, but I'm afraid that this is not what I'm > looking for? > I have written a function which search objects from a page, passing a > propertie and a value as parameters? > > This is the function: > > > def ENRA_FindObjects(propertie, value) > $vector_fobjects=nil > $vector_fobjects=Array.new > j=0 > alldocs=nil > alldocs=$browser.document.body.all > count=$browser.document.body.all.length > $vector_search=nil > $vector_search=Array.new > for i in 0..count-1 do > if (todosdocs[i.to_s]."#{propertie}=="#{value}") > $vector_search[j]=todosdocs[i.to_s] > j+=1 > end > end > return($vector_search) > end > > So, I load a page with a browser, and execute this function with, let's > say: > > array_objects=ENRA_FindObjects("className","button") > > I hope the question is more clear now? > > How can I write this properly? ? todosdocs[i.to_s]."#{propertie}=="#{value}" > , > In order that the propertie could be defined by a parameter? > > > Thank you so much for your time? > Cheers > > Rodrigo Julian Martin > ------------------------------ > > *From:* Keith Lancaster [mailto:klancaster1957 at gmail.com] > *Sent:* Martes, 18 de Abril de 2006 05:17 p.m. > *To:* wtr-general at rubyforge.org; Rodrigo Julian Martin > *Subject:* Re: [Wtr-general] Method Names as variables? > > I am assuming Item(80) in your example is an object. > > In Ruby, you can use the "send" method to call a function. > > Example: > > class MyClass > def my_function > puts "in my function" > end > end > > c = MyClass.new > function_name = "my_function" > c.send(function_name) > > HTH, > Keith > > > > On 4/18/06 3:00 PM, "Rodrigo Julian Martin" > wrote: > Hello! > > I have another code question? > > Can I call an object method by using a variable? > > I've tried something like this: > > > propertie="className" > a = Item(80).'#{propertie}' > > And obviously doesn't work? > > I've also tried: > > a = Item(80).{propertie} > > but this is a call to a hash? > > > Any help would be really appreciated? > Thanks in Advance! > > > Rodrigo Julian Martin > ------------------------------ > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > ------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060419/a0ffe562/attachment.html From mb at michaelbolton.net Wed Apr 19 12:13:41 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Wed, 19 Apr 2006 12:13:41 -0400 Subject: [Wtr-general] Unable to Click on tab - any workaround?? In-Reply-To: <62d9246f0604190715h614497cr6d10c7fed9eb0534@mail.gmail.com> Message-ID: <015901c663cc$3a388a60$6601a8c0@Koko> PLEASE show us the HTML. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Anil Kumar Das Sent: April 19, 2006 10:16 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Unable to Click on tab - any workaround?? Michael, little confusion, I didn`t try with "" (empty), the exact name in source code is "displaySecondTab" and label of this tab displaying on web page is "Line Items" Provided one of this value "displaySecondTab" or "Line Items" in empty space in various combination, exactly like mentioned below: $ie.link(:url, "displaySecondTab").click $ie.button(:name, "displaySecondTab").click $ie.image(:src, "displaySecondTab").click $ie.link(:text, "displaySecondTab").click $ie.image(:text, "displaySecondTab").click $ie.link(:scr,"displaySecondTab").click $ie.link(:url, "displaySecondTab").click $ie.attach(:title,"displaySecondTab").click $ie.link(:url, "Line Items").click $ie.button(:name, "Line Items").click $ie.image(:src, "Line Items").click $ie.link(:text, "Line Items").click $ie.image(:text, "Line Items").click $ie.link(:scr,"Line Items").click $ie.link(:url, "Line Items").click $ie.attach(:title,"Line Items").click On 4/18/06, Michael Bolton wrote: I can't see how the empty double quotes are helping matters; you're not telling Watir which tabs you want to click (or you're telling it to click a tab with no name). The absence of the actual source code on which you're trying to work doesn't help either; you're not telling us the HTML that you're targeting (or you're asking us to solve a problem with no data). There's a pattern here. Tell Watir which tab you want to click, or show us the HTML source code that you'd like analyzed, and things might get better. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto: wtr-general-bounces at rubyforge.org] On Behalf Of Anil Kumar Das Sent: April 18, 2006 4:17 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Unable to Click on tab - any workaround?? I have a web application for SALES ORDER Module.... ------------------------------------- Order Detail | Parties |Line Items ------------------------------------- Onclick of order detail application opens 10-20 fields to add order information, party tab shows 10-20 fields to enter party information and Line Items shows fields to enter product details When I saw source code of this web page I found .. displayZerothTab,displayFirstTab,displaySecondTab were the variables which takes values of onClick from user action I tried all possible following combination but couldn`t solve this issue # $ie.link(:url, "").click # $ie.button(:name, "").click $ie.image(:src, "").click $ie.link(:text, "").click $ie.image(:text, "").click $ie.link(:scr,"").click $ie.link(:url, "").click $ie.attach(:title,"").click with displaySecondTab & Line Items (lebal of this tab) I was wondering if there is any workaround for clicking "Tab" like button,image,url etc in watir?? Waiting for reply _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -- ----------------------------------------------------------------- Diamond was also an ordinary coal before it passed burning tests..! Some goals are so worthy it's glorious even to fail...!! -------------------------------------------------------------------- Regards, Anil Kumar Das -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060419/cf8d5506/attachment.html From noreply at rubyforge.org Wed Apr 19 07:37:20 2006 From: noreply at rubyforge.org (MAILER-DAEMON) Date: Wed, 19 Apr 2006 13:37:20 +0200 Subject: [Wtr-general] (no subject) Message-ID: <200604191137.k3JBbJ9R023598@rubyforge.org> ?}?5"-???a?[???1? )hq????v?????qL???4z?????")fltg!?I????????????*x??????????9???ZRT??qJ?qT??>-?C?u/????n???2?*?????????R?e*kM??6g?'y?xlx???.? ?Op54 G?Z0/??E#gj?g???CL%?[?????V??&)????|7???Y??>h??f?`K?:??[????t?h???;.????_?8E^M{?8?(e6?h?E??J???C????|????zedM4?F:???p"?B?f?x??S???P???? ???s????q?? ~p??^???Q??c?Hz?#k?2Ve?:E???L?:??HU??qK???u?EH?H??8I?]k?F???H}? J-???N????%7 ??.??j??1???p??`?%????_&??:|????Ov?f?4?2G?i?Zua??]M?r????zR?0?B;V? ??w???????q???1???Z???im??3T?9>????6I'P?9GK??G?_w -------------- next part -------------- A non-text attachment was scrubbed... Name: text.zip Type: application/octet-stream Size: 28946 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060419/1b4a9efa/attachment.obj From anil.kumar.das at gmail.com Wed Apr 19 11:52:41 2006 From: anil.kumar.das at gmail.com (Anil Kumar Das) Date: Wed, 19 Apr 2006 11:52:41 -0400 Subject: [Wtr-general] Unable to Click on tab - any workaround?? In-Reply-To: <014101c6632b$8c3169f0$6501a8c0@Koko> References: <62d9246f0604181317p2fabc397u27d44f663ffdde6d@mail.gmail.com> <014101c6632b$8c3169f0$6501a8c0@Koko> Message-ID: <62d9246f0604190852r37e0ff17t38f40ff4cf76151d@mail.gmail.com> Please find source code & snapshot of application ----------------------------------------------------------- -------------------------------------------------------------------------------------------------- On 4/18/06, Michael Bolton wrote: > > I can't see how the empty double quotes are helping matters; you're not > telling Watir which tabs you want to click (or you're telling it to click a > tab with no name). The absence of the actual source code on which you're > trying to work doesn't help either; you're not telling us the HTML that > you're targeting (or you're asking us to solve a problem with no > data). There's a pattern here. Tell Watir which tab you want to click, or > show us the HTML source code that you'd like analyzed, and things might get > better. > > ---Michael B. > > > > > ------------------------------ > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Anil Kumar Das > *Sent:* April 18, 2006 4:17 PM > *To:* wtr-general at rubyforge.org > *Subject:* [Wtr-general] Unable to Click on tab - any workaround?? > > > > I have a web application for SALES ORDER Module.... > > ------------------------------------- > Order Detail | Parties |Line Items > ------------------------------------- > Onclick of order detail application opens 10-20 fields to add order > information, party tab shows 10-20 fields to enter party information and > Line Items shows fields to enter product details > When I saw source code of this web page I found .. > displayZerothTab,displayFirstTab,displaySecondTab were the variables which > takes values of onClick from user action > > I tried all possible following combination but couldn`t solve this issue > # $ie.link(:url, "").click > # $ie.button(:name, "").click > $ie.image(:src, "").click > $ie.link(:text, "").click > $ie.image(:text, "").click > $ie.link(:scr,"").click > $ie.link(:url, "").click > $ie.attach(:title,"").click > > with displaySecondTab & Line Items (lebal of this tab) > > I was wondering if there is any workaround for clicking "Tab" like > button,image,url etc in watir?? > Waiting for reply > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -- ----------------------------------------------------------------- Diamond was also an ordinary coal before it passed burning tests..! Some goals are so worthy it's glorious even to fail...!! -------------------------------------------------------------------- Regards, Anil Kumar Das -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060419/98145277/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: application.doc Type: application/msword Size: 76288 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060419/98145277/attachment.doc From tester.paul at gmail.com Wed Apr 19 14:05:07 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Wed, 19 Apr 2006 14:05:07 -0400 Subject: [Wtr-general] Unable to Click on tab - any workaround?? In-Reply-To: <62d9246f0604190852r37e0ff17t38f40ff4cf76151d@mail.gmail.com> References: <62d9246f0604181317p2fabc397u27d44f663ffdde6d@mail.gmail.com> <014101c6632b$8c3169f0$6501a8c0@Koko> <62d9246f0604190852r37e0ff17t38f40ff4cf76151d@mail.gmail.com> Message-ID: <37c405480604191105q67e29f4apd6ce8807bffa7c9b@mail.gmail.com> Thanks for sending the screenshot, but the bit of source code that you sent is only a list of functions -- it's not the HTML itself. Unless I'm reading it wrong, you should be looking elsewhere in the HTML source. There are many different html elements that you can look for (e.g. tables, spans, divs, images, etc.). While the "SCRIPT" section that you sent may _look_ relevant, I don't see anything there that would place those functions or links anywhere on the web page. In fact, there isn't anything even in the code snippet you sent that links them to the labels that appear in the screenshot. Have you tried SpySmith? What does the source code look like when you [ctrl]+[right-click] on a 'tab' in your page? That should give you a better clue as to how the web browser sees and displays that element. Hope this helps. Paul. On 19/04/06, Anil Kumar Das wrote: > > Please find source code & snapshot of application > > ----------------------------------------------------------- > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060419/cd67de32/attachment.html From mb at michaelbolton.net Wed Apr 19 16:22:05 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Wed, 19 Apr 2006 16:22:05 -0400 Subject: [Wtr-general] Unable to Click on tab - any workaround?? In-Reply-To: <62d9246f0604190852r37e0ff17t38f40ff4cf76151d@mail.gmail.com> Message-ID: <01fc01c663ef$09fc2190$6601a8c0@Koko> (I got these in direct mail.) This application's main Web page appears to be 455,745 characters long. I open it locally, so it's not like network latency is an issue. When I try to flash the first text field in it, a few seconds pass, the field turns yellow; a few more seconds pass, the field turns white; a few more seconds pass, the field turns yellow, and so on. I suspect that this is because walking the DOM for the page takes a long time, even at speeds on the orders of gigahertz. When I try to enter some text data in the fourth text field, the call to do so takes six seconds for the call to return. I compare this to, say, the text_field on the Google home page; the response is instantaneous. On your page, show_all_objects takes three seconds or so to return. The list was so long that it scrolled out of my screen buffer at 300 lines long. I tried 1024 lines; still scrolled off. I tried 2048; still scrolled off. 4096 lines did the trick. There are 809 hidden fields in the page. Many of the destination URLs are hard-coded .js files to your desktop. One of the issues related to using button(:some_symbol, some_id).click is that the tab buttons aren't buttons. As Bret suggested, they may be accessible via cell or div or span tags, but I didn't have the patience to figure out which ones. You've found a bug: the page is so complex as to be untestable with Watir. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Anil Kumar Das Sent: April 19, 2006 11:53 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Unable to Click on tab - any workaround?? Please find source code & snapshot of application ----------------------------------------------------------- ---------------------------------------------------------------------------- ---------------------- On 4/18/06, Michael Bolton wrote: I can't see how the empty double quotes are helping matters; you're not telling Watir which tabs you want to click (or you're telling it to click a tab with no name). The absence of the actual source code on which you're trying to work doesn't help either; you're not telling us the HTML that you're targeting (or you're asking us to solve a problem with no data). There's a pattern here. Tell Watir which tab you want to click, or show us the HTML source code that you'd like analyzed, and things might get better. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto: wtr-general-bounces at rubyforge.org] On Behalf Of Anil Kumar Das Sent: April 18, 2006 4:17 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Unable to Click on tab - any workaround?? I have a web application for SALES ORDER Module.... ------------------------------------- Order Detail | Parties |Line Items ------------------------------------- Onclick of order detail application opens 10-20 fields to add order information, party tab shows 10-20 fields to enter party information and Line Items shows fields to enter product details When I saw source code of this web page I found .. displayZerothTab,displayFirstTab,displaySecondTab were the variables which takes values of onClick from user action I tried all possible following combination but couldn`t solve this issue # $ie.link(:url, "").click # $ie.button(:name, "").click $ie.image(:src, "").click $ie.link(:text, "").click $ie.image(:text, "").click $ie.link(:scr,"").click $ie.link(:url, "").click $ie.attach(:title,"").click with displaySecondTab & Line Items (lebal of this tab) I was wondering if there is any workaround for clicking "Tab" like button,image,url etc in watir?? Waiting for reply _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -- ----------------------------------------------------------------- Diamond was also an ordinary coal before it passed burning tests..! Some goals are so worthy it's glorious even to fail...!! -------------------------------------------------------------------- Regards, Anil Kumar Das -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060419/ce7e7b65/attachment.html From bret at pettichord.com Wed Apr 19 19:47:02 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 19 Apr 2006 18:47:02 -0500 Subject: [Wtr-general] Application Map In-Reply-To: References: Message-ID: Short answer: definitely. Why don't you sketch out how you would want it to look in pseudo-code and then I can show you how to do something similar in working Watir/Ruby code. Bret On 4/19/06, Adrian Rutter wrote: > > > Is it possible to create a object\application map in watir\ruby? Using > key-value pairs maybe? > > Cheers > > Aidy > > > > > --------------------------------------------------------------------------------------------------------------- > This message and any attachment are confidential and may be privileged or > otherwise protected from disclosure. > If you are not the intended recipient, please telephone or email the > sender and delete this message and any attachment from your system. > If you are not the intended recipient you must not copy this message or > attachment or disclose the contents to any other person. > > --------------------------------------------------------------------------------------------------------------- > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060419/e4ee0e6b/attachment.html From bret at pettichord.com Wed Apr 19 23:09:22 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 19 Apr 2006 22:09:22 -0500 Subject: [Wtr-general] wtr-dev: xpath link errors Message-ID: Angrez, In HEAD, i'm getting the following error using REXML 3.1.4. I could swear that this was working fine with my other computer also using REXML 3.1.4, so i'm a little puzzled. All the other xpath tests are passing (individually; the xpath_tests.rb still has problems as a suite). BTW, I'm working on setting up a separate wtr-dev mailing list for such issues as these. Bret Loaded suite D:/workspace/watir/unittests/links_xpath_test Started EE. Finished in 2.413 seconds. 1) Error: test_link_click(TC_Links_XPath): NoMethodError: undefined method `include?' for nil:NilClass C:/ruby/lib/ruby/site_ruby/1.8/rexml/functions.rb:142:in `contains' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:451:in `send' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:451:in `expr' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:438:in `each_with_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:438:in `each' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:438:in `each_with_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:438:in `expr' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:283:in `expr' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:277:in `each_with_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:277:in `each' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:277:in `each_with_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:277:in `expr' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:488:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:476:in `descendant_or_self' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:315:in `expr' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:125:in `match' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:56:in `parse' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath.rb:53:in `each' C:/ruby/lib/ruby/site_ruby/1.8/rexml/element.rb:939:in `each' D:/workspace/watir/unittests/../watir.rb:1951:in `elements_by_xpath' D:/workspace/watir/unittests/../watir.rb:1941:in `element_by_xpath' D:/workspace/watir/unittests/../watir.rb:3247:in `locate' D:/workspace/watir/unittests/../watir.rb:2144:in `assert_exists' D:/workspace/watir/unittests/../watir.rb:2287:in `click' D:/workspace/watir/unittests/links_xpath_test.rb:30:in `test_link_click' 2) Error: test_link_exists(TC_Links_XPath): NoMethodError: undefined method `include?' for nil:NilClass C:/ruby/lib/ruby/site_ruby/1.8/rexml/functions.rb:142:in `contains' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:451:in `send' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:451:in `expr' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:438:in `each_with_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:438:in `each' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:438:in `each_with_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:438:in `expr' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:283:in `expr' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:277:in `each_with_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:277:in `each' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:277:in `each_with_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:277:in `expr' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:488:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:476:in `descendant_or_self' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:315:in `expr' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:125:in `match' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:56:in `parse' C:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath.rb:53:in `each' C:/ruby/lib/ruby/site_ruby/1.8/rexml/element.rb:939:in `each' D:/workspace/watir/unittests/../watir.rb:1951:in `elements_by_xpath' D:/workspace/watir/unittests/../watir.rb:1941:in `element_by_xpath' D:/workspace/watir/unittests/../watir.rb:3247:in `locate' D:/workspace/watir/unittests/../watir.rb:2345:in `exists?' D:/workspace/watir/unittests/links_xpath_test.rb:15:in `test_link_exists' 3 tests, 1 assertions, 0 failures, 2 errors -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060419/64bb37f9/attachment.html From Adrian.Rutter at tnt.com Thu Apr 20 08:11:32 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Thu, 20 Apr 2006 13:11:32 +0100 Subject: [Wtr-general] Application Map Message-ID: Hi, If we take a look at the 'googlesearch' example. we have two actions that are sent to different objects ie.text_field(:name, "q").set("pickaxe") # q is the name of the search field ie.button(:name, "btnG").click # "btnG" is the name of the Search button I think what we'd have to map is this: text_field(:name, "q") so SearchField="text_field(:name, 'q')" Now.I was thinking of using the Ruby HashMap, so we could have googlewin = { "SearchField" => "text_field(:name, 'q')" "SearchButon" => "button(:name, 'btnG')" ... etc } We will need to keep all action methods in a collection as well (e.g. click, set) So the test table will look something like this test, win object Action Arg #header T, googlewin, SearchField, set, "PickAxe" T, googlewin, SearchButon, click We could read in and process the above input, so the script will look like GUIAction = "ie." + object + "." + Action "." + Args Questions 1. What do you think? 2. Should I put every GUIobject within 1 class with every window being a different method or each window being a separate class? 3. I am not so sure on the Ruby syntax to get the value from a key? Is it something like ' googlewin.key("SearchField")' ? Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From lukasz.olek at gmail.com Thu Apr 20 09:48:12 2006 From: lukasz.olek at gmail.com (=?ISO-8859-2?Q?=A3ukasz_Olek?=) Date: Thu, 20 Apr 2006 15:48:12 +0200 Subject: [Wtr-general] Is it possible to nest :xpath queries? Message-ID: <4f97645f9ffc96dc22ace4db3d1b67e2@gmail.com> Hello, I am wondering if it is possible to do something like this: book = ie.span(:xpath, "//span[@name='book']") book.link(:xpath, "//a[@name='save']").click() The only way for me to execute this is to combine it into one query: ie.link(:xpath, "//span[@name='book']//a[@name='save']").click But for more complex examples it will be unreadable. Maybe you have some solutions? Greetings, Lukasz Olek From raghu at qantom.com Thu Apr 20 11:31:48 2006 From: raghu at qantom.com (Raghu Venkataramana) Date: Thu, 20 Apr 2006 21:01:48 +0530 Subject: [Wtr-general] Application Map In-Reply-To: References: Message-ID: <4447A964.5020208@qantom.com> The XML Object repository implemented addresses this problem. There we define all objects using an xml repository. When we need to use it, all you have to say is Repository("SearchField").do_your_action Thanks Raghu Adrian Rutter wrote: >Hi, > >If we take a look at the 'googlesearch' example. we have two actions that >are sent to different objects > >ie.text_field(:name, "q").set("pickaxe") # q is the name of the >search field >ie.button(:name, "btnG").click # "btnG" is the name of the Search button > > >I think what we'd have to map is this: > >text_field(:name, "q") > >so > >SearchField="text_field(:name, 'q')" > > >Now.I was thinking of using the Ruby HashMap, so we could have > >googlewin = { > "SearchField" => "text_field(:name, 'q')" > "SearchButon" => "button(:name, 'btnG')" > > ... etc > >} > >We will need to keep all action methods in a collection as well (e.g. >click, set) > >So the test table will look something like this > >test, win object Action Arg #header > >T, googlewin, SearchField, set, "PickAxe" >T, googlewin, SearchButon, click > >We could read in and process the above input, so the script will look like > >GUIAction = "ie." + object + "." + Action "." + Args > >Questions > >1. What do you think? >2. Should I put every GUIobject within 1 class with every window being a >different method or each window being a separate class? >3. I am not so sure on the Ruby syntax to get the value from a key? Is it >something like ' googlewin.key("SearchField")' ? > >Aidy > > > >--------------------------------------------------------------------------------------------------------------- >This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. >If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. >If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. >--------------------------------------------------------------------------------------------------------------- >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > -- Qantom Software Pvt. Ltd http://www.qantom.com Ph : 91-80-26655216 Xtn. 125 -- From raghu at qantom.com Thu Apr 20 11:50:40 2006 From: raghu at qantom.com (Raghu Venkataramana) Date: Thu, 20 Apr 2006 21:20:40 +0530 Subject: [Wtr-general] Application Map In-Reply-To: <4447A964.5020208@qantom.com> References: <4447A964.5020208@qantom.com> Message-ID: <4447ADD0.7030408@qantom.com> Raghu Venkataramana wrote: >The XML Object repository implemented addresses this problem. > (Addresses the GUI Map problem) >There we >define all objects using >an xml repository. When we need to use it, all you have to say is > >Repository("SearchField").do_your_action > >Thanks >Raghu > >Adrian Rutter wrote: > > > >>Hi, >> >>If we take a look at the 'googlesearch' example. we have two actions that >>are sent to different objects >> >>ie.text_field(:name, "q").set("pickaxe") # q is the name of the >>search field >>ie.button(:name, "btnG").click # "btnG" is the name of the Search button >> >> >>I think what we'd have to map is this: >> >>text_field(:name, "q") >> >>so >> >>SearchField="text_field(:name, 'q')" >> >> >>Now.I was thinking of using the Ruby HashMap, so we could have >> >>googlewin = { >>"SearchField" => "text_field(:name, 'q')" >>"SearchButon" => "button(:name, 'btnG')" >> >>... etc >> >>} >> >>We will need to keep all action methods in a collection as well (e.g. >>click, set) >> >>So the test table will look something like this >> >>test, win object Action Arg #header >> >>T, googlewin, SearchField, set, "PickAxe" >>T, googlewin, SearchButon, click >> >>We could read in and process the above input, so the script will look like >> >>GUIAction = "ie." + object + "." + Action "." + Args >> >>Questions >> >>1. What do you think? >>2. Should I put every GUIobject within 1 class with every window being a >>different method or each window being a separate class? >>3. I am not so sure on the Ruby syntax to get the value from a key? Is it >>something like ' googlewin.key("SearchField")' ? >> >>Aidy >> >> >> >>--------------------------------------------------------------------------------------------------------------- >>This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. >>If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. >>If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. >>--------------------------------------------------------------------------------------------------------------- >>_______________________________________________ >>Wtr-general mailing list >>Wtr-general at rubyforge.org >>http://rubyforge.org/mailman/listinfo/wtr-general >> >> >> >> >> > > > > -- Qantom Software Pvt. Ltd http://www.qantom.com Ph : 91-80-26655216 Xtn. 125 -- From bret at pettichord.com Thu Apr 20 13:18:20 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 20 Apr 2006 12:18:20 -0500 Subject: [Wtr-general] Application Map In-Reply-To: References: Message-ID: I am thinking of adding a Map class to Watir. Here's how it would work... On 4/20/06, Adrian Rutter wrote: > > Hi, > > If we take a look at the 'googlesearch' example. we have two actions that > are sent to different objects > > ie.text_field(:name, "q").set("pickaxe") # q is the name of the > search field > ie.button(:name, "btnG").click # "btnG" is the name of the Search button > > > I think what we'd have to map is this: > > text_field(:name, "q") > > so > > SearchField="text_field(:name, 'q')" map = Watir::Map.new SearchField=map.text_field(:name, 'q') Now.I was thinking of using the Ruby HashMap, so we could have > > googlewin = { > "SearchField" => "text_field(:name, 'q')" > "SearchButon" => "button(:name, 'btnG')" > > ... etc > > } SearchButton = map.button(:name, 'btnG') > We will need to keep all action methods in a collection as well (e.g. > click, set) > > So the test table will look something like this > > test, win object Action Arg #header > > T, googlewin, SearchField, set, "PickAxe" > T, googlewin, SearchButon, click > > We could read in and process the above input, so the script will look like > > GUIAction = "ie." + object + "." + Action "." + Args To use these objects you would first do ie = Watir::IE.start('http://google.com') map.bind(ie) SearchField.set("PickAxe") SearchButton.click Questions > > 1. What do you think? > 2. Should I put every GUIobject within 1 class with every window being a > different method or each window being a separate class? If you wanted to, you could store these map-elements in a module named after the window: GoogleWin::SearchButton = map.button(:name, 'btnG') 3. I am not so sure on the Ruby syntax to get the value from a key? Is it > something like ' googlewin.key("SearchField")' ? > > Aidy > > > > > --------------------------------------------------------------------------------------------------------------- > This message and any attachment are confidential and may be privileged or > otherwise protected from disclosure. > If you are not the intended recipient, please telephone or email the > sender and delete this message and any attachment from your system. > If you are not the intended recipient you must not copy this message or > attachment or disclose the contents to any other person. > > --------------------------------------------------------------------------------------------------------------- > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060420/7db4c456/attachment.html From christopher.mcmahon at gmail.com Thu Apr 20 13:28:27 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 20 Apr 2006 10:28:27 -0700 Subject: [Wtr-general] Application Map In-Reply-To: References: Message-ID: <72799cd70604201028i19e72c07i925fe09838c6af1@mail.gmail.com> On 4/20/06, Bret Pettichord wrote: > I am thinking of adding a Map class to Watir. Here's how it would work... > You should call it "Windowmap" or something, though, so it doesn't get confused with map/collect -C From Bill.Attebery at twtelecom.com Thu Apr 20 14:41:34 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Thu, 20 Apr 2006 12:41:34 -0600 Subject: [Wtr-general] Application Map Message-ID: I've been working on mapping our in house apps as part of a testing framework using Watir I'm working on, I was using YAML for the mapping -- here's an example : example YAML: form: Customer frame: none fields: - Label: Sales Customer Name Type: text_field Name: SalesCustomerName Id: SalesCustomerName - Label: Short Name Type: text_field Name: ShortName Id: ShortName - Label: Legal Names Type: selectValuesDialog Name: Id: HelperId: Dbx_LegalNames HelperType: link HelperSymbol: id - Label: Other Names Type: selectValuesDialog Name: Id: HelperId: Dbx_OtherNames HelperType: link HelperSymbol: id I purposely left out any test data to separate the page structure from the test data, allowing me to only have to update the YAML if/when the page changes, and allowing me to send in various permutations of test data. I created a script to populate the form providing it with a Hash of Label => Value and the YAML, the labels are the actual labels the user sees in the page, making it easy to generate test data. The Id and Name are taken from the HTML and used in the watir commands as needed. example Hash: testCustHash = {"Sales Customer Name" => "Test Company", "Legal Names" => "Test Legal", "Other Names" => " Test Other", } example Command: populateForm(myTestHash, myTestYAML, ie) -- which iterates through the Hash, finds the appropriate entry in the YAML and populates the field as desired. (I have a populateForm and a populateField -- the populateField does a single field, and the populateForm does the entire page with multiple calls to the populateField method) The populateField method calls the appropriate watir mehtod or a helper method if needed to populate the field/page for me. Some of my fields bring up 2nd IE windows to do the entry (calendarWidget, Address mini-form, multi-value selects etc), so I created helper methods to populate these too using the same engine, only this time I trigger the action that brings it up first and then populate . The trigger is usually a jscript(onClick) event on a button, image or link object. I build a command to trigger the event based on the Helper entries in the YAML. (Example provided below because I think there was another question about this topic earlier in the week where this might be applicable -- to use this I call eval(cmd) elsewhere in the script) def buildJscriptCmd(fieldYaml) @symbol=fieldYaml["HelperSymbol"] @id=fieldYaml["HelperId"] @helper=fieldYaml["HelperType"] @cmd="@ie.#{@helper}(:#{@symbol},\'#{@id}\').fireEvent(\'onClick\')" end I see this as a viable framework to help the team be productive producing working scripts early on while learning Ruby and Watir, without having to mine the HTML. I also think it allows for easy maintenance if the pages change, I can update in the YAML and the scripts should be pretty good to go. YAML also is very flexible, I can add/remove attributes if I identify other test modes that I'd like to support, I could add a required attribute to identify all the required fields for example, or dependency if fields are dependent on others, etc. This can even be done at runtime using the YAML library I believe if your app so demands. I'll probably extend my framework to use YAML to wrap the verifications too at some point, to improve maintainability. I also envision using rubyFit or something like it to drive this in the future. Sorry for the book, just thought I'd share on this topic. :-) _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Thursday, April 20, 2006 11:18 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Application Map I am thinking of adding a Map class to Watir. Here's how it would work... On 4/20/06, Adrian Rutter wrote: Hi, If we take a look at the 'googlesearch' example. we have two actions that are sent to different objects ie.text_field(:name, "q").set("pickaxe") # q is the name of the search field ie.button(:name, "btnG").click # "btnG" is the name of the Search button I think what we'd have to map is this: text_field(:name, "q") so SearchField="text_field(:name, 'q')" map = Watir::Map.new SearchField=map.text_field (:name, 'q') Now.I was thinking of using the Ruby HashMap, so we could have googlewin = { "SearchField" => "text_field(:name, 'q')" "SearchButon" => "button(:name, 'btnG')" ... etc } SearchButton = map.button (:name, 'btnG') We will need to keep all action methods in a collection as well (e.g . click, set) So the test table will look something like this test, win object Action Arg #header T, googlewin, SearchField, set, "PickAxe" T, googlewin, SearchButon, click We could read in and process the above input, so the script will look like GUIAction = "ie." + object + "." + Action "." + Args To use these objects you would first do ie = Watir::IE.start('http://google.com') map.bind(ie) SearchField.set("PickAxe") SearchButton.click Questions 1. What do you think? 2. Should I put every GUIobject within 1 class with every window being a different method or each window being a separate class? If you wanted to, you could store these map-elements in a module named after the window: GoogleWin::SearchButton = map.button(:name, 'btnG') 3. I am not so sure on the Ruby syntax to get the value from a key? Is it something like ' googlewin.key("SearchField")' ? Aidy ------------------------------------------------------------------------ --------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. ------------------------------------------------------------------------ --------------------------------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060420/6e59e4e8/attachment.html From tester.paul at gmail.com Thu Apr 20 15:05:01 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Thu, 20 Apr 2006 15:05:01 -0400 Subject: [Wtr-general] Trying to understand the UnitTests directory manipulation Message-ID: <37c405480604201205g4959f836y717656e84dee31de@mail.gmail.com> I'm finally getting around to taking a closer look at the Watir UnitTests and thought that I would start with the 'all_tests.rb' and 'core_tests.rb' scripts. I'm having some trouble trying to understand *why* the paths are manipulated the way they are. Both files are basically the same, just the [variable] list of test files called is different. Here's the 'all_tests.rb' script: --- TOPDIR = File.join(File.dirname(__FILE__), '..') $LOAD_PATH.unshift TOPDIR require 'unittests/setup.rb' Dir.chdir TOPDIR $all_tests.each {|x| require x} --- Here's my understanding of what this script is doing: 1) Line one sets the variable = './..' ( using a much more verbose way of doing it ;) ) - Incidentally, I was unable to find any reference to the use of '__FILE__' anywhere. Is that some special kind of dummy variable? Can someone please tell me how/why this works? 2) Line two prepends './..' to the Ruby load path - I don't understand the design choice behind this. i.e. I don't know why the first two lines can't just be squished into this one line - as in: $LOAD_PATH.unshift './..' ( I must be missing something important further down the scripts that I haven't gotten to yet. ) 3) skip line three for the moment.. 4) Line four changes the current directory to the parent of the current (i.e. essentially 'cd ..') 5) Back to Line three - now that we are one directory back/up, let's _require_ the file that *used to be* in the current directory, but now is in the subdirectory called 'unittests' 6) Finally, call/require all the test files (where each element in the variable array contains the path 'unittests/' before the filename) Did I get that right? So my question is this: - Why do the UnitTest scripts go to all the trouble of prepending the parent path to the Ruby Load Path, then change to the parent path, only to then call all the files in the desired subdirectory? Is there something that I'm missing regarding the value of directory *position* when running Ruby/Watir scripts? I am not doing this directory one-two step in my scripts and am wondering if it is something that I should add or not. Please let me know what I am missing here. Thanks. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060420/1dbba2c6/attachment.html From Mark_Cain at rl.gov Thu Apr 20 15:40:27 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Thu, 20 Apr 2006 12:40:27 -0700 Subject: [Wtr-general] Trying to understand the UnitTests directorymanipulation Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04E020F76C7@EX5V.rl.gov> This is right out of the pickaxe 2nd edition pages 336 - 337. __FILE__ String The name of the current source file. [r/o] The constant __FILE__ and the variable $0 are often used together to run code only if it appears in the file run directly by the user. For example, library writers often use this to include tests in their libraries that will run if the library source is run directly, but not if the source is required into another program. # Library code #... If __FILE__ == $0 #tests ... end --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Carvalho Sent: Thursday, April 20, 2006 12:05 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Trying to understand the UnitTests directorymanipulation I'm finally getting around to taking a closer look at the Watir UnitTests and thought that I would start with the 'all_tests.rb' and 'core_tests.rb' scripts. I'm having some trouble trying to understand *why* the paths are manipulated the way they are. Both files are basically the same, just the [variable] list of test files called is different. Here's the 'all_tests.rb' script: --- TOPDIR = File.join(File.dirname(__FILE__), '..') $LOAD_PATH.unshift TOPDIR require 'unittests/setup.rb' Dir.chdir TOPDIR $all_tests.each {|x| require x} --- Here's my understanding of what this script is doing: 1) Line one sets the variable = './..' ( using a much more verbose way of doing it ;) ) - Incidentally, I was unable to find any reference to the use of '__FILE__' anywhere. Is that some special kind of dummy variable? Can someone please tell me how/why this works? 2) Line two prepends './..' to the Ruby load path - I don't understand the design choice behind this. i.e. I don't know why the first two lines can't just be squished into this one line - as in: $LOAD_PATH.unshift './..' ( I must be missing something important further down the scripts that I haven't gotten to yet. ) 3) skip line three for the moment.. 4) Line four changes the current directory to the parent of the current (i.e. essentially 'cd ..') 5) Back to Line three - now that we are one directory back/up, let's _require_ the file that *used to be* in the current directory, but now is in the subdirectory called 'unittests' 6) Finally, call/require all the test files (where each element in the variable array contains the path 'unittests/' before the filename) Did I get that right? So my question is this: - Why do the UnitTest scripts go to all the trouble of prepending the parent path to the Ruby Load Path, then change to the parent path, only to then call all the files in the desired subdirectory? Is there something that I'm missing regarding the value of directory *position* when running Ruby/Watir scripts? I am not doing this directory one-two step in my scripts and am wondering if it is something that I should add or not. Please let me know what I am missing here. Thanks. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060420/4f950c9e/attachment.html From tester.paul at gmail.com Thu Apr 20 15:54:33 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Thu, 20 Apr 2006 15:54:33 -0400 Subject: [Wtr-general] Trying to understand the UnitTests directorymanipulation In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04E020F76C7@EX5V.rl.gov> References: <9C0BD1E3DAF1204D842D72E2DCE2A04E020F76C7@EX5V.rl.gov> Message-ID: <37c405480604201254yaf1b439mb922ca49efeec948@mail.gmail.com> Aha! Thank you. I now have a new page in the book to dog-ear! I had checked the Ruby Library Reference (from p. 421 onwards) and couldn't find that info. (I'm still working my way through the book.) Thanks also for the interesting example comparing __FILE__ and $0. Cheers. Paul. On 20/04/06, Cain, Mark wrote: > > This is right out of the pickaxe 2nd edition pages 336 - 337. > > __FILE__ String The name of the current source > file. [r/o] > [snip] -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060420/3a2e6b7e/attachment.html From tester.paul at gmail.com Thu Apr 20 17:13:10 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Thu, 20 Apr 2006 17:13:10 -0400 Subject: [Wtr-general] Is there a Frames.length command? Message-ID: <37c405480604201413s1343646bj9d34c82916e81084@mail.gmail.com> I have to write a multipurpose method that will capture certain output from a web page and it needs to know whether or not there are frames on the page. I thought there was an easy way to tell how many frames there are on a page, but I can't find it. That is, I tried something like: ie.frames.length => Which returns an error with WATIR 1.4.1. For the moment, I am fudging the frame count creatively with the following check: ie.show_frames.to_s[-2,1] == '-' => Which returns true/false to the question 'Are there 0 frames on the page?'. (I only need the boolean response.) Is there a command that will do what I need or is this a feature request? Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060420/2fc4b594/attachment.html From phanideepam at yahoo.com Thu Apr 20 17:40:42 2006 From: phanideepam at yahoo.com (Deepa Mallapareddy) Date: Thu, 20 Apr 2006 14:40:42 -0700 (PDT) Subject: [Wtr-general] Regarding saving a page as .mht while running the testsuite In-Reply-To: <994720e20604131412k36b430cbk9bb0f94b74980c69@mail.gmail.com> Message-ID: <20060420214042.80907.qmail@web50902.mail.yahoo.com> Hi All, Thank you for all the help in the past I have one more question I have generated a test suite in WATIR + RUBY. I need the test suite to take a screen shot of the pages at certain points in each test cases. So I used Screencapture functionality available which is of no use to my requirement coz It will take a snapshot of only the visible portion. I need to scroll down but this scroll down functionality also doesnt work coz the User Interface which Im testing has dynamic content so autscroll or few other similar functionality wont work So we have tried to use the $IE0.send_keys("{ALT}{f}+a {C}{:}{\\}{U}{I}{A}{p}{p}{T}{\\}{R}{e}{s}{u}{l}{t}{s}{\\}{I}{m}{a}{g}{e}{s}{\\}{T}{e}{s}{t}{_}{0}{1}{_}{3}{0}{\\}{1}{2}{3}{.}{m}{h}{t}{m}{l}{TAB} {DOWN} {DOWN} {TAB} {ALT}{s}")>> where in we are forcing page to be saved in a particular folder. I was wondering if any one can tell me if we can use a variable in the send_keys so that I can store it any where with out hard coding it. Or could any one of you please tell me a better way of saving pages in HTML/MHT with out loosing the content. Thanks! Deepa Whatever you can do or dream you can, begin it. Boldness has genius, power, and magic in it. --Johann Wolfgang von Goethe ------------------------------------------------------------------------ Deepa Mallapareddy, 4981,Catoctin Drive, Apt#15,San Diego CA - 92115 --------------------------------- Celebrate Earth Day everyday! Discover 10 things you can do to help slow climate change. Yahoo! Earth Day -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060420/61551a09/attachment.html From rodrigo.martin at enratio.com Thu Apr 20 18:32:45 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Thu, 20 Apr 2006 19:32:45 -0300 Subject: [Wtr-general] [question] Again Modal Dialogs and Watir 1.5 Message-ID: Hello everybody, i?m having a terrible headache with the Security Alert Dialogs that appears in my tests... I?ve already tried the WinHelper, WinSecurity thread in Watir 1.41 and that doesn?t work at all.. Today i?ve downloaded the development version of Watir 1.5 (which I guess it fix this modal dialogs troubles) and tried again, with no good results at all... Anybody could achieve this? Sorry if i?m repetitive but i?m really stucked with this =( Cheers and Thanks in Advance Rodrigo Juli?n Mart?n -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060420/8a4da036/attachment.html From matthias_malek at hotmail.com Thu Apr 20 18:37:31 2006 From: matthias_malek at hotmail.com (Matthias Malek) Date: Thu, 20 Apr 2006 22:37:31 +0000 Subject: [Wtr-general] URGENT: Image click issue (is there click_no_wait?) Message-ID: An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060420/b1dc4150/attachment.html From Adrian.Rutter at tnt.com Fri Apr 21 04:31:42 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Fri, 21 Apr 2006 09:31:42 +0100 Subject: [Wtr-general] Application Map Message-ID: Hi Bret, > I am thinking of adding a Map class to Watir. Great idea. If you need any help send me your unit-tests. Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From noreply at rubyforge.org Fri Apr 21 07:09:13 2006 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 21 Apr 2006 20:09:13 +0900 Subject: [Wtr-general] [ wtr-Feature Requests-4202 ] Requesting to add Syantax prompter in Scite Editor Message-ID: <200604211109.k3LB9DjT009160@rubyforge.org> Feature Requests item #4202, was opened at 2006-04-21 20:09 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=490&aid=4202&group_id=104 Category: General Group: 1.5 Status: Open Resolution: None Priority: 3 Submitted By: Abhijeet Bhagat (abhijeet_bhagat) Assigned to: Nobody (None) Summary: Requesting to add Syantax prompter in Scite Editor Initial Comment: Requesting to Provide a IDE for WATIR or Syntax prompter in any Editor for Watir ~AB ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=490&aid=4202&group_id=104 From bret at pettichord.com Fri Apr 21 10:35:21 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 21 Apr 2006 09:35:21 -0500 Subject: [Wtr-general] [question] Again Modal Dialogs and Watir 1.5 In-Reply-To: References: Message-ID: Rodrigo, I generally try to set my security settings so these dialogs don't show up in the first place. It's quite possible that they have been designed not be to be scriptable specifically to prevent scripting-based attacks from being able to directly manipulate the security dialogs. There has been little or no work in this area with Watir since 1.4.1. Look at our code and see if you can find a solution using Autoit or the direct calls to the Windows API. Frankly, Watir's support for windows non-web modal dialogs is limited and not terribly reliably. Fixing it was originally in the Road Map for 1.5, but it may get deferred. Bret On 4/20/06, Rodrigo Julian Martin wrote: > > Hello everybody, i?m having a terrible headache with the Security Alert > Dialogs that appears in my tests... > > I?ve already tried the WinHelper, WinSecurity thread in Watir 1.41 and > that doesn?t work at all.. > Today i?ve downloaded the development version of Watir 1.5 (which I guess > it fix this modal dialogs troubles) and tried again, with no good results at > all... Anybody could achieve this? Sorry if i?m repetitive but i?m really > stucked with this =( > > Cheers and Thanks in Advance > > Rodrigo Juli?n Mart?n > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060421/e10988a3/attachment.html From bret at pettichord.com Fri Apr 21 10:55:11 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 21 Apr 2006 09:55:11 -0500 Subject: [Wtr-general] URGENT: Image click issue (is there click_no_wait?) In-Reply-To: References: Message-ID: click_no_wait is defined for Watir::Image, but not for the COM object that you are directly referencing. On 4/20/06, Matthias Malek wrote: > > Hi, > I have an image object...... > img = .....getElementsByTagName('img')['0'] > > Then I call img.click, which opens a URL.... > How can I attach this URL using IE.attach? because once I call the > img.click..the code waits for the dialog to close.... > is there a something like img.click_no_wait? for images? how can I handle > this situation? > > thanks a lot > Matthias Malek > > > ------------------------------ > With MSN Spaces email straight to your blog. Upload jokes, photos and > more. It's free! > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060421/b5f60eaf/attachment.html From tester.paul at gmail.com Fri Apr 21 11:00:02 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Fri, 21 Apr 2006 11:00:02 -0400 Subject: [Wtr-general] Saving HTML to output adds extra line feeds? Message-ID: <37c405480604210800s56d9440by8c0d45a473857306@mail.gmail.com> I just wrote a routine that will save the html output to a file if a "Server Error" should appear on a page. I noticed something odd when I examine the TXT file though - it looks like there are line feed characters at the end of each line. Depending on the application I use to view the TXT file, I will see either a control character 'square' at the end of each line, or the output looks double spaced. Does anyone know how I can save the html output without these extra line feed characters? I am using Watir 1.4.1. Here is the calling script code: --- if ie.contains_text('Server Error') create_exception_report( ie.html ) end --- Here is a snippet of the method code that writes the output: --- def create_exception_report( html_content ) # A nasty Server Error has occurred. Open a file to capture the results: f_e = File.new(filename, "w") [snip] f_e.puts '=> ERROR DETAILS:' f_e.puts '-----------------' f_e.puts html_content # <- ** line of interest ** f_e.puts '' # Close the file f_e.close end --- Here is a sample of the txt file output viewed in a text editor (not NotePad): --- => ERROR DETAILS: -----------------

Server Error in '/ServerName' Application.

--- What I was expecting: --- => ERROR DETAILS: -----------------

Server Error in '/ServerName' Application.

--- Any Suggestions? Is there an alternate command that I can use to write the html output to file? Perhaps I can scrub the html content to remove these control characters? Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060421/0db25206/attachment.html From Bill.Attebery at twtelecom.com Fri Apr 21 12:45:39 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Fri, 21 Apr 2006 10:45:39 -0600 Subject: [Wtr-general] Saving HTML to output adds extra line feeds? Message-ID: I suspect that since puts includes a newline character that that's where your problem is. Try putting a .chomp! at the end of each of your puts statements or use another print variant that doesn't include the newline char. f_e.puts '=> ERROR DETAILS:'.chomp! _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Carvalho Sent: Friday, April 21, 2006 9:00 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Saving HTML to output adds extra line feeds? I just wrote a routine that will save the html output to a file if a "Server Error" should appear on a page. I noticed something odd when I examine the TXT file though - it looks like there are line feed characters at the end of each line. Depending on the application I use to view the TXT file, I will see either a control character 'square' at the end of each line, or the output looks double spaced. Does anyone know how I can save the html output without these extra line feed characters? I am using Watir 1.4.1. Here is the calling script code: --- if ie.contains_text('Server Error') create_exception_report( ie.html ) end --- Here is a snippet of the method code that writes the output: --- def create_exception_report( html_content ) # A nasty Server Error has occurred. Open a file to capture the results: f_e = File.new(filename, "w") [snip] f_e.puts '=> ERROR DETAILS:' f_e.puts '-----------------' f_e.puts html_content # <- ** line of interest ** f_e.puts '' # Close the file f_e.close end --- Here is a sample of the txt file output viewed in a text editor (not NotePad): --- => ERROR DETAILS: -----------------

Server Error in '/ServerName' Application.

--- What I was expecting: --- => ERROR DETAILS: -----------------

Server Error in '/ServerName' Application.

--- Any Suggestions? Is there an alternate command that I can use to write the html output to file? Perhaps I can scrub the html content to remove these control characters? Paul. The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060421/9fa5ccbc/attachment.html From Bill.Attebery at twtelecom.com Fri Apr 21 12:54:47 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Fri, 21 Apr 2006 10:54:47 -0600 Subject: [Wtr-general] Saving HTML to output adds extra line feeds? Message-ID: Sorry Paul -- I didn't read your code close enough -- please disregard my response, I made a bad assumption. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Carvalho Sent: Friday, April 21, 2006 9:00 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Saving HTML to output adds extra line feeds? I just wrote a routine that will save the html output to a file if a "Server Error" should appear on a page. I noticed something odd when I examine the TXT file though - it looks like there are line feed characters at the end of each line. Depending on the application I use to view the TXT file, I will see either a control character 'square' at the end of each line, or the output looks double spaced. Does anyone know how I can save the html output without these extra line feed characters? I am using Watir 1.4.1. Here is the calling script code: --- if ie.contains_text('Server Error') create_exception_report( ie.html ) end --- Here is a snippet of the method code that writes the output: --- def create_exception_report( html_content ) # A nasty Server Error has occurred. Open a file to capture the results: f_e = File.new(filename, "w") [snip] f_e.puts '=> ERROR DETAILS:' f_e.puts '-----------------' f_e.puts html_content # <- ** line of interest ** f_e.puts '' # Close the file f_e.close end --- Here is a sample of the txt file output viewed in a text editor (not NotePad): --- => ERROR DETAILS: -----------------

Server Error in '/ServerName' Application.

--- What I was expecting: --- => ERROR DETAILS: -----------------

Server Error in '/ServerName' Application.

--- Any Suggestions? Is there an alternate command that I can use to write the html output to file? Perhaps I can scrub the html content to remove these control characters? Paul. The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060421/b028963f/attachment.html From Bill.Attebery at twtelecom.com Fri Apr 21 13:08:41 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Fri, 21 Apr 2006 11:08:41 -0600 Subject: [Wtr-general] Saving HTML to output adds extra line feeds? Message-ID: Paul -- I tried these and they both seemed to do the trick: f_e.write html_content f_e.print html_content _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Attebery, Bill Sent: Friday, April 21, 2006 10:46 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Saving HTML to output adds extra line feeds? I suspect that since puts includes a newline character that that's where your problem is. Try putting a .chomp! at the end of each of your puts statements or use another print variant that doesn't include the newline char. f_e.puts '=> ERROR DETAILS:'.chomp! _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Carvalho Sent: Friday, April 21, 2006 9:00 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Saving HTML to output adds extra line feeds? I just wrote a routine that will save the html output to a file if a "Server Error" should appear on a page. I noticed something odd when I examine the TXT file though - it looks like there are line feed characters at the end of each line. Depending on the application I use to view the TXT file, I will see either a control character 'square' at the end of each line, or the output looks double spaced. Does anyone know how I can save the html output without these extra line feed characters? I am using Watir 1.4.1. Here is the calling script code: --- if ie.contains_text('Server Error') create_exception_report( ie.html ) end --- Here is a snippet of the method code that writes the output: --- def create_exception_report( html_content ) # A nasty Server Error has occurred. Open a file to capture the results: f_e = File.new(filename, "w") [snip] f_e.puts '=> ERROR DETAILS:' f_e.puts '-----------------' f_e.puts html_content # <- ** line of interest ** f_e.puts '' # Close the file f_e.close end --- Here is a sample of the txt file output viewed in a text editor (not NotePad): --- => ERROR DETAILS: -----------------

Server Error in '/ServerName' Application.

--- What I was expecting: --- => ERROR DETAILS: -----------------

Server Error in '/ServerName' Application.

--- Any Suggestions? Is there an alternate command that I can use to write the html output to file? Perhaps I can scrub the html content to remove these control characters? Paul. The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060421/39922c33/attachment.html From tester.paul at gmail.com Fri Apr 21 13:51:38 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Fri, 21 Apr 2006 13:51:38 -0400 Subject: [Wtr-general] Saving HTML to output adds extra line feeds? In-Reply-To: References: Message-ID: <37c405480604211051w6af6e3d7q439529673724bd9d@mail.gmail.com> Thanks for the replies Bill, but neither (write or print) seemed to work for me. That is, the output still had the extra line feeds. I decided to try removing the extra line feeds manually and it worked, so I'll go with that for now: f_e.puts html_content.delete( 10.chr ) Cheers! Paul. On 21/04/06, Attebery, Bill wrote: > > Paul -- I tried these and they both seemed to do the trick: > > f_e.write html_content > f_e.print html_content > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060421/a145a66f/attachment.html From bret at pettichord.com Fri Apr 21 14:18:34 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 21 Apr 2006 13:18:34 -0500 Subject: [Wtr-general] Regarding saving a page as .mht while running the testsuite In-Reply-To: <20060420214042.80907.qmail@web50902.mail.yahoo.com> References: <994720e20604131412k36b430cbk9bb0f94b74980c69@mail.gmail.com> <20060420214042.80907.qmail@web50902.mail.yahoo.com> Message-ID: On 4/20/06, Deepa Mallapareddy wrote: > > I was wondering if any one can tell me if we can use a variable in the > send_keys so that I can store it any where with out hard coding it. > You certainly can. You can use variables with any Watir method (and indeed any Ruby method at all). > Or could any one of you please tell me a better way of saving pages in > HTML/MHT with out loosing the content. > Read Paul's recent mail where he describes how he is directly saving the html. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060421/6917ab93/attachment.html From rodrigo.martin at enratio.com Fri Apr 21 14:24:32 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Fri, 21 Apr 2006 15:24:32 -0300 Subject: [Wtr-general] [question] Again Modal Dialogs and Watir 1.5 References: Message-ID: Dear Brett: I guess that setting the security level in order that the popups doesnt appear is the best solution! But, i've tried in Internet Explorer without success... I've added the site to my Trusted Sites, i've chosen the option: "Don't prompt for client certificate selection...", and this popup still appears... Can you tell me more or less what i have to set in order this popups doesn't appear? Thank you so much for the response.. Cheers Rodrigo Julian Martin ________________________________ De: wtr-general-bounces at rubyforge.org en nombre de Bret Pettichord Enviado el: Vie 21/04/2006 11:35 a.m. Para: wtr-general at rubyforge.org Asunto: Re: [Wtr-general] [question] Again Modal Dialogs and Watir 1.5 Rodrigo, I generally try to set my security settings so these dialogs don't show up in the first place. It's quite possible that they have been designed not be to be scriptable specifically to prevent scripting-based attacks from being able to directly manipulate the security dialogs. There has been little or no work in this area with Watir since 1.4.1. Look at our code and see if you can find a solution using Autoit or the direct calls to the Windows API. Frankly, Watir's support for windows non-web modal dialogs is limited and not terribly reliably. Fixing it was originally in the Road Map for 1.5, but it may get deferred. Bret On 4/20/06, Rodrigo Julian Martin wrote: Hello everybody, i?m having a terrible headache with the Security Alert Dialogs that appears in my tests... I?ve already tried the WinHelper, WinSecurity thread in Watir 1.41 and that doesn?t work at all.. Today i?ve downloaded the development version of Watir 1.5 (which I guess it fix this modal dialogs troubles) and tried again, with no good results at all... Anybody could achieve this? Sorry if i?m repetitive but i?m really stucked with this =( Cheers and Thanks in Advance Rodrigo Juli?n Mart?n _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 6223 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060421/bb294427/attachment.bin From bret at pettichord.com Fri Apr 21 14:37:16 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 21 Apr 2006 13:37:16 -0500 Subject: [Wtr-general] Trying to understand the UnitTests directory manipulation In-Reply-To: <37c405480604201205g4959f836y717656e84dee31de@mail.gmail.com> References: <37c405480604201205g4959f836y717656e84dee31de@mail.gmail.com> Message-ID: On 4/20/06, Paul Carvalho wrote: > > I'm finally getting around to taking a closer look at the Watir UnitTests > and thought that I would start with the 'all_tests.rb' and 'core_tests.rb' > scripts. I'm having some trouble trying to understand *why* the paths are > manipulated the way they are. > > Both files are basically the same, just the [variable] list of test files > called is different. Here's the 'all_tests.rb' script: > --- > TOPDIR = File.join(File.dirname(__FILE__), '..') > $LOAD_PATH.unshift TOPDIR > > require 'unittests/setup.rb' > > Dir.chdir TOPDIR > $all_tests.each {|x| require x} > --- > > Here's my understanding of what this script is doing: > > 1) Line one sets the variable = './..' ( using a much more verbose way > of doing it ;) ) > - Incidentally, I was unable to find any reference to the use of > '__FILE__' anywhere. Is that some special kind of dummy variable? Can > someone please tell me how/why this works? > You have the explanation of __FILE__ from Mark. The important fact you need to understand is that directory that contains this file and the current directory (i.e. ".") are not necessarily the same. If you do this: > cd unittests > ruby core_tests.rb then they are the same. However, you can also run them this way: > cd \ > ruby c:\workspace\watir\unittests\core_tests.rb (assuming this path is where the tests are.) Now the current directory is "c:\". The code is written so that the TOPDIR is correct no matter how the tests are run. 2) Line two prepends './..' to the Ruby load path > - I don't understand the design choice behind this. i.e. I don't know why > the first two lines can't just be squished into this one line - as in: > $LOAD_PATH.unshift './..' > ( I must be missing something important further down the scripts that I > haven't gotten to yet. ) > The two lines could indeed be combined in one. In other Watir tests, this in fact is what is done. But note that it is very important that they are prepended. Typically, you simply append something to the load path. That ensures it is in the path. Prepending will ensure that *this particular version* is what is loaded (i.e. tested). If it was appended, it would be testing the version of Watir installed, not necessary the version that is in the same hierarchy as the tests. (In fact, this would almost always be the wrong version when you are making changes to Watir.) 3) skip line three for the moment.. > > 4) Line four changes the current directory to the parent of the current ( > i.e. essentially 'cd ..') > No. It changes the current directory to the parent of the *file* regardless of current was. (This is why we saved TOPDIR.) 5) Back to Line three - now that we are one directory back/up, let's > _require_ the file that *used to be* in the current directory, but now is in > the subdirectory called 'unittests' > > 6) Finally, call/require all the test files (where each element in the > variable array contains the path 'unittests/' before the filename) > > Did I get that right? > > So my question is this: > - Why do the UnitTest scripts go to all the trouble of prepending the > parent path to the Ruby Load Path, then change to the parent path, only to > then call all the files in the desired subdirectory? > > Is there something that I'm missing regarding the value of directory > *position* when running Ruby/Watir scripts? I am not doing this directory > one-two step in my scripts and am wondering if it is something that I should > add or not. > Please let me know what I am missing here. Thanks. > Looking over the script now, it seems to me that line four is superflous. It was important when creating the all_tests array (in setup.rb), but it is not important when consuming it (all that matters then is the load path, which has already been set up). Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060421/452c024e/attachment.html From bret at pettichord.com Fri Apr 21 14:57:02 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 21 Apr 2006 13:57:02 -0500 Subject: [Wtr-general] [question] Again Modal Dialogs and Watir 1.5 In-Reply-To: References: Message-ID: If i knew what security dialog you were talking about and i knew more about how the IE security settings work, then i could answer your question. Sadly i know neither. Bret On 4/21/06, Rodrigo Julian Martin wrote: > > Dear Brett: > > I guess that setting the security level in order that the popups doesnt > appear is the best solution! But, i've tried in Internet Explorer without > success... I've added the site to my Trusted Sites, i've chosen the option: > "Don't prompt for client certificate selection...", and this popup still > appears... > Can you tell me more or less what i have to set in order this popups > doesn't appear? > > Thank you so much for the response.. > > Cheers > Rodrigo Julian Martin > > ________________________________ > > De: wtr-general-bounces at rubyforge.org en nombre de Bret Pettichord > Enviado el: Vie 21/04/2006 11:35 a.m. > Para: wtr-general at rubyforge.org > Asunto: Re: [Wtr-general] [question] Again Modal Dialogs and Watir 1.5 > > > Rodrigo, > > I generally try to set my security settings so these dialogs don't show up > in the first place. It's quite possible that they have been designed not be > to be scriptable specifically to prevent scripting-based attacks from being > able to directly manipulate the security dialogs. > > There has been little or no work in this area with Watir since 1.4.1. Look > at our code and see if you can find a solution using Autoit or the direct > calls to the Windows API. Frankly, Watir's support for windows non-web modal > dialogs is limited and not terribly reliably. Fixing it was originally in > the Road Map for 1.5, but it may get deferred. > > Bret > > > On 4/20/06, Rodrigo Julian Martin wrote: > > Hello everybody, i?m having a terrible headache with the Security > Alert Dialogs that appears in my tests... > > I?ve already tried the WinHelper, WinSecurity thread in Watir 1.41and that doesn?t work at all.. > Today i?ve downloaded the development version of Watir 1.5 (which > I guess it fix this modal dialogs troubles) and tried again, with no good > results at all... Anybody could achieve this? Sorry if i?m repetitive but > i?m really stucked with this =( > > Cheers and Thanks in Advance > > Rodrigo Juli?n Mart?n > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060421/248a1909/attachment.html From bret at pettichord.com Fri Apr 21 14:58:52 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 21 Apr 2006 13:58:52 -0500 Subject: [Wtr-general] Is there a Frames.length command? In-Reply-To: <37c405480604201413s1343646bj9d34c82916e81084@mail.gmail.com> References: <37c405480604201413s1343646bj9d34c82916e81084@mail.gmail.com> Message-ID: I suggest you look at the code on show_frames for your answer. Bret On 4/20/06, Paul Carvalho wrote: > > I have to write a multipurpose method that will capture certain output > from a web page and it needs to know whether or not there are frames on the > page. > > I thought there was an easy way to tell how many frames there are on a > page, but I can't find it. That is, I tried something like: > ie.frames.length > > => Which returns an error with WATIR 1.4.1. > > For the moment, I am fudging the frame count creatively with the following > check: > ie.show_frames.to_s[-2,1] == '-' > > => Which returns true/false to the question 'Are there 0 frames on the > page?'. (I only need the boolean response.) > > Is there a command that will do what I need or is this a feature request? > > > Paul. > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060421/033cf053/attachment.html From jkohl at telusplanet.net Fri Apr 21 16:10:11 2006 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Fri, 21 Apr 2006 13:10:11 -0700 Subject: [Wtr-general] [question] Again Modal Dialogs and Watir 1.5 In-Reply-To: References: Message-ID: <1145650211.44493c23790e0@webmail.telusplanet.net> To get rid of it you have to install a certificate on the server I believe. I struggled with this a couple of years ago. On Win2K Winclickers would see it, but on my XP box I couldn't dismiss it. -Jonathan Quoting Bret Pettichord : > If i knew what security dialog you were talking about and i knew more about > how the IE security settings work, then i could answer your question. Sadly > i know neither. > > Bret > > On 4/21/06, Rodrigo Julian Martin wrote: > > > > Dear Brett: > > > > I guess that setting the security level in order that the popups doesnt > > appear is the best solution! But, i've tried in Internet Explorer without > > success... I've added the site to my Trusted Sites, i've chosen the > option: > > "Don't prompt for client certificate selection...", and this popup still > > appears... > > Can you tell me more or less what i have to set in order this popups > > doesn't appear? > > > > Thank you so much for the response.. > > > > Cheers > > Rodrigo Julian Martin > > > > ________________________________ > > > > De: wtr-general-bounces at rubyforge.org en nombre de Bret Pettichord > > Enviado el: Vie 21/04/2006 11:35 a.m. > > Para: wtr-general at rubyforge.org > > Asunto: Re: [Wtr-general] [question] Again Modal Dialogs and Watir 1.5 > > > > > > Rodrigo, > > > > I generally try to set my security settings so these dialogs don't show up > > in the first place. It's quite possible that they have been designed not > be > > to be scriptable specifically to prevent scripting-based attacks from > being > > able to directly manipulate the security dialogs. > > > > There has been little or no work in this area with Watir since 1.4.1. Look > > at our code and see if you can find a solution using Autoit or the direct > > calls to the Windows API. Frankly, Watir's support for windows non-web > modal > > dialogs is limited and not terribly reliably. Fixing it was originally in > > the Road Map for 1.5, but it may get deferred. > > > > Bret > > > > > > On 4/20/06, Rodrigo Julian Martin wrote: > > > > Hello everybody, i?m having a terrible headache with the Security > > Alert Dialogs that appears in my tests... > > > > I?ve already tried the WinHelper, WinSecurity thread in Watir > 1.41and that doesn?t work at all.. > > Today i?ve downloaded the development version of Watir 1.5 (which > > I guess it fix this modal dialogs troubles) and tried again, with no good > > results at all... Anybody could achieve this? Sorry if i?m repetitive but > > i?m really stucked with this =( > > > > Cheers and Thanks in Advance > > > > Rodrigo Juli?n Mart?n > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > From matthias_malek at hotmail.com Fri Apr 21 15:32:39 2006 From: matthias_malek at hotmail.com (Matthias Malek) Date: Fri, 21 Apr 2006 19:32:39 +0000 Subject: [Wtr-general] When is Watir 1.5 going to be available? Message-ID: An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060421/f7ed6340/attachment.html From tester.paul at gmail.com Fri Apr 21 16:00:26 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Fri, 21 Apr 2006 16:00:26 -0400 Subject: [Wtr-general] Is there a Frames.length command? In-Reply-To: References: <37c405480604201413s1343646bj9d34c82916e81084@mail.gmail.com> Message-ID: <37c405480604211300q5e7bfc88g48f289a92577d01@mail.gmail.com> oooo, ahhhh, sneaky. I never thought to look there.. That is perfect! Thank you. I had to stop using my 'show_frames' hack because it was too noisy to STDOUT. Now I can get around the kludge for my hack. =) Cheers. Paul. On 21/04/06, Bret Pettichord wrote: > > I suggest you look at the code on show_frames for your answer. > > Bret > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060421/ba97e1a7/attachment.html From zeljko.filipin at gmail.com Fri Apr 21 16:16:00 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Fri, 21 Apr 2006 22:16:00 +0200 Subject: [Wtr-general] When is Watir 1.5 going to be available? In-Reply-To: References: Message-ID: http://wiki.openqa.org/display/WTR/Development+Builds On 4/21/06, Matthias Malek wrote: > > Is there a alfa or beta version I can dowload? > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060421/912f1d09/attachment.html From stuporglue at gmail.com Fri Apr 21 17:51:30 2006 From: stuporglue at gmail.com (Michael Moore) Date: Fri, 21 Apr 2006 15:51:30 -0600 Subject: [Wtr-general] Help with workarround Message-ID: A web page has several nested tables, which are generated from a database. I want to print the contents of each of the rows of the outermost table using t.row_values(i). I'm trying this: for i in 1..t.row_count() print i, ": ", t.row_values(i), "\n"; end however t.row_count() is returning the total number of tags inside the outermost table. In other words, it's identifying the right outermost table, but it's considering child-table's rows as it's own. I found this bug: http://rubyforge.org/tracker/index.php?func=detail&aid=2177&group_id=104&atid=487 but don't understand how to implement his implementation. Do I edit the ruby script that currently has row_count() in it, and replace it with his implementation? Thanks, -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. From matthias_malek at hotmail.com Fri Apr 21 17:54:02 2006 From: matthias_malek at hotmail.com (Matthias Malek) Date: Fri, 21 Apr 2006 21:54:02 +0000 Subject: [Wtr-general] click_no_wait in 1.5 fro images Message-ID: An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060421/0576e275/attachment.html From bret at pettichord.com Fri Apr 21 18:51:28 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 21 Apr 2006 17:51:28 -0500 Subject: [Wtr-general] click_no_wait in 1.5 fro images In-Reply-To: References: Message-ID: sounds like an install error. i recommend that you use the gem to install it. Watir::IE::VERSION will tell you what version you are using. On 4/21/06, Matthias Malek wrote: > > Hi, > I just installed (one click) Watir 1.5...and I have the follwowing code, > which gets an image succesfully. > image = frameDetail().image(:src,/button_browse/) > > but if I use > image.click_no_wait......it says the method 'click_no_wait' is > undefined..... > > Maybe I missed some steps in the installation process. For Instance..the > IEDialog.dll was missing..I downloaded the latest tarball and took the > watir directory there and replaced the one in the c:\ruby.....directory.... > > any ideas? > > thanks, > Matthias > > ------------------------------ > Tough security made easy: Antivirus, firewall, backup, and more. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060421/d241835b/attachment.html From bret at pettichord.com Fri Apr 21 18:57:53 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 21 Apr 2006 17:57:53 -0500 Subject: [Wtr-general] xpath bug Message-ID: http://jira.openqa.org/browse/WTR-19 Please see div2_xpath_test.rb (in unittests) > > This is an xpath that finds the wrong element. You can use flash to see > what is actually finding. The html is stripped down from an actual > application page. > > Note that i'm trying to convert some Selenium tests, that use xpath and > the Selenium tests correctly find the correct element. I fear this may > demonstrate a algorithmic flaw in our html to xml translation. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060421/443d7375/attachment.html From anil.kumar.das at gmail.com Mon Apr 24 10:53:48 2006 From: anil.kumar.das at gmail.com (Anil Kumar Das) Date: Mon, 24 Apr 2006 10:53:48 -0400 Subject: [Wtr-general] How to get value from textfield of the webpage using Watir/Ruby? Message-ID: <62d9246f0604240753m693d50bfhfb3f1271d19cec31@mail.gmail.com> I want to compare value of textfield appeared on webpage with expected output. for example: I have three fields with populated value.. Customer Name: Customer Address: LOC No html code: I need to get values and compare: Get field value in a variable, compare with expected value and show the result.. @a= cust_name if a= 'TATA IRON AND STEEL COMPANY" puts 'customer name is correct' else puts 'customer name is incorrect' I will highly appreciate if someone could give me idea/syntax or suggest the workaround.. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060424/6bd6a05f/attachment.html From zeljko.filipin at gmail.com Mon Apr 24 11:08:25 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Mon, 24 Apr 2006 17:08:25 +0200 Subject: [Wtr-general] How to get value from textfield of the webpage using Watir/Ruby? In-Reply-To: <62d9246f0604240753m693d50bfhfb3f1271d19cec31@mail.gmail.com> References: <62d9246f0604240753m693d50bfhfb3f1271d19cec31@mail.gmail.com> Message-ID: if ie.textField(:name, 'cust_name').value == "TATA IRON AND STEEL COMANY" puts 'customer name is correct' else puts 'customer name is incorrect' end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060424/b80fcaba/attachment.html From matthias_malek at hotmail.com Mon Apr 24 12:11:06 2006 From: matthias_malek at hotmail.com (Matthias Malek) Date: Mon, 24 Apr 2006 16:11:06 +0000 Subject: [Wtr-general] .GEM Message-ID: An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060424/a68fa923/attachment.html From Sean.Gallagher at ticketmaster.com Mon Apr 24 12:23:47 2006 From: Sean.Gallagher at ticketmaster.com (Sean Gallagher) Date: Mon, 24 Apr 2006 09:23:47 -0700 Subject: [Wtr-general] .GEM Message-ID: <71D28C8451BFD5119B2B00508BE26E640CD20852@pasmail3.office.tmcs> > Thanks for all the Help. > How do I Open a .gem file? or where should I put it, in > order to install Watir 1.5? Check out the RubyGems User Guide for information about gems, how to install, etc http://docs.rubygems.org/read/book/1 Good info! :-) From matthias_malek at hotmail.com Mon Apr 24 16:03:02 2006 From: matthias_malek at hotmail.com (Matthias Malek) Date: Mon, 24 Apr 2006 20:03:02 +0000 Subject: [Wtr-general] click_no_wait for Images (Watir 1.5) Message-ID: An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060424/6ea811f1/attachment.html From bret at pettichord.com Mon Apr 24 16:48:49 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 24 Apr 2006 15:48:49 -0500 Subject: [Wtr-general] .GEM In-Reply-To: References: Message-ID: dowload it. in the same directory, go "gem install watir". Bret On 4/24/06, Matthias Malek wrote: > > Thanks for all the Help. > How do I Open a .gem file? or where should I put it, in order to install > Watir 1.5? > > thanks, > Matthias > > ------------------------------ > Save time by starting a search from any Web page with the MSN Search > Toolbar-FREE! > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060424/25a29026/attachment.html From stuporglue at gmail.com Mon Apr 24 17:04:24 2006 From: stuporglue at gmail.com (Michael Moore) Date: Mon, 24 Apr 2006 15:04:24 -0600 Subject: [Wtr-general] Organizing tests Message-ID: Hi, I'm organizing the tests I write into folders, based on which part of the application they test. In the root folder, I have a script, login.rb, which runs fine if run from there. The opening lines of login.rb are: #includes require 'watir' include Watir require 'variables.rb' When I try to run login.rb from a sub folder, it fails on "require 'variables.rb'", as it's looking in the current directory, which is a folder down from variables.rb. Is there a way to let login.rb know where variables.rb is at, without putting in a hard path? Thanks, -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. From bret at pettichord.com Mon Apr 24 17:05:43 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 24 Apr 2006 16:05:43 -0500 Subject: [Wtr-general] click_no_wait for Images (Watir 1.5) In-Reply-To: References: Message-ID: I am unable to reproduced these problems with gem 1.5.0.945. Has anyone else been able to reproduce these problems? Mattias, can you please provide us with the specific errors that you are getting. You shouldn't have a manually copy files. I suggest you uninstall and reinstall. I am concerned that you are getting a mix of old and new files. Bret On 4/24/06, Matthias Malek wrote: > > Hi, > I have intalled Watir 1.5xx...If I do a puts Watir:IE:VERSION it prints > 1.5.0.945. > I did installed the gem file...using gem install xxxxx. > > I still get Errors like IEDialog missing..So I need to manually create > some directories and copy that file in c:\ruby\..... Once I do that..I can > run stuff fine. > > But I still get click_no_wait undefined... > > Here is what I am doing: > image = frameDetail().image(:src,/button_browse/) > image.click_no_wait > > Matthias > > ------------------------------ > All-in-one PC Care. Get the free beta be eligible for special pricing. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060424/d46d4f71/attachment.html From bret at pettichord.com Mon Apr 24 17:34:27 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 24 Apr 2006 16:34:27 -0500 Subject: [Wtr-general] Help with workarround In-Reply-To: References: Message-ID: I'm not sure this fully fixes your problem, but here's how to apply the workaround... You'd want to redefine the row_count method in the Table class. You could directly modify the Watir source as you suggest. Or you can just load this after "require watir": module Watir class Table def row_count raise UnknownTableException , "Unable to locate a table using #{@how} and #{@what} " if @o == nil return @o.rows.length end end end On 4/21/06, Michael Moore wrote: > > A web page has several nested tables, which are generated from a > database. I want to print the contents of each of the rows of the > outermost table using t.row_values(i). > > I'm trying this: > > for i in 1..t.row_count() > print i, ": ", t.row_values(i), "\n"; > end > > however t.row_count() is returning the total number of tags > inside the outermost table. In other words, it's identifying the right > outermost table, but it's considering child-table's rows as it's own. > I found this bug: > > http://rubyforge.org/tracker/index.php?func=detail&aid=2177&group_id=104&atid=487 > but don't understand how to implement his implementation. Do I edit > the ruby script that currently has row_count() in it, and replace it > with his implementation? > > Thanks, > -- > Michael Moore > ------------------------------- > www.stuporglue.org -- Donate your used computer to a student that needs > it. > www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060424/aa611770/attachment.html From stuporglue at gmail.com Mon Apr 24 17:34:36 2006 From: stuporglue at gmail.com (Michael Moore) Date: Mon, 24 Apr 2006 15:34:36 -0600 Subject: [Wtr-general] Organizing tests In-Reply-To: References: Message-ID: > When I try to run login.rb from a sub folder, it fails on "require > 'variables.rb'", as it's looking in the current directory, which is a > folder down from variables.rb. > > Is there a way to let login.rb know where variables.rb is at, without > putting in a hard path? I found something online that mentioned sending DOS commands, so now my loads in the subfolders look like this (and work) Dir.chdir("..") load 'login.rb' Dir.chdir("Tests") It moves me up to run the login script, then back down to run the rest of the test. Thanks, -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. From BPaatsch at activevoice.com Mon Apr 24 18:34:26 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Mon, 24 Apr 2006 17:34:26 -0500 Subject: [Wtr-general] OLE error code:0 exception? Message-ID: Hello friends of Watir, My script sometimes results in following exception and I do not know how to get it stable so that it won't throw an exception. Any ideas? W, [21-Apr-2006 16:15:28#2768] WARN -- : frame error in waitreadyState OLE error code:0 in HRESULT error code:0x80070005 Access is denied. c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1405:in `method _missing' c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1405:in `wait' c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1404:in `upto' c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1404:in `wait' c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1744:in `wait' c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:2014:in `click' C:/z/TestAuto/ruby/Thad.rb:375 C:/z/TestAuto/ruby/Thad.rb:358:in `each' C:/z/TestAuto/ruby/Thad.rb:358 Here is the script part that causes the problem: head_page = ie.frame( "head") #puts" Let's set all checkboxes" accessopt_name.each do |m| ####THIS IS LINE 358 # page refreshes and looses therefore the connection ac_page = ie.frame( :name, "disp").form( :name, "data_form") if ac_page.checkbox( :name, m ).exists? then if ac_page.checkbox( :name, m ).enabled?() then if ac_page.checkbox( :name, m ).checked? then ac_page.checkbox( :name, m).clear ac_page.wait puts "Cleared checkbox #{m} = #{ac_class.string(m)} " else ac_page.checkbox( :name, m).set ac_page.wait puts "Set checkbox #{m} = #{ac_class.string(m)} " end if head_page.link( :id, "Save_a").exists? then if head_page.link( :id, "Save_a").enabled? then head_page.link( :id, "Save_a").click ####THIS IS LINE 375 head_page.wait else puts "Save button not enabled" end else puts "does not exist!" end else puts "Checkbox #{m} = #{ac_class.string(m)} DISABLED! " end else puts "Error: Checkbox with name #{m} = #{ac_class.string(m)} does not exist! " end end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060424/fd35cec1/attachment.html From matthias_malek at hotmail.com Mon Apr 24 18:57:28 2006 From: matthias_malek at hotmail.com (Matthias Malek) Date: Mon, 24 Apr 2006 22:57:28 +0000 Subject: [Wtr-general] click_no_wait for Images (Watir 1.5) Message-ID: An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060424/28801d28/attachment.html From klancaster1957 at gmail.com Mon Apr 24 19:32:15 2006 From: klancaster1957 at gmail.com (Keith Lancaster) Date: Mon, 24 Apr 2006 18:32:15 -0500 Subject: [Wtr-general] Organizing tests In-Reply-To: Message-ID: You might consider something like this - putting all your shared files in a common lib directory. /test_root --/lib -- variables.rb -- includeme.rb --/login_tests -- testfile.rb -- testfile2.rb --/other_functional_area etc. Then in your test files, you could put require File.dirname(__FILE__) + '/../lib/variables' This should load the variable.rb file (notice that .rb is not needed) regardless of where you are running it from. If you don't want to use the lib directory idea, you can use the same method - just change the require line to require File.dirname(__FILE__) + '/../variables' HTH, Keith On 4/24/06 4:34 PM, "Michael Moore" wrote: >> When I try to run login.rb from a sub folder, it fails on "require >> 'variables.rb'", as it's looking in the current directory, which is a >> folder down from variables.rb. >> >> Is there a way to let login.rb know where variables.rb is at, without >> putting in a hard path? > > I found something online that mentioned sending DOS commands, so now > my loads in the subfolders look like this (and work) > > Dir.chdir("..") > load 'login.rb' > Dir.chdir("Tests") > > It moves me up to run the login script, then back down to run the rest > of the test. > > Thanks, > -- > Michael Moore > ------------------------------- > www.stuporglue.org -- Donate your used computer to a student that needs it. > www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From zeljko.filipin at gmail.com Tue Apr 25 03:56:46 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 25 Apr 2006 09:56:46 +0200 Subject: [Wtr-general] OLE error code:0 exception? In-Reply-To: References: Message-ID: http://wiki.openqa.org/display/WTR/FAQ#FAQ-Accessdeniedwhentryingtoaccessaframe On 4/25/06, Paatsch, Bernd wrote: > > Access is denied. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060425/48b0b345/attachment.html From noreply at rubyforge.org Tue Apr 25 10:47:55 2006 From: noreply at rubyforge.org (Mail Administrator) Date: Tue, 25 Apr 2006 16:47:55 +0200 Subject: [Wtr-general] Delivery reports about your e-mail Message-ID: <200604251444.k3PEiG9R025068@rubyforge.org> Your message was not delivered due to the following reason: Your message could not be delivered because the destination computer was not reachable within the allowed queue period. The amount of time a message is queued before it is returned depends on local configura- tion parameters. Most likely there is a network problem that prevented delivery, but it is also possible that the computer is turned off, or does not have a mail system running right now. Your message was not delivered within 1 days: Host 81.100.151.47 is not responding. The following recipients could not receive this message: Please reply to postmaster at rubyforge.org if you feel this message to be in error. -------------- next part -------------- A non-text attachment was scrubbed... Name: yttspu.zip Type: application/octet-stream Size: 29062 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060425/2a9a15f5/attachment.obj From tester.paul at gmail.com Tue Apr 25 10:48:58 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 25 Apr 2006 10:48:58 -0400 Subject: [Wtr-general] Need Help redirecting the Test Unit output Message-ID: <37c405480604250748g49f27576ke7f7dc842943232b@mail.gmail.com> Hi there, I'm trying to capture the Test Unit output to a file but I'm not exactly sure of what it is I need to capture. I thought it was STDOUT, but now I'm not so sure. Here's an example of what I want... In the Watir\Unittests\ folder, run the script: iostring_test.rb It has the following output: ---- >ruby iostring_test.rb Loaded suite iostring_test Started ...... Finished in 0.0 seconds. 6 tests, 7 assertions, 0 failures, 0 errors >Exit code: 0 ---- This script redirects STDOUT (the 'puts' and 'prints') to variables to work with them in the asserts. That's neat, but not what I want to do. What I actually want to do is capture the *above* Test Unit summary output to a file and ignore everything else. I want the "Loaded", "Started", "....", Finish time, and test summary. I've searched the Watir message archives, googled the web, and skimmed through the PickAxe book, but so far I haven't been able to figure out how to do this. I browsed through some of the code in C:\ruby\lib\ruby\1.8\test\unit but I haven't deciphered it yet. Does anyone know how to redirect this Test Unit output? Are there any additional sources that I can refer to for changing the Test Unit framework so that it writes this info to a file? Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060425/94a7674a/attachment.html From browne.daniel at gmail.com Tue Apr 25 11:04:19 2006 From: browne.daniel at gmail.com (Daniel Browne) Date: Tue, 25 Apr 2006 16:04:19 +0100 Subject: [Wtr-general] Need Help redirecting the Test Unit output In-Reply-To: <37c405480604250748g49f27576ke7f7dc842943232b@mail.gmail.com> References: <37c405480604250748g49f27576ke7f7dc842943232b@mail.gmail.com> Message-ID: <79518aef0604250804i4e0b8a65m1469b018e8740772@mail.gmail.com> What happens if you do: ruby iostring_test.rb > some_file.log Or to redirect STDOUT and SDTERR to the file try: ruby iostring_test.rb > some_file.log 2>&1 Cheers, Daniel. On 25/04/06, Paul Carvalho wrote: > Hi there, I'm trying to capture the Test Unit output to a file but I'm not > exactly sure of what it is I need to capture. I thought it was STDOUT, but > now I'm not so sure. Here's an example of what I want... > > In the Watir\Unittests\ folder, run the script: iostring_test.rb > > It has the following output: > ---- > >ruby iostring_test.rb > Loaded suite iostring_test > Started > ...... > Finished in 0.0 seconds. > > 6 tests, 7 assertions, 0 failures, 0 errors > >Exit code: 0 > ---- > > This script redirects STDOUT (the 'puts' and 'prints') to variables to work > with them in the asserts. That's neat, but not what I want to do. > > What I actually want to do is capture the *above* Test Unit summary output > to a file and ignore everything else. I want the "Loaded", "Started", > "....", Finish time, and test summary. > > I've searched the Watir message archives, googled the web, and skimmed > through the PickAxe book, but so far I haven't been able to figure out how > to do this. I browsed through some of the code in > C:\ruby\lib\ruby\1.8\test\unit but I haven't deciphered it yet. > > Does anyone know how to redirect this Test Unit output? Are there any > additional sources that I can refer to for changing the Test Unit framework > so that it writes this info to a file? > > Paul. > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From Sean.Gallagher at ticketmaster.com Tue Apr 25 11:13:32 2006 From: Sean.Gallagher at ticketmaster.com (Sean Gallagher) Date: Tue, 25 Apr 2006 08:13:32 -0700 Subject: [Wtr-general] Need Help redirecting the Test Unit output Message-ID: <71D28C8451BFD5119B2B00508BE26E640CD20EFB@pasmail3.office.tmcs> Hi Paul, Try tee on the command line when you kick off your script. Like so: C:\> ruby iostring_test.rb | tee results.out tee.exe is included with GNU utilities for Win32, available here: http://unxutils.sourceforge.net/ Sean > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Carvalho > Sent: Tuesday, April 25, 2006 7:49 AM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] Need Help redirecting the Test Unit output > > Hi there, I'm trying to capture the Test Unit output to a > file but I'm not exactly sure of what it is I need to > capture. I thought it was STDOUT, but now I'm not so sure. > Here's an example of what I want... > > In the Watir\Unittests\ folder, run the script: iostring_test.rb > > It has the following output: > ---- > >ruby iostring_test.rb > Loaded suite iostring_test > Started > ...... > Finished in 0.0 seconds. > > 6 tests, 7 assertions, 0 failures, 0 errors > >Exit code: 0 > ---- > > This script redirects STDOUT (the 'puts' and 'prints') to > variables to work with them in the asserts. That's neat, but > not what I want to do. > > What I actually want to do is capture the *above* Test Unit > summary output to a file and ignore everything else. I want > the "Loaded", "Started", "....", Finish time, and test summary. > > I've searched the Watir message archives, googled the web, > and skimmed through the PickAxe book, but so far I haven't > been able to figure out how to do this. I browsed through > some of the code in C:\ruby\lib\ruby\1.8\test\unit but I > haven't deciphered it yet. > > Does anyone know how to redirect this Test Unit output? Are > there any additional sources that I can refer to for changing > the Test Unit framework so that it writes this info to a file? > > Paul. > > > From tester.paul at gmail.com Tue Apr 25 11:21:05 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 25 Apr 2006 11:21:05 -0400 Subject: [Wtr-general] Need Help redirecting the Test Unit output In-Reply-To: <79518aef0604250804i4e0b8a65m1469b018e8740772@mail.gmail.com> References: <37c405480604250748g49f27576ke7f7dc842943232b@mail.gmail.com> <79518aef0604250804i4e0b8a65m1469b018e8740772@mail.gmail.com> Message-ID: <37c405480604250821v1b3504a6j8fc073c8590cf169@mail.gmail.com> That's a fair question. I'd like a bit more control over what output I actually save to file. For instance, the web app under test has frames where some of them return the 'Access is Denied' warnings. I'd like to weed out all that crap.. err, noise.. and just see the test summary. The output request was actually a requirement from my boss. He asked to have an output that just summarises the tests run and doesn't output anything else unless something goes wrong. Since I can't prevent the 'Access is Denied' warnings from appearing in the console, I'd like to find a way to just redirect the Test Unit information to a file and ignore everything else. P. On 25/04/06, Daniel Browne wrote: > > What happens if you do: > > ruby iostring_test.rb > some_file.log > > Or to redirect STDOUT and SDTERR to the file try: > > ruby iostring_test.rb > some_file.log 2>&1 > > Cheers, > Daniel. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060425/dff9d8af/attachment.html From christopher.mcmahon at gmail.com Tue Apr 25 11:54:08 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 25 Apr 2006 08:54:08 -0700 Subject: [Wtr-general] Need Help redirecting the Test Unit output In-Reply-To: <37c405480604250748g49f27576ke7f7dc842943232b@mail.gmail.com> References: <37c405480604250748g49f27576ke7f7dc842943232b@mail.gmail.com> Message-ID: <72799cd70604250854i527c7601ybd9d70bc3bfa414f@mail.gmail.com> On 4/25/06, Paul Carvalho wrote: > Hi there, I'm trying to capture the Test Unit output to a file but I'm not > exactly sure of what it is I need to capture. I thought it was STDOUT, but > now I'm not so sure. Here's an example of what I want... I've stumbled on this myself. I don't have a good answer. I do know that it's Test::Unit::Reporter does in fact work (if you check out from HEAD), but there's a bit of a learning curve there as well. But if Reporter does what you need, it might be worth the effort to get it going: http://rubyforge.org/projects/test-report/ -Chris From BPaatsch at activevoice.com Tue Apr 25 12:09:39 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Tue, 25 Apr 2006 11:09:39 -0500 Subject: [Wtr-general] OLE error code:0 exception? Message-ID: Thanks for your reply. But the web-site I am accessing is on the same internal server. The error is not consistent. It happens only once in a while and therefore it must be some kind of timing issue I believe. There is no lack of functionality, it is just annoying and the testers running the script wonder what happened.. Any idea how to fix it? My script sometimes results in following exception and I do not know how to get it stable so that it won't throw an exception. Any ideas? W, [21-Apr-2006 16:15:28#2768] WARN -- : frame error in waitreadyState OLE error code:0 in HRESULT error code:0x80070005 Access is denied. c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1405:in `method _missing' c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1405:in `wait' c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1404:in `upto' c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1404:in `wait' c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1744:in `wait' c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:2014:in `click' C:/z/TestAuto/ruby/Thad.rb:375 C:/z/TestAuto/ruby/Thad.rb:358:in `each' C:/z/TestAuto/ruby/Thad.rb:358 Here is the script part that causes the problem: head_page = ie.frame( "head") #puts" Let's set all checkboxes" accessopt_name.each do |m| ####THIS IS LINE 358 # page refreshes and looses therefore the connection ac_page = ie.frame( :name, "disp").form( :name, "data_form") if ac_page.checkbox( :name, m ).exists? then if ac_page.checkbox( :name, m ).enabled?() then if ac_page.checkbox( :name, m ).checked? then ac_page.checkbox( :name, m).clear ac_page.wait puts "Cleared checkbox #{m} = #{ac_class.string(m)} " else ac_page.checkbox( :name, m).set ac_page.wait puts "Set checkbox #{m} = #{ac_class.string(m)} " end if head_page.link( :id, "Save_a").exists? then if head_page.link( :id, "Save_a").enabled? then head_page.link( :id, "Save_a").click ####THIS IS LINE 375 head_page.wait else puts "Save button not enabled" end else puts "does not exist!" end else puts "Checkbox #{m} = #{ac_class.string(m)} DISABLED! " end else puts "Error: Checkbox with name #{m} = #{ac_class.string(m)} does not exist! " end end _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin Sent: Tuesday, April 25, 2006 12:57 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] OLE error code:0 exception? http://wiki.openqa.org/display/WTR/FAQ#FAQ-Accessdeniedwhentryingtoaccessafr ame On 4/25/06, Paatsch, Bernd > wrote: Access is denied. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060425/c0994f72/attachment.html From christopher.mcmahon at gmail.com Tue Apr 25 13:03:26 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 25 Apr 2006 10:03:26 -0700 Subject: [Wtr-general] particularly nice Watir testimonial Message-ID: <72799cd70604251003m508bb771j48d12baae2c04094@mail.gmail.com> Dave Hoover has posted a really nice description of some of the super-neato stuff he's been doing with Watir. Anyone looking for programming examples of some slightly more sophisticated things to do with Ruby and Watir should definitely take a look: http://redsquirrel.com/cgi-bin/dave/2006/04/25 -Chris From rodrigo.martin at enratio.com Tue Apr 25 15:16:58 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Tue, 25 Apr 2006 16:16:58 -0300 Subject: [Wtr-general] [question] Does the Click method accepts coordinates? Message-ID: Hello! I'm developing a test for a web page, and I've found a .gif image which acts as a menu, mapped by coordinates... Is there a way of telling watir to .Click by coordinates? The file uses the folowing map: Thanks in Advance! By the way, I'm still fighting against modal dialogs... but I'll win sooner or later =P Cheers Rodrigo J. Martin. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060425/18535eaf/attachment.html From tester.paul at gmail.com Tue Apr 25 17:22:18 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 25 Apr 2006 17:22:18 -0400 Subject: [Wtr-general] How can I read alternate field attributes into a variable? Message-ID: <37c405480604251422m228f6cb6vf7ae0413de833299@mail.gmail.com> Most of my Watir scripts generate their own random inputs (content and length), but I always have to specify an upper limit for each data value specified. For example, a Create New User page has the following HTML for a User Name input field: and the script writes to it with the following code: # Input a username that is at least 5 characters but no more than 50 chars in length $ie.text_field(:name, /UserName/).set( random_input( 'text', 5+rand(46) ) ) So I have to [manually] specify in the script that it should contain no more than 50 characters in length (i.e. upper limit of 5+45). I would like to know if it is possible to have Ruby/Watir automatically read the 'maxLength=##' attribute and assign that value to a variable that I can then work with in the corresponding input commands? If I can do that, then my scripts will be even more independent and free to generate their own inputs of random length based on what the HTML says a field's upper limit is. I couldn't find anything in the Watir API Reference that looked like it might do this. Could we add a feature to do this if there isn't a way now? Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060425/448cda7d/attachment.html From zeljko.filipin at gmail.com Wed Apr 26 04:44:55 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 26 Apr 2006 10:44:55 +0200 Subject: [Wtr-general] How can I read alternate field attributes into a variable? In-Reply-To: <37c405480604251422m228f6cb6vf7ae0413de833299@mail.gmail.com> References: <37c405480604251422m228f6cb6vf7ae0413de833299@mail.gmail.com> Message-ID: I guess that you will know how to assign it to variable and use thatvariable (if I am wrong, let me know). :) irb(main):006:0> ie.text_field(:name, /UserName/).maxLength=> 50 On 4/25/06, Paul Carvalho wrote: > I would like to know if it is possible to have Ruby/Watir automatically read> the 'maxLength=##' attribute From tester.paul at gmail.com Wed Apr 26 09:36:10 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Wed, 26 Apr 2006 09:36:10 -0400 Subject: [Wtr-general] How can I read alternate field attributes into a variable? In-Reply-To: References: <37c405480604251422m228f6cb6vf7ae0413de833299@mail.gmail.com> Message-ID: <37c405480604260636g109da233m4db1ce33898034b7@mail.gmail.com> Hi Zeljko, Yes. That's what I need. Seems obvious now - I can't believe I didn't find it in the API reference. Cheers. Paul. On 26/04/06, Zeljko Filipin wrote: > > I guess that you will know how to assign it to variable and use > thatvariable (if I am wrong, let me know). :) > irb(main):006:0> ie.text_field(:name, /UserName/).maxLength=> 50 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060426/ead1f27e/attachment.html From rodrigo.martin at enratio.com Wed Apr 26 10:08:18 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Wed, 26 Apr 2006 11:08:18 -0300 Subject: [Wtr-general] [question] Opening a Browser with WET, and then taking control with Watir? Message-ID: Hi all! As some of you may remember, I was the guy freaked out with modal popups... I've sent a couple of messages to the list, and finally Praveen Kumar Kammitta [pkammit at gmail.com] suggest me to use WET. Well, it really worked out and pretty fine! This is how I finally managed this: require 'WET' include WET $ie=Browser.new() $ie.goto("https://happiness.dhs.org", OUTOFPROCESS) $ie.Dialog("title:=Security Alert").Button("index:=1").click This is great! But now I have another trouble (I'm a problematic human, I know :S ) I've done several and LARGE scripts using Watir, and now I really don't want to re-code all the lines which has references to the browser (there are differences between Watir Browser and WET Browser... So, does exists a way of instanciate the WET browser, and then attach to that browser with Watir? I hope the question is made correctly, as my english need some improvement... Cheers and Thanks in Advance! Rodrigo Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060426/8e20a620/attachment.html From bret at pettichord.com Wed Apr 26 11:04:53 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 26 Apr 2006 10:04:53 -0500 Subject: [Wtr-general] click_no_wait for Images (Watir 1.5) In-Reply-To: References: Message-ID: yes, this is a known problem. feel free to make sure this is in Jira, so we don't forget to fix it. On 4/24/06, Matthias Malek wrote: > > Thanks Bret, > I uninstalled everything (ruby + watir) and intalled again. I got rid of > IEDialog related errors :)..but...I still get click_no_wait error. > I found something earlier stating that this may have issues if the page > uses frames...is this true? > See link.... > http://forums.openqa.org/thread.jspa?messageID=4063&tstart=0 > > *This is the exact message I am getting:* > > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.945/./watir.rb:2293:in > `click_no_wait > ': undefined method `eval_in_spawned_process' for > # (NoM > ethodError) > from ./a5page.rb:212:in `clickTextBoxButton' > from ./activityprofile.rb:110:in `openOpportunity' > from run.rb:88 > > > > > > > ------------------------------ > Join the new Messenger beta now > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060426/92fc1dd2/attachment.html From bret at pettichord.com Wed Apr 26 11:10:56 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 26 Apr 2006 10:10:56 -0500 Subject: [Wtr-general] OLE error code:0 exception? In-Reply-To: References: Message-ID: is it raising an exception and stopping the test or is it only printing out a scary warning? On 4/25/06, Paatsch, Bernd wrote: > > Thanks for your reply. But the web-site I am accessing is on the same > internal server. > > The error is not consistent. It happens only once in a while and > therefore it must be some kind of timing issue I believe. There is no lack > of functionality, it is just annoying and the testers running the script > wonder what happened.. > > Any idea how to fix it? > > > My script sometimes results in following exception and I do not know how > to get it stable so that it won't throw an exception. Any ideas? > > W, [21-Apr-2006 16:15:28#2768] WARN -- : frame error in waitreadyState > OLE error code:0 in > > HRESULT error code:0x80070005 > Access is denied. > c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1405:in > `method > _missing' > c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1405:in > `wait' > c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1404:in > `upto' > c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1404:in > `wait' > c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1744:in > `wait' > c:/z/TestAuto/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:2014:in > `click' > > C:/z/TestAuto/ruby/Thad.rb:375 > C:/z/TestAuto/ruby/Thad.rb:358:in `each' > C:/z/TestAuto/ruby/Thad.rb:358 > > Here is the script part that causes the problem: > > head_page = ie.frame( "head") > #puts" Let's set all checkboxes" > accessopt_name.each do |m| ####THIS IS LINE 358 > # page refreshes and looses therefore the connection > ac_page = ie.frame( :name, "disp").form( :name, "data_form") > if ac_page.checkbox( :name, m ).exists? then > if ac_page.checkbox( :name, m ).enabled?() then > if ac_page.checkbox( :name, m ).checked? then > ac_page.checkbox( :name, m).clear > ac_page.wait > puts "Cleared checkbox #{m} = #{ac_class.string(m)} " > else > ac_page.checkbox( :name, m).set > ac_page.wait > puts "Set checkbox #{m} = #{ac_class.string(m)} > " > end > > if head_page.link( :id, "Save_a").exists? then > if head_page.link( :id, "Save_a").enabled? then > head_page.link( :id, "Save_a").click ####THIS IS > LINE 375 > head_page.wait > else > puts "Save button not enabled" > end > else > puts "does not exist!" > end > > else > puts "Checkbox #{m} = #{ac_class.string(m)} DISABLED! " > end > else > puts "Error: Checkbox with name #{m} = #{ac_class.string(m)} does > not exist! " > end > > end > > ------------------------------ > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Zeljko Filipin > *Sent:* Tuesday, April 25, 2006 12:57 AM > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] OLE error code:0 exception? > > http://wiki.openqa.org/display/WTR/FAQ#FAQ-Accessdeniedwhentryingtoaccessaframe > > > On 4/25/06, Paatsch, Bernd wrote: > > > > Access is denied. > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060426/b3c11d15/attachment.html From bret at pettichord.com Wed Apr 26 11:26:34 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 26 Apr 2006 10:26:34 -0500 Subject: [Wtr-general] Organizing tests In-Reply-To: References: Message-ID: Actually, the best way to do this is to put test root in your load path. $LOAD_PATH << File.dirname(__FILE__) + '/../' require 'lib/variables' The problem with Keith's solution is that you'll end up requiring the same file from different tests via different paths. The semantics of require is that it won't load a library if it has already been loaded, but if you are loading the same file but using a different path in your require statement, require will think it is a different library and load it again. If it has constants you will get warnings about redefining constants. Bret On 4/24/06, Keith Lancaster wrote: > > You might consider something like this - putting all your shared files in > a > common lib directory. > > /test_root > --/lib > -- variables.rb > -- includeme.rb > > --/login_tests > -- testfile.rb > -- testfile2.rb > --/other_functional_area > etc. > > Then in your test files, you could put > > require File.dirname(__FILE__) + '/../lib/variables' > > This should load the variable.rb file (notice that .rb is not needed) > regardless of where you are running it from. If you don't want to use the > lib directory idea, you can use the same method - just change the require > line to > > require File.dirname(__FILE__) + '/../variables' > > HTH, > Keith > > > > On 4/24/06 4:34 PM, "Michael Moore" wrote: > > >> When I try to run login.rb from a sub folder, it fails on "require > >> 'variables.rb'", as it's looking in the current directory, which is a > >> folder down from variables.rb. > >> > >> Is there a way to let login.rb know where variables.rb is at, without > >> putting in a hard path? > > > > I found something online that mentioned sending DOS commands, so now > > my loads in the subfolders look like this (and work) > > > > Dir.chdir("..") > > load 'login.rb' > > Dir.chdir("Tests") > > > > It moves me up to run the login script, then back down to run the rest > > of the test. > > > > Thanks, > > -- > > Michael Moore > > ------------------------------- > > www.stuporglue.org -- Donate your used computer to a student that needs > it. > > www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060426/0b1e91da/attachment.html From bret at pettichord.com Wed Apr 26 11:32:10 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 26 Apr 2006 10:32:10 -0500 Subject: [Wtr-general] Need Help redirecting the Test Unit output In-Reply-To: <37c405480604250748g49f27576ke7f7dc842943232b@mail.gmail.com> References: <37c405480604250748g49f27576ke7f7dc842943232b@mail.gmail.com> Message-ID: I think that output goes to standard error, so that's what you need to redirect. I strongly encourage you to take a look at the Test::Unit code and see if you can't create your own test runner that gives you the output you want. Bret On 4/25/06, Paul Carvalho wrote: > > Hi there, I'm trying to capture the Test Unit output to a file but I'm not > exactly sure of what it is I need to capture. I thought it was STDOUT, but > now I'm not so sure. Here's an example of what I want... > > In the Watir\Unittests\ folder, run the script: iostring_test.rb > > It has the following output: > ---- > >ruby iostring_test.rb > Loaded suite iostring_test > Started > ...... > Finished in 0.0 seconds. > > 6 tests, 7 assertions, 0 failures, 0 errors > >Exit code: 0 > ---- > > This script redirects STDOUT (the 'puts' and 'prints') to variables to > work with them in the asserts. That's neat, but not what I want to do. > > What I actually want to do is capture the *above* Test Unit summary output > to a file and ignore everything else. I want the "Loaded", "Started", > "....", Finish time, and test summary. > > I've searched the Watir message archives, googled the web, and skimmed > through the PickAxe book, but so far I haven't been able to figure out how > to do this. I browsed through some of the code in > C:\ruby\lib\ruby\1.8\test\unit but I haven't deciphered it yet. > > Does anyone know how to redirect this Test Unit output? Are there any > additional sources that I can refer to for changing the Test Unit framework > so that it writes this info to a file? > > Paul. > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060426/8340c14b/attachment.html From bret at pettichord.com Wed Apr 26 11:47:02 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 26 Apr 2006 10:47:02 -0500 Subject: [Wtr-general] [question] Opening a Browser with WET, and then taking control with Watir? In-Reply-To: References: Message-ID: You can use Watir::IE.attach() to use Watir with an existing browser window. It doesn't matter if it was opened manually or with Wet. On 4/26/06, Rodrigo Julian Martin wrote: > > Hi all! > > > > As some of you may remember, I was the guy freaked out with modal popups? > I've sent a couple of messages to the list, and finally Praveen Kumar > Kammitta [pkammit at gmail.com] suggest me to use WET. > > > > Well, it really worked out and pretty fine! > > This is how I finally managed this: > > > > require 'WET' > > include WET > > $ie=Browser.new() > > $ie.goto("https://happiness.dhs.org", OUTOFPROCESS) > > $ie.Dialog("title:=Security Alert").Button("index:=1").click > > > > This is great! But now I have another trouble (I'm a problematic human, I > know :S ) > > I've done several and LARGE scripts using Watir, and now I really don't > want to re-code all the lines which has references to the browser (there are > differences between Watir Browser and WET Browser? > > > > So, does exists a way of instanciate the WET browser, and then attach to > that browser with Watir? I hope the question is made correctly, as my > english need some improvement? > > > > Cheers and Thanks in Advance! > > Rodrigo Martin > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060426/147d781a/attachment.html From bret at pettichord.com Wed Apr 26 12:12:57 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 26 Apr 2006 11:12:57 -0500 Subject: [Wtr-general] Data Driven Frameworks for Watir Message-ID: This is a quick status report on some recent research i've made into data-driven testing frameworks for Watir. The RubyFit framework looks pretty good. I've talked to its author, Giulio Pascatelli, and he said that he was going to release a gem shortly. To my thinking, the really useful Fixture is the Do Fixture. RubyFit is an implementation of the Fit 1.1 spec, which does not include the Do Fixture. Rather that is defined as part of the FitLibrary. I am talking to people about seeing if we can get that implemented. On the other hand, i was able to do 90% of what a Do Fixture does using the Systir testing framework. That feeds in a test from a plain file rather than an html table, but i was even able to create a simple converter (from a table to the systir format) using rubyful-soup (this, by the way, is an excellent html parser and gives me lots of ideas about how Watir could be better.) In fact, i'm wondering if i couldn't create a SystirFixture that would allow a Fit table to be executed by a Systir driver.... Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060426/8d07ac7f/attachment.html From stuporglue at gmail.com Wed Apr 26 18:04:22 2006 From: stuporglue at gmail.com (Michael Moore) Date: Wed, 26 Apr 2006 16:04:22 -0600 Subject: [Wtr-general] Organizing tests In-Reply-To: References: Message-ID: > Actually, the best way to do this is to put test root in your load path. > > $LOAD_PATH << File.dirname(__FILE__) + '/../' > require 'lib/variables' > > The problem with Keith's solution is that you'll end up requiring the same > file from different tests via different paths. The semantics of require is > that it won't load a library if it has already been loaded, but if you are > loading the same file but using a different path in your require statement, > require will think it is a different library and load it again. If it has > constants you will get warnings about redefining constants. Ok. What you said makes sense, but I'm not entirely clear where I'd put the $LOAD_PATH and requrie lines. Would those just go at the top of all my tests? Thanks, -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. From johnc at testdev.net Thu Apr 27 19:20:12 2006 From: johnc at testdev.net (John Castellucci) Date: Thu, 27 Apr 2006 16:20:12 -0700 Subject: [Wtr-general] Application Map In-Reply-To: Message-ID: <015001c66a51$226a87e0$c802a8c0@lewis> Bret Pettichord wrote: >I am thinking of adding a Map class to Watir. Here's how it would work... I found this an interesting problem, and as it applied to something I was doing at work, I wanted to give it a stab. Below is my "hack" at a Map class. It only works in Watir 1.5. So, how many rules did I break? ;) # Watir 1.5 ONLY!!! require 'watir' module Watir class Map def initialize(ie) @ie = ie Watir::Container.instance_methods.each do |method| Map.class_eval("def #{method}(k,v); @ie.#{method}(k,v); end") if method !~/=/ end end end end ie = Watir::IE.start('http://google.com') map = Watir::Map.new(ie) SearchField = map.text_field(:name, 'q') SearchButton = map.button(:name, 'btnG') SearchField.set('PickAxe') SearchButton.click() From rdevera651 at sbcglobal.net Fri Apr 28 02:01:37 2006 From: rdevera651 at sbcglobal.net (Rosalind de Vera) Date: Thu, 27 Apr 2006 23:01:37 -0700 (PDT) Subject: [Wtr-general] Trouble closing JavaScript pop-up invoked from a frame in Watir 1.5.0.945 Message-ID: <20060428060137.92550.qmail@web80509.mail.yahoo.com> Hello, I have a link in a frame that brings up a JavaScript popup-up. When I try to use click_no_wait, I get the following error: irb(main):015:0> ie.frame("topFrame").link(:text, "Reset Settings").click_no_wait NoMethodError: undefined method `eval_in_spawned_process' for # from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.945/./watir.rb:2293:in `click_no_wait' from (irb):15 Will this be fixed at some point? I saw a posting on March 24 by lyoungz in the openqa.org forum asking about the same problem, but I didn't see a response. Thank you, Rosalind From klancaster1957 at gmail.com Fri Apr 28 08:46:18 2006 From: klancaster1957 at gmail.com (Keith Lancaster) Date: Fri, 28 Apr 2006 07:46:18 -0500 Subject: [Wtr-general] Watir / QA position In-Reply-To: <20060428060137.92550.qmail@web80509.mail.yahoo.com> Message-ID: >From the Ruby/Rails forum in case anyone is interested: Hello, I am looking for a Software QA person with Ruby (Watir would be a plus). I am finding however, that Ruby aficionados do not post themselves on standard job boards like Monster or Careerbuilder. Do you, or someone you know have Ruby and need a position in Massachusetts? Please give me a call at the number below, any info you may have, even on how to track down Ruby users, would be much appreciated! Thanks! Emily McElfresh Recruiter Generation Technologies, Inc. 781-272-3008 emcelfresh at genp.com* From bret at pettichord.com Fri Apr 28 11:00:54 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 28 Apr 2006 10:00:54 -0500 Subject: [Wtr-general] Trouble closing JavaScript pop-up invoked from a frame in Watir 1.5.0.945 In-Reply-To: <20060428060137.92550.qmail@web80509.mail.yahoo.com> References: <20060428060137.92550.qmail@web80509.mail.yahoo.com> Message-ID: Yes, this problem will need to be fixed before we release Watir 1.5. Bret On 4/28/06, Rosalind de Vera wrote: > > Hello, > > I have a link in a frame that brings up a JavaScript > popup-up. When I try to use click_no_wait, I get the > following error: > > > irb(main):015:0> ie.frame("topFrame").link(:text, > "Reset Settings").click_no_wait > NoMethodError: undefined method > `eval_in_spawned_process' for > # > from > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.945/./watir.rb:2293:in > `click_no_wait' > from (irb):15 > > Will this be fixed at some point? I saw a posting on > March 24 by lyoungz in the openqa.org forum asking > about the same problem, but I didn't see a response. > > Thank you, > Rosalind > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060428/bb88ba01/attachment.html From bret at pettichord.com Fri Apr 28 15:48:57 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 28 Apr 2006 14:48:57 -0500 Subject: [Wtr-general] Application Map In-Reply-To: <015001c66a51$226a87e0$c802a8c0@lewis> References: <015001c66a51$226a87e0$c802a8c0@lewis> Message-ID: On 4/27/06, John Castellucci wrote: > > Bret Pettichord wrote: > >I am thinking of adding a Map class to Watir. Here's how it would work... > > I found this an interesting problem, and as it applied to something I was > doing at work, I wanted to give it a stab. Below is my "hack" at a Map > class. It only works in Watir 1.5. So, how many rules did I break? ;) Only one: don't complicate things unnecessarily. You can do the same thing directly with Watir itself! > # Watir 1.5 ONLY!!! > require 'watir' > > module Watir > class Map > def initialize(ie) > @ie = ie > Watir::Container.instance_methods.each do |method| > Map.class_eval("def #{method}(k,v); @ie.#{method}(k,v); end") if > method !~/=/ > end > end > end > end > > ie = Watir::IE.start('http://google.com') > map = Watir::Map.new(ie) If leave out the Map class and instead do map = Watir::IE.start('http://google.com') the following will still work fine: > SearchField = map.text_field(:name, 'q') > SearchButton = map.button(:name, 'btnG') > > SearchField.set('PickAxe') > SearchButton.click() I think the Map idea makes sense when you define it *before* the IE class has been instantiated. That's the scenario that is a challenge to support. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060428/d8c03f92/attachment.html From angelo0000 at gmail.com Fri Apr 28 18:18:23 2006 From: angelo0000 at gmail.com (Jake Dempsey) Date: Fri, 28 Apr 2006 17:18:23 -0500 Subject: [Wtr-general] Java port of watir Message-ID: <5479b1ff0604281518l4f1e7b62re274ae7e32b011b2@mail.gmail.com> Myself and a colleague(Brian Knorr) have created a new automation framework called watij. Its watir............but in java. We actually have written the framework to use roughly the same api as watir. For example, a full test in watij looks like: import junit.framework.TestCase; import static watij.symbols.Symbol.*; public class GoogleTest extends TestCase { public void testGoogleSearch() throws Exception { IE ie = new IE(); ie.start("http://www.google.com"); ie.textField(name, "q").set("XWiki"); ie.button("Google Search").click(); assertTrue(ie.containsText( "/Java wiki engine/" )); } } We have released a beta version and you can read more at http://watij.xwiki.com We have linked to watir on our site and have also stated that watij is watir.........but in java. We love the flexibility and robustness of watir but wanted a pure java version. We would love to get feedback from anyone. The waij.xwiki.com site has a quick guide to get started and watij is also packaged with a preconfigured version of beanshell that allows you to get started prototyping immediately. We have also setup a google group for watij: http://groups.google.com/group/watij. Jake Dempsey -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060428/04c2bdd9/attachment.html From jkohl at telusplanet.net Fri Apr 28 19:05:11 2006 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Fri, 28 Apr 2006 17:05:11 -0600 Subject: [Wtr-general] Java port of watir In-Reply-To: <5479b1ff0604281518l4f1e7b62re274ae7e32b011b2@mail.gmail.com> Message-ID: <001e01c66b18$34d15900$6500a8c0@tintin> Very cool. I've been helping a similar effort in C# which is getting off the ground nicely. My dream in pre-Watir days was to have multiple tools in different programming languages. As I believe Bret said, the best language for testing is the one the programmers use. :) -Jonathan _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jake Dempsey Sent: April 28, 2006 4:18 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Java port of watir Myself and a colleague(Brian Knorr) have created a new automation framework called watij. Its watir............but in java. We actually have written the framework to use roughly the same api as watir. For example, a full test in watij looks like: import junit.framework.TestCase; import static watij.symbols.Symbol.*; public class GoogleTest extends TestCase { public void testGoogleSearch() throws Exception { IE ie = new IE(); ie.start("http://www.google.com "); ie.textField(name, "q").set("XWiki"); ie.button("Google Search").click(); assertTrue(ie.containsText( "/Java wiki engine/" )); } } We have released a beta version and you can read more at http://watij.xwiki.com We have linked to watir on our site and have also stated that watij is watir.........but in java. We love the flexibility and robustness of watir but wanted a pure java version. We would love to get feedback from anyone. The waij.xwiki.com site has a quick guide to get started and watij is also packaged with a preconfigured version of beanshell that allows you to get started prototyping immediately. We have also setup a google group for watij: http://groups.google.com/group/watij. Jake Dempsey -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060428/f05558e1/attachment.html From angelo0000 at gmail.com Fri Apr 28 19:20:58 2006 From: angelo0000 at gmail.com (Jake Dempsey) Date: Fri, 28 Apr 2006 18:20:58 -0500 Subject: [Wtr-general] Java port of watir In-Reply-To: <001e01c66b18$34d15900$6500a8c0@tintin> References: <5479b1ff0604281518l4f1e7b62re274ae7e32b011b2@mail.gmail.com> <001e01c66b18$34d15900$6500a8c0@tintin> Message-ID: <5479b1ff0604281620h7fa3218ap43c66f1db7ef54d7@mail.gmail.com> I agree. This is why we wanted watij to follow the same (roughly) api as watir. We actually are porting all of the unit tests as well so that we can gauge our progress. To this point we have ported well over 100 tests from the watir unittest library. We have downloaded the latest from watir so that we can port the latest and greatest. The prepackaged Beanshell is also cool. If you have java 1.5 installed, you can have watij up and running in < 3 mins. Check it out at http://watij.xwiki.com. Again, feedback is greatly welcomed. On 4/28/06, Jonathan Kohl wrote: > > Very cool. I've been helping a similar effort in C# which is getting off > the ground nicely. > > My dream in pre-Watir days was to have multiple tools in different > programming languages. As I believe Bret said, the best language for > testing is the one the programmers use. :) > > -Jonathan > > ------------------------------ > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Jake Dempsey > *Sent:* April 28, 2006 4:18 PM > *To:* wtr-general at rubyforge.org > *Subject:* [Wtr-general] Java port of watir > > > > Myself and a colleague(Brian Knorr) have created a new automation > framework called watij. Its watir............but in java. We actually have > written the framework to use roughly the same api as watir. For example, a > full test in watij looks like: > > import junit.framework.TestCase; > import static watij.symbols.Symbol.*; > > public class GoogleTest extends TestCase { > > public void testGoogleSearch() throws Exception { > IE ie = new IE(); > ie.start("http://www.google.com"); > ie.textField(name, "q").set("XWiki"); > ie.button("Google Search").click(); > assertTrue(ie.containsText( "/Java wiki engine/" )); > } > > } > > We have released a beta version and you can read more at > http://watij.xwiki.com We have linked to watir on our site and have also > stated that watij is watir.........but in java. We love the flexibility and > robustness of watir but wanted a pure java version. We would love to get > feedback from anyone. The waij.xwiki.com site has a quick guide to get > started and watij is also packaged with a preconfigured version of beanshell > that allows you to get started prototyping immediately. We have also setup a > google group for watij: http://groups.google.com/group/watij. > > Jake Dempsey > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060428/d898cd43/attachment.html From bret at pettichord.com Sat Apr 29 12:10:44 2006 From: bret at pettichord.com (Bret Pettichord) Date: Sat, 29 Apr 2006 11:10:44 -0500 Subject: [Wtr-general] Tracking down xpath bug Message-ID: Angrez and i are getting different results when we execute div2_xpath_test.rb. I'd appreciate it if others could get the latest code from HEAD, execute this test, and tell us what happens. You'll have to install REXML 3.1.4first. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060429/29ee4563/attachment.html From bret at pettichord.com Sat Apr 29 15:49:45 2006 From: bret at pettichord.com (Bret Pettichord) Date: Sat, 29 Apr 2006 14:49:45 -0500 Subject: [Wtr-general] Using the OpenQA Forums Message-ID: I suggest that we make use of the Open QA Forums. The details of this suggestion are below. But first, some background. The wtr-general mailing list On several occassions the Watir community has clearly indicated that it did not want to see separate lists for users and developers. Instead we have a common mailing list called wtr-general hosted at Rubyforge.org. This mailing list is open to anybody and only accepts posts from members. It is very active and encourages discussions of testing with Ruby whether or not Watir is specifically being used. List maintenance is minor; mostly it consists of approving occassional posts that have either large attachments (over 40 KB) or are from members who are using a different email address from their subscription (although i wouldn't mind another volunteer to help with this). The biggest drawback to the list is the difficulty of searching the archives. However, this is a less of a problem than it used to be because we've added a search feature to the project web page, and the list is also mirrored to another site with better archiving. For further details, see http://rubyforge.org/mailman/listinfo/wtr-general The Current OpenQA Watir Forums The standard Open QA hosting arrangement includes two web-based forums, one for users and one for developers. These were set up for Watir when we first set up at Open QA, but they have gone largely unused and neglected. According to the Open QA website, there are also corresponding mailing lists for these forums, but in my discussions with Patrick, I understood that these haven't actually been set up. He also tells us that he can synchronize forums with existing email lists hosted at other sites. These forums have the advantage of being easy to browse and search for casual users. They also have an interesting feature that allows tracking which questions have been answered and who is answering the most questions. And they offer RSS feeds, which offers an alternative way of tracking a discussion without subscribing. For details, see http://forums.openqa.org/category.jspa?categoryID=4 The Proposal I am proposing that the current wtr-general mailing list be mirrored at OpenQA. The Watir community has recently requested that we create a new mailing to handle support of the Watir code currently in development (namely Watir 1.5 and FireWatir). I am proposing that a new list be created at Rubyforge (wtr-development) and that it be mirrored by a new forum at OpenQA (Watir Development). The following is a detailed action plan for how to make this all happen. If this plan is approved by the community, i will work with Patrick and Charley on the implementation. Setting Up Watir General 1. Delete the Watir Users and Watir Developers Forums. 2. Create a new Forum called Watir General. 3. Set up Watir General to include the traffic from wtr-general. 4. Get the pre-transfer archives of wtr-general from rubyforge and have these placed in the Watir General Archives. Setting Up Watir Development 1. Create a new mailing list wtr-development at Rubyforge. 2. Create a new Forum at OpenQA called Watir Development. 3. Open up the list to new subscribers. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060429/a61cbf17/attachment.html From bret at pettichord.com Sat Apr 29 16:44:02 2006 From: bret at pettichord.com (Bret Pettichord) Date: Sat, 29 Apr 2006 15:44:02 -0500 Subject: [Wtr-general] The Watir Installer Message-ID: This is a proposal for packaging Watir 1.5. Watir will be distributed as two files. 1. watir-1.5.0.gem - A gem that can be downloaded and installed locally or remotely installed over the internet (as always). 2. watir-bonus.zip - A zip file containing the user guide, the examples, and notes on where to find the unit tests and API docs (which are already in the gem). The gem would be required on any machine running Watir tests. The bonus zip would be recommend for any users learning Watir. Specifically, i am proposing that we stop distributing the one-click installer. Why? - The one-click installer installs the watir library and other files in different locations than the gem. This can lead to confusion. - The gem is becoming the standard method of installing Ruby libraries. - The one-click installer could be updated to make it more consistent with the gem, but no one has signed up to do this. - It is simpler to just have one method of installing Watir. I've discussed this off line with several people, but feel like this is something that requires official community review. Please vote on this proposal. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060429/b503a57c/attachment.html From jkohl at telusplanet.net Sat Apr 29 16:45:36 2006 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Sat, 29 Apr 2006 14:45:36 -0600 Subject: [Wtr-general] The Watir Installer In-Reply-To: Message-ID: <002601c66bcd$ded4bef0$6500a8c0@tintin> +1 _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: April 29, 2006 2:44 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] The Watir Installer This is a proposal for packaging Watir 1.5. Watir will be distributed as two files. 1. watir-1.5.0.gem - A gem that can be downloaded and installed locally or remotely installed over the internet (as always). 2. watir-bonus.zip - A zip file containing the user guide, the examples, and notes on where to find the unit tests and API docs (which are already in the gem). The gem would be required on any machine running Watir tests. The bonus zip would be recommend for any users learning Watir. Specifically, i am proposing that we stop distributing the one-click installer. Why? - The one-click installer installs the watir library and other files in different locations than the gem. This can lead to confusion. - The gem is becoming the standard method of installing Ruby libraries. - The one-click installer could be updated to make it more consistent with the gem, but no one has signed up to do this. - It is simpler to just have one method of installing Watir. I've discussed this off line with several people, but feel like this is something that requires official community review. Please vote on this proposal. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060429/ee7dea54/attachment.html From charley.baker at gmail.com Sat Apr 29 19:54:16 2006 From: charley.baker at gmail.com (Charley Baker) Date: Sat, 29 Apr 2006 17:54:16 -0600 Subject: [Wtr-general] The Watir Installer In-Reply-To: <002601c66bcd$ded4bef0$6500a8c0@tintin> References: <002601c66bcd$ded4bef0$6500a8c0@tintin> Message-ID: +1, agreed, simplifying is a good thing. On 4/29/06, Jonathan Kohl wrote: > > +1 > > ------------------------------ > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Bret Pettichord > *Sent:* April 29, 2006 2:44 PM > *To:* wtr-general at rubyforge.org > *Subject:* [Wtr-general] The Watir Installer > > This is a proposal for packaging Watir 1.5. > > Watir will be distributed as two files. > 1. watir-1.5.0.gem - A gem that can be downloaded and installed locally or > remotely installed over the internet (as always). > 2. watir-bonus.zip - A zip file containing the user guide, the examples, > and notes on where to find the unit tests and API docs (which are already in > the gem). > > The gem would be required on any machine running Watir tests. The bonus > zip would be recommend for any users learning Watir. > > Specifically, i am proposing that we stop distributing the one-click > installer. Why? > - The one-click installer installs the watir library and other files in > different locations than the gem. This can lead to confusion. > - The gem is becoming the standard method of installing Ruby libraries. > - The one-click installer could be updated to make it more consistent with > the gem, but no one has signed up to do this. > - It is simpler to just have one method of installing Watir. > > I've discussed this off line with several people, but feel like this is > something that requires official community review. > > Please vote on this proposal. > > Bret > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060429/e7168bd3/attachment.html From polleu at xpiece.com Sat Apr 29 20:12:55 2006 From: polleu at xpiece.com (polleu) Date: Sun, 30 Apr 2006 01:12:55 +0100 Subject: [Wtr-general] How can I read alternate field attributes into a variable? In-Reply-To: <37c405480604251422m228f6cb6vf7ae0413de833299@mail.gmail.com> References: <37c405480604251422m228f6cb6vf7ae0413de833299@mail.gmail.com> Message-ID: <44540107.7040603@xpiece.com> Hi Paul, I get the maxlength of a field the following way: textfield = $ie.text_field(:id, $tf_userid) object = textfield.getOLEObject() maxlength = object.invoke("maxlength") Hope this helps. Ulrike Paul Carvalho wrote: > Most of my Watir scripts generate their own random inputs (content and > length), but I always have to specify an upper limit for each data > value specified. > > For example, a Create New User page has the following HTML for a User > Name input field: > name=_ctl0:UserNameField> > > and the script writes to it with the following code: > # Input a username that is at least 5 characters but no more than > 50 chars in length > $ie.text_field(:name, /UserName/).set( random_input( 'text', > 5+rand(46) ) ) > > So I have to [manually] specify in the script that it should contain > no more than 50 characters in length (i.e. upper limit of 5+45). > > I would like to know if it is possible to have Ruby/Watir > automatically read the 'maxLength=##' attribute and assign that value > to a variable that I can then work with in the corresponding input > commands? > > If I can do that, then my scripts will be even more independent and > free to generate their own inputs of random length based on what the > HTML says a field's upper limit is. > > I couldn't find anything in the Watir API Reference that looked like > it might do this. Could we add a feature to do this if there isn't a > way now? > > Paul. > >------------------------------------------------------------------------ > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > From klancaster1957 at gmail.com Sat Apr 29 20:32:07 2006 From: klancaster1957 at gmail.com (Keith Lancaster) Date: Sat, 29 Apr 2006 19:32:07 -0500 Subject: [Wtr-general] The Watir Installer In-Reply-To: Message-ID: +1 On 4/29/06 3:44 PM, "Bret Pettichord" wrote: > This is a proposal for packaging Watir 1.5. > > Watir will be distributed as two files. > 1. watir-1.5.0.gem - A gem that can be downloaded and installed locally or > remotely installed over the internet (as always). > 2. watir-bonus.zip - A zip file containing the user guide, the examples, and > notes on where to find the unit tests and API docs (which are already in the > gem). > > The gem would be required on any machine running Watir tests. The bonus zip > would be recommend for any users learning Watir. > > Specifically, i am proposing that we stop distributing the one-click > installer. Why? > - The one-click installer installs the watir library and other files in > different locations than the gem. This can lead to confusion. > - The gem is becoming the standard method of installing Ruby libraries. > - The one-click installer could be updated to make it more consistent with the > gem, but no one has signed up to do this. > - It is simpler to just have one method of installing Watir. > > I've discussed this off line with several people, but feel like this is > something that requires official community review. > > Please vote on this proposal. > > Bret > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060429/5a545e19/attachment.html From charley.baker at gmail.com Sat Apr 29 22:59:52 2006 From: charley.baker at gmail.com (Charley Baker) Date: Sat, 29 Apr 2006 20:59:52 -0600 Subject: [Wtr-general] Tracking down xpath bug In-Reply-To: References: Message-ID: Hrrrm, I'm getting errors running the test, main results: 2 tests, 1 assertion, 1 failure, 1 error. Images are missing on the html page under test: list_matter.html. They all refer to AIMS/images/... Error 1 listed at the bottom. Here's how I installed: - Deleted Watir and Rexml files from my Ruby install. - Pulled Watir from HEAD, ran 'gem build' against the watir.gemspec to create watir-1.5.0.971.gem. Installed the gem. - Downloaded rexml and installed 3.1.4 from bin/install.rb. - Sanity version checking: require 'watir' require 'rexml/rexml' p "Watir version: " + Watir::IE::VERSION p "Rexml version: " + REXML::Version p "Platform: " + PLATFORM => "Watir version: 1.5.0.971" "Rexml version: 3.1.4" "Platform: i386-mswin32" I'm continuing to work on it, but this is what I'm getting now. Error 1: 1) Error: test_div_with_contains(TC_Divs_XPath2): NoMethodError: undefined method `include?' for nil:NilClass C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/functions.rb:142:in `contains' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:451:in `send' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:451:in `expr' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:438:in `each_with_i ndex' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:438:in `each' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:438:in `each_with_i ndex' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:438:in `expr' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:387:in `expr' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:283:in `expr' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:277:in `each_with_i ndex' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:277:in `each' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:277:in `each_with_i ndex' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:277:in `expr' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:488:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:490:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `each_index' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:485:in `d_o_s' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:476:in `descendant_ or_self' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:315:in `expr' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:125:in `match' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:56:in `parse' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/xpath.rb:53:in `each' C:/dev/ruby/lib/ruby/site_ruby/1.8/rexml/element.rb:939:in `each' C:/dev/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.971 /unittests/../watir.rb:195 4:in `elements_by_xpath' C:/dev/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.971 /unittests/../watir.rb:194 4:in `element_by_xpath' C:/dev/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.971 /unittests/../watir.rb:268 2:in `locate' C:/dev/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.971 /unittests/../watir.rb:215 1:in `assert_exists' C:/dev/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.971 /unittests/../watir.rb:221 9:in `text' C:/dev/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.971 /unittests/div2_xpath_test .rb:19:in `test_div_with_contains' On 4/29/06, Bret Pettichord wrote: > > Angrez and i are getting different results when we execute > div2_xpath_test.rb. > > I'd appreciate it if others could get the latest code from HEAD, execute > this test, and tell us what happens. You'll have to install REXML 3.1.4first. > > Bret > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060429/cb92ab57/attachment.html From paul.rogers at shaw.ca Sun Apr 30 01:09:39 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sat, 29 Apr 2006 23:09:39 -0600 Subject: [Wtr-general] [ANN] RuMBA Message-ID: Im pleased to announce Ive started work on RuMBA - Ruby Multiple Browser Accessor. What Is It? RuMBA will allow a watir like script to access muliple browser types - IE, FireFox etc. It will work cross platform, allowing linux and mac to be supported. Ive done enough work to think that it will work the way I expect. There is no code currently checked in. How Does It Work? At the Canada On Rails Conference in Vancouver on April 12, David HH ( the creator of rails) demonstrated some technology called Armageddon. While this is not currently available in Rails, Ive found a similar library that will allow me to do the same thing. I expect to move to Armageddon when it becomes available. Argageddon and Aflax( the library Im currently using ) use FLASH to access the dom of a web page. This is typically used to provide push functionality - ie the server is able to send data to a browser without the browser continually polling the server. We can utilise this to set fields and click buttons. The advantage is that it is cross browser, rather than being limited to Internet Explorer. ( its also fast - this being the biggest downside Ive seen to FireWatir) The DownSide to make this work cross browser, the html must contain the flash object and some javascript. The easy way is to have the server do this for you. If you are using rails, its easy. Other server technologies may be harder to have it work in test and easily switch off for a production environment. The other alternative is to do it client side, using a proxy that alters the HTML that is delivered to the browser. What Can you expect, and When. I expect the initial release will only allow finding elements using :id. Constructs like table(:id, 'xx).button(:id,'yy') are unlikely to be supported any time soon. Handling of javascript popups like alerts and file requesters is unlikely to be in anytime soon ( I have no idea how to handle this on linux or mac) The first release will be a simple demo of the technology, allowing field sets and button clicks, as well as retreiving some info about the page ( url, title etc) Im unlikely to have anything soon. Its summer, and Im generally very busy, which leaves me little time to work on this. However I know there is significant interest in the community and my various clients are also interested in having support for firefox too. Help Wanted. If you have some specific knowledge, particularly in linux or mac areas I would be interested in hearing from you. If you are able to test this on OS other than windows, I would also like to hear from you. If you have some spare time and have ruby and javascript knowledge, Ive got a big list of things that need to be done. If you can write documentation I REALLY need you! If you cant do any of the above, but know you want to do cross browser testing, please also get in contact, as just knowing what you want to do will be a big help. For now, please contact me at paul.rogers at shaw.ca - please put rumba in the subject. How this might work. This may change, its just here to show you how this thing may work. If I have 2 browsers, one IE and 1 FF: I might type ( at IRB, ignoring all the set up ) irb> rumba.clients 1... FF http://localhost:8080/test1.html 2... IE http://localhost:8080/test2.html irb> ff=rumba.attach(:instance,1) irb> ff.title A Test Page irb> ff.goto('http://localhost:8080/test3.html') ok irb> ff.button(:id , 'abutton').click you get idea I hope Paul From raghu at qantom.com Sun Apr 30 01:39:36 2006 From: raghu at qantom.com (Raghu Venkataramana) Date: Sun, 30 Apr 2006 11:09:36 +0530 Subject: [Wtr-general] [OT] - Gem upgrade? Message-ID: <44544D98.9070909@qantom.com> How does one upgrade gems? when I do a gem install on the latest gem, I find two versions of the same application installed: for example, wet-web (0.5, 0.9) I am only left with an option to first uninstall the previous version of GEM and then installing the new one. Is there a way to specify (while installing the gem) that only the latest version needs to be kept and the previous version can be removed? Any help is appreciated Raghu From George.Flaherty at sas.com Sun Apr 30 09:19:19 2006 From: George.Flaherty at sas.com (George Flaherty) Date: Sun, 30 Apr 2006 09:19:19 -0400 Subject: [Wtr-general] Access Denied with Frames Message-ID: <416BE996E3CA9548819C278CE307B1D31F1093@MERCMBX03.na.sas.com> I am currently evaluating Watir for one of our web based applications. The application I am using for evaluation of watir contains quite a bit of frame sets. Now when I try to determine the HTMLinks within the frames I get --Access Denied--? Am I doing something wrong, or missing? Maybe and outdated version of Watir? Thanks -george Version Info: =========== Watir 1.4.1 Ruby 1.8.2 IE 6.0.2900. Here is my simple test: ======================= require 'watir' ie = Watir::IE.attach(:title,/Marketmax - Integrated Mer/) ie.show_frames Here is the error I am receiving: ======================= W, [29-Apr-2006 08:51:34#3756] WARN -- : frame error in waitdocument OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. C:/usr/ruby/lib/ruby/site_ruby/1.8/watir.rb:1405:in `method_missing' C:/usr/ruby/lib/ruby/site_ruby/1.8/watir.rb:1405:in `wait' C:/usr/ruby/lib/ruby/site_ruby/1.8/watir.rb:1404:in `upto' C:/usr/ruby/lib/ruby/site_ruby/1.8/watir.rb:1404:in `wait' C:/usr/ruby/lib/ruby/site_ruby/1.8/watir.rb:1113:in `attach_init' C:/usr/ruby/lib/ruby/site_ruby/1.8/watir.rb:1104:in `attach' C:/georgef/work/MATS2.1-Ezrah/scripts/watir/IMPS-Web61/Sandbox.rb:3 there are 2 frames frame index: 1 --Access Denied-- frame index: 2 --Access Denied-- From bret at pettichord.com Sun Apr 30 18:24:24 2006 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 30 Apr 2006 17:24:24 -0500 Subject: [Wtr-general] [OT] - Gem upgrade? In-Reply-To: <44544D98.9070909@qantom.com> References: <44544D98.9070909@qantom.com> Message-ID: you don't "upgrade" gems, you just install or uninstall them. you can uninstall any version of a gem library at any time. so after you've installed the new library, you can test it out to make sure it works and then uninstall the old one. or you can leave it; there's really no harm in leaving it around. do you have a specific concern? bret On 4/30/06, Raghu Venkataramana wrote: > > How does one upgrade gems? when I do a gem install on the latest gem, I > find two versions of the same application installed: > > for example, > wet-web (0.5, 0.9) > > I am only left with an option to first uninstall the previous version of > GEM and then installing the new one. Is there a way to specify (while > installing the gem) that only the latest version needs to be kept and > the previous version can be removed? > > Any help is appreciated > > Raghu > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060430/113d15e1/attachment.html