From aidy.lewis at googlemail.com Sun Apr 1 11:26:56 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Sun, 1 Apr 2007 16:26:56 +0100 Subject: [Wtr-general] IDEs for Watir Message-ID: <7ac2300c0704010826r2bbe0dbcnec7d8a26b22268e@mail.gmail.com> Hi Zeljko, > I am using Arachno Ruby for two years Could you please tell me what version of the ruby interpreter you are using with Arachno Ruby to allow the debug to run? Error msg informs me I can use the release version of 1.8.5, but this is not the case. currently using 1.8.5-22 http://rubyforge.org/frs/?group_id=167 aidy From cancer9920 at gmail.com Mon Apr 2 03:12:38 2007 From: cancer9920 at gmail.com (ankur bajpai) Date: Mon, 2 Apr 2007 12:42:38 +0530 Subject: [Wtr-general] problem in identifying the button In-Reply-To: References: Message-ID: Hi Angrez Thanks for ur response..but its not working.I cannot access the root directory of "some path" Is there any other way out????? Also where can i get a exhaustive list of all the ways to access n click all types of buttons? On 3/30/07, Angrez Singh wrote: > > Hi, > > try this: > > ie.image(:src, "some path").click() > > - Angrez > > On 3/30/07, ankur bajpai < cancer9920 at gmail.com> wrote: > > > Hi > > > > I am very new to Ruby-Watir and i am facing a problem in clicking a > > button which has no input name > > > > The HTML is like > > > target="_self"href="(some path)"> > border="0"> > > > > I am stuck at this point cannot proceed further. Please help me out > > > > _______________________________________________ > > 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/20070402/eb0a3015/attachment-0001.html From forum-watir-users at openqa.org Mon Apr 2 03:14:47 2007 From: forum-watir-users at openqa.org (Maisonnette) Date: Mon, 02 Apr 2007 02:14:47 CDT Subject: [Wtr-general] Count checked checkbox In-Reply-To: Message-ID: <24633676.231175498118650.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Ok thank you very much for your explain... This code work ! Fabien From cancer9920 at gmail.com Mon Apr 2 03:19:12 2007 From: cancer9920 at gmail.com (ankur bajpai) Date: Mon, 2 Apr 2007 12:49:12 +0530 Subject: [Wtr-general] problem in identifying the button In-Reply-To: References: Message-ID: Hi Thanks for ur response..but its not working.I cannot access the root directory of "some path" Is there any other way out????? Also where can i get a exhaustive list of all the ways to access n click all types of buttons? On 3/30/07, ?eljko Filipin wrote: > > Try this. > > ie.image(:src, /some%20path/).flash > ie.link(:href, /some%20path/).flash > > Zeljko > -- > ZeljkoFilipin.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/20070402/17836f50/attachment.html From zeljko.filipin at gmail.com Mon Apr 2 04:15:54 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 2 Apr 2007 10:15:54 +0200 Subject: [Wtr-general] IDEs for Watir In-Reply-To: <7ac2300c0704010826r2bbe0dbcnec7d8a26b22268e@mail.gmail.com> References: <7ac2300c0704010826r2bbe0dbcnec7d8a26b22268e@mail.gmail.com> Message-ID: On 4/1/07, aidy lewis wrote: > > Could you please tell me what version of the ruby interpreter > you are using with Arachno Ruby to allow the debug to run? > ruby 1.8.2 (2004-12-25) [i386-mswin32] -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070402/10d0faa6/attachment.html From forum-watir-users at openqa.org Mon Apr 2 05:20:09 2007 From: forum-watir-users at openqa.org (Vamsee Krishna M) Date: Mon, 02 Apr 2007 04:20:09 CDT Subject: [Wtr-general] HTML element physical location on screen. Message-ID: <29773784.1251175505639230.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, Is it possible get physical location of an html element relative to screen ? Since watir can't drive the mouse, I want this location so that I can go to that location and do a physical click through a thridpary tool like autoit. I don't want to do it through fire_event since it can't fire right mouse click events. Thanks. From vikashkumar051 at yahoo.co.in Mon Apr 2 07:42:05 2007 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Mon, 2 Apr 2007 17:12:05 +0530 (IST) Subject: [Wtr-general] problem in clicking button Message-ID: <614914.51348.qm@web7801.mail.in.yahoo.com> I have a button in my web page, the relevant snippet of html is as follows:
 
This button can be click using watir by ie.button(:value,'Sign In').click, but in case of FireWatir, the same syntax gives error. The Error is as follows : c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.0.1-mswin32/./MozillaBaseElement.rb:739:in `assert_exists': Unable to locate object, using value and Sign In (FireWatir::Exception::UnknownObjectException) from c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.0.1-mswin32/./MozillaBaseElement.rb:897:in `click' Please, help me in clicking this button using FireWatir Thanks in advance Vikash __________________________________________________________ Yahoo! India Answers: Share what you know. Learn something new http://in.answers.yahoo.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070402/f3522a5d/attachment.html From prema.arya at gmail.com Mon Apr 2 08:31:02 2007 From: prema.arya at gmail.com (Prema Arya) Date: Mon, 2 Apr 2007 18:01:02 +0530 Subject: [Wtr-general] problem in clicking button In-Reply-To: <614914.51348.qm@web7801.mail.in.yahoo.com> References: <614914.51348.qm@web7801.mail.in.yahoo.com> Message-ID: <27915010704020531q48c5cfdic5c440b4088502@mail.gmail.com> Hi Vikash, Thanks for raising the issue. We are working on FireWatir to remove all the gaps it has with Watir so that there is no need to change scripts. For now you can click the button using text and type properties, this works on Watir also. ff.button(:text, "Sign In") ff.button(:type, "submit") Regards, Prema On 4/2/07, VIKASH KUMAR wrote: > > I have a button in my web page, the relevant snippet of html is as > follows: > >
 
> >
> > This button can be click using watir by ie.button(:value,'Sign In').click, > but in case of FireWatir, the same syntax gives error. > > The Error is as follows : > > c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.0.1-mswin32/./MozillaBaseElement.rb:739:in > `assert_exists': Unable to locate object, using value and Sign In > (FireWatir::Exception::UnknownObjectException) > from c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.0.1-mswin32/./MozillaBaseElement.rb:897:in > `click' > > Please, help me in clicking this button using FireWatir > Thanks in advance > Vikash > > ------------------------------ > Here's a new way to find what you're looking for - Yahoo! Answers > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- Prema Arya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070402/b047af15/attachment.html From forum-watir-users at openqa.org Mon Apr 2 10:50:16 2007 From: forum-watir-users at openqa.org (Fletch) Date: Mon, 02 Apr 2007 09:50:16 CDT Subject: [Wtr-general] Assert Dates? Message-ID: <33572816.4421175525446337.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello All, I have been working on trying to assert whether a date range is displayed on screen, but have run in to problems and was hoping someone could give me some advice. I have the dates stored in the format dd/mm/yy I want to use a function which takes an arrival date and a departure date as two parameters and checks against data on screen which is in the format "arrivalDate - departureDate (x)" where x can be any number. This means that I am going to use a Regex to try and match the parameters to part of the text on screen, not taking in to account the last number. def checkDates(arrDate, depDate) myDates = arrDate + " - " + depDate begin assert( $mainF.contains_text(/myDates/)) rescue => e # Do Stuff end This code does not seem to be working, and I think that the reason is the date uses "/" characters which are used to Denote a Regex expression. If I use a constant '01/01/07 - 01/01/08' there is no problem, but I need some way to deal with the dates in the parameters. Does anyone have any suggestions? Any help would be greatly appreciated. Thanks, PMF. From forum-watir-users at openqa.org Mon Apr 2 11:46:55 2007 From: forum-watir-users at openqa.org (Ravi) Date: Mon, 02 Apr 2007 10:46:55 CDT Subject: [Wtr-general] Assert Dates? In-Reply-To: <33572816.4421175525446337.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <31478621.4701175528845834.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Replace: $mainF.contains_text(/myDates/) with: $mainF.contains_text("#{myDates}") -Ravi From paul.rogers at shaw.ca Mon Apr 2 12:36:49 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 02 Apr 2007 10:36:49 -0600 Subject: [Wtr-general] HTML element physical location on screen. In-Reply-To: <29773784.1251175505639230.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <29773784.1251175505639230.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: I think you can do a right click by ie.button(:id, 'xx').fire_event('onContextMenu') if that doesnt work, this might be what you need to help get the coordinates http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/getclientrects.asp http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/textrectangle.asp http://msdn.microsoft.com/workshop/browser/webbrowser/reference/methods/clienttowindow.asp?frame=true ----- Original Message ----- From: Vamsee Krishna M Date: Monday, April 2, 2007 3:20 am Subject: [Wtr-general] HTML element physical location on screen. > Hi, > > Is it possible get physical location of an html element relative > to screen ? > Since watir can't drive the mouse, I want this location so that I > can go to that location and do a physical click through a > thridpary tool like autoit. > I don't want to do it through fire_event since it can't fire right > mouse click events. > > Thanks. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From aidy.lewis at googlemail.com Mon Apr 2 12:48:26 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Mon, 2 Apr 2007 17:48:26 +0100 Subject: [Wtr-general] little framework In-Reply-To: <013b01c771ab$762f5bf0$6400a8c0@laptop> References: <7ac2300c0703270856j7c43e8d7hb3b301834e77662f@mail.gmail.com> <7ac2300c0703280955h8820726s2e8d2f78e266919b@mail.gmail.com> <013b01c771ab$762f5bf0$6400a8c0@laptop> Message-ID: <7ac2300c0704020948x3dbee909j4e0fc330d0c88@mail.gmail.com> #Hi, #This is what I have got, I don't think it is anything new: #each page has a class where objects of that class are mapped class Login def username;$ie.text_field(:name, 'user_name');end def password;$ie.text_field(:name, 'password');end def remember_me;$ie.checkbox(:name, 'remember_me');end def sign_in;$ie.button(:value, 'Sign in');end end #objects that dont neatly fit into a class go into a project module module Mission def Mission.log_out;$ie.link(:text, /Log-out/);end end #browser also has its own module module Browser def Browser.open;$ie = Watir::IE.new;end def Browser.goto(url);$ie.goto(url);end def Browser.bring_to_front;$ie.bring_to_front;end def Browser.maximize;$ie.maximize;end def Browser.close;$ie.close;end end #we have suites of tests with a test set-up and teardown method #the set-up is executed before each method, the teardown after class MissionSuite < Test::Unit::TestCase include Mission include Browser def setup Browser.open Browser.goto('http://missiontesting.updatelog.com') Browser.bring_to_front Browser.maximize #we use ruby test assertions for are own purposes login = Login.new assert(login.username.exists?) assert(login.password.exists?) end def teardown Browser.close end def test_1 login = Login.new login.username.set('aidy') login.password.set('lewis') login.remember_me.set #need to use the watir xml logger or log to xml myself for external purposes end def test_2 login = Login.new login.username.set('tony') login.password.set('smith') login.remember_me.clear login.sign_in.click end end #don't know if anyone has any opinions #aidy From paul.rogers at shaw.ca Mon Apr 2 13:40:20 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 02 Apr 2007 11:40:20 -0600 Subject: [Wtr-general] little framework In-Reply-To: <7ac2300c0704020948x3dbee909j4e0fc330d0c88@mail.gmail.com> References: <7ac2300c0703270856j7c43e8d7hb3b301834e77662f@mail.gmail.com> <7ac2300c0703280955h8820726s2e8d2f78e266919b@mail.gmail.com> <013b01c771ab$762f5bf0$6400a8c0@laptop> <7ac2300c0704020948x3dbee909j4e0fc330d0c88@mail.gmail.com> Message-ID: instead of explitily asserting the existance of all the elements, Id try and come up with an easier way, ( this probably wont work, but it might, and may give you some ideas ) def username;$ie.text_field(:name, 'user_name');end def password;$ie.text_field(:name, 'password');end def remember_me;$ie.checkbox(:name, 'remember_me');end def existance_check( *elems ) &elems.each do |el| raise "Didnt exist" unless eval(el.to_s.exists?) end end def test_it assert_nothing_raised( existance_check :username , :password) end ----- Original Message ----- From: aidy lewis Date: Monday, April 2, 2007 10:48 am Subject: Re: [Wtr-general] little framework > #Hi, > > #This is what I have got, I don't think it is anything new: > > #each page has a class where objects of that class are mapped > class Login > def username;$ie.text_field(:name, 'user_name');end > def password;$ie.text_field(:name, 'password');end > def remember_me;$ie.checkbox(:name, 'remember_me');end > def sign_in;$ie.button(:value, 'Sign in');end > end > > > #objects that dont neatly fit into a class go into a project module > module Mission > def Mission.log_out;$ie.link(:text, /Log-out/);end > end > > #browser also has its own module > module Browser > def Browser.open;$ie = Watir::IE.new;end > def Browser.goto(url);$ie.goto(url);end > def Browser.bring_to_front;$ie.bring_to_front;end > def Browser.maximize;$ie.maximize;end > def Browser.close;$ie.close;end > end > > #we have suites of tests with a test set-up and teardown method > #the set-up is executed before each method, the teardown after > class MissionSuite < Test::Unit::TestCase > include Mission > include Browser > > def setup > Browser.open > Browser.goto('http://missiontesting.updatelog.com') > Browser.bring_to_front > Browser.maximize > #we use ruby test assertions for are own purposes > login = Login.new > assert(login.username.exists?) > assert(login.password.exists?) > end > > def teardown > Browser.close > end > > def test_1 > login = Login.new > login.username.set('aidy') > login.password.set('lewis') > login.remember_me.set > #need to use the watir xml logger or log to xml myself for > external purposes > > end > > def test_2 > login = Login.new > login.username.set('tony') > login.password.set('smith') > login.remember_me.clear > login.sign_in.click > end > > > end > > #don't know if anyone has any opinions > > #aidy > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From christopher.mcmahon at gmail.com Mon Apr 2 13:57:36 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 2 Apr 2007 11:57:36 -0600 Subject: [Wtr-general] Assert Dates? In-Reply-To: <33572816.4421175525446337.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <33572816.4421175525446337.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70704021057l6c3dd79axbe7b4ae969f811e@mail.gmail.com> > If I use a constant '01/01/07 - 01/01/08' there is no problem, but I need some way to deal with the dates in the parameters. escape the slashes: /01\/01\/07/ - 01\/01\/08/ That said, anytime I deal with dates, I usually try to make them actual date objects, then I can assert interesting things about when stuff happens. I made a demo, I hope this helps. ##################################### require 'parsedate' require 'test/unit' class TC_Date < Test::Unit::TestCase def test_date #TEST DATA arr_date = "01/01/07" dep_date = "01/10/07" #DATA FOUND IN THE APP found_arr_date = "01/01/07" #CHANGE YEAR TO "07" TO PASS TEST 2, CHANGE MONTH TO "10" TO PASS TEST 3 found_dep_date = "01/09/06" #GET THE RAW ELEMENTS OF THE DATE arr = ParseDate.parsedate(arr_date) dep = ParseDate.parsedate(dep_date) found_arr = ParseDate.parsedate(found_arr_date) found_dep = ParseDate.parsedate(found_dep_date) #TURN THE RAW ELEMENTS INTO DATE OBJECTS FOR COMPARISON arr_obj = Time.local(*arr) dep_obj = Time.local(*dep) found_arr_obj = Time.local(*found_arr) found_dep_obj = Time.local(*found_dep) #TEST 1: JUST SHOWING WHAT A PASSING TEST LOOKS LIKE assert_equal(arr_obj,found_arr_obj) #TEST 2: ASSERT THAT WE'RE LEAVING LATER THAN WE'RE ARRIVING assert(found_dep_obj >= found_arr_obj,"leaving before we arrive! #{found_dep_obj} is less than #{found_arr_obj}") #TEST 3: ASSERT THAT OUR TEST DATE MATCHES THE DATE IN THE APP assert_equal((dep_obj - arr_obj),(found_dep_obj - found_arr_obj)) end end From forum-watir-users at openqa.org Mon Apr 2 14:30:24 2007 From: forum-watir-users at openqa.org (John Lolis) Date: Mon, 02 Apr 2007 13:30:24 CDT Subject: [Wtr-general] Assert Dates? In-Reply-To: <72799cd70704021057l6c3dd79axbe7b4ae969f811e@mail.gmail.com> Message-ID: <38155555.6201175538654615.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for the demo Chris, I haven't messed with dates beyond the basics, this was a nice way to get brought up to speed. While my first thoughts were along the lines of Chris, I think I would go with the string compare. It seems, in his case, that the level of complexity isn't needed. I can see many situation wheres having the option of using real dates would be useful, but the case for simplicity over 'correctness' needs to be made too. Just my 2c, thanks again for the sample code! From forum-watir-users at openqa.org Mon Apr 2 14:43:45 2007 From: forum-watir-users at openqa.org (John Lolis) Date: Mon, 02 Apr 2007 13:43:45 CDT Subject: [Wtr-general] little framework In-Reply-To: Message-ID: <23840773.6211175539455201.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Looks good. In your setup I would wrap $ie with a global function (internet_explorer or some such). I would then use that global function through out your class files. This could save you a headache down the road :) From vikashkumar051 at yahoo.co.in Tue Apr 3 00:22:02 2007 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Tue, 3 Apr 2007 09:52:02 +0530 (IST) Subject: [Wtr-general] problem in clicking button Message-ID: <1005.89431.qm@web7813.mail.in.yahoo.com> Hi Prema, Thanks for your reply, but when I used this ff.button(:text, "Sign In").click It throws error, as shown below irb(main):016:0> ff.button(:text,"Sign In").click FireWatir::Exception::UnknownObjectException: Unable to locate object, using text and Sign In from c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.0.1-mswin32/./MozillaBaseElement.rb:739:in `assert_exists' from c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.0.1-mswin32/./MozillaBaseElement.rb:897:in `click' also, while using this ff.button(:type, "submit") It throws the following error irb(main):015:0> ff.button(:type,"submit").click FireWatir::Exception::UnknownObjectException: Unable to locate object, using type and submit from c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.0.1-mswin32/./MozillaBaseElement.rb:739:in `assert_exists' from c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.0.1-mswin32/./MozillaBaseElement.rb:897:in `click' Thanks and Regards, Vikash > Please, help me in clicking this button using FireWatir > __________________________________________________________ Yahoo! India Answers: Share what you know. Learn something new http://in.answers.yahoo.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070403/990e9d74/attachment.html From bret at pettichord.com Tue Apr 3 01:21:46 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 03 Apr 2007 00:21:46 -0500 Subject: [Wtr-general] Assert Dates? In-Reply-To: <31478621.4701175528845834.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <31478621.4701175528845834.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4611E46A.8020707@pettichord.com> Ravi wrote: > Replace: > $mainF.contains_text(/myDates/) > with: > $mainF.contains_text("#{myDates}") > This will also work: $mainF.contains_text(myDates) From sayali.shail at gmail.com Tue Apr 3 01:36:59 2007 From: sayali.shail at gmail.com (Sayali Patil) Date: Tue, 3 Apr 2007 11:06:59 +0530 Subject: [Wtr-general] Stable version for watir and ruby Message-ID: <59618fe50704022236q717c8f40n798a0f7d6ccda035@mail.gmail.com> Hi All, Which is the stable version of watior and ruby to use . I used the latest one ,which gives me this error frequently and sometimes it works fine. WIN32OLERuntimeError: unknown property or method `getAttributeNode' HRESULT error code:0x80070005 Access is denied. Please let me know. Thanks, Sayali -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070403/331f687c/attachment.html From forum-watir-users at openqa.org Tue Apr 3 02:04:28 2007 From: forum-watir-users at openqa.org (vijay) Date: Tue, 03 Apr 2007 01:04:28 CDT Subject: [Wtr-general] Can we use as many variable names without worrying about memory wastage In-Reply-To: Message-ID: <23044603.181175580299014.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for all your answers. They were really helpful to me. One small question, do we need to invoke "Garbage Collector" explictly and if so, how? Thanks, Vijay. From forum-watir-users at openqa.org Tue Apr 3 03:06:07 2007 From: forum-watir-users at openqa.org (vijay) Date: Tue, 03 Apr 2007 02:06:07 CDT Subject: [Wtr-general] .Can we set the Watir's time_out_value in the script? In-Reply-To: <33637351.33731175088250534.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <21783389.741175583997335.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks Jlolis for your reply. It is exactly what I had wanted. Thanks, Vijay. From forum-watir-users at openqa.org Tue Apr 3 03:27:37 2007 From: forum-watir-users at openqa.org (vijay) Date: Tue, 03 Apr 2007 02:27:37 CDT Subject: [Wtr-general] How to check for the presence of a frame in a page? Message-ID: <21832300.831175585287077.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello people, Our application has got several frames. The controls need to be accesses through these frames like '$ie.frame('Detail').link(:text,'Disclosure').click'. Before certain statements of this type, I want to check whether the particular frame is present in the current page or not. How do I do that? The '.exists?' method does not seem to work for a frame. If we check a frame, which is not present in the current page, through the '.exists?' method, Watir throws an exception saying "Unable to locate the given frame". Thanks for your time, Vijay From forum-watir-users at openqa.org Tue Apr 3 05:35:46 2007 From: forum-watir-users at openqa.org (Vamsee Krishna M) Date: Tue, 03 Apr 2007 04:35:46 CDT Subject: [Wtr-general] HTML element physical location on screen. In-Reply-To: Message-ID: <24658051.2201175592976850.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for these links helped me verymuch, although I have one problem, last method ClientToWindow method doen't return anything insted it modifies the passed arguments with new values, how to handle this situation in ruby ? From forum-watir-users at openqa.org Tue Apr 3 07:18:12 2007 From: forum-watir-users at openqa.org (vijay) Date: Tue, 03 Apr 2007 06:18:12 CDT Subject: [Wtr-general] Converts DOM Tree into XML file. Message-ID: <27066433.3091175599122451.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi people, I just want to know , how to convert The DOM Tree Structure into a XML file format..? And also can we save the DOM tree Structure from the IE's DOM Explorer.? Thanks, Vijay. From forum-watir-users at openqa.org Tue Apr 3 07:58:25 2007 From: forum-watir-users at openqa.org (John Lolis) Date: Tue, 03 Apr 2007 06:58:25 CDT Subject: [Wtr-general] How to check for the presence of a frame in a page? In-Reply-To: <21832300.831175585287077.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <23136484.3141175601535873.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Take a look at this thread http://forums.openqa.org/thread.jspa?threadID=7082&tstart=30 I give some ideas on how to approach a very similar problem. The easy option to catch the specific exception and handle it from there. From forum-watir-users at openqa.org Tue Apr 3 08:27:55 2007 From: forum-watir-users at openqa.org (Vamsee Krishna M) Date: Tue, 03 Apr 2007 07:27:55 CDT Subject: [Wtr-general] HTML element physical location on screen. In-Reply-To: <24658051.2201175592976850.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <25042140.3421175603305346.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hey, Able to drag the code up to here. def get_location_on_screen assert_exists rects = ole_object.getClientRects().item x = rects.left y = rects.top width = rects.right - rects.left height = rects.bottom - rects.top puts "BEFORE #{x} #{y} #{width} #{height} " #ClientToWindow call @container.ie._invoke(301, [x, y], [WIN32OLE::VARIANT::VT_BYREF|WIN32OLE::VARIANT::VT_I4, WIN32OLE::VARIANT::VT_BYREF|WIN32OLE::VARIANT::VT_I4]) x = WIN32OLE::ARGV[0] y = WIN32OLE::ARGV[1] puts "AFTER #{x} #{y} #{width} #{height} " end GetClientRects method returns the valid values. But when I make a call to ClientToWindow call its returning inaccurate values. If possbile somebody look into this code. BTW This function goes in to Element class. Thanks. Bye. From forum-watir-users at openqa.org Tue Apr 3 09:23:14 2007 From: forum-watir-users at openqa.org (Fletch) Date: Tue, 03 Apr 2007 08:23:14 CDT Subject: [Wtr-general] Assert Dates? In-Reply-To: <33572816.4421175525446337.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <25830903.3701175606624366.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for your replies, The date guide was really good, but as it is only a String comparison, I did not want to over complicate the code. I have also tried the other two suggestions, and have still not been able to get the match to work. I think that I might have to use an escape. I have tried the CGI.escape which works quite well, and picks up the / character by converting it to a %2F, but to use this method is overkill really as it is designed for all HTML characters, so I am thinking that I just need a simple line of code to replace all instances of / with %2F PMF From forum-watir-users at openqa.org Tue Apr 3 10:03:46 2007 From: forum-watir-users at openqa.org (Nicola Kennedy) Date: Tue, 03 Apr 2007 09:03:46 CDT Subject: [Wtr-general] Using Until Message-ID: <24525837.4211175609056037.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, Am v new to Watir/Ruby, so probably a simple question for someone. I'm trying to put a loop in a script where it checks for a link on a page, if the link isn't there, it clicks on the next page button, looks for the link again, and the process repeats until it finds the link, and then clicks on it. Can anyone help? TIA From christopher.mcmahon at gmail.com Tue Apr 3 10:22:03 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 3 Apr 2007 08:22:03 -0600 Subject: [Wtr-general] Assert Dates? In-Reply-To: <25830903.3701175606624366.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <33572816.4421175525446337.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <25830903.3701175606624366.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70704030722j261732dfk56d8419424888f96@mail.gmail.com> On 4/3/07, Fletch wrote: > Thanks for your replies, > The date guide was really good, but as it is only a String comparison, I did not want to over complicate the code. > I have also tried the other two suggestions, and have still not been able to get the match to work. > I think that I might have to use an escape. I have tried the CGI.escape which works quite well, and picks up the / character by converting it to a %2F, but to use this method is overkill really as it is designed for all HTML characters, so I am thinking that I just need a simple line of code to replace all instances of / with %2F > Now that's crazy talk. :) Seriously, look at this code: ################################ arr_date = "xxx01/01/07xxxx" if arr_date =~ /01\/01\/07/ puts "got a regex match" end From christopher.mcmahon at gmail.com Tue Apr 3 10:38:39 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 3 Apr 2007 08:38:39 -0600 Subject: [Wtr-general] Using Until In-Reply-To: <24525837.4211175609056037.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <24525837.4211175609056037.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70704030738m43da64f1tca207c7d4f4feedf@mail.gmail.com> > I'm trying to put a loop in a script where it checks for a link on a page, if the link isn't there, it clicks on the next page button, looks for the link again, and the process repeats until it finds the link, and then clicks on it. It'd be easier to help if you would post a) the HTML involved and b) the Watir code you've tried so far. From forum-watir-users at openqa.org Tue Apr 3 10:39:16 2007 From: forum-watir-users at openqa.org (John Lolis) Date: Tue, 03 Apr 2007 09:39:16 CDT Subject: [Wtr-general] Using Until In-Reply-To: <24525837.4211175609056037.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <24298496.5801175611186872.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I'm not sure how new 'wait_until' is, but if you have it do wait_until(time_to_wait_in_seconds){ $ie.element(:type,'value').exists? } From forum-watir-users at openqa.org Tue Apr 3 10:44:53 2007 From: forum-watir-users at openqa.org (Nicola Kennedy) Date: Tue, 03 Apr 2007 09:44:53 CDT Subject: [Wtr-general] Using Until In-Reply-To: <24298496.5801175611186872.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <25450203.5901175611523606.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Sorry, probably my fault for not being clear about how new I am to this. I want the code to do the following things: 1. Check on page for a link. 2. If link not there, press "Next page" 3. If link there, click on it. 4. When next page reached (if step 2 followed), repeat the action of looking for link/clicking next. Am playing around with code, and have come up with following: link = ie.link(:url, "http://www.freeuk.com") until link.exists ie.goto("http://www.google.co.uk/search?q=freeuk&hl=en&start=10&sa=N") if link.exists = true ie.goto(link) end Am totally aware that this will not work, but it may give my helpers more idea of the details I want!! Thankyou all in advance, and please help! From christopher.mcmahon at gmail.com Tue Apr 3 11:04:32 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 3 Apr 2007 09:04:32 -0600 Subject: [Wtr-general] Using Until In-Reply-To: <25450203.5901175611523606.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <24298496.5801175611186872.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <25450203.5901175611523606.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70704030804l74bb364cmbe252dd978527e73@mail.gmail.com> Aha, so you want to click Google's "Next" button? Take a look at this, it might give you some ideas: http://testingjeff.wordpress.com/2007/01/27/creating-methods-on-the-flyand-bugs-in-google-phonebook/ Also, if you are unsure how to address a particular page element, take a look at the "unittests" folder in the watir directory. It will be in C:/ruby/lib/ruby... somewhere, depending on whether you did a gem install or used the one-click installer. On 4/3/07, Nicola Kennedy wrote: > Sorry, probably my fault for not being clear about how new I am to this. > > I want the code to do the following things: > 1. Check on page for a link. > 2. If link not there, press "Next page" > 3. If link there, click on it. > 4. When next page reached (if step 2 followed), repeat the action of looking for link/clicking next. > > Am playing around with code, and have come up with following: > > link = ie.link(:url, "http://www.freeuk.com") > until link.exists > ie.goto("http://www.google.co.uk/search?q=freeuk&hl=en&start=10&sa=N") > > if link.exists = true > ie.goto(link) > end > > Am totally aware that this will not work, but it may give my helpers more idea of the details I want!! > > Thankyou all in advance, and please help! > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From aidy.lewis at googlemail.com Tue Apr 3 11:40:24 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Tue, 3 Apr 2007 16:40:24 +0100 Subject: [Wtr-general] IE nested class of module watir? Message-ID: <7ac2300c0704030840k3a11d6f9gf76fc96086ffae34@mail.gmail.com> Hi, I am unsure why IE is a nested class of the module watir I was thinking of creating this object hierarchy IE ObjectMap Test Inheriting the IE class from the ObjectMap class. aidy From paul.rogers at shaw.ca Tue Apr 3 13:15:03 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 03 Apr 2007 11:15:03 -0600 Subject: [Wtr-general] Using Until In-Reply-To: <72799cd70704030804l74bb364cmbe252dd978527e73@mail.gmail.com> References: <24298496.5801175611186872.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <25450203.5901175611523606.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <72799cd70704030804l74bb364cmbe252dd978527e73@mail.gmail.com> Message-ID: isnt Jeffs code kind of over kill for this? def link_there? link_text = "Click Me" return @ie.link(:text , link_text).exists? end while 1 # add something here to stop infinite loop if link_there? @ie.link(:text , link_text).click? else @ie.link(:text , "Next").click end end ----- Original Message ----- From: Chris McMahon Date: Tuesday, April 3, 2007 9:04 am Subject: Re: [Wtr-general] Using Until > Aha, so you want to click Google's "Next" button? Take a look at > this, it might give you some ideas: > http://testingjeff.wordpress.com/2007/01/27/creating-methods-on- > the-flyand-bugs-in-google-phonebook/ > > Also, if you are unsure how to address a particular page element, take > a look at the "unittests" folder in the watir directory. It will be > in C:/ruby/lib/ruby... somewhere, depending on whether you did a gem > install or used the one-click installer. > > On 4/3/07, Nicola Kennedy wrote: > > Sorry, probably my fault for not being clear about how new I am > to this. > > > > I want the code to do the following things: > > 1. Check on page for a link. > > 2. If link not there, press "Next page" > > 3. If link there, click on it. > > 4. When next page reached (if step 2 followed), repeat the > action of looking for link/clicking next. > > > > Am playing around with code, and have come up with following: > > > > link = ie.link(:url, "http://www.freeuk.com") > > until link.exists > > > ie.goto("http://www.google.co.uk/search?q=freeuk&hl=en&start=10&sa=N")> > > if link.exists = true > > ie.goto(link) > > end > > > > Am totally aware that this will not work, but it may give my > helpers more idea of the details I want!! > > > > Thankyou all in advance, and please help! > > _______________________________________________ > > 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 christopher.mcmahon at gmail.com Tue Apr 3 13:37:38 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 3 Apr 2007 11:37:38 -0600 Subject: [Wtr-general] OT: Thoughtworks planning to release a tool for application testers Message-ID: <72799cd70704031037v6ab1bbbdh98215521144b732@mail.gmail.com> TW is about to release this thing called "Mingle" to manage agile projects. Today they announced an upcoming tool for testers: http://studios.thoughtworks.com/2007/4/2/how-our-testers-use-mingle (see the last paragraph). From charley.baker at gmail.com Tue Apr 3 13:41:04 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 3 Apr 2007 13:41:04 -0400 Subject: [Wtr-general] Can we use as many variable names without worrying about memory wastage In-Reply-To: <23044603.181175580299014.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <23044603.181175580299014.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: You shouldn't have to invoke the garbage collector manually as it runs automatically, most often when ruby is allocating memory and it's internal memory tracker says there isn't any available or if allocating memory fails. -Charley On 4/3/07, vijay wrote: > > Thanks for all your answers. They were really helpful to me. One small > question, do we need to invoke "Garbage Collector" explictly and if so, how? > > Thanks, > Vijay. > _______________________________________________ > 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/20070403/b1a6115a/attachment-0001.html From forum-watir-users at openqa.org Tue Apr 3 16:37:47 2007 From: forum-watir-users at openqa.org (matt) Date: Tue, 03 Apr 2007 15:37:47 CDT Subject: [Wtr-general] win32/process question Message-ID: <28432298.10011175632697830.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I'm having problems with the win32/process Process.create() method. The following link is very useful... http://textsnippets.com/posts/show/829 The issue, I think, is with finding the file to launch with the Process.create() method. [jclicker.rb] require "watir" # Auto Popup Handler. Posted by brad at longbrothers.net # require 'win32ole' # already included if you use 'require watir' begin autoit = WIN32OLE.new('AutoItX3.Control') loop do autoit.ControlClick("Microsoft Internet Explorer",'', 'OK') autoit.ControlClick("Security Information",'', '&Yes') autoit.ControlClick("Security Alert",'', '&Yes') sleep(5) end rescue Exception => e puts e end If I run this script directly 'ruby jclicker.rb', then any javascript popup windows will "magically" click away. It works really cool! However, if I use the win32/process library to create a process while running a test, then the popup handler doesn't run. [runtest.rb] require 'win32/process' $pid = Process.create( :app_name => 'ruby jclicker.rb', :creation_flags => Process::DETACHED_PROCESS ).process_id at_exit{ Process.kill(9,$pid) } class TC_NewTest < Test::Unit::TestCase ... end It's as if the process is not getting created. The jclicker.rb script is in the same directory as the test program. But, the clicker doesn't run. Any hints are greatly appreciated. From forum-watir-users at openqa.org Tue Apr 3 16:50:02 2007 From: forum-watir-users at openqa.org (matt) Date: Tue, 03 Apr 2007 15:50:02 CDT Subject: [Wtr-general] Stable version for watir and ruby In-Reply-To: <59618fe50704022236q717c8f40n798a0f7d6ccda035@mail.gmail.com> Message-ID: <40933561.10361175633432966.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> The following combination works quite well... Ruby 1.8.5 + watir 1.5.1.1158. From paul.rogers at shaw.ca Tue Apr 3 16:58:36 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 03 Apr 2007 14:58:36 -0600 Subject: [Wtr-general] win32/process question In-Reply-To: <28432298.10011175632697830.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28432298.10011175632697830.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: if you make you jclicker.rb write a file or something in the loop, then when you run it as a process, you should see the extra files get created. The problem may also be something to do with the stdout and stderr of ruby when running as a process. I tried using the process for a different purpose to you, and gave up. console windows may look ugly, but they make it easy to see what the problems are... ----- Original Message ----- From: matt Date: Tuesday, April 3, 2007 2:37 pm Subject: [Wtr-general] win32/process question > I'm having problems with the win32/process Process.create() > method. The following link is very useful... > > http://textsnippets.com/posts/show/829 > > The issue, I think, is with finding the file to launch with the > Process.create() method. > > [jclicker.rb] > require "watir" > > # Auto Popup Handler. Posted by brad at longbrothers.net > # > require 'win32ole' # already included if you use 'require watir' > > begin > autoit = WIN32OLE.new('AutoItX3.Control') > loop do > autoit.ControlClick("Microsoft Internet Explorer",'', 'OK') > autoit.ControlClick("Security Information",'', '&Yes') > autoit.ControlClick("Security Alert",'', '&Yes') > sleep(5) > end > > rescue Exception => e > puts e > end > > > If I run this script directly 'ruby jclicker.rb', then any > javascript popup windows will "magically" click away. It works > really cool! However, if I use the win32/process library to > create a process while running a test, then the popup handler > doesn't run. > > [runtest.rb] > require 'win32/process' > $pid = Process.create( > :app_name => 'ruby jclicker.rb', > :creation_flags => Process::DETACHED_PROCESS > ).process_id > at_exit{ Process.kill(9,$pid) } > > class TC_NewTest < Test::Unit::TestCase > > ... > > end > > > It's as if the process is not getting created. The jclicker.rb > script is in the same directory as the test program. But, the > clicker doesn't run. Any hints are greatly appreciated. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Wed Apr 4 01:13:55 2007 From: forum-watir-users at openqa.org (rkkanneganti) Date: Wed, 04 Apr 2007 00:13:55 CDT Subject: [Wtr-general] Stable version for watir and ruby In-Reply-To: <40933561.10361175633432966.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <31583013.581175663665942.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> yep Ruby 1.8.5 and watir 1.5.1.1158. They are working fine. From forum-watir-users at openqa.org Wed Apr 4 01:31:40 2007 From: forum-watir-users at openqa.org (rkkanneganti) Date: Wed, 04 Apr 2007 00:31:40 CDT Subject: [Wtr-general] OT: Thoughtworks planning to release a tool for application testers In-Reply-To: <72799cd70704031037v6ab1bbbdh98215521144b732@mail.gmail.com> Message-ID: <27442364.631175664730182.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Good info :) From sayali.shail at gmail.com Wed Apr 4 01:57:11 2007 From: sayali.shail at gmail.com (Sayali Patil) Date: Wed, 4 Apr 2007 11:27:11 +0530 Subject: [Wtr-general] Stable version for watir and ruby In-Reply-To: <31583013.581175663665942.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <40933561.10361175633432966.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <31583013.581175663665942.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <59618fe50704032257l87095f1j27035677ed27f76@mail.gmail.com> Hi , I had asked for the stable version of Watir and Ruby becuse i was getting the Access Denied error with the latest versions . But when i installed Ruby 1.8.5 and watir 1.5.1.1158 i still keep getting the same error . I think i m not installing it the right way ,please go through the following steps and let me know if i m going the right way , 1)Install Ruby 1.8.5 using the one click installer for Ruby . 2)Install Watir 1.4.1 using the one click installer . 3)Extract the watir gem for 1.5.1.1158 using gem install watir command . Kindly let me know if i m missing something . Thanks, Sayali On 4/4/07, rkkanneganti wrote: > > yep Ruby 1.8.5 and watir 1.5.1.1158. They are working fine. > _______________________________________________ > 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/20070404/7f32dc9b/attachment.html From a.premkumar at gmail.com Wed Apr 4 02:01:01 2007 From: a.premkumar at gmail.com (Prem) Date: Wed, 4 Apr 2007 11:31:01 +0530 Subject: [Wtr-general] OT: Thoughtworks planning to release a tool for application testers In-Reply-To: <72799cd70704031037v6ab1bbbdh98215521144b732@mail.gmail.com> References: <72799cd70704031037v6ab1bbbdh98215521144b732@mail.gmail.com> Message-ID: On 4/3/07, Chris McMahon wrote: > > TW is about to release this thing called "Mingle" to manage agile > projects. Today they announced an upcoming tool for testers: > http://studios.thoughtworks.com/2007/4/2/how-our-testers-use-mingle > (see the last paragraph). > It seems to be what I have already got after combining TestLink, Mantis, Docuwiki, Subversion & Scumbug. Ofcourse my setup needs a bit of integration efforts :( -- - Prem I spent a minute looking at my own code by accident. I was thinking "What the hell is this guy doing?" ---------------------------------------------------- Prem Kumar Aparanji M: 00919845226618 [Bangalore, KA, INDIA] http://scorpfromhell.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070404/ccf97001/attachment.html From forum-watir-users at openqa.org Wed Apr 4 02:11:32 2007 From: forum-watir-users at openqa.org (rkkanneganti) Date: Wed, 04 Apr 2007 01:11:32 CDT Subject: [Wtr-general] Stable version for watir and ruby In-Reply-To: <59618fe50704032257l87095f1j27035677ed27f76@mail.gmail.com> Message-ID: <27423542.861175667122351.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> 2)Install Watir 1.4.1 using the one click installer . when you are installing the watir 1.5.1.1158, watir 1.4.1 is not required. You can uninstall it. Just download the latest watir Gem and follow the steps provided with it and install according to it. I hope this helps. From Jason.He at resilience.com Wed Apr 4 02:21:09 2007 From: Jason.He at resilience.com (Jason He) Date: Tue, 3 Apr 2007 23:21:09 -0700 Subject: [Wtr-general] How to make IE as active windows and capture it? In-Reply-To: <32612624.9011175185954868.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Dear all, I use a batch script in Windows command prompt (console) to start ruby scripts, when capture the active window using screen_capture("test.jpg", true), it will capture the console window rather than the Internet Explorer, how to make IE as active window and bring it forward by watir/ruby script? Regards, Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070403/892096ae/attachment.html From prema.arya at gmail.com Wed Apr 4 02:36:33 2007 From: prema.arya at gmail.com (Prema Arya) Date: Wed, 4 Apr 2007 12:06:33 +0530 Subject: [Wtr-general] problem in clicking button In-Reply-To: <1005.89431.qm@web7813.mail.in.yahoo.com> References: <1005.89431.qm@web7813.mail.in.yahoo.com> Message-ID: <27915010704032336v37e965b8p5828448bb5665d0f@mail.gmail.com> Hi Vikash, Sorry, I tested the code with the new version that I am working on. We will be releasing the next version, around next week-end. For now you can copy (replace) the files I have attached, in the firewatir directory. The path is normally like "C:\ruby\lib\ruby\gems\1.8\gems\firewatir- 1.0.1-mswin32" Hope this wil lresolve the problem, untill next week. Reagrds, Prema On 4/3/07, VIKASH KUMAR wrote: > > Hi Prema, > > Thanks for your reply, but when I used this > ff.button(:text, "Sign In").click > It throws error, as shown below > > irb(main):016:0> ff.button(:text,"Sign In").click > FireWatir::Exception::UnknownObjectException: Unable to locate object, > using text and Sign In > from c:/ruby/lib/ruby/gems/1.8/gems/firewatir- 1.0.1-mswin32/./MozillaBaseElement.rb:739:in > `assert_exists' > from c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.0.1-mswin32/./MozillaBaseElement.rb:897:in > `click' > also, while using this > ff.button(:type, "submit") > > It throws the following error > irb(main):015:0> ff.button(:type,"submit").click > FireWatir::Exception::UnknownObjectException: Unable to locate object, > using type and submit > from c:/ruby/lib/ruby/gems/1.8/gems/firewatir- 1.0.1-mswin32/./MozillaBaseElement.rb:739:in > `assert_exists' > from c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.0.1-mswin32/./MozillaBaseElement.rb:897:in > `click' > > Thanks and Regards, > Vikash > > > Please, help me in clicking this button using FireWatir > > > > ------------------------------ > Here's a new way to find what you're looking for - Yahoo! Answers > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- Prema Arya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070404/c979c4a8/attachment-0001.html From prema.arya at gmail.com Wed Apr 4 02:37:18 2007 From: prema.arya at gmail.com (Prema Arya) Date: Wed, 4 Apr 2007 12:07:18 +0530 Subject: [Wtr-general] problem in clicking button In-Reply-To: <27915010704032336v37e965b8p5828448bb5665d0f@mail.gmail.com> References: <1005.89431.qm@web7813.mail.in.yahoo.com> <27915010704032336v37e965b8p5828448bb5665d0f@mail.gmail.com> Message-ID: <27915010704032337g583806bfv66603e42cde0e7d0@mail.gmail.com> Oops forgot to attach!! On 4/4/07, Prema Arya wrote: > > Hi Vikash, > > Sorry, I tested the code with the new version that I am working on. > We will be releasing the next version, around next week-end. > For now you can copy (replace) the files I have attached, in the > firewatir directory. > The path is normally like "C:\ruby\lib\ruby\gems\1.8\gems\firewatir- > 1.0.1-mswin32" > > Hope this wil lresolve the problem, untill next week. > > Reagrds, > Prema > > > On 4/3/07, VIKASH KUMAR wrote: > > > Hi Prema, > > > > Thanks for your reply, but when I used this > > ff.button(:text, "Sign In").click > > It throws error, as shown below > > > > irb(main):016:0> ff.button(:text,"Sign In").click > > FireWatir::Exception::UnknownObjectException: Unable to locate object, > > using text and Sign In > > from c:/ruby/lib/ruby/gems/1.8/gems/firewatir- 1.0.1-mswin32/./MozillaBaseElement.rb:739:in > > `assert_exists' > > from c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.0.1-mswin32/./MozillaBaseElement.rb:897:in > > `click' > > also, while using this > > ff.button(:type, "submit") > > > > It throws the following error > > irb(main):015:0> ff.button(:type,"submit").click > > FireWatir::Exception::UnknownObjectException: Unable to locate object, > > using type and submit > > from c:/ruby/lib/ruby/gems/1.8/gems/firewatir- 1.0.1-mswin32/./MozillaBaseElement.rb:739:in > > `assert_exists' > > from c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.0.1-mswin32/./MozillaBaseElement.rb:897:in > > `click' > > > > Thanks and Regards, > > Vikash > > > > > Please, help me in clicking this button using FireWatir > > > > > > > ------------------------------ > > Here's a new way to find what you're looking for - Yahoo! Answers > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > -- > Prema Arya -- Prema Arya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070404/91ebb939/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: button_fix.zip Type: application/zip Size: 22854 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20070404/91ebb939/attachment-0001.zip From forum-watir-users at openqa.org Wed Apr 4 02:38:24 2007 From: forum-watir-users at openqa.org (Naga Harish Kanegolla) Date: Wed, 04 Apr 2007 01:38:24 CDT Subject: [Wtr-general] Alert popups, Message-ID: <29307932.911175668734241.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi all, Now i am able to click on the alert popup with watir, i followed the code form the FAQ's but later i copied the whole code into another machine, i am able to run all the test cases except the alert popup, that is not working in another machine, so wat mightbe the problem?? Its giving an error "timed out" This is my code, require 'watir\contrib\enabled_popup' # def startClicker( button , waitTime= 9, user_input=nil ) # get a handle if one exists hwnd = $ie.enabled_popup(waitTime) if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) w.setTextValueForFileNameField( hwnd, "#{user_input}" ) end # I put this in to see the text being input it is not necessary to work sleep 3 # "OK" or whatever the name on the button is w.clickWindowsButton_hwnd( hwnd, "#{button}" ) # # this is just cleanup w=nil end end # # MAIN APPLICATION CODE # $ie = Watir::IE.start( "c:\test.htm" ) # This is whatever object that uses the click method. # You MUST use the click_no_wait method. $ie.image( :id, '3' ).click_no_wait # # 3rd parameter is optional and is used for input and file dialog boxes. startClicker( @button, 7 , "User Input" ) Thanks in Advance, Harish From Jason.He at resilience.com Wed Apr 4 04:27:33 2007 From: Jason.He at resilience.com (Jason He) Date: Wed, 4 Apr 2007 01:27:33 -0700 Subject: [Wtr-general] About the execution speed of waitr/ruby In-Reply-To: <33637351.33731175088250534.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Dear all, Can we configure the watir execution speed? For example, wait 3 seconds for each step when people want to observe a testing process, and wait 0.1s just for finishing the whole process. Regards, Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070404/da8d9604/attachment.html From zeljko.filipin at gmail.com Wed Apr 4 04:49:14 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 4 Apr 2007 10:49:14 +0200 Subject: [Wtr-general] About the execution speed of waitr/ruby In-Reply-To: References: <33637351.33731175088250534.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Jason, Try ie.set_slow_speed ie.set_fast_speed If you want more control (faster, slower) you can modify that methods. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070404/2393dcb7/attachment.html From forum-watir-users at openqa.org Wed Apr 4 05:59:34 2007 From: forum-watir-users at openqa.org (Nicola Kennedy) Date: Wed, 04 Apr 2007 04:59:34 CDT Subject: [Wtr-general] Using Until In-Reply-To: Message-ID: <36044722.741175680805029.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I have tried the advice given by Paul (Thankyou) but am now receiving an error message when I run: 1) Error: test_recorded(TC_recorded): NoMethodError: undefined method `link' for nil:NilClass testnic26.rb:30:in `link_there?' testnic26.rb:35:in `test_recorded' 1 tests, 0 assertions, 0 failures, 1 errors >Exit code: 0 Please advise?? TIA From Bryan.Mihok at systemsandsoftware.net Wed Apr 4 08:18:42 2007 From: Bryan.Mihok at systemsandsoftware.net (Bryan Mihok) Date: Wed, 4 Apr 2007 08:18:42 -0400 Subject: [Wtr-general] Stable version for watir and ruby In-Reply-To: <31583013.581175663665942.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Does that combination allow use of the modal_dialog method? I recall reading that one needed Ruby 1.8.2 to use Watir's modal code. Did I misunderstand something? -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of rkkanneganti Sent: Wednesday, April 04, 2007 1:14 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Stable version for watir and ruby yep Ruby 1.8.5 and watir 1.5.1.1158. They are working fine. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Wed Apr 4 11:35:16 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 04 Apr 2007 09:35:16 -0600 Subject: [Wtr-general] Using Until In-Reply-To: <36044722.741175680805029.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36044722.741175680805029.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: so my example was kind of incomplete. I really only meant it as an example. Try this instead. def link_there? link_text = "Click Me" return @ie.link(:text , link_text).exists? end @ie=Watir::IE.attach('www.google.com') while 1 # add something here to stop infinite loop if link_there? @ie.link(:text , link_text).click? else @ie.link(:text , "Next").click end end ----- Original Message ----- From: Nicola Kennedy Date: Wednesday, April 4, 2007 3:59 am Subject: Re: [Wtr-general] Using Until > I have tried the advice given by Paul (Thankyou) but am now > receiving an error message when I run: > > 1) Error: > test_recorded(TC_recorded): > NoMethodError: undefined method `link' for nil:NilClass > testnic26.rb:30:in `link_there?' > testnic26.rb:35:in `test_recorded' > > 1 tests, 0 assertions, 0 failures, 1 errors > >Exit code: 0 > > > Please advise?? > > TIA > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From charley.baker at gmail.com Wed Apr 4 13:34:39 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 4 Apr 2007 13:34:39 -0400 Subject: [Wtr-general] How to make IE as active windows and capture it? In-Reply-To: References: <32612624.9011175185954868.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: ie = IE.new ie.goto('http://www.google.com') ie.bring_to_front -Charley On 4/4/07, Jason He wrote: > > Dear all, > > > > I use a batch script in Windows command prompt (console) to start ruby > scripts, when capture the active window using screen_capture("test.jpg", > true), it will capture the console window rather than the Internet Explorer, > how to make IE as active window and bring it forward by watir/ruby script? > > > > Regards, > > Jason > > _______________________________________________ > 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/20070404/56d1dc93/attachment.html From charley.baker at gmail.com Wed Apr 4 13:39:00 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 4 Apr 2007 13:39:00 -0400 Subject: [Wtr-general] Stable version for watir and ruby In-Reply-To: References: <31583013.581175663665942.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: You're correct, modal_dialog works with 1.8.2 currently. The access denied problems may be due to frames/cross site scripting issue. In the latest code in svn, we're swallowing the access denied exceptions for better or worse until a more permanent solution is in place. I'm running Ruby 1.8.2 and Watir 1.5.1.1164. -Charley On 4/4/07, Bryan Mihok wrote: > > > Does that combination allow use of the modal_dialog method? I recall > reading that one needed Ruby 1.8.2 to use Watir's modal code. Did I > misunderstand something? > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of rkkanneganti > Sent: Wednesday, April 04, 2007 1:14 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Stable version for watir and ruby > > yep Ruby 1.8.5 and watir 1.5.1.1158. They are working fine. > _______________________________________________ > 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/20070404/ccf35264/attachment.html From Darrel.Boyt at gdit.com Wed Apr 4 14:03:29 2007 From: Darrel.Boyt at gdit.com (Boyt, Darrel) Date: Wed, 4 Apr 2007 14:03:29 -0400 Subject: [Wtr-general] Speaking of IDEs... Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC802B7ECBA@HQ-EXVS02.anteon.com> I saw this "Application Development Trends" article today and thought some of you might be interested in checking it out. Sun Provides Early Access to NetBeans Ruby Pack, http://adtmag.com/article.aspx?id=20438 Note, you'll need the latest development build of the NetBeans IDE which you can get via the "NetBeans 6.0 Milestone Downloads" page (http://www.netbeans.info/downloads/milestones.php). Darrel Boyt Systems Analyst General Dynamics Information Technology 2770 Gunter Park Drive East, Suite H Montgomery, Alabama 36109-1412 (334) 260-3331 direct (334) 277-2331 fax Darrel.Boyt at gdit.com www.gdit.com From forum-watir-users at openqa.org Wed Apr 4 14:39:26 2007 From: forum-watir-users at openqa.org (Mark) Date: Wed, 04 Apr 2007 13:39:26 CDT Subject: [Wtr-general] Accessing Nested Tables In-Reply-To: <40229333.1172617206030.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <28997736.3181175711996207.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> This is all fine if you don't care about "hard coding" your table indexes or don't expect your page layout to change. Here is how I did it without using hard coded indexes. (Note: use unique data that will get you the table you want. If there are multiple tables nested within an outer table you may have to use different data to get to the nested table you want) *EXAMPLE*: On my page, table #9 is nested within Table #8. So using the above code I could do this: t=ie.table(:index,8).table(:index,1) However, If I want to access the nested table by a text value (or other just substitute other object) outer_table = @ie.tables.find {|t| t.text =~ /#{data}/i } nested_table = outer_table.tables.find {|t| t.text =~ /#{data}/i } +<=== this can be repeated for multi-nesting+ r=nested_table.rows.find{|r| r.text =~ /#{data}/i } Now I have the Row the Item I was looking for is in. I can now do what I want with that row. Hope this was helpful. *EXAMPLE 2*: Page has table #4 is nested within Table #5, Table #6, and Table#9. Table #6 nests Table #7 and Table #8. I want a cell in table #8. However, tables #5 and #6 both contain the #{data} that I am looking for. So I will use #{unique} data to specify table #6 So using the above code I could do this: t=ie.table(:index,4).table(:index,2).table(:index,2) Heres how I would do it: outer_table = @ie.tables.find {|t| t.text =~ /#{data}/i } <== Table #4 nested_table = outer_table.tables.find {|t| t.text =~ /#{unique}/i } <== Table #6 nested_table = nested_table.tables.find {|t| t.text =~ /#{data}/i } <== Table #8 r=nested_table.rows.find{|r| r.text =~ /#{data}/i } <== Row in Table #8 that has #{data} From forum-watir-users at openqa.org Wed Apr 4 18:12:37 2007 From: forum-watir-users at openqa.org (Kevin Scott) Date: Wed, 04 Apr 2007 17:12:37 CDT Subject: [Wtr-general] Accessing a web page when a server request for username/password appears? Message-ID: <24381808.4831175724787427.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello, I am running into an issue where I am attempting to go to a web page but cannot proceed due to a standard IE window (I believe this is a standard IE window). test_site = 'http://my_test_site.com' ie = Watir::IE.new ie.goto(test_site) A popup window appears when I attempt ie.goto(test_site) - The popup window is asking me for a username/password in order to access the web page. I have attached the standard language below: +The server requires a username and password.+ +Warning: This server is requesting that your username and password be sent in an insecure manner (basic authentication without a secure connection).+ It seems no matter what I try, I cannot get pass the line - ie.goto(test_site). I looked at using a timeout and could not get past the line - ie.goto(test_site). Any direction on how to proceed would be apprecipated. Thanks, Kevin From jim_matt at swbell.net Wed Apr 4 21:26:12 2007 From: jim_matt at swbell.net (jim_matt) Date: Wed, 4 Apr 2007 20:26:12 -0500 Subject: [Wtr-general] Accessing a web page when a server request for username/password appears? References: <24381808.4831175724787427.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <028401c77721$661de5d0$6401a8c0@Jimsxp> Kevin, You are not going to get any further until you supply a username and password. You cannot simply wait it out. You will have to attach the popup, enter a username and password and click the button to continue. Jim Matthews ----- Original Message ----- From: "Kevin Scott" To: Sent: Wednesday, April 04, 2007 5:12 PM Subject: [Wtr-general] Accessing a web page when a server request for username/password appears? > Hello, > > I am running into an issue where I am attempting to go to a web page but > cannot proceed due to a standard IE window (I believe this is a standard > IE window). > > test_site = 'http://my_test_site.com' > ie = Watir::IE.new > ie.goto(test_site) > > A popup window appears when I attempt ie.goto(test_site) - The popup > window is asking me for a username/password in order to access the web > page. I have attached the standard language below: > > +The server requires a username and password.+ > > +Warning: This server is requesting that your username and password be > sent in an insecure manner (basic authentication without a secure > connection).+ > > It seems no matter what I try, I cannot get pass the line - > ie.goto(test_site). I looked at using a timeout and could not get past the > line - ie.goto(test_site). > > Any direction on how to proceed would be apprecipated. > > Thanks, > > Kevin > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From vikashkumar051 at yahoo.co.in Wed Apr 4 23:48:50 2007 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Thu, 5 Apr 2007 09:18:50 +0530 (IST) Subject: [Wtr-general] problem in clicking button Message-ID: <143329.35944.qm@web7815.mail.in.yahoo.com> Hi Prema, I pasted the two file in this directory "C:\ruby\lib\ruby\gems\1.8\gems\firewatir- 1.0.1-mswin32", and now the code is working well. Thanks for the help. Reagrds, Vikash __________________________________________________________ Yahoo! India Answers: Share what you know. Learn something new http://in.answers.yahoo.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070405/2e86247b/attachment.html From forum-watir-users at openqa.org Thu Apr 5 00:51:29 2007 From: forum-watir-users at openqa.org (rkkanneganti) Date: Wed, 04 Apr 2007 23:51:29 CDT Subject: [Wtr-general] Accessing a web page when a server request for username/password appears? In-Reply-To: <24381808.4831175724787427.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <40430188.5601175748719457.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> The above said code steps are working fine with me when i opened a particular site. May be there aren't enough permissions to view the site which have been mentioned above. From forum-watir-users at openqa.org Thu Apr 5 01:59:09 2007 From: forum-watir-users at openqa.org (shalini) Date: Thu, 05 Apr 2007 00:59:09 CDT Subject: [Wtr-general] How do I click the "OK" button on a java alert? In-Reply-To: <41922599.1166218145437.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <24596407.5841175752780035.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi all, I am new to ruby, and have searched these forums for answers, but have not found anything that seems to work or help me. (including links to FAQ's which do not appear to be available anymore) Situation: I am writing ruby/watir scripts to automate tests against a website/application. On one page there are a date field and a "Search" button.after entering wrong dae in date field a popup alert opens and display message please enter valid date this dialog box also has a "OK" button. Problem: I am unable to gain access to the java alert dialog to gain control of the button and click it. The modal dialog have a :title,"Microsofte Internet Explorer".but error comes unable to locate with window with title "Microsoft Internet Explorer" . So my tests "hang" while it waits for the button to be clicked before it can continue on. I also do not have access to the webcode (java code) to change it, but I know that the dialog is simply invoked with 'alert("")'. Things I have tried (with no success...) $ie = IE.attach(:title, "Microsoft Internet Explorer") $ie.button(:id, '2').click # #require 'win32ole' # already included if you use 'require watir' # # Function to look for popups #def check_for_popups # autoit = WIN32OLE.new('AutoItX3.Control') # # Do forever - assumes popups could occur anywhere/anytime in your application. #loop do # Look for window with given title. Give up after 1 second. # ret = autoit.WinWait('Popup Window Title', '', 1) # # If window found, send appropriate keystroke (e.g. {enter}, {Y}, {N}). #if (ret==1) then autoit.Send('{enter}') end # # Take a rest to avoid chewing up cycles and give another thread a go. # Then resume the loop. #sleep(3) #end # end # # MAIN APPLICATION CODE # Setup popup handler # $popup = Thread.new { check_for_popups } # start popup handler #at_exit { Thread.kill($popup) } ##$ie.button(:id, "ctl00_MainContentPlaceHolder_btn_Search").fire_event("onclick") ## w = WinClicker.new() #("#32770", "Microsoft Internet Explorer", ##handle = w.getWindowHandle("Microsoft Internet Explorer") ##puts handle ##w.makeWindowActive(handle) #w.button(:value,"OK").click ##w.clickWindowsButton_hwnd(handle,"OK") ##w.close #ie2=IE.attach(:id,"00000fdc") #$ie2.enter #ie2.button(:name, add.wacTagAdd).getOLEObject.click #w = WinClicker.new() #w.clickWindowsButton("Microsoft Internet Explorer", "OK" , maxWaitTime=2 ) #w = nil #ie2.close #puts "ent 1" #$autoit = WIN32OLE.new('AutoItX3.Control') #puts "ent 2" # $autoit.WinWait("Microsoft Internet Explorer", "", 0) #puts "ent 3" #$autoit.WinActivate("Microsoft Internet Explorer") #puts "ent 4" #$autoit.send_keys('enter') #$autoit.Winbutton(:name,"OK").click #$autoit.ControlClick("Microsoft Internet Explorer", "", "OK") #clickWindowsButton("Microsoft Internet Explorer" , "&OK" ) #$autoit.Send("enter") #puts "ent 5" #$autoit.WinWait("Microsoft Internet Explorer", "Look &in", 3) #$autoit.ControlSetText("Microsoft Internet Explorer", "", "", "#{$path}") #$autoit.ControlClick("Microsoft Internet Explorer", "", "&OK") #$ie.link(:text, 'New Window').click_no_wait #IE.attach_timeout = 1.0 #ie_new = IE.attach(:title, "Microsoft Internet Explorer") #assert(ie_new.text.include?("OK")) #ie_new.button(:title,"OK").click #begin #autoit = WIN32OLE.new('AutoItX3.Control') #autoit.ControlClick("Microsoft Internet Explorer",'', '&OK') #autoit.ControlClick("Security Information",'', '&OK') #autoit.ControlClick("Security Alert",'', '&OK') #sleep(1) #rescue Exception => e #puts "error" #end #hwnd = $ie.enabled_popup(5) #puts "hwnd" #if(hwnd) #w = WinClicker.new # w.makeWindowActive(hwnd) #w.clickJSDialog_NewProcess(button = "OK" ) # puts hwnd.to_s #$ie.Window("Microsoft Internet Explorer").button(:title, "OK").click #pp=TC_PopUps.new #pp.startClicker( "OK" , waitTime = 0.5) Versions: ruby 1.8.4 watir 1.5.1.1127 ie 6 From bret at pettichord.com Thu Apr 5 02:41:45 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 05 Apr 2007 01:41:45 -0500 Subject: [Wtr-general] Using Until In-Reply-To: <25450203.5901175611523606.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <25450203.5901175611523606.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <46149A29.3040602@pettichord.com> Nicola Kennedy wrote: > I want the code to do the following things: > 1. Check on page for a link. > 2. If link not there, press "Next page" > > 3. If link there, click on it. > > 4. When next page reached (if step 2 followed), repeat the action of looking for link/clicking next. > Here is one way: def click_links ie unless ie.link(:url, "http://www.freeuk.com").exists? ie.link(:value, 'Next page').click click_links ie else ie.link(:url, "http://www.freeuk.com").click end end From bret at pettichord.com Thu Apr 5 02:43:41 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 05 Apr 2007 01:43:41 -0500 Subject: [Wtr-general] IE nested class of module watir? In-Reply-To: <7ac2300c0704030840k3a11d6f9gf76fc96086ffae34@mail.gmail.com> References: <7ac2300c0704030840k3a11d6f9gf76fc96086ffae34@mail.gmail.com> Message-ID: <46149A9D.7000307@pettichord.com> aidy lewis wrote: > I am unsure why IE is a nested class of the module watir All of the Watir classes are in the Watir module. This is to avoid collisions with classes you may be using from other packages. Watir tries to be a good citizen. If you look at other Ruby libraries, you will see that this is a common arrangement. Bret From sayali.shail at gmail.com Thu Apr 5 04:26:30 2007 From: sayali.shail at gmail.com (Sayali Patil) Date: Thu, 5 Apr 2007 13:56:30 +0530 Subject: [Wtr-general] Access all elements in a form Message-ID: <59618fe50704050126g70dfbdc6x50755585978961c@mail.gmail.com> Hi All, How to access all the elements in a particular
,in an html document using watir? Please let me know. Thanks, Sayali -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070405/e361b87c/attachment.html From pandeanupama at hotmail.com Thu Apr 5 05:33:56 2007 From: pandeanupama at hotmail.com (Anupama Kaple) Date: Thu, 5 Apr 2007 09:33:56 +0000 Subject: [Wtr-general] How do I click the "OK" button on a java alert? Message-ID: Hi Shalini, Here is the method to click the OK button on a java alert #Put this method in 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 #Then call it right before you click the button (or whatever) thatcauses the javascript popup to display: startClicker("OK" , 3)$ie.button("Submit").click Thanks & Regards, Anupama > Date: Thu, 5 Apr 2007 00:59:09 -0500> From: forum-watir-users at openqa.org> To: wtr-general at rubyforge.org> Subject: Re: [Wtr-general] How do I click the "OK" button on a java alert?> > Hi all,> > I am new to ruby, and have searched these forums for answers, but have not found anything that seems to work or help me. (including links to FAQ's which do not appear to be available anymore)> > Situation:> I am writing ruby/watir scripts to automate tests against a website/application. On one page there are a date field and a "Search" button.after entering wrong dae in date field a popup alert opens and display message please enter valid date this dialog box also has a "OK" button.> > Problem:> I am unable to gain access to the java alert dialog to gain control of the button and click it. The modal dialog have a :title,"Microsofte Internet Explorer".but error comes unable to locate with window with title "Microsoft Internet Explorer" . So my tests "hang" while it waits for the button to be clicked before it can continue on.> > I also do not have access to the webcode (java code) to change it, but I know that the dialog is simply invoked with 'alert("")'.> > Things I have tried (with no success...)> $ie = IE.attach(:title, "Microsoft Internet Explorer")> $ie.button(:id, '2').click> > #> #require 'win32ole' # already included if you use 'require watir'> #> # Function to look for popups> #def check_for_popups> # autoit = WIN32OLE.new('AutoItX3.Control')> #> # Do forever - assumes popups could occur anywhere/anytime in your application.> #loop do> # Look for window with given title. Give up after 1 second.> # ret = autoit.WinWait('Popup Window Title', '', 1)> #> # If window found, send appropriate keystroke (e.g. {enter}, {Y}, {N}).> #if (ret==1) then autoit.Send('{enter}') end> #> # Take a rest to avoid chewing up cycles and give another thread a go.> # Then resume the loop.> #sleep(3)> #end> # end> #> # MAIN APPLICATION CODE> # Setup popup handler> # $popup = Thread.new { check_for_popups } # start popup handler> #at_exit { Thread.kill($popup) } > > ##$ie.button(:id, "ctl00_MainContentPlaceHolder_btn_Search").fire_event("onclick")> ## w = WinClicker.new()> > #("#32770", "Microsoft Internet Explorer", > > ##handle = w.getWindowHandle("Microsoft Internet Explorer")> ##puts handle> > ##w.makeWindowActive(handle)> #w.button(:value,"OK").click> ##w.clickWindowsButton_hwnd(handle,"OK")> ##w.close > #ie2=IE.attach(:id,"00000fdc")> #$ie2.enter> #ie2.button(:name, add.wacTagAdd).getOLEObject.click> #w = WinClicker.new()> > #w.clickWindowsButton("Microsoft Internet Explorer", "OK" , maxWaitTime=2 )> #w = nil> #ie2.close > #puts "ent 1"> #$autoit = WIN32OLE.new('AutoItX3.Control') > #puts "ent 2"> # $autoit.WinWait("Microsoft Internet Explorer", "", 0)> #puts "ent 3"> #$autoit.WinActivate("Microsoft Internet Explorer")> #puts "ent 4"> #$autoit.send_keys('enter')> #$autoit.Winbutton(:name,"OK").click> #$autoit.ControlClick("Microsoft Internet Explorer", "", "OK")> #clickWindowsButton("Microsoft Internet Explorer" , "&OK" )> #$autoit.Send("enter")> #puts "ent 5"> #$autoit.WinWait("Microsoft Internet Explorer", "Look &in", 3) > > #$autoit.ControlSetText("Microsoft Internet Explorer", "", "", "#{$path}") > > #$autoit.ControlClick("Microsoft Internet Explorer", "", "&OK")> #$ie.link(:text, 'New Window').click_no_wait> #IE.attach_timeout = 1.0> #ie_new = IE.attach(:title, "Microsoft Internet Explorer")> #assert(ie_new.text.include?("OK"))> #ie_new.button(:title,"OK").click> #begin> > #autoit = WIN32OLE.new('AutoItX3.Control') > > #autoit.ControlClick("Microsoft Internet Explorer",'', '&OK')> > #autoit.ControlClick("Security Information",'', '&OK')> > #autoit.ControlClick("Security Alert",'', '&OK')> > #sleep(1)> > #rescue Exception => e> > #puts "error"> > #end> #hwnd = $ie.enabled_popup(5) > #puts "hwnd"> #if(hwnd) > > #w = WinClicker.new> > # w.makeWindowActive(hwnd)> #w.clickJSDialog_NewProcess(button = "OK" )> > > # puts hwnd.to_s> #$ie.Window("Microsoft Internet Explorer").button(:title, "OK").click> #pp=TC_PopUps.new> #pp.startClicker( "OK" , waitTime = 0.5)> Versions:> ruby 1.8.4> watir 1.5.1.1127> ie 6> _______________________________________________> Wtr-general mailing list> Wtr-general at rubyforge.org> http://rubyforge.org/mailman/listinfo/wtr-general _________________________________________________________________ Take a break and play crossword puzzles - FREE! http://games.msn.com/en/flexicon/default.htm?icid=flexicon_ wlmemailtaglinemarch07 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070405/90737f3d/attachment-0001.html From pandeanupama at hotmail.com Thu Apr 5 05:29:09 2007 From: pandeanupama at hotmail.com (Anupama Kaple) Date: Thu, 5 Apr 2007 09:29:09 +0000 Subject: [Wtr-general] How do I click the "OK" button on a java alert? Message-ID: Hi Try this piece of code. I found this code on Waitr QA forums and I tried it in my suite. It worked def startClicker( OK, 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 Thanks & Regards, Anupama> Date: Thu, 5 Apr 2007 00:59:09 -0500> From: forum-watir-users at openqa.org> To: wtr-general at rubyforge.org> Subject: Re: [Wtr-general] How do I click the "OK" button on a java alert?> > Hi all,> > I am new to ruby, and have searched these forums for answers, but have not found anything that seems to work or help me. (including links to FAQ's which do not appear to be available anymore)> > Situation:> I am writing ruby/watir scripts to automate tests against a website/application. On one page there are a date field and a "Search" button.after entering wrong dae in date field a popup alert opens and display message please enter valid date this dialog box also has a "OK" button.> > Problem:> I am unable to gain access to the java alert dialog to gain control of the button and click it. The modal dialog have a :title,"Microsofte Internet Explorer".but error comes unable to locate with window with title "Microsoft Internet Explorer" . So my tests "hang" while it waits for the button to be clicked before it can continue on.> > I also do not have access to the webcode (java code) to change it, but I know that the dialog is simply invoked with 'alert("")'.> > Things I have tried (with no success...)> $ie = IE.attach(:title, "Microsoft Internet Explorer")> $ie.button(:id, '2').click> > #> #require 'win32ole' # already included if you use 'require watir'> #> # Function to look for popups> #def check_for_popups> # autoit = WIN32OLE.new('AutoItX3.Control')> #> # Do forever - assumes popups could occur anywhere/anytime in your application.> #loop do> # Look for window with given title. Give up after 1 second.> # ret = autoit.WinWait('Popup Window Title', '', 1)> #> # If window found, send appropriate keystroke (e.g. {enter}, {Y}, {N}).> #if (ret==1) then autoit.Send('{enter}') end> #> # Take a rest to avoid chewing up cycles and give another thread a go.> # Then resume the loop.> #sleep(3)> #end> # end> #> # MAIN APPLICATION CODE> # Setup popup handler> # $popup = Thread.new { check_for_popups } # start popup handler> #at_exit { Thread.kill($popup) } > > ##$ie.button(:id, "ctl00_MainContentPlaceHolder_btn_Search").fire_event("onclick")> ## w = WinClicker.new()> > #("#32770", "Microsoft Internet Explorer", > > ##handle = w.getWindowHandle("Microsoft Internet Explorer")> ##puts handle> > ##w.makeWindowActive(handle)> #w.button(:value,"OK").click> ##w.clickWindowsButton_hwnd(handle,"OK")> ##w.close > #ie2=IE.attach(:id,"00000fdc")> #$ie2.enter> #ie2.button(:name, add.wacTagAdd).getOLEObject.click> #w = WinClicker.new()> > #w.clickWindowsButton("Microsoft Internet Explorer", "OK" , maxWaitTime=2 )> #w = nil> #ie2.close > #puts "ent 1"> #$autoit = WIN32OLE.new('AutoItX3.Control') > #puts "ent 2"> # $autoit.WinWait("Microsoft Internet Explorer", "", 0)> #puts "ent 3"> #$autoit.WinActivate("Microsoft Internet Explorer")> #puts "ent 4"> #$autoit.send_keys('enter')> #$autoit.Winbutton(:name,"OK").click> #$autoit.ControlClick("Microsoft Internet Explorer", "", "OK")> #clickWindowsButton("Microsoft Internet Explorer" , "&OK" )> #$autoit.Send("enter")> #puts "ent 5"> #$autoit.WinWait("Microsoft Internet Explorer", "Look &in", 3) > > #$autoit.ControlSetText("Microsoft Internet Explorer", "", "", "#{$path}") > > #$autoit.ControlClick("Microsoft Internet Explorer", "", "&OK")> #$ie.link(:text, 'New Window').click_no_wait> #IE.attach_timeout = 1.0> #ie_new = IE.attach(:title, "Microsoft Internet Explorer")> #assert(ie_new.text.include?("OK"))> #ie_new.button(:title,"OK").click> #begin> > #autoit = WIN32OLE.new('AutoItX3.Control') > > #autoit.ControlClick("Microsoft Internet Explorer",'', '&OK')> > #autoit.ControlClick("Security Information",'', '&OK')> > #autoit.ControlClick("Security Alert",'', '&OK')> > #sleep(1)> > #rescue Exception => e> > #puts "error"> > #end> #hwnd = $ie.enabled_popup(5) > #puts "hwnd"> #if(hwnd) > > #w = WinClicker.new> > # w.makeWindowActive(hwnd)> #w.clickJSDialog_NewProcess(button = "OK" )> > > # puts hwnd.to_s> #$ie.Window("Microsoft Internet Explorer").button(:title, "OK").click> #pp=TC_PopUps.new> #pp.startClicker( "OK" , waitTime = 0.5)> Versions:> ruby 1.8.4> watir 1.5.1.1127> ie 6> _______________________________________________> Wtr-general mailing list> Wtr-general at rubyforge.org> http://rubyforge.org/mailman/listinfo/wtr-general _________________________________________________________________ Your friends are close to you.?Keep them that way. http://spaces.live.com/signup.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070405/855abdb2/attachment.html From aidy.lewis at googlemail.com Thu Apr 5 08:14:34 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Thu, 5 Apr 2007 13:14:34 +0100 Subject: [Wtr-general] 'method_missing': document (WIN32OLERuntimeError) Message-ID: <7ac2300c0704050514x1eb951c7q7296ac95fddd5b58@mail.gmail.com> Hi, I wonder if anyone could shed some light on this? I am getting this error: 'method_missing': document (WIN32OLERuntimeError) that lies @ie.document I am using 1.4.1. Here is my code require 'watir' include Watir require 'test\unit' $ie = Watir::IE.new def browser;$ie;end module Login USERNAME = browser.text_field(:name, 'user_name') PASSWORD = browser.text_field(:name, 'password') REMEMBER_ME = browser.checkbox(:name, 'remember_me') SIGN_IN = browser.button(:value, 'Sign in') end module Mission LOG_OUT = browser.link(:text, /Log-out/) end class TC_Mission < Test::Unit::TestCase include Login def setup browser.goto('www.something.com') browser.bring_to_front browser.maximize end def teardown Mission::LOG_OUT.click browser.close end def test_1 Login::USERNAME.set('aidy') Login::PASSWORD.set('password') Login::REMEMBER_ME.set #unit test assertations assert(REMEMBER_ME.enabled?) end end Cheers aidy From forum-watir-users at openqa.org Thu Apr 5 08:52:26 2007 From: forum-watir-users at openqa.org (vamsi) Date: Thu, 05 Apr 2007 07:52:26 CDT Subject: [Wtr-general] Assign a Selected Value from Drop Down list to any varibale Message-ID: <33798517.1341175777576997.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I need to slect one value from the dropdown list and want to store it into one varibale. For selecting value in drop down list: ie.select_list(:id, 'ctlWorkflow_ddlname').select_value('1') what is for reading and storing the same value into one Variable. Name = ????? As i need to verify the values in other pages. Thanks in Advance. Regards Vamsi From forum-watir-users at openqa.org Thu Apr 5 09:20:20 2007 From: forum-watir-users at openqa.org (Ravi) Date: Thu, 05 Apr 2007 08:20:20 CDT Subject: [Wtr-general] Assign a Selected Value from Drop Down list to any varibale In-Reply-To: <33798517.1341175777576997.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <27104322.1661175779250755.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> names=ie.select_list(:id, 'ctlWorkflow_ddlname').getAllContents #array name0=ie.select_list(:id, 'ctlWorkflow_ddlname').getAllContents[0] #single item From forum-watir-users at openqa.org Thu Apr 5 09:32:14 2007 From: forum-watir-users at openqa.org (vamsi) Date: Thu, 05 Apr 2007 08:32:14 CDT Subject: [Wtr-general] Assign a Selected Value from Drop Down list to any varibale In-Reply-To: <27104322.1661175779250755.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <35971864.1961175779964261.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you very much ..... From aidy.lewis at googlemail.com Thu Apr 5 09:59:12 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Thu, 5 Apr 2007 14:59:12 +0100 Subject: [Wtr-general] .getElementsByTagName Message-ID: <7ac2300c0704050659o6b55d69csfacec55f3b53fef1@mail.gmail.com> Are we all using the DOM method .getElementsByTagName to get for example, a level 2 heading? return document.getElementsByTagName('h2') Should we refactor these methods to make a more abstract method show_labels show_spans show_pres etc? Thanks aidy From charley.baker at gmail.com Thu Apr 5 19:12:34 2007 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 5 Apr 2007 19:12:34 -0400 Subject: [Wtr-general] .getElementsByTagName In-Reply-To: <7ac2300c0704050659o6b55d69csfacec55f3b53fef1@mail.gmail.com> References: <7ac2300c0704050659o6b55d69csfacec55f3b53fef1@mail.gmail.com> Message-ID: In Watir 1.5 there is support for adding elements fairly easily so that you shouldn't have to call getElementsByTagName directly. We haven't added headings yet, but most other common elements are supported and easily extended, you could put the following in a file and include it in your scripts: module Watir class H2 < NonControlElement TAG = 'H2' end class H2s < ElementCollections include Watir::CommonCollection def element_class; H2; end end module Container def h2(how, what) return H2.new(self, how, what) end def h2s return H2s.new(self) end end end ie.h2s.show -Charley On 4/5/07, aidy lewis wrote: > > Are we all using the DOM method .getElementsByTagName to get for example, > a level 2 heading? > > return document.getElementsByTagName('h2') > > Should we refactor these methods to make a more abstract method > > show_labels > show_spans > show_pres > etc? > > Thanks > > aidy > _______________________________________________ > 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/20070405/967485ec/attachment.html From charley.baker at gmail.com Thu Apr 5 19:25:07 2007 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 5 Apr 2007 19:25:07 -0400 Subject: [Wtr-general] Access all elements in a form In-Reply-To: <59618fe50704050126g70dfbdc6x50755585978961c@mail.gmail.com> References: <59618fe50704050126g70dfbdc6x50755585978961c@mail.gmail.com> Message-ID: Something like this: $ie.form(:name,'myform').button(:value, 'Submit').click You can take a look at the unittests for watir in form_test.rb, there are plenty of examples there. -Charley On 4/5/07, Sayali Patil wrote: > > Hi All, > How to access all the elements in a particular ,in an html document > using watir? > Please let me know. > Thanks, > Sayali > > _______________________________________________ > 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/20070405/f9937b25/attachment-0001.html From sayali.shail at gmail.com Fri Apr 6 01:17:44 2007 From: sayali.shail at gmail.com (Sayali Patil) Date: Fri, 6 Apr 2007 10:47:44 +0530 Subject: [Wtr-general] Access all elements in a form In-Reply-To: References: <59618fe50704050126g70dfbdc6x50755585978961c@mail.gmail.com> Message-ID: <59618fe50704052217x3b8029d0s701f8a285b31976c@mail.gmail.com> Hi Charley, I can access a single element in the form. What i want is i should be able to access all the elements in a form with a loop . Actually i have nested forms and i m not able to access each element individually ,so i want to try n access all the elements and further do the operations . My scenario si something like this 1 2
now i m able to access the radio button 1 but when i try to access radio button 2 i get an error saying cannot find. Please help me out . Thanks, Sayali On 4/6/07, Charley Baker wrote: > > Something like this: > > $ie.form(:name,'myform').button(:value, 'Submit').click > > You can take a look at the unittests for watir in form_test.rb, there are > plenty of examples there. > > -Charley > > > On 4/5/07, Sayali Patil wrote: > > > Hi All, > > How to access all the elements in a particular
,in an html > > document using watir? > > Please let me know. > > Thanks, > > Sayali > > > > _______________________________________________ > > 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/20070406/06f308f1/attachment.html From zeljko.filipin at gmail.com Fri Apr 6 03:24:00 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 6 Apr 2007 09:24:00 +0200 Subject: [Wtr-general] Access all elements in a form In-Reply-To: <59618fe50704052217x3b8029d0s701f8a285b31976c@mail.gmail.com> References: <59618fe50704050126g70dfbdc6x50755585978961c@mail.gmail.com> <59618fe50704052217x3b8029d0s701f8a285b31976c@mail.gmail.com> Message-ID: Hi Sayali, Can you post html of that form, your watir code, and error message? Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070406/920a88b4/attachment.html From Jason.He at resilience.com Fri Apr 6 04:45:36 2007 From: Jason.He at resilience.com (Jason He) Date: Fri, 6 Apr 2007 01:45:36 -0700 Subject: [Wtr-general] About the execution speed of waitr/ruby In-Reply-To: Message-ID: Hi, Zeljko, Follow your suggestion, I find the methods set_fast_speed & set_slow_speed, and can control the script execution speed. I want to make it could be configurable in testing script, so write the following code in my test script, ---------------------------------------------------------------------------- $FAST_SPEED = false class Watir::IE @@attach_timeout = 5 DEFAULT_TYPING_SPEED = 0.2 DEFAULT_SLEEP_TIME = 0.2 end ---------------------------------------------------------------------------- And the above code could take effect, but there will be two warnings output in console, ../include/RESILIENCE_CLASS.rb:36: warning: already initialized constant DEFAULT_TYPING_SPEED ../include/RESILIENCE_CLASS.rb:37: warning: already initialized constant DEFAULT_SLEEP_TIME It says I change the assign a new value to initialized constant. If I want to make those two values could configurable in testing script as well as make them conform to the watir/ruby syntax, is there a reasonable way to eliminate this message? Thanks in advance. Jason ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of ?eljko Filipin Sent: 2007?4?4? 16:49 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] About the execution speed of waitr/ruby Hi Jason, Try ie.set_slow_speed ie.set_fast_speed If you want more control (faster, slower) you can modify that methods. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070406/5346f9ce/attachment.html From Jason.He at resilience.com Fri Apr 6 04:53:37 2007 From: Jason.He at resilience.com (Jason He) Date: Fri, 6 Apr 2007 01:53:37 -0700 Subject: [Wtr-general] How to make IE as active windows and capture it? In-Reply-To: Message-ID: Yes, thank you for your help. I find if ie.bring_to_front is before ie.goto(), then the window console will be brought in front. And if it is after ie.goto() just as you write, then the ie window will be brought in the front. Can anyone explain what the difference between those two is? Regards, Jason ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Charley Baker Sent: 2007?4?5? 1:35 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How to make IE as active windows and capture it? ie = IE.new ie.goto('http://www.google.com') ie.bring_to_front -Charley On 4/4/07, Jason He wrote: Dear all, I use a batch script in Windows command prompt (console) to start ruby scripts, when capture the active window using screen_capture("test.jpg", true), it will capture the console window rather than the Internet Explorer, how to make IE as active window and bring it forward by watir/ruby script? Regards, Jason _______________________________________________ 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/20070406/3b842cf5/attachment-0001.html From sayali.shail at gmail.com Fri Apr 6 05:13:04 2007 From: sayali.shail at gmail.com (Sayali Patil) Date: Fri, 6 Apr 2007 14:43:04 +0530 Subject: [Wtr-general] Access all elements in a form In-Reply-To: References: <59618fe50704050126g70dfbdc6x50755585978961c@mail.gmail.com> <59618fe50704052217x3b8029d0s701f8a285b31976c@mail.gmail.com> Message-ID: <59618fe50704060213p69123d7aqd0b394bac8f7bdaa@mail.gmail.com> Hi Zeljko, Here is the html that is generated, one two aa bb cc two three
aa bb cc
two three In this case the parId0 parameter name is repeated twice in the same code. Once it is displayed as individual radio buttons and once it is displayed in the form of nested, so when i select the parId0 from the individual parId0 the same radio button gets selected in the nested one . The Watir code i m using is $ie.radio(:name,"parId0",0).set assert($ie.form(:index ,6).radio(:name , "parId0",0).isSet?) $ie.radio(:name,"parId0",1).set assert($ie.form(:index ,6).radio(:name , "parId0",1).isSet?) the error i m getting when i run this code is 1) Error: test_cxipvar(TC_CxIpVar): Watir::Exception::UnknownObjectException: Unable to locate object, using name and parId0 c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:2416:in `assert_exists' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:4149:in `isSet?' Please go through the above and let me know how can i code in watir the right way for this. Thanks, Sayali On 4/6/07, ?eljko Filipin wrote: > > Hi Sayali, > > Can you post html of that form, your watir code, and error message? > > Zeljko > -- > ZeljkoFilipin.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/20070406/e6b404e4/attachment.html From forum-watir-users at openqa.org Fri Apr 6 05:44:26 2007 From: forum-watir-users at openqa.org (vamsi) Date: Fri, 06 Apr 2007 04:44:26 CDT Subject: [Wtr-general] Read a Focused value in Drop List Message-ID: <28027774.1491175852696776.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> How to read a focussed value in Drop Down list and assign to some variable? Thanks in Advance... Regards Vamsi From forum-watir-users at openqa.org Fri Apr 6 05:47:16 2007 From: forum-watir-users at openqa.org (vamsi) Date: Fri, 06 Apr 2007 04:47:16 CDT Subject: [Wtr-general] How Capture the Text area Message-ID: <28659945.1541175852866819.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I need to compare the text (in Captured text area) with some predefined value... Can any one please assist me on this Thanks in Advance... Regards Vamsi From zeljko.filipin at gmail.com Fri Apr 6 07:53:17 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 6 Apr 2007 13:53:17 +0200 Subject: [Wtr-general] Read a Focused value in Drop List In-Reply-To: <28027774.1491175852696776.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28027774.1491175852696776.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Vamsi, If you have this html this is how you can find what it selected (this is irb session). irb(main):008:0> selected = ie.select_list(:index, 1).getSelectedItems => ["one"] irb(main):010:0> selected[0] => "one" Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070406/acae6636/attachment.html From zeljko.filipin at gmail.com Fri Apr 6 08:17:47 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 6 Apr 2007 14:17:47 +0200 Subject: [Wtr-general] Access all elements in a form In-Reply-To: <59618fe50704060213p69123d7aqd0b394bac8f7bdaa@mail.gmail.com> References: <59618fe50704050126g70dfbdc6x50755585978961c@mail.gmail.com> <59618fe50704052217x3b8029d0s701f8a285b31976c@mail.gmail.com> <59618fe50704060213p69123d7aqd0b394bac8f7bdaa@mail.gmail.com> Message-ID: Hi Sayali, I got lost. I did not understand what do you want to do. You can not set one radio button? Regarding your original post, this is how you can flash all radio buttons in a form. ie.form(:index, 1).radios.each { |radio| radio.flash } Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070406/7f237ed3/attachment.html From zeljko.filipin at gmail.com Fri Apr 6 08:23:38 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 6 Apr 2007 14:23:38 +0200 Subject: [Wtr-general] How Capture the Text area In-Reply-To: <28659945.1541175852866819.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28659945.1541175852866819.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Vamsi, If you have this html you can do it like this irb(main):009:0> "some text" == ie.text_field(:index, 1).text => true Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070406/b1a91631/attachment.html From charley.baker at gmail.com Fri Apr 6 10:05:12 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 6 Apr 2007 10:05:12 -0400 Subject: [Wtr-general] How to make IE as active windows and capture it? In-Reply-To: References: Message-ID: The bring to front method acts on the window title. If there's no window title (you haven't navigated anywhere yet) then it won't bring the window to the front. -Charley On 4/6/07, Jason He wrote: > > Yes, thank you for your help. > > > > I find if ie.bring_to_front is before ie.goto(), then the window console > will be brought in front. > > And if it is after ie.goto() just as you write, then the ie window will be > brought in the front. > > > > Can anyone explain what the difference between those two is? > > > > Regards, > > Jason > > > ------------------------------ > > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Charley Baker > *Sent:* 2007?4?5? 1:35 > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] How to make IE as active windows and capture > it? > > > > ie = IE.new > ie.goto('http://www.google.com' ) > ie.bring_to_front > > -Charley > > On 4/4/07, *Jason He* wrote: > > Dear all, > > > > I use a batch script in Windows command prompt (console) to start ruby > scripts, when capture the active window using screen_capture("test.jpg", > true), it will capture the console window rather than the Internet Explorer, > how to make IE as active window and bring it forward by watir/ruby script? > > > > Regards, > > Jason > > > _______________________________________________ > 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/20070406/406db61c/attachment-0001.html From forum-watir-users at openqa.org Fri Apr 6 16:00:29 2007 From: forum-watir-users at openqa.org (Bill) Date: Fri, 06 Apr 2007 15:00:29 CDT Subject: [Wtr-general] Everyday Scripting with Ruby (the book) In-Reply-To: <72799cd70702021553o50ba6697i208453a8aee756ec@mail.gmail.com> Message-ID: <31193379.4091175889659660.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Upon further review... I finally got to the book and gave it a proper reading. (Although I still need to go back and do some of the excercises) I was inaccurate in my initial comments based on a superficial browsing of the book a couple months back. Mea culpa. The first half is a lot of review, but there are definitely some nuggets and neat tricks in there, many he points out and others jump out at you. He does a good job of illustrating test-first scripting for example, he shows Ruby short-cuts and nuances that are cool but not necessarily obvious, etc. The middle chapters on project organization, packaging, building etc. are very valuable and definitely helped me see how I could reorganize some of the projects I've done to make them easier to mangage, enhance, and share with others. I look forward to using his project template utilities and seeing what they do. The last few chapters are really pretty cool -- I'm looking forward to reading them again and working on the exercises to catch everything but he hits on some slick stuff. And although it didn't meet my initial expectations, which as I've now learned were off-base from the book's intentions, I found it to be a very good resource on the craft of scripting and that it gives you a lot of tools and concepts to apply to your test scripting projects. I would recommend it to both newbies and experienced ruby programmers, as Chris McMahon pointed out "Even if you know this stuff, there are surprising little bits that will still probably take you by surprise, unless you are very, very good at Ruby." (and even then I bet :-) And lastly, the book has some good philosophy on scripting and testing in general. He provides a lot of insight from an experienced point of view that I found helpful and enlightening. From forum-watir-users at openqa.org Sat Apr 7 05:56:42 2007 From: forum-watir-users at openqa.org (Maloy kanti debnath) Date: Sat, 07 Apr 2007 04:56:42 CDT Subject: [Wtr-general] hi, how to get TOOLTIP In-Reply-To: Message-ID: <34864407.181175939833140.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello Zeljko Filipin, I am not able to find out the image. So, I will post the '.html' of a link, which gives a tooltip when the mouse is hovered over it. The 'link' is enclosed by a 'span' and the tooltip is present as the 'title' of the span. But how can I make sure that the tooltip, no matter whether it is present in the title of the enclosing 'span' or not, gets displayed on the screen, when the mouse is hovered over the link. a. The 'html' of the table that contains the link is:
bergc1 / 4/5/2007
b. The actual link is 'bergc1 / 4/5/2007'. c. The tooltip that will be displayed when the mouse is hovered over this link is: The html of the table that contains the link is: 'Note from Yolanda Dave.This is a public note.This is an additional note from Christina Bergman' (you may see this tooltip as the 'title' of the 'span' that encloses the link) I sincerely hope that this information would help you. Thanks, Maloy. From forum-watir-users at openqa.org Sat Apr 7 16:24:47 2007 From: forum-watir-users at openqa.org (Devendra Yadav) Date: Sat, 07 Apr 2007 15:24:47 CDT Subject: [Wtr-general] Handling popup message Message-ID: <31786657.471175977517281.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi All, I am very new with watir. Can any one tell me how to handle popup message(e.g. java script ALERTs) Thanks in Advance Devendra Yadav From ftorres at incisif.net Sat Apr 7 12:08:41 2007 From: ftorres at incisif.net (ftorres at incisif.net) Date: Sat, 7 Apr 2007 12:08:41 -0400 Subject: [Wtr-general] 1 Questions for Watir's creators References: Message-ID: <003501c7792f$02ee8b80$6564a8c0@INCISIF01> I guess the question is for Bret [1] What are the pros and cons of naming a method bring_to_front rather than BringToFront. Thanks. Fred. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070407/0e690c65/attachment.html From charley.baker at gmail.com Sun Apr 8 18:03:06 2007 From: charley.baker at gmail.com (Charley Baker) Date: Sun, 8 Apr 2007 16:03:06 -0600 Subject: [Wtr-general] 1 Questions for Watir's creators In-Reply-To: <003501c7792f$02ee8b80$6564a8c0@INCISIF01> References: <003501c7792f$02ee8b80$6564a8c0@INCISIF01> Message-ID: Hi Fred, It's standard ruby coding conventions, this style of naming is used in ruby not camel cased as is prevalent in Java and c/c++. Take a look at the Ruby coding conventions doc: http://pub.cozmixng.org/~the-rwiki/rw-cgi.rb?cmd=view;name=RubyCodingConvention The naming conventions lists naming conventions for classes/modules and methods, variables, constants. Class names are constants in Ruby internally and must begin with an upper case letter. Try the following: class dog def bark puts 'woof' end end d = dog.new d.bark You'll get a compilation error that class/module name must be a CONSTANT - must begin with an upper case letter. Method names therefore begin with a lower case letter to differentiate and use underscores to separate words not camel case. This matches variable names which in some cases - attributes notably - are basically interchangeable. -Charley On 4/7/07, ftorres at incisif.net wrote: > > I guess the question is for Bret > > [1] What are the pros and cons of naming a method bring_to_front rather > than BringToFront. > > Thanks. > > Fred. > > > > _______________________________________________ > 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/20070408/46691fec/attachment.html From charley.baker at gmail.com Sun Apr 8 18:07:59 2007 From: charley.baker at gmail.com (Charley Baker) Date: Sun, 8 Apr 2007 16:07:59 -0600 Subject: [Wtr-general] Handling popup message In-Reply-To: <31786657.471175977517281.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <31786657.471175977517281.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: It' in the FAQ under handling Javascript popups (the 3rd entry) and also littered throughout previous posts on the mailing list: http://wiki.openqa.org/display/WTR/FAQ The second method in the FAQ works well for most people. -Charley On 4/7/07, Devendra Yadav wrote: > > Hi All, > I am very new with watir. > Can any one tell me how to handle popup message(e.g. java script ALERTs) > > Thanks in Advance > > Devendra Yadav > _______________________________________________ > 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/20070408/29dc76bf/attachment.html From forum-watir-users at openqa.org Mon Apr 9 04:55:38 2007 From: forum-watir-users at openqa.org (san) Date: Mon, 09 Apr 2007 03:55:38 CDT Subject: [Wtr-general] How To Deal With External CSS Files....ink All Message-ID: <28581251.371176108968612.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi All, Pls Look At This Site http://research.thomsonib.com/ ...... The HTML Contains Nothing.... Now If I Want To Click On The LOGIN On The Top Left What Should I Do & After Clicking The Pop Up Box Asks For ID & Pass... How Do I Handel That Also... Pls Help... Thanks... From angrez at gmail.com Mon Apr 9 05:35:41 2007 From: angrez at gmail.com (Angrez Singh) Date: Mon, 9 Apr 2007 15:05:41 +0530 Subject: [Wtr-general] How To Deal With External CSS Files....ink All In-Reply-To: <28581251.371176108968612.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28581251.371176108968612.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi, The page actually contains frame. You can open the page in Firefox and access appropriate frame. You can view the HTML of the frame and write the script accordingly somewhat like this: ie.frame(:name, "frame name").link(:text, "some text") -Angrez On 4/9/07, san wrote: > > Hi All, > > Pls Look At This Site http://research.thomsonib.com/ ...... The > HTML Contains Nothing.... Now If I Want To Click On The LOGIN On The Top > Left What Should I Do & After Clicking The Pop Up Box Asks For ID & Pass... > How Do I Handel That Also... > > Pls Help... Thanks... > _______________________________________________ > 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/20070409/3d0722ad/attachment.html From forum-watir-users at openqa.org Mon Apr 9 06:55:13 2007 From: forum-watir-users at openqa.org (san) Date: Mon, 09 Apr 2007 05:55:13 CDT Subject: [Wtr-general] How To Deal With External CSS Files....ink All In-Reply-To: <28581251.371176108968612.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <23943763.1251176116143911.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Ok, But How Do I Get All The Names Of The Frames Of The Page.... As I Can See Just 2 Of Them In HTML Code, But In Firefox I Can See At Least 6 Or 7 Of Them... How Do I Get Them Through Code.... & Then I'll Try To Proceed... Thanks From Koteswara_Annavarapu at symantec.com Mon Apr 9 06:38:14 2007 From: Koteswara_Annavarapu at symantec.com (Koteswara Annavarapu) Date: Mon, 9 Apr 2007 16:08:14 +0530 Subject: [Wtr-general] Running Watir in cygwin environment Message-ID: <2B63BBC3F2F85B45A985FAD965DE969E02E719C1@ITPXCHCLN1.enterprise.veritas.com> Hi all , For some project requirements , I need to setup WATIR to run in cygwin environment. I have got RUBY+WATIR installed in only windows environement. This windows only environment is working fine with the libraries that we have written for our framework. So , if I need to use WATIR module from the cygwin environment , please let me know wat I need to do of the below 1) change the environement variables in cygwin , for using the same ruby installed in windows 2) let me know , if we can install the watir gem in the cygwin ruby environment. --Koteswara Rao -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070409/4a02229f/attachment-0001.html From forum-watir-users at openqa.org Mon Apr 9 08:19:43 2007 From: forum-watir-users at openqa.org (vamsi) Date: Mon, 09 Apr 2007 07:19:43 CDT Subject: [Wtr-general] How to Read the values from the Table Message-ID: <35662404.1771176121214024.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Could anyone please explain how to get the values from the Table. and please mention the name spaces and classes required for table too. Thanks in Advance Vamsi From forum-watir-users at openqa.org Mon Apr 9 09:05:40 2007 From: forum-watir-users at openqa.org (rkkanneganti) Date: Mon, 09 Apr 2007 08:05:40 CDT Subject: [Wtr-general] How to Overwrite a field data Message-ID: <34585381.4181176123970632.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I have a field in the form which is the first field in the form. It has some default data present on it when the form opens. But when i call that form through ruby/watir it has accept the value which i provide through the script ie the value which i provide should overwrite the data on the field. Ex: From date : 03/01/2007 (default), i want to overwrite this value with 02/01/2007 From watir_user at yahoo.co.in Mon Apr 9 10:09:17 2007 From: watir_user at yahoo.co.in (watir-user watir-user) Date: Mon, 9 Apr 2007 15:09:17 +0100 (BST) Subject: [Wtr-general] How to run all the steps defined in a method even if any of step fails? Message-ID: <886136.67616.qm@web94314.mail.in2.yahoo.com> Hi, Following methods i want to call in another method def assertButton assert($ie.button(:caption, "Click Me").enabled?) end def assertLink assert($ie.link(:text, "Click Me").exists? end def assertTextfield assert($ie.text_field(:name, "field1").exists?) end def assertRbutton assert($ie.radio(:value,"radio button").isSet? end def check_controls assertButton assertLink assertTextfield assertRbutton end The problem i am facing here is, in check_controls method if assertLink method fails, it wont executes the next step of code just it comes out of the method. But what i wanted is even if assertLink method fails it should execute the remaining methods (or next step of code)i.e, assertTextfield and assertRbutton Please help me in this regard, Thanks in Advance Watir User --------------------------------- Here?s a new way to find what you're looking for - Yahoo! Answers -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070409/51412298/attachment.html From charley.baker at gmail.com Mon Apr 9 11:11:02 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 9 Apr 2007 09:11:02 -0600 Subject: [Wtr-general] How to Read the values from the Table In-Reply-To: <35662404.1771176121214024.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <35662404.1771176121214024.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Vamsi, It would help if you included some html code for what you're looking to find. The basic syntax is this: value = ie.table(:name, 'mytable')[1][3].text That is, get the text that stored in the first row, 3rd column of a table with a name attribute of mytable and assign it to a variable, in this case value. There are more examples in the unit tests, table_test.rb. -Charley On 4/9/07, vamsi wrote: > > Could anyone please explain how to get the values from the Table. > > and please mention the name spaces and classes required for table too. > > Thanks in Advance > > Vamsi > _______________________________________________ > 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/20070409/45774653/attachment.html From charley.baker at gmail.com Mon Apr 9 11:20:42 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 9 Apr 2007 09:20:42 -0600 Subject: [Wtr-general] How to Overwrite a field data In-Reply-To: <34585381.4181176123970632.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <34585381.4181176123970632.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: ie.text_field(:index, 1).set('02/01/2007') Does that not work? If not what does your html for the field look like? -Charley On 4/9/07, rkkanneganti wrote: > > I have a field in the form which is the first field in the form. It has > some default data present on it when the form opens. But when i call that > form through ruby/watir it has accept the value which i provide through the > script ie the value which i provide should overwrite the data on the field. > > Ex: From date : 03/01/2007 (default), i want to overwrite this value with > 02/01/2007 > _______________________________________________ > 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/20070409/f626ccff/attachment.html From charley.baker at gmail.com Mon Apr 9 12:00:44 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 9 Apr 2007 10:00:44 -0600 Subject: [Wtr-general] How to run all the steps defined in a method even if any of step fails? In-Reply-To: <886136.67616.qm@web94314.mail.in2.yahoo.com> References: <886136.67616.qm@web94314.mail.in2.yahoo.com> Message-ID: Hi watir user, You can use the assertions methods that Bret wrote in watir/assertions.rb that's included Watir 1.5.1.1100 and later (if you're using 1.4.1 you can pull that file from subversion and use it). To use the verify methods: require 'watir/assertions' Change your asserts to verify and assert_equal to verify_equal: def assertButton verify($ie.button(:caption, "Click Me").enabled?) end etc. def check_controls assertButton ..... end Verify methods will be counted as assertions in the test unit run without exiting out of the calling method. -Charley On 4/9/07, watir-user watir-user wrote: > > Hi, > > Following methods i want to call in another method > > def assertButton > assert($ie.button(:caption, "Click Me").enabled?) > end > > def assertLink > assert($ie.link(:text, "Click Me").exists? > end > > def assertTextfield > assert($ie.text_field(:name, "field1").exists?) > end > > def assertRbutton > assert($ie.radio(:value,"radio button").isSet? > end > > def check_controls > assertButton > assertLink > assertTextfield > assertRbutton > end > > The problem i am facing here is, in check_controls method if assertLink > method fails, it wont executes the next step of code just it comes out of > the method. But what i wanted is even if assertLink method fails it should > execute the remaining methods (or next step of code)i.e, assertTextfield and > assertRbutton > > Please help me in this regard, > > Thanks in Advance > Watir User > > ------------------------------ > Here's a new way to find what you're looking for - Yahoo! Answers > > > _______________________________________________ > 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/20070409/d45d50f2/attachment.html From christopher.mcmahon at gmail.com Mon Apr 9 12:56:25 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 9 Apr 2007 10:56:25 -0600 Subject: [Wtr-general] OT? O'Reilly Open Source Awards nominations Message-ID: <72799cd70704090956p1751a5b0jb5ba9448912af8e3@mail.gmail.com> O'Reilly announced a call for nominations for this year's Open Source Awards: http://radar.oreilly.com/archives/2007/04/call_for_open_s.html If Watir has helped you in your career, you should consider nominating some of the helpful people who make Watir possible. osawards at oreilly.com From forum-watir-users at openqa.org Mon Apr 9 17:27:06 2007 From: forum-watir-users at openqa.org (Parv) Date: Mon, 09 Apr 2007 16:27:06 CDT Subject: [Wtr-general] unknown property or method `readyState' (WIN32OLERuntimeError) Message-ID: <37963613.5751176154056064.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> i've been using watir 1.5.1.1158 for a while. Recently i've getting the error: C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1839: unknown property or method `readyState' (WIN32OLERuntimeError) Access is denied. from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1839:in `wait' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:326:in `wait' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:2592:in `click' in my scripts, even though i can interact with the web app fine. This error occurs regardless of how responsive the SUT is. This error has been occurring as a result of each user interaction that results in page load or redirection. Can anybody offer some help or suggestions. Thanks. From dkurtz at olenick.com Mon Apr 9 19:27:22 2007 From: dkurtz at olenick.com (Daniel Kurtz) Date: Mon, 9 Apr 2007 18:27:22 -0500 Subject: [Wtr-general] Accessing elements between DIV tags Message-ID: <82E50B4081E1354AAC1F917519B13F0DA23D47@olenick-01-ex.atlarge.net> How do I access each link, say, inside a DIV? Let's say I have something like this: Thing is I don't know in advance what the text, or even the href for the links ahead of time. Even the number of links is subject to change, so I can't use the :index. How can I just specify that I want the links in one div or the other? Thanks. daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070409/6780b2f4/attachment-0001.html From forum-watir-users at openqa.org Tue Apr 10 00:45:26 2007 From: forum-watir-users at openqa.org (san) Date: Mon, 09 Apr 2007 23:45:26 CDT Subject: [Wtr-general] How To Click On Image Inside A Table Cell.... Message-ID: <35979218.8051176180356519.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Everybody, Heres The HTML... ..................
...............
Theres a table inside the 2nd table in the page.... i tried this... ie.table(:index, 2)[1][1].table(:index, 1)[1][2].image(:index, 1).src to get back the src, but it didn't work... Can You Help Please.... Thanks.... From forum-watir-users at openqa.org Tue Apr 10 01:36:30 2007 From: forum-watir-users at openqa.org (rkkanneganti) Date: Tue, 10 Apr 2007 00:36:30 CDT Subject: [Wtr-general] How to Overwrite a field data In-Reply-To: Message-ID: <35284967.8331176183420276.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks charley it is working fine. From Jason.He at resilience.com Tue Apr 10 01:47:20 2007 From: Jason.He at resilience.com (Jason He) Date: Mon, 9 Apr 2007 22:47:20 -0700 Subject: [Wtr-general] How to get the return code during script running? References: <886136.67616.qm@web94314.mail.in2.yahoo.com> Message-ID: Dear all, I write every single script for each test case and start running them by a batch file, I expect to capture the screen if those cases who get failure/error. The problem I meet now is, how to find out immediately when a failure/error is happen during testing. Does watir/ruby provide return code or message which could be used as indication to capture screen? Regards, Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070409/85ecc6db/attachment.html From forum-watir-users at openqa.org Tue Apr 10 01:58:37 2007 From: forum-watir-users at openqa.org (san) Date: Tue, 10 Apr 2007 00:58:37 CDT Subject: [Wtr-general] How To Click On Image Inside A Table Cell.... In-Reply-To: <35979218.8051176180356519.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <30971079.8381176184747501.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> ok solved it.... :) ie.button(:src, /go/).click this type of images behave like button (submit) according to watir help.... From zeljko.filipin at gmail.com Tue Apr 10 03:45:56 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 10 Apr 2007 09:45:56 +0200 Subject: [Wtr-general] Everyday Scripting with Ruby (the book) In-Reply-To: <31193379.4091175889659660.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <72799cd70702021553o50ba6697i208453a8aee756ec@mail.gmail.com> <31193379.4091175889659660.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: I was reviewer, and over two months ago I received an e-mail from Daniel Steinberg (Pragmatic Programmers) saying that if I send them my mailing address they would send me a free copy. I replied with my mailing address, but the book did not arrive. I even sent him a reminder two weeks ago. No reply. Maybe there is a problem because I am from Europe (but I already received mail from US). Did anybody had a similar experience? Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070410/b20d8112/attachment.html From zeljko.filipin at gmail.com Tue Apr 10 03:57:17 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 10 Apr 2007 09:57:17 +0200 Subject: [Wtr-general] hi, how to get TOOLTIP In-Reply-To: <34864407.181175939833140.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <34864407.181175939833140.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 4/7/07, Maloy kanti debnath wrote: > > how can I make sure that the tooltip, no matter whether it is present in > the title of the enclosing 'span' or not, gets displayed on the screen, when > the mouse is hovered over the link. Hi Maloy, The answer is very simple. If span tag has some text in title attribute, that text will be displayed on the screen when mouse is over it. So, all you have to do is to check if span has title. You can do like this. irb(main):004:0> ie.span(:class, "listCellQT").title => "Note from Yolanda Dave.This is a public note.This is an additional note from Christina Bergman" If you want to test if browser displays title of a tag, it is outside of watir's scope. Watir tests functionality of web applications, not functionality of browsers. And displaying title of a tag is browser functionality. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070410/3b55dd2a/attachment.html From zeljko.filipin at gmail.com Tue Apr 10 04:13:09 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 10 Apr 2007 10:13:09 +0200 Subject: [Wtr-general] How To Deal With External CSS Files....ink All In-Reply-To: <23943763.1251176116143911.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28581251.371176108968612.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <23943763.1251176116143911.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 4/9/07, san wrote: > > As I Can See Just 2 Of Them In HTML Code, But In Firefox I Can See At > Least 6 Or 7 Of Them This is because some frames contain another frames. First, you find root frames. irb(main):007:0> ie.show_frames there are 2 frames frame index: 1 name: TR_MAINFRAME frame index: 2 name: TR_BLANK => 0..1 Then you find nested frames. irb(main):009:0> ie.frame(:name, "TR_MAINFRAME").show_frames there are 3 frames frame index: 1 name: TOP_TOOLBAR frame index: 2 name: leftFrame frame index: 3 name: GA_DISPLAY Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070410/5e23a57a/attachment.html From forum-watir-users at openqa.org Tue Apr 10 04:26:01 2007 From: forum-watir-users at openqa.org (san) Date: Tue, 10 Apr 2007 03:26:01 CDT Subject: [Wtr-general] How To Deal With External CSS Files....ink All In-Reply-To: <28581251.371176108968612.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <41806994.8801176193591546.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks... zeljko Yes Now I Can Find All The Frames... From zeljko.filipin at gmail.com Tue Apr 10 04:47:52 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 10 Apr 2007 10:47:52 +0200 Subject: [Wtr-general] Accessing elements between DIV tags In-Reply-To: <82E50B4081E1354AAC1F917519B13F0DA23D47@olenick-01-ex.atlarge.net> References: <82E50B4081E1354AAC1F917519B13F0DA23D47@olenick-01-ex.atlarge.net> Message-ID: Hi Daniel, This is how you can flash each link from the second div. ie.div(:class, "bottom_menu").links.each {|link| link.flash} Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070410/fc7a828f/attachment.html From oblomov.consulting at googlemail.com Tue Apr 10 04:51:41 2007 From: oblomov.consulting at googlemail.com (George Hawthorne) Date: Tue, 10 Apr 2007 09:51:41 +0100 Subject: [Wtr-general] Everyday Scripting with Ruby (the book) In-Reply-To: References: <72799cd70702021553o50ba6697i208453a8aee756ec@mail.gmail.com> <31193379.4091175889659660.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi ?eljko, I was also a reviewer and I live in the UK. Daniel sent me a copy about two months ago. I'd guess yours got lost in the post. George Hawthorne On 10 Apr 2007, at 08:45, ?eljko Filipin wrote: > I was reviewer, and over two months ago I received an e-mail from > Daniel Steinberg (Pragmatic Programmers) saying that if I send them > my mailing address they would send me a free copy. I replied with > my mailing address, but the book did not arrive. > > I even sent him a reminder two weeks ago. No reply. > > Maybe there is a problem because I am from Europe (but I already > received mail from US). > > Did anybody had a similar experience? > > Zeljko > -- > ZeljkoFilipin.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From WKruse at multichoice.co.za Tue Apr 10 04:54:24 2007 From: WKruse at multichoice.co.za (Walter Kruse) Date: Tue, 10 Apr 2007 10:54:24 +0200 Subject: [Wtr-general] Everyday Scripting with Ruby (the book) In-Reply-To: References: <72799cd70702021553o50ba6697i208453a8aee756ec@mail.gmail.com><31193379.4091175889659660.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: I was also a reviewer, but I purchased my copy myself. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of George Hawthorne Sent: 10 April 2007 10:52 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Everyday Scripting with Ruby (the book) Hi ?eljko, I was also a reviewer and I live in the UK. Daniel sent me a copy about two months ago. I'd guess yours got lost in the post. George Hawthorne On 10 Apr 2007, at 08:45, ?eljko Filipin wrote: > I was reviewer, and over two months ago I received an e-mail from > Daniel Steinberg (Pragmatic Programmers) saying that if I send them > my mailing address they would send me a free copy. I replied with > my mailing address, but the book did not arrive. > > I even sent him a reminder two weeks ago. No reply. > > Maybe there is a problem because I am from Europe (but I already > received mail from US). > > Did anybody had a similar experience? > > Zeljko > -- > ZeljkoFilipin.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 ************************************************************************************************************************** Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and destroy the original message. ************************************************************************************************************************** From zeljko.filipin at gmail.com Tue Apr 10 04:58:45 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 10 Apr 2007 10:58:45 +0200 Subject: [Wtr-general] Everyday Scripting with Ruby (the book) In-Reply-To: References: <72799cd70702021553o50ba6697i208453a8aee756ec@mail.gmail.com> <31193379.4091175889659660.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 4/10/07, Walter Kruse wrote: > > I was also a reviewer, but I purchased my copy myself. I was thinking of buying it, but they said I would receive one for free, so I am waiting and waiting... :) -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070410/2fd97a43/attachment.html From WKruse at multichoice.co.za Tue Apr 10 05:12:53 2007 From: WKruse at multichoice.co.za (Walter Kruse) Date: Tue, 10 Apr 2007 11:12:53 +0200 Subject: [Wtr-general] Everyday Scripting with Ruby (the book) In-Reply-To: References: <72799cd70702021553o50ba6697i208453a8aee756ec@mail.gmail.com><31193379.4091175889659660.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: It was worth the money though :-) -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Walter Kruse Sent: 10 April 2007 10:54 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Everyday Scripting with Ruby (the book) I was also a reviewer, but I purchased my copy myself. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of George Hawthorne Sent: 10 April 2007 10:52 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Everyday Scripting with Ruby (the book) Hi ?eljko, I was also a reviewer and I live in the UK. Daniel sent me a copy about two months ago. I'd guess yours got lost in the post. George Hawthorne On 10 Apr 2007, at 08:45, ?eljko Filipin wrote: > I was reviewer, and over two months ago I received an e-mail from > Daniel Steinberg (Pragmatic Programmers) saying that if I send them > my mailing address they would send me a free copy. I replied with > my mailing address, but the book did not arrive. > > I even sent him a reminder two weeks ago. No reply. > > Maybe there is a problem because I am from Europe (but I already > received mail from US). > > Did anybody had a similar experience? > > Zeljko > -- > ZeljkoFilipin.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 ************************************************************************************************************************** Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and destroy the original message. ************************************************************************************************************************** _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ************************************************************************************************************************** Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and destroy the original message. ************************************************************************************************************************** From forum-watir-users at openqa.org Tue Apr 10 06:34:44 2007 From: forum-watir-users at openqa.org (rkkanneganti) Date: Tue, 10 Apr 2007 05:34:44 CDT Subject: [Wtr-general] Selecting value from a List displayed through Autoextender Message-ID: <29816705.371176201314352.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I have a particular field in which values are displayed through Auto extender (.net) ie in the field if i start entering alphabets like "A or a" a drop down list of names starting with "A or a" will be displayed. Likewise if i enter "R or r" next to "A or a" list of names starting with "AR or ar" will be displayed. My problem is that out of the displayed values in the list i want to pick one value thru watir script. Here i can set or enter the value i desired directly into the field, but it won't solve my purpose. So i have to pick the value from the displayed list only. any help would be appreciatable. thanks From watir_user at yahoo.co.in Tue Apr 10 09:16:41 2007 From: watir_user at yahoo.co.in (watir-user watir-user) Date: Tue, 10 Apr 2007 14:16:41 +0100 (BST) Subject: [Wtr-general] How to run all the steps defined in a method even if any of step fails? Message-ID: <406683.22995.qm@web94312.mail.in2.yahoo.com> Hi Charley, Can you tell me how to overcome the same in Watir 1.4.1. Its not only related to assertions, the problem i am facing is if the method which i am calling if does not execute for some reason the next step of the code does not executes in the called method. So, is there any other way to over come this problem in Watir 1.4.1? Any suggestions most welcome Thanks, Hi watir user, You can use the assertions methods that Bret wrote in watir/assertions.rb that's included Watir 1.5.1.1100 and later (if you're using 1.4.1 you can pull that file from subversion and use it). To use the verify methods: require 'watir/assertions' Change your asserts to verify and assert_equal to verify_equal: def assertButton verify($ie.button(:caption, "Click Me").enabled?) end etc. def check_controls assertButton ..... end Verify methods will be counted as assertions in the test unit run without exiting out of the calling method. -Charley On 4/9/07, watir-user watir-user wrote: Hi, Following methods i want to call in another method def assertButton assert($ie.button(:caption, "Click Me").enabled?) end def assertLink assert($ie.link(:text, "Click Me").exists? end def assertTextfield assert($ie.text_field(:name, "field1").exists?) end def assertRbutton assert($ie.radio(:value,"radio button").isSet? end def check_controls assertButton assertLink assertTextfield assertRbutton end The problem i am facing here is, in check_controls method if assertLink method fails, it wont executes the next step of code just it comes out of the method. But what i wanted is even if assertLink method fails it should execute the remaining methods (or next step of code)i.e, assertTextfield and assertRbutton Please help me in this regard, Thanks in Advance Watir User --------------------------------- Here's a new way to find what you're looking for - Yahoo! Answers _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general --------------------------------- Check out what you're missing if you're not on Yahoo! Messenger -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070410/302e511b/attachment.html From tester.paul at gmail.com Tue Apr 10 09:44:03 2007 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 10 Apr 2007 09:44:03 -0400 Subject: [Wtr-general] How to run all the steps defined in a method even if any of step fails? In-Reply-To: <406683.22995.qm@web94312.mail.in2.yahoo.com> References: <406683.22995.qm@web94312.mail.in2.yahoo.com> Message-ID: <37c405480704100644r7fd0b8d8k9ec8f578ccc5eb3@mail.gmail.com> I suppose you could always wrap a "rescue true" around each of your assertions. There are different ways of doing this. This is just off the top of my head but I'm pretty sure it works because I've done something similar in the past. One way would be: def assertButton assert($ie.button(:caption, "Click Me").enabled?) rescue true end If you have other commands that are likely to fail (e.g. a navigate link command when the link isn't there), then you could wrap the rescue for the whole method like this: def assertButton assert($ie.button(:caption, "Click Me").enabled?) rescue true end Where the "rescue" and "true" are the last lines before the "end" of the method. This will exit the method nicely and allow you to go to the next method. There are a lot of neat things you can do with a container like this at the end of a test method. If you want more information about recovering from methods like this you should check out the "Programming Ruby" book, second edition. Hope this helps. Paul C. On 10/04/07, watir-user wrote: > > > Hi Charley, > > Can you tell me how to overcome the same in Watir 1.4.1. Its not only > related to assertions, the problem i am facing is if the method which i am > calling if does not execute for some reason the next step of the code does > not executes in the called method. So, is there any other way to over come > this problem in Watir 1.4.1? > > Any suggestions most welcome > > Thanks, > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070410/108e2469/attachment.html From charley.baker at gmail.com Tue Apr 10 10:22:35 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 10 Apr 2007 08:22:35 -0600 Subject: [Wtr-general] How to run all the steps defined in a method even if any of step fails? In-Reply-To: <37c405480704100644r7fd0b8d8k9ec8f578ccc5eb3@mail.gmail.com> References: <406683.22995.qm@web94312.mail.in2.yahoo.com> <37c405480704100644r7fd0b8d8k9ec8f578ccc5eb3@mail.gmail.com> Message-ID: You can also pull the assertions file and use it with Watir 1.4.1. https://svn.openqa.org/svn/watir/trunk/watir/watir/assertions.rb Download this file, put it in your watir/watir directory and use it the same way I mentioned in my previous mail. -Charley On 4/10/07, Paul Carvalho wrote: > > I suppose you could always wrap a "rescue true" around each of your > assertions. There are different ways of doing this. This is just off the > top of my head but I'm pretty sure it works because I've done something > similar in the past. > > One way would be: > > def assertButton > assert($ie.button(:caption, "Click Me").enabled?) rescue true > end > > > If you have other commands that are likely to fail (e.g. a navigate link > command when the link isn't there), then you could wrap the rescue for the > whole method like this: > > def assertButton > assert($ie.button(:caption, "Click Me").enabled?) > rescue > true > end > > Where the "rescue" and "true" are the last lines before the "end" of the > method. This will exit the method nicely and allow you to go to the next > method. There are a lot of neat things you can do with a container like > this at the end of a test method. If you want more information about > recovering from methods like this you should check out the "Programming > Ruby" book, second edition. > > Hope this helps. Paul C. > > > On 10/04/07, watir-user wrote: > > > > > > Hi Charley, > > > > Can you tell me how to overcome the same in Watir 1.4.1. Its not only > > related to assertions, the problem i am facing is if the method which i am > > calling if does not execute for some reason the next step of the code does > > not executes in the called method. So, is there any other way to over come > > this problem in Watir 1.4.1? > > > > Any suggestions most welcome > > > > Thanks, > > > > > _______________________________________________ > 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/20070410/f92668f6/attachment-0001.html From tester.paul at gmail.com Tue Apr 10 10:37:41 2007 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 10 Apr 2007 10:37:41 -0400 Subject: [Wtr-general] How to run all the steps defined in a method even if any of step fails? In-Reply-To: References: <406683.22995.qm@web94312.mail.in2.yahoo.com> <37c405480704100644r7fd0b8d8k9ec8f578ccc5eb3@mail.gmail.com> Message-ID: <37c405480704100737yba67b0dqc64c5e7d583eb021@mail.gmail.com> You're repeating yourself, Charley. ;-) This new assertions.rb covers one aspect of what Watir User asked but not the other: "Its not only related to assertions .. ". That's why I described a general Ruby construct for recovering from methods regardless of what Watir version you're using. Cheers. Paul C. On 10/04/07, Charley Baker wrote: > > You can also pull the assertions file and use it with Watir 1.4.1. > https://svn.openqa.org/svn/watir/trunk/watir/watir/assertions.rb Download > this file, put it in your watir/watir directory and use it the same way I > mentioned in my previous mail. > > -Charley > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070410/e983c913/attachment.html From charley.baker at gmail.com Tue Apr 10 10:45:34 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 10 Apr 2007 08:45:34 -0600 Subject: [Wtr-general] How to run all the steps defined in a method even if any of step fails? In-Reply-To: <37c405480704100737yba67b0dqc64c5e7d583eb021@mail.gmail.com> References: <406683.22995.qm@web94312.mail.in2.yahoo.com> <37c405480704100644r7fd0b8d8k9ec8f578ccc5eb3@mail.gmail.com> <37c405480704100737yba67b0dqc64c5e7d583eb021@mail.gmail.com> Message-ID: That's what I get for answering emails before finishing my first cup of coffee. :) -c On 4/10/07, Paul Carvalho wrote: > > You're repeating yourself, Charley. ;-) This new assertions.rb covers one > aspect of what Watir User asked but not the other: "Its not only related to > assertions .. ". That's why I described a general Ruby construct for > recovering from methods regardless of what Watir version you're using. > > Cheers. Paul C. > > > On 10/04/07, Charley Baker wrote: > > > > You can also pull the assertions file and use it with Watir 1.4.1. https://svn.openqa.org/svn/watir/trunk/watir/watir/assertions.rb > > Download this file, put it in your watir/watir directory and use it > > the same way I mentioned in my previous mail. > > > > -Charley > > > > > _______________________________________________ > 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/20070410/5cbed36d/attachment.html From dkurtz at olenick.com Tue Apr 10 11:24:04 2007 From: dkurtz at olenick.com (Daniel Kurtz) Date: Tue, 10 Apr 2007 10:24:04 -0500 Subject: [Wtr-general] Accessing elements between DIV tags References: <82E50B4081E1354AAC1F917519B13F0DA23D47@olenick-01-ex.atlarge.net> Message-ID: <82E50B4081E1354AAC1F917519B13F0DA23D48@olenick-01-ex.atlarge.net> Thanks, I'll give it a try. Although I haven't had luck so far with things like div().links. We'll see how it goes. Daniel Kurtz ________________________________ From: wtr-general-bounces at rubyforge.org on behalf of Zeljko Filipin Sent: Tue 4/10/2007 3:47 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Accessing elements between DIV tags Hi Daniel, This is how you can flash each link from the second div. ie.div(:class, "bottom_menu").links.each {|link| link.flash} Zeljko -- ZeljkoFilipin.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 4066 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20070410/f0ce8afb/attachment.bin From charley.baker at gmail.com Tue Apr 10 11:42:28 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 10 Apr 2007 09:42:28 -0600 Subject: [Wtr-general] Selecting value from a List displayed through Autoextender In-Reply-To: <29816705.371176201314352.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <29816705.371176201314352.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: I'm not familiar with the auto extender, but I'm assuming it works on basically the same principle as this: http://demo.script.aculo.us/ajax/autocompleter. If you use IE developer toolbar on this page and enter text into the text field, you'll see that the dom is updated with a div, id of contact_name_auto_complete, class auto_complete which contains a list of names. The following script works and might give you some idea how to procede: require 'watir' include Watir ie = IE.start('http://demo.script.aculo.us/ajax/autocompleter') ie.text_field(:id, 'contact_name').set('al') ie.text_field(:id, 'contact_name').fire_event('onkeypress') # need to fire a key press event after setting the text since the js is handling keypress events # the li/lis tags are available in watir 1.5.1 puts ie.div(:id, 'contact_name_auto_complete').lis.length puts ie.div(:id, 'contact_name_auto_complete').li(:index, 5).text ie.div(:id, 'contact_name_auto_complete').li(:text, 'Alan Jochen').click hth, Charley On 4/10/07, rkkanneganti wrote: > > I have a particular field in which values are displayed through Auto > extender (.net) ie in the field if i start entering alphabets like "A or > a" a drop down list of names starting with "A or a" will be displayed. > Likewise if i enter "R or r" next to "A or a" list of names starting with > "AR or ar" will be displayed. > > My problem is that out of the displayed values in the list i want to pick > one value thru watir script. Here i can set or enter the value i desired > directly into the field, but it won't solve my purpose. So i have to pick > the value from the displayed list only. > > any help would be appreciatable. > > thanks > _______________________________________________ > 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/20070410/98ccd27d/attachment.html From forum-watir-users at openqa.org Tue Apr 10 17:53:34 2007 From: forum-watir-users at openqa.org (mark) Date: Tue, 10 Apr 2007 16:53:34 CDT Subject: [Wtr-general] Watir - Logger - Log Files Message-ID: <38137784.4471176242044325.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi all, I've only been doing this for a few months, script writing and all, and have found the going slow at times. I'd thought I'd post some lines from a script of mine to help others getting started out there. This portion of script may contain a line or two of helpful code if you are looking at getting started with Watir and generating log files; $logger.log("") $logger.log("## Beginning of test: Access Web Application-Navigate to Homepage") #Prints to Log file $logger.log("Step 1: Go to test site")#Prints to Log file $logger.log("Access Test Site")#Prints to Log file $ie.goto("http://dispositioningstestsite")#not a real site by the way. . . $logger.log($ie.down_load_time)#records response time and prints to Log file $ie.maximize()#maximizes the IE window $logger.log("**IE Page Title**")#Prints to Log file $logger.log($ie.title)#records IE page title and prints to Log File $logger.log("**IE Page Text**")#Prints to Log file $logger.log($ie.text)#records IE page text and prints to Log File $logger.log("Select selectlist option 01")#Prints to Log file $ie.select_list(:id, 'selectlist').select_value('01') $logger.log("Select Organisation 'OK' button")#Prints to Log file $ie.button(:id, 'OrganisationButton').click $logger.log($ie.down_load_time)#records response time and prints to Log file sleep 5#Pause for five seconds $ie.send_keys('{PRINTSCREEN}')#I use an application that takes screenshots via the PrintScreen key and dumps the screenshot to a selected destination. #I use Wisdom-soft ScreenHunter 4.0 from www.download.com (free). There are others out there . . . $logger.log(" Action: Navigated to Home Page.")#Prints to Log file Cheers, Mark From charley.baker at gmail.com Tue Apr 10 19:07:12 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 10 Apr 2007 17:07:12 -0600 Subject: [Wtr-general] OT: selenium ajax testing tool released Message-ID: This is an offtopic post on Selenium and a recent release from TIBCO with an ajax testing framework: http://ddj.com/198702228;jsessionid=OP1CXLIHSLECCQSNDLPCKH0CJUNN2JVN? Thoughts? -charley -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070410/f688d7c9/attachment.html From christopher.mcmahon at gmail.com Tue Apr 10 19:17:48 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 10 Apr 2007 17:17:48 -0600 Subject: [Wtr-general] OT: selenium ajax testing tool released In-Reply-To: References: Message-ID: <72799cd70704101617h59c9beb8s7353b7e0b5aca237@mail.gmail.com> On 4/10/07, Charley Baker wrote: > This is an offtopic post on Selenium and a recent release from TIBCO with an > ajax testing framework: > http://ddj.com/198702228;jsessionid=OP1CXLIHSLECCQSNDLPCKH0CJUNN2JVN > ? > Thoughts? It's weird that it's from TIBCO, who sell EAI products and have very little to do with GUIs. At least it's open source. -C From forum-watir-users at openqa.org Wed Apr 11 01:22:20 2007 From: forum-watir-users at openqa.org (rkkanneganti) Date: Wed, 11 Apr 2007 00:22:20 CDT Subject: [Wtr-general] Selecting value from a List displayed through Autoextender In-Reply-To: Message-ID: <28088664.4921176268970154.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank Q for the response charley.. Autocompleting is what i meant autoextender. The example which you have given is working to the extent of entering the words "AL" in the text field and showing the list containing names starting with "AL". Further it is not working and throwing a exception. Here is the script you have passed to me for which i added few messeges to know where it is throwing exception require 'watir' include Watir ie = IE.start('http://demo.script.aculo.us/ajax/autocompleter') ie.maximize() puts "Entering Words AL in the field " ie.text_field(:id, 'contact_name').set('al') puts "Event Firing" ie.text_field(:id, 'contact_name').fire_event('onkeypress') # need to fire a key press event after setting the text since the js is handling keypress events puts "Checking the length" ------> *bold* Passing through this and stopping puts ie.div(:id, 'contact_name_auto_complete').lis.length puts ie.div(:id, 'contact_name_auto_complete').li(:index, 5).text Puts "Clicking Alan Jochen" ie.div(:id, 'contact_name_auto_complete').li(:text, 'Alan Jochen').click ------------------------------------------------- Entering AL in the field ----> passed thru this Event Firing ----> passed thru this Checking the length ----> passed thru this and stopped 0 ------------------------------------- Unable to locate object, using index and 5 ---> This is the exception thrown. did i missed anything thanks From chitta.ranjan at globallogic.com Wed Apr 11 02:02:19 2007 From: chitta.ranjan at globallogic.com (chitta) Date: Wed, 11 Apr 2007 11:32:19 +0530 Subject: [Wtr-general] Problem Calling 2 ruby files Message-ID: <000d01c77bfe$f76b4320$b064a8c0@synapse.com> Hi, I want to run five ruby programs from a single ruby program. I used load "file name.rb" & require "file name. rb" as their are multiple programs & each contains new excel application to open, all the excel application opens simultenously but only the last call was succeed, the first four calls are closed automaticaly. Thanks in Advance Chitta Ranjan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070411/3f4b3f01/attachment.html From aidy.lewis at googlemail.com Wed Apr 11 07:02:10 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Wed, 11 Apr 2007 12:02:10 +0100 Subject: [Wtr-general] code structure problem Message-ID: <7ac2300c0704110402m37771221w6438be55343d6c79@mail.gmail.com> Hi, I have a bit of a code structure problem, I wonder if any-one can help? I instantiate the IE class and assign it to a global object $ie = Watir::IE.new def browser;$ie;end I go through an Object Map using Module constants module Login USERNAME = browser.text_field(:name, 'user_name') PASSWORD = browser.text_field(:name, 'password') # etc end I use Test::Unit setup and teardown methods include Login #the setup method is executed before each test method def setup browser.goto('http://missiontesting.updatelog.com') browser.bring_to_front browser.maximize end #the teardown method is executed after each test method def teardown browser.close end However, after the first test method, the browser is closed, so Ruby cannot find the goto method (above in setup) How best can I structure this? aidy From forum-watir-users at openqa.org Wed Apr 11 07:55:12 2007 From: forum-watir-users at openqa.org (san) Date: Wed, 11 Apr 2007 06:55:12 CDT Subject: [Wtr-general] Need suggestion to download files from net.... Message-ID: <38944961.8031176292542819.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Everybody.... I Need To Download Huge No Of html Files From net As Intact... & Also pdf Files... As Far As I Know Watir Can't Download Both.... ie.html just gives the html codes.... & watir Can't Save pdf... So Will You Pls Suggest A gem Or Some Other Way To Do It By Ruby.... Thanks... :) From watir_user at yahoo.co.in Wed Apr 11 10:22:09 2007 From: watir_user at yahoo.co.in (watir-user watir-user) Date: Wed, 11 Apr 2007 15:22:09 +0100 (BST) Subject: [Wtr-general] How to run all the steps defined in a method even if any of step fails? Message-ID: <627986.27381.qm@web94301.mail.in2.yahoo.com> Hi Charley and Paul, If I use rescue true in the method, i wont be getting any error all the methods will execute. But, the method which has error does not shows what actual error it has. Here is the code which i executed def test_yahooSite test_site = 'http://www.mail.yahoo.com' $ie = IE.new $ie.goto(test_site) assertTextfield assertCheckbox #If this method fails it wont execute the next method assertButton end def assertTextfield assert($ie.text_field(:id,"username").exists?, "Username text field does not exist") assert($ie.text_field(:id,"passwd").exists?, "Password text field does not exist") end def assertButton assert($ie.button(:value,"Sign In").exists?, "Sign In button does not exist") end def assertCheckbox assert_equal($ie.checkbox(:id, "persistent",2).isSet?, "Keep me signed in, check box is not checked") rescue true end Is there any other way which executes all the steps defined in the method even any of the step fails and also should show the message why it has failed? That's what I get for answering emails before finishing my first cup of coffee. :) -c On 4/10/07, Paul Carvalho < tester.paul at gmail.com> wrote: You're repeating yourself, Charley. ;-) This new assertions.rb covers one aspect of what Watir User asked but not the other: "Its not only related to assertions .. ". That's why I described a general Ruby construct for recovering from methods regardless of what Watir version you're using. Cheers. Paul C. On 10/04/07, Charley Baker < charley.baker at gmail.com> wrote: You can also pull the assertions file and use it with Watir 1.4.1. https://svn.openqa.org/svn/watir/trunk/watir/watir/assertions.rb Download this file, put it in your watir/watir directory and use it the same way I mentioned in my previous mail. -Charley --------------------------------- Check out what you're missing if you're not on Yahoo! Messenger -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070411/1baaa5df/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: yahoopage.rb Type: application/octet-stream Size: 787 bytes Desc: 2132032765-yahoopage.rb Url : http://rubyforge.org/pipermail/wtr-general/attachments/20070411/1baaa5df/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: yahoorescue.rb Type: application/octet-stream Size: 805 bytes Desc: 43341326-yahoorescue.rb Url : http://rubyforge.org/pipermail/wtr-general/attachments/20070411/1baaa5df/attachment-0001.obj From BAttebery at archstonesmith.com Wed Apr 11 10:15:57 2007 From: BAttebery at archstonesmith.com (Attebery, Bill) Date: Wed, 11 Apr 2007 08:15:57 -0600 Subject: [Wtr-general] code structure problem In-Reply-To: <7ac2300c0704110402m37771221w6438be55343d6c79@mail.gmail.com> References: <7ac2300c0704110402m37771221w6438be55343d6c79@mail.gmail.com> Message-ID: <058F595709851C4E968070ED914CEA75010783BA@engexc11.archstonesmith.com> instantiate $ie in setup or don't close browser in teardown - when you close browser, $ie is closed (because browser is just a reference to the same object) and thus unavailable going forward. #the setup method is executed before each test method def setup browser.goto('http://missiontesting.updatelog.com') browser.bring_to_front browser.maximize end #the teardown method is executed after each test method def teardown browser.close end However, after the first test method, the browser is closed, so Ruby cannot find the goto method (above in setup) How best can I structure this? aidy _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From matt.makins at studylink.com Wed Apr 11 10:36:46 2007 From: matt.makins at studylink.com (Matt Makins) Date: Wed, 11 Apr 2007 15:36:46 +0100 Subject: [Wtr-general] screen_capture filename Message-ID: <00e501c77c46$d7b05140$8710f3c0$@makins@studylink.com> i am using the screen_capture function which i have working correctly. How do i specify the path where i want to save the image file? screen_capture("C:\InstantRails\rails_apps\watir_tests\public\images\#@time. jpg" , true, false) this doesn't work, anybody tried this?? Cheers, Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070411/7628d416/attachment.html From zeljko.filipin at gmail.com Wed Apr 11 10:55:17 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 11 Apr 2007 16:55:17 +0200 Subject: [Wtr-general] How to run all the steps defined in a method even if any of step fails? In-Reply-To: <627986.27381.qm@web94301.mail.in2.yahoo.com> References: <627986.27381.qm@web94301.mail.in2.yahoo.com> Message-ID: On 4/11/07, watir-user watir-user wrote: > > Is there any other way which executes all the steps defined in the method > even any of the step fails and also should show the message why it has > failed? Of course. Read "Exceptions, Catch, and Throw" chapter from "Programming Ruby" (http://phrogz.net/ProgrammingRuby/tut_exceptions.html). This is sample code. begin raise rescue puts $! end Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070411/63c9c71b/attachment-0001.html From christopher.mcmahon at gmail.com Wed Apr 11 11:02:19 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 11 Apr 2007 09:02:19 -0600 Subject: [Wtr-general] Selecting value from a List displayed through Autoextender In-Reply-To: <28088664.4921176268970154.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28088664.4921176268970154.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70704110802sf5f2975ye2730510165fb7f7@mail.gmail.com> > ------------------------------------- > Unable to locate object, using index and 5 ---> This is the exception thrown. Do you get anything if you try smaller values of index, like 1 or 2? It might choose the wrong one, but you would know if it's working at all. From forum-watir-users at openqa.org Wed Apr 11 11:07:04 2007 From: forum-watir-users at openqa.org (Vamsee Krishna M) Date: Wed, 11 Apr 2007 10:07:04 CDT Subject: [Wtr-general] How to run all the steps defined in a method even if any of step fails? In-Reply-To: Message-ID: <33992677.11321176304054854.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I think what he meant was he wants to execute each and every statement without considering whether the previous statement was failed. So the solution would be like putting try rescue catch block around around each line and code won't look professional. Is there any flag in watir that can be used to suppress all the exceptions ? From christopher.mcmahon at gmail.com Wed Apr 11 11:20:32 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 11 Apr 2007 09:20:32 -0600 Subject: [Wtr-general] OT: Ruby idioms Message-ID: <72799cd70704110820v54b7a5l4e6cae0c2295ad9b@mail.gmail.com> I ran across this, and it's worth sharing... Dan Manges blogged about what he calls "Ruby anti-patterns". I might argue with some of them, but he's got some great examples of efficient ways to do some things that we all do every day: http://www.dcmanges.com/blog/28 From forum-watir-users at openqa.org Wed Apr 11 14:15:02 2007 From: forum-watir-users at openqa.org (Parv) Date: Wed, 11 Apr 2007 13:15:02 CDT Subject: [Wtr-general] unknown property or method `readyState' (WIN32OLERuntimeError) In-Reply-To: <37963613.5751176154056064.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <34272305.12161176315332159.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Some more info. The application i'm testing uses a lot of frames. From charley.baker at gmail.com Wed Apr 11 14:28:35 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 11 Apr 2007 12:28:35 -0600 Subject: [Wtr-general] How to run all the steps defined in a method even if any of step fails? In-Reply-To: <33992677.11321176304054854.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <33992677.11321176304054854.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: There's no flag in watir to swallow all exceptions, that's rather dangerous behavior and not recommended. You could wrap methods with begin/rescue blocks and print out the exceptions as they occur - follow Zeljko's example above and the more specific the exceptions you catch the better. I'd agree, it's not slick or pretty but it's the nature of the way test unit is designed and my understanding of how these specific tests are coded and the requirements. I reserve the right to be wrong on both accounts. :) The way test unit and assertions work is more on a unit => single assertion aspect vs grouping multiple assertion points(test cases) into one larger grouping. For better or worse, I've ignored the issue to some extent as the assertion points fold up into a larger test case, which I'm assuming passes if all individual test points pass, and dump out of the test case with a message on any individual assertion instead of bending it all around to a functional pass through with multiple assertions that are all independent. I added the ability track assertions in the test unit reports we're running just to identify the running assertions. Otherwise, I'm basically using test unit as is with it's limitations for true functional test scenarios. -c On 4/11/07, Vamsee Krishna M wrote: > > I think what he meant was he wants to execute each and every statement > without considering whether the previous statement was failed. > > So the solution would be like putting try rescue catch block around around > each line and code won't look professional. > > Is there any flag in watir that can be used to suppress all the exceptions > ? > _______________________________________________ > 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/20070411/7ccb844b/attachment.html From charley.baker at gmail.com Wed Apr 11 14:41:05 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 11 Apr 2007 12:41:05 -0600 Subject: [Wtr-general] unknown property or method `readyState' (WIN32OLERuntimeError) In-Reply-To: <34272305.12161176315332159.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <37963613.5751176154056064.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <34272305.12161176315332159.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: It's likely your frames are throwing errors with cross site scripting issues. You might try updating to the latest version of watir 1.5.1.1165 in svn. Installation instructions are included on the FAQ site. I may end up making a gem from the current source today. It's been a while and there have been a couple of changes, notably this workaround that might make it worthwhile. -c On 4/11/07, Parv wrote: > > Some more info. The application i'm testing uses a lot of frames. > _______________________________________________ > 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/20070411/48aadab9/attachment.html From charley.baker at gmail.com Wed Apr 11 15:07:49 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 11 Apr 2007 13:07:49 -0600 Subject: [Wtr-general] screen_capture filename In-Reply-To: <792909638488058040@unknownmsgid> References: <792909638488058040@unknownmsgid> Message-ID: This is probably some code that needs to be yanked out and put in contrib. I haven't used it and have yet to hear anyone else using it although I'm sure there are some. You might take a look at Aslak Hellesoy's screenshot library. http://blog.aslakhellesoy.com/2006/12/2/getting-screenshots-from-watir which might make sense to include in Watir vs the screen_capture library since his implementation has unit tests. You can enter a ticket for that in Jira if you'd like. As far as the current function, taking a brief look at it, you've not included curly brackets for evaluation on the time.jpgvariable, you might try the following: screen_capture(" C:\\InstantRails\\rails_apps\\watir_tests\\public\\images\\#{@time.jpg}" , true, false) or this: screen_capture(" C:/InstantRails/rails_apps/watir_tests/public/images/#{@time.jpg}" , true, false) which should get converted into the same thing. -Charley On 4/11/07, Matt Makins wrote: > > i am using the screen_capture function which i have working correctly. > > > > How do i specify the path where i want to save the image file? > > > > screen_capture(" > C:\InstantRails\rails_apps\watir_tests\public\images\#@time.jpg" > , true, false) > > > > this doesn't work, anybody tried this?? > > > > Cheers, > > Matt > > _______________________________________________ > 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/20070411/e045378c/attachment.html From bret at pettichord.com Wed Apr 11 23:11:18 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 11 Apr 2007 22:11:18 -0500 Subject: [Wtr-general] Running Watir in cygwin environment In-Reply-To: <2B63BBC3F2F85B45A985FAD965DE969E02E719C1@ITPXCHCLN1.enterprise.veritas.com> References: <2B63BBC3F2F85B45A985FAD965DE969E02E719C1@ITPXCHCLN1.enterprise.veritas.com> Message-ID: <461DA356.3080201@pettichord.com> Koteswara Annavarapu wrote: > So , if I need to use WATIR module from the cygwin environment , > please let me know wat I need to do of the below > > 1) change the environement variables in cygwin , for using the same > ruby installed in windows > 2) let me know , if we can install the watir gem in the cygwin ruby > environment. In the early days of watir development, we regularly tested it with both Native Windows and Cygwin. If you look at the setup.rb in the unit tests, you will see one small function that ensured that the file:// paths we used in the unit testing framework would be correct in either environment. You can use either the Windows Ruby or the cygwin ruby from within the cygwin environment. It's really just a matter of the path you use to access ruby.exe. Over time, we may have added a few dependencies on Native Windows in a few of the Watir methods, but if you run the unit tests, they should help you track down any possible problems. Let us know how it works for you. I consider Cygwin a supported environment and am happy to accept bug reports and patches for it if you turn up any issues. Bret From bret at pettichord.com Wed Apr 11 23:13:13 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 11 Apr 2007 22:13:13 -0500 Subject: [Wtr-general] Accessing elements between DIV tags In-Reply-To: <82E50B4081E1354AAC1F917519B13F0DA23D48@olenick-01-ex.atlarge.net> References: <82E50B4081E1354AAC1F917519B13F0DA23D47@olenick-01-ex.atlarge.net> <82E50B4081E1354AAC1F917519B13F0DA23D48@olenick-01-ex.atlarge.net> Message-ID: <461DA3C9.9050005@pettichord.com> Daniel Kurtz wrote: > Thanks, I'll give it a try. Although I haven't had luck so far with things like div().links. We'll see how it goes. > Use Watir 1.5. From forum-watir-users at openqa.org Wed Apr 11 23:21:31 2007 From: forum-watir-users at openqa.org (lin) Date: Wed, 11 Apr 2007 22:21:31 CDT Subject: [Wtr-general] How to deal with jsp event Message-ID: <23758542.1801176348121581.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> How to click this link.follwoig is code
Date & Time
From zeljko.filipin at gmail.com Thu Apr 12 03:10:09 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 12 Apr 2007 09:10:09 +0200 Subject: [Wtr-general] How to deal with jsp event In-Reply-To: <23758542.1801176348121581.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <23758542.1801176348121581.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Maybe the problem is that there are no links in the code that you sent. You can fire onclick event of table tag with this (from http://wiki.openqa.org/display/WTR/FAQ#FAQ-TriggeringJavaScriptevents) ie.table(:index, 1).fire_event("onclick") Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070412/23370a5b/attachment.html From matt.makins at studylink.com Thu Apr 12 04:13:25 2007 From: matt.makins at studylink.com (Matt Makins) Date: Thu, 12 Apr 2007 09:13:25 +0100 Subject: [Wtr-general] screen_capture filename In-Reply-To: References: <792909638488058040@unknownmsgid> Message-ID: <010201c77cda$727da4a0$5778ede0$@makins@studylink.com> Hi Charley, Thanks for that. Regarding the omission of curly braces, I didn't think they were required when referencing a global or instance variable. According to the ruby pickaxe book anyway ;) Cheers, Matt From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Charley Baker Sent: 11 April 2007 20:08 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] screen_capture filename This is probably some code that needs to be yanked out and put in contrib. I haven't used it and have yet to hear anyone else using it although I'm sure there are some. You might take a look at Aslak Hellesoy's screenshot library. http://blog.aslakhellesoy.com/2006/12/2/getting-screenshots-from-watir which might make sense to include in Watir vs the screen_capture library since his implementation has unit tests. You can enter a ticket for that in Jira if you'd like. As far as the current function, taking a brief look at it, you've not included curly brackets for evaluation on the time.jpg variable, you might try the following: screen_capture(" C:\\InstantRails\\rails_apps\\watir_tests\\public\\images\\#{@time.jpg}" , true, false) or this: screen_capture(" C:/InstantRails/rails_apps/watir_tests/public/images/#{@time.jpg}" , true, false) which should get converted into the same thing. -Charley On 4/11/07, Matt Makins wrote: i am using the screen_capture function which i have working correctly. How do i specify the path where i want to save the image file? screen_capture(" C:\InstantRails\rails_apps\watir_tests\public\images\#@time.jpg" , true, false) this doesn't work, anybody tried this?? Cheers, Matt _______________________________________________ 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/20070412/472a7d03/attachment.html From manishs at gs-lab.com Thu Apr 12 04:42:35 2007 From: manishs at gs-lab.com (Manish Sapariya) Date: Thu, 12 Apr 2007 14:12:35 +0530 Subject: [Wtr-general] "method missing: document" while accessing hotmail.com Message-ID: <461DF0FB.8050600@gs-lab.com> Hi, I tried searching archives but did not see any issue. If run this code snippet ------------------------------- #includes require 'watir' # the controller include Watir #test::unit includes require 'test/unit' require 'test/unit/ui/console/testrunner' #-------------------------------------------------------- # test case that shows basic WATIR functionality: # * enter text in a field # * click a button # #variables test_site = 'http://www.hotmail.com' -------------------------------- gives error ------------ >ruby hotmail.rb ## Beginning of test: google search Step 1: go to the google site: www.google.com c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in `method_missing': document (WIN32OLERuntimeError) OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in `wait' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1829:in `times' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1829:in `wait' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1693:in `goto' from hotmail.rb:24 >Exit code: 1 ------------ Has anybody seen such issue? Is this known issue in watir-1.5.1.1158. Thanks and Regards, Manish From forum-watir-users at openqa.org Thu Apr 12 06:58:53 2007 From: forum-watir-users at openqa.org (Nicola Kennedy) Date: Thu, 12 Apr 2007 05:58:53 CDT Subject: [Wtr-general] Basic question re looping Message-ID: <27137155.7211176375563964.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I am trying to write a simple script (very new to Ruby) to gain an understanding of looping. My script is basically going into google, typing something into the search engine, and pressing enter. I want the script to check for a link, if it's not there press next page, search for a link, and basically carry on until the link is found and then press it. I've had lots of help on here already, and now have a script below. When I play this script, it loads the first page of the search engine, then ends saying test completed successfully. (So basically, no Next pressed, and no link found, but no errors reported). Can someone please have a look and tell me where I'm going wrong. (I know the next link will only work to go to the second page, but not sure how to just define the Next link as looking for the button instead of the actual url). TIA!! require 'watir' include Watir require 'test/unit' class TC_recorded < Test::Unit::TestCase def test_recorded ie = IE.new ie.goto("http://www.google.co.uk") ie.bring_to_front ie.text_field(:name, 'q').set("barry manilow") ie.button(:name, 'btnG').click end def click_links ie unless ie.link(:url, "http://www.classicbands.com/manilow.html").exists? ie.link(:url, 'http://www.google.co.uk/search?q=barry+manilow&hl=en&start=10&sa=N').click click_links ie else ie.link(:url, "http://www.classicbands.com/manilow.html").click end end end From forum-watir-users at openqa.org Thu Apr 12 08:13:26 2007 From: forum-watir-users at openqa.org (vamsi) Date: Thu, 12 Apr 2007 07:13:26 CDT Subject: [Wtr-general] How to verify the values in the tages Message-ID: <26249298.8301176380036439.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, i need to verify the values in the tags.. the problem occurs in this way.... Actual in application is like this: do you want to continue. click on contnue button. HTML Source : Do you want to continue
Click on continue Button. Script written like this.. Watir Recongizing this one as 'Do you want to continue. \r\n click on cconinue button." However i am not able understand "\r". can you pleae explain what does it mean by '\r'...... Script is like this : wintext1='Do you want to continue. click on cconinue button.' Watir Result is like this: <"Do you want to continue. \n Click on continue Button.> expected but was <"Do you want to continue. \r\n Click on continue Button? Can anyone help me to get '\r' to sove this problem. Thanks in Advance. Vamsi From forum-watir-users at openqa.org Thu Apr 12 08:14:57 2007 From: forum-watir-users at openqa.org (John Lolis) Date: Thu, 12 Apr 2007 07:14:57 CDT Subject: [Wtr-general] Basic question re looping In-Reply-To: <27137155.7211176375563964.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <25489826.8351176380127420.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Give this a shot require 'watir' include Watir # Lets setup our data so the code is easier to read url = "http://www.google.co.uk" search_string = "barry manilow" target_url = "http://www.classicbands.com/manilow.html" # Get IE ready to go ie = IE.new # Goto the website ie.goto(url) # Set the text in the search box ie.text_field(:name, 'q').set(search_string) # Click the search button ie.button(:name, 'btnG').click # Lets setup the control to our loop found = false # "While NOT found" (ie, keep searching until it IS found) while !found # If the link exists, do the following if ie.link(:url, target_url).exists? ie.link(:url, target_url).click found = true # If not keep searching else ie.div(:id, 'nn').click end end # The end From zeljko.filipin at gmail.com Thu Apr 12 08:47:35 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 12 Apr 2007 14:47:35 +0200 Subject: [Wtr-general] How to verify the values in the tages In-Reply-To: <26249298.8301176380036439.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <26249298.8301176380036439.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 4/12/07, vamsi wrote: > > can you pleae explain what does it mean by '\r' > Hi Vamsi, \r is substitution in string. It represents Return. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070412/48f22f3d/attachment.html From forum-watir-users at openqa.org Thu Apr 12 09:04:26 2007 From: forum-watir-users at openqa.org (Nicola Kennedy) Date: Thu, 12 Apr 2007 08:04:26 CDT Subject: [Wtr-general] Basic question re looping In-Reply-To: <27137155.7211176375563964.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <27698072.8981176383096244.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks so much, you're brilliant!!! From bret at pettichord.com Thu Apr 12 09:04:49 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 12 Apr 2007 08:04:49 -0500 Subject: [Wtr-general] Basic question re looping In-Reply-To: <27137155.7211176375563964.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <27137155.7211176375563964.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <461E2E71.7020700@pettichord.com> Nicola Kennedy wrote: > require 'watir' > include Watir > require 'test/unit' > class TC_recorded < Test::Unit::TestCase > > def test_recorded > ie = IE.new > ie.goto("http://www.google.co.uk") > ie.bring_to_front > > ie.text_field(:name, 'q').set("barry manilow") > ie.button(:name, 'btnG').click > end > > def click_links ie > unless ie.link(:url, "http://www.classicbands.com/manilow.html").exists? > ie.link(:url, 'http://www.google.co.uk/search?q=barry+manilow&hl=en&start=10&sa=N').click > click_links ie > else > ie.link(:url, "http://www.classicbands.com/manilow.html").click > end > end > end > Your problem is that your test method never calls your click_link method. You need to add a call to it, presumably as the last line of test_recorded. You also have run into a little-known limitation of Watir. It does not support Barry Manilow. And I'm not sure it ever will. Sorry. Bret From forum-watir-users at openqa.org Thu Apr 12 09:13:47 2007 From: forum-watir-users at openqa.org (Ravi) Date: Thu, 12 Apr 2007 08:13:47 CDT Subject: [Wtr-general] Basic question re looping In-Reply-To: <27137155.7211176375563964.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <27107123.9311176383657247.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Inspired by the suggestion given by Bret on a different thread :) #----------------------------------------------- require 'watir' include Watir # Lets setup our data so the code is easier to read url = "http://www.google.co.uk" search_string = "barry manilow" target_url = "http://www.classicbands.com/manilow.html" def click_links(ie,target_url) unless ie.link(:url, target_url).exists? ie.div(:id, 'nn').click click_links(ie,target_url) else ie.link(:url, target_url).click end end # Get IE ready to go ie = IE.new # Goto the website ie.goto(url) # Set the text in the search box ie.text_field(:name, 'q').set(search_string) # Click the search button ie.button(:name, 'btnG').click click_links(ie,target_url) #The end #----------------------------------------------- From forum-watir-users at openqa.org Thu Apr 12 09:20:46 2007 From: forum-watir-users at openqa.org (John Lolis) Date: Thu, 12 Apr 2007 08:20:46 CDT Subject: [Wtr-general] Basic question re looping In-Reply-To: <461E2E71.7020700@pettichord.com> Message-ID: <26001163.9361176384076388.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> You had me laughing in my cube Bret :) I am not a fanilow From forum-watir-users at openqa.org Thu Apr 12 09:41:53 2007 From: forum-watir-users at openqa.org (Nicola Kennedy) Date: Thu, 12 Apr 2007 08:41:53 CDT Subject: [Wtr-general] Basic question re looping In-Reply-To: <26001163.9361176384076388.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <26552847.9561176385343308.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> As much as I appreciate the help, putting down the great man himself will not be tolerated!!!! I did cringe after I'd posted it, and wished I'd changed it to something cooler. Sorry. From christopher.mcmahon at gmail.com Thu Apr 12 11:25:19 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 12 Apr 2007 09:25:19 -0600 Subject: [Wtr-general] How to verify the values in the tages In-Reply-To: <26249298.8301176380036439.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <26249298.8301176380036439.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70704120825j2688ede9r8ca849dd048b317a@mail.gmail.com> > Watir Result is like this: <"Do you want to continue. \n Click on continue Button.> expected but was > <"Do you want to continue. \r\n Click on continue Button? So that "\r\n" means "carriage return -- line feed", and it has a long history. http://en.wikipedia.org/wiki/Carriage_return What's bad in your situation is that Ruby (and Perl and many other languages) usually interprets "\n" to be the carriage-return-line-feed on whatever platform Ruby is installed on. But test/unit is not doing that in your case. If it were me, I would use assert_match and a regular expression, like this: ################################ require 'test/unit' class TC_Spike < Test::Unit::TestCase def test_crlf data = "first line second line" assert_match(/first line\s+second line/,data) end end ############################### change the regexp to see it fail <"first line\nsecond line"> expected to be =~ . From christopher.mcmahon at gmail.com Thu Apr 12 12:46:52 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 12 Apr 2007 10:46:52 -0600 Subject: [Wtr-general] OT: run Firefox inside Firefox Message-ID: <72799cd70704120946w59cfd744pf24fc1c6db1623c1@mail.gmail.com> This makes my head hurt: http://seejay.wordpress.com/2007/04/11/firefox-inside-firefox/ From christopher.mcmahon at gmail.com Thu Apr 12 14:05:56 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 12 Apr 2007 12:05:56 -0600 Subject: [Wtr-general] CONTRIB: search craigslist for telecommuting jobs Message-ID: <72799cd70704121105t809d0bfma6e0b40bcfa310e@mail.gmail.com> I recently finished a job search for a telecommuting job. In the course of that, I found that craigslist.org has the best job listings. However, craigslist doesn't allow you to search the whole country for jobs, you have to go state-by-state and city-by-city. I hadn't coded anything in Watir for some time, so I wrote a script that searches every city in every state on craigslist for telecommuting jobs. It was really effective. I had very interesting conversations with companies in Maine and Montana, for instance. It's in my interest to promote telecommuting in general, so I'm contributing this script hoping that it adds just that much more general interest to the subject of telecommuting for software testing jobs. ################################# require 'watir' include Watir def do_search jobs_links = [] @ie.text_field(:index, 1).set("qa") #@ie.text_field(:index, 1).set("software test") @ie.select_list(:index,1).set("jobs") @ie.button(:index,1).click @ie.checkbox(:value, "telecommuting").set @ie.button(:index,1).click unless @ie.html =~ /Nothing found for/ @ie.links.each do |j_link| if j_link.href =~ /\d+.html$/ @outfile.puts(j_link) @outfile.puts("") end #if end #do end #unless @ie.back @ie.back end #def def click_cities @city_links = [] @ie.links.each do |c_link| if ((c_link.text != "craigslist") and (c_link.text != "w") and (c_link.text != "or suggest a new one")) @city_links << c_link end #if end #do @city_links.each do |cit_link| cit_link.click do_search @ie.back end #do end #def @ie = IE.new @ie.goto("http://craigslist.org") @state_links = [] @small_state_links = [] @city_links = [] @outfile = File.new("jobslinks3.txt", "w+") @small_states = ["alaska","guam","delaware","dc","montana","n hampshire", "puerto rico","rhode island", "south dakota","wyoming","hawaii","maine","vermont"] @ie.links.each do |link| if link.href =~ /geo.craigslist.org\/iso\/us/ unless link.text == "us cities" if @small_states.include?(link.text) #puts link.text @small_state_links << link else #puts link @state_links << link end #if end #unless end #if end #do @state_links.each do |state_link| state_link.click click_cities @ie.back end @small_state_links.each do |small_link| small_link.click do_search @ie.back end From charley.baker at gmail.com Thu Apr 12 14:09:37 2007 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 12 Apr 2007 12:09:37 -0600 Subject: [Wtr-general] OT: run Firefox inside Firefox In-Reply-To: <72799cd70704120946w59cfd744pf24fc1c6db1623c1@mail.gmail.com> References: <72799cd70704120946w59cfd744pf24fc1c6db1623c1@mail.gmail.com> Message-ID: That's oddly disturbing. :) -c On 4/12/07, Chris McMahon wrote: > > This makes my head hurt: > http://seejay.wordpress.com/2007/04/11/firefox-inside-firefox/ > _______________________________________________ > 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/20070412/0cdabbe4/attachment.html From jim_matt at swbell.net Thu Apr 12 20:04:04 2007 From: jim_matt at swbell.net (jim_matt) Date: Thu, 12 Apr 2007 19:04:04 -0500 Subject: [Wtr-general] OLE error code:80070005 in Access is denied. Message-ID: <080e01c77d5f$3fcc30a0$6401a8c0@Jimsxp> Hi guys, I got the following error and am having trouble getting around it: d:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in `method_missing': document (WIN32OLERuntimeError) OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. from d:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in `wait' from d:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1829:in `times' from d:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1829:in `wait' from d:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:2577:in `click' from google-check-out.rb:33 >Exit code: 1 I searched the posts and found the following, but it did not help. I am clicking a button that takes IE to a URL in a different domain. I do eventially end up on the right page in IE, but the exception keeps the script from continuing. class Watir::IE attr_accessor :error_checkers end $ie = Watir::IE.new $ie.error_checkers = [] Does anyone have any other suggestions? Thanks, Jim Matthews -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070412/274f41ec/attachment.html From bret at pettichord.com Fri Apr 13 00:08:39 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 12 Apr 2007 23:08:39 -0500 Subject: [Wtr-general] OLE error code:80070005 in Access is denied. In-Reply-To: <080e01c77d5f$3fcc30a0$6401a8c0@Jimsxp> References: <080e01c77d5f$3fcc30a0$6401a8c0@Jimsxp> Message-ID: <461F0247.9090702@pettichord.com> jim_matt wrote: > Hi guys, > > I got the following error and am having trouble getting around it: > > d:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in > `method_missing': document (WIN32OLERuntimeError) > OLE error code:80070005 in > Access is denied. Use a previous gem. Or build from trunk. Bret From bret at pettichord.com Fri Apr 13 00:13:16 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 12 Apr 2007 23:13:16 -0500 Subject: [Wtr-general] 'method_missing': document (WIN32OLERuntimeError) In-Reply-To: <7ac2300c0704050514x1eb951c7q7296ac95fddd5b58@mail.gmail.com> References: <7ac2300c0704050514x1eb951c7q7296ac95fddd5b58@mail.gmail.com> Message-ID: <461F035C.4010000@pettichord.com> aidy lewis wrote: > I am getting this error: > > 'method_missing': document (WIN32OLERuntimeError) > > that lies @ie.document > > I am using 1.4.1. > > Here is my code > > > > require 'watir' > include Watir > require 'test\unit' > > $ie = Watir::IE.new > def browser;$ie;end > > module Login > USERNAME = browser.text_field(:name, 'user_name') > PASSWORD = browser.text_field(:name, 'password') > REMEMBER_ME = browser.checkbox(:name, 'remember_me') > SIGN_IN = browser.button(:value, 'Sign in') > end > > module Mission > LOG_OUT = browser.link(:text, /Log-out/) > end > > class TC_Mission < Test::Unit::TestCase > include Login > > > def setup > browser.goto('www.something.com') > Right here add: browser.wait This bug is fixed in 1.5. > browser.bring_to_front > browser.maximize > end > From forum-watir-users at openqa.org Fri Apr 13 01:49:29 2007 From: forum-watir-users at openqa.org (rkkanneganti) Date: Fri, 13 Apr 2007 00:49:29 CDT Subject: [Wtr-general] Selecting value from a List displayed through Autoextender In-Reply-To: <72799cd70704110802sf5f2975ye2730510165fb7f7@mail.gmail.com> Message-ID: <34462359.17691176443399536.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> i checked with changing the index to 1 or 2 or 3 it is throwing the same exception. *Unable to locate object, using index and 2* *Unable to locate object, using index and 1* *Unable to locate object, using index and 3* thanks From manishs at gs-lab.com Fri Apr 13 03:00:58 2007 From: manishs at gs-lab.com (Manish Sapariya) Date: Fri, 13 Apr 2007 12:30:58 +0530 Subject: [Wtr-general] 'method_missing': document (WIN32OLERuntimeError) In-Reply-To: <461F035C.4010000@pettichord.com> References: <7ac2300c0704050514x1eb951c7q7296ac95fddd5b58@mail.gmail.com> <461F035C.4010000@pettichord.com> Message-ID: <461F2AAA.1000609@gs-lab.com> Hi, I am facing same problem in 1.5, not sure if its the same. I had sent query regarding this on list, but had no replies. It happens always when I do goto ("www.hotmail.com") Is there any known bug in 1.5 latest gem? Any directions so that I can give more inputs to debug problem. Watir Version: watir-1.5.1.1158. Thanks and Regards, Manish Bret Pettichord wrote: > aidy lewis wrote: > >> I am getting this error: >> >> 'method_missing': document (WIN32OLERuntimeError) >> >> that lies @ie.document >> >> I am using 1.4.1. >> >> Here is my code >> >> >> >> require 'watir' >> include Watir >> require 'test\unit' >> >> $ie = Watir::IE.new >> def browser;$ie;end >> >> module Login >> USERNAME = browser.text_field(:name, 'user_name') >> PASSWORD = browser.text_field(:name, 'password') >> REMEMBER_ME = browser.checkbox(:name, 'remember_me') >> SIGN_IN = browser.button(:value, 'Sign in') >> end >> >> module Mission >> LOG_OUT = browser.link(:text, /Log-out/) >> end >> >> class TC_Mission < Test::Unit::TestCase >> include Login >> >> >> def setup >> browser.goto('www.something.com') >> >> > Right here add: > browser.wait > > This bug is fixed in 1.5. > > >> browser.bring_to_front >> browser.maximize >> end >> >> > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From forum-watir-users at openqa.org Fri Apr 13 08:35:07 2007 From: forum-watir-users at openqa.org (vamsi) Date: Fri, 13 Apr 2007 07:35:07 CDT Subject: [Wtr-general] How to post a failed message when the assert fails Message-ID: <32788017.2101176467737638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi I am using this function : assert_equal(1,2) --> when i execute this imeediatley will get the error message and stops the script execution. insetad of that , is there any way to post failed message like "expected 1, but it was 2" Thanks in advance. Regards Vamsi From zeljko.filipin at gmail.com Fri Apr 13 08:58:16 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 13 Apr 2007 14:58:16 +0200 Subject: [Wtr-general] How to post a failed message when the assert fails In-Reply-To: <32788017.2101176467737638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32788017.2101176467737638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Vamsi, Try this: irb(main):006:0> a = 1 => 1 irb(main):007:0> b = 2 => 2 irb(main):008:0> puts "expected #{a}, but it was #{b}" unless a == b expected 1, but it was 2 => nil Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070413/1974b041/attachment.html From forum-watir-users at openqa.org Fri Apr 13 08:58:50 2007 From: forum-watir-users at openqa.org (John Lolis) Date: Fri, 13 Apr 2007 07:58:50 CDT Subject: [Wtr-general] How to post a failed message when the assert fails In-Reply-To: <32788017.2101176467737638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <23935653.2481176469160135.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I'm noticing this question or very similar questions get posted a lot here (which means its a good question). I would search through the old posts and read what others said, there has been some very good posts on the subject. Below I'm posting a chunk of code that should help you answer your own question (i hope!). Also, its very early, so i may miss the mark on this, I hope it helps! def test_1 begin 1 / 0 rescue puts 'Error' end end def test_2 begin 1 / 0 rescue => e puts e end end def test_3 1 / 0 end def test_4 begin 1 / 0 rescue false end true end test_1 test_2 begin test_3 rescue => e puts "An error hash occured: #{e}" end puts test_4 From forum-watir-users at openqa.org Fri Apr 13 09:16:44 2007 From: forum-watir-users at openqa.org (Nicola Kennedy) Date: Fri, 13 Apr 2007 08:16:44 CDT Subject: [Wtr-general] Looping with excel worksheets Message-ID: <34027563.2571176470234831.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, Have written following script (which works! I'm getting there!) I now want to put a loop in so that when this is complete, it goes to the second worksheet in my excel file, basically starting the process from the beginning again and then inputs this information in the same fields. Can anyone help? TIA require 'watir' include Watir url = "http://www.zoomerang.com/recipient/survey.zgi?p=WEB225WDYJNVDT" search_string = "questionnaire" ie = IE.new ie.goto(url) ie.bring_to_front #ie.show_all_objects require 'win32ole' excel = WIN32OLE::new('excel.Application') workbook = excel.Workbooks.Open('C:\WATIR_RUBY\excel_testdata5.xls') worksheet = workbook.Worksheets(1) #get hold of the first worksheet worksheet.Select @mydata = [] @mydata = worksheet.Range('a1:a6').value # The data is in cell a1 - a6 excel['Visible'] = false # hide the spreadsheet from view workbook.close excel.Quit ie.text_field(:name, 'u_answer_58').set(@mydata[0].to_s) ie.text_field(:name, 'u_answer_59').set(@mydata[1].to_s) ie.text_field(:name, 'u_answer_60').set(@mydata[2].to_s) ie.text_field(:name, 'u_answer_61').set(@mydata[3].to_s) ie.text_field(:name, 'u_answer_62').set(@mydata[4].to_s) ie.text_field(:name, 'u_answer_63').set(@mydata[5].to_s) From forum-watir-users at openqa.org Fri Apr 13 10:16:57 2007 From: forum-watir-users at openqa.org (John Lolis) Date: Fri, 13 Apr 2007 09:16:57 CDT Subject: [Wtr-general] Good 'wrapper' sample Message-ID: <25835111.3581176473847770.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I had some time to kill this morning so I decided to toss together another 'sample'. I know when I start learning something new there is nothing better then working examples that I can modify and see how they break, so here you go. This is a 'wrapper' for the Google website. I wrote it with the intention of show a number of different things about ruby. The goal is that you should be able to take the 'Google' class and quickly generate new scripts from it. Run it, update it, modify it and have some fun :) ------------ require 'watir' include Watir # A wrapper for our global ie object # contains some special logic for creating a new IE if one doesnt' exist def browser if $ie == nil or !$ie.exists? $ie = IE.new else $ie end end # I found that the search box and the search button are the same on the home page # and the results page, so I made a module to hold them both module Generic_Search_Functions def search_box( search_string ) browser.text_field(:name, 'q').set( search_string ) end def google_search() browser.button(:name, 'btnG').click end end # This class handles issues dealing with the results page class Results # this includes the functions in the module include Generic_Search_Functions # Since the buttons are named differently I wrapped it # this is just calling the function in the above module def search() google_search() end # click the next button, handle it not being there def next() element = browser.div(:id, 'nn') if element.exists? element.click else puts 'End of the list' end end # click the previous button, handle it not being there def previous() element = browser.div(:id, 'np') if element.exists? element.click else puts 'Start of the list' end end # this just outputs the href for the search results # if it can't find it, it lets you know def search_result(index) element = browser.div(:index,'2').div(:index,'1').link(:index,index) if element.exists? puts element.href else puts 'Unable to find element' end end end # here is our main class, google # it contains both the module and the results class class Google # heres that module again! include Generic_Search_Functions # lets define our url in here # lets also create a results object so we have access to it def initialize() @url = 'http://www.google.com' @results = Results.new() end # ooooo, magic! attr_accessor :results # this navigates us to the page and checks to make sure the logo is there def go() browser.goto(@url) wait_until{ browser.image(:src, /logo.gif/).exists? } end # wrapper for the I'm feeling Lucky botton def im_feeling_lucky() browser.button(:name, 'btnI').click end end # create our new google object google = Google.new() # go to the website google.go # Input some text into the search box (this function is from the module) google.search_box('Cats') # click search (this is from the module also) google.google_search() # show us the href of the first link google.results.search_result(1) # next page please! google.results.next() # show us the href of first link on this page google.results.search_result(1) # lets go page, i liked those results better google.results.previous() # How about the second link, maybe its better google.results.search_result(2) # change the search! google.results.search_box('Dogs') # click! google.results.search() # maybe this is what i really wanted! google.results.search_result(1) From charley.baker at gmail.com Fri Apr 13 11:03:23 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 13 Apr 2007 09:03:23 -0600 Subject: [Wtr-general] Looping with excel worksheets In-Reply-To: <34027563.2571176470234831.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <34027563.2571176470234831.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Nicola, Put it in a method and call the method from within a loop: require 'watir' include Watir url = "http://www.zoomerang.com/recipient/survey.zgi?p=WEB225WDYJNVDT" search_string = "questionnaire" $ie = IE.new $ie.goto(url) $ie.bring_to_front #ie.show_all_objects require 'win32ole' def fill_fields(worksheet_no) excel = WIN32OLE::new('excel.Application') workbook = excel.Workbooks.Open('C:\WATIR_RUBY\excel_testdata5.xls') worksheet = workbook.Worksheets(worksheet_no) #get hold of the first worksheet worksheet.Select @mydata = [] @mydata = worksheet.Range('a1:a6').value # The data is in cell a1 - a6 excel['Visible'] = false # hide the spreadsheet from view workbook.close excel.Quit $ie.text_field(:name, 'u_answer_58').set(@mydata[0].to_s) $ie.text_field(:name, 'u_answer_59').set(@mydata[1].to_s) $ie.text_field(:name, 'u_answer_60').set(@mydata[2].to_s) $ie.text_field(:name, 'u_answer_61').set(@mydata[3].to_s) $ie.text_field(:name, 'u_answer_62').set(@mydata[4].to_s) $ie.text_field(:name, 'u_answer_63').set(@mydata[5].to_s) end # call the method: for i in 1..5 fill_fields(i) end Note that I've changed ie to $ie making it global so it's visible inside the method. -Charley On 4/13/07, Nicola Kennedy wrote: > > Hi, > > Have written following script (which works! I'm getting there!) > I now want to put a loop in so that when this is complete, it goes to the > second worksheet in my excel file, basically starting the process from the > beginning again and then inputs this information in the same fields. > > Can anyone help? > > TIA > > require 'watir' > include Watir > > url = "http://www.zoomerang.com/recipient/survey.zgi?p=WEB225WDYJNVDT" > search_string = "questionnaire" > > ie = IE.new > ie.goto(url) > ie.bring_to_front > #ie.show_all_objects > > require 'win32ole' > > excel = WIN32OLE::new('excel.Application') > workbook = excel.Workbooks.Open > ('C:\WATIR_RUBY\excel_testdata5.xls') > > > worksheet = workbook.Worksheets(1) #get hold of the first > worksheet > worksheet.Select > @mydata = [] > @mydata = worksheet.Range('a1:a6').value # The data is in cell a1 > - a6 > excel['Visible'] = false # hide the spreadsheet from view > workbook.close > excel.Quit > > > ie.text_field(:name, 'u_answer_58').set(@mydata[0].to_s) > ie.text_field(:name, 'u_answer_59').set(@mydata[1].to_s) > ie.text_field(:name, 'u_answer_60').set(@mydata[2].to_s) > ie.text_field(:name, 'u_answer_61').set(@mydata[3].to_s) > ie.text_field(:name, 'u_answer_62').set(@mydata[4].to_s) > ie.text_field(:name, 'u_answer_63').set(@mydata[5].to_s) > _______________________________________________ > 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/20070413/51958d53/attachment.html From charley.baker at gmail.com Fri Apr 13 11:09:00 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 13 Apr 2007 09:09:00 -0600 Subject: [Wtr-general] 'method_missing': document (WIN32OLERuntimeError) In-Reply-To: <461F2AAA.1000609@gs-lab.com> References: <7ac2300c0704050514x1eb951c7q7296ac95fddd5b58@mail.gmail.com> <461F035C.4010000@pettichord.com> <461F2AAA.1000609@gs-lab.com> Message-ID: Hi Manish, Try using the latest gem on the watir site, 1165. There's a bit of a work around for this issue in place until we get around to a longer term fix. It's the same cross site scripting frame issue which has been discussed on this list previously. -Charley On 4/13/07, Manish Sapariya wrote: > > Hi, > I am facing same problem in 1.5, not sure if its the same. I had > sent query regarding this on list, but had no replies. It happens > always when I do > > goto ("www.hotmail.com") > > Is there any known bug in 1.5 latest gem? > Any directions so that I can give more inputs to debug problem. > > Watir Version: watir-1.5.1.1158. > > > Thanks and Regards, > Manish > > > Bret Pettichord wrote: > > aidy lewis wrote: > > > >> I am getting this error: > >> > >> 'method_missing': document (WIN32OLERuntimeError) > >> > >> that lies @ie.document > >> > >> I am using 1.4.1. > >> > >> Here is my code > >> > >> > >> > >> require 'watir' > >> include Watir > >> require 'test\unit' > >> > >> $ie = Watir::IE.new > >> def browser;$ie;end > >> > >> module Login > >> USERNAME = browser.text_field(:name, 'user_name') > >> PASSWORD = browser.text_field(:name, 'password') > >> REMEMBER_ME = browser.checkbox(:name, 'remember_me') > >> SIGN_IN = browser.button(:value, 'Sign in') > >> end > >> > >> module Mission > >> LOG_OUT = browser.link(:text, /Log-out/) > >> end > >> > >> class TC_Mission < Test::Unit::TestCase > >> include Login > >> > >> > >> def setup > >> browser.goto('www.something.com') > >> > >> > > Right here add: > > browser.wait > > > > This bug is fixed in 1.5. > > > > > >> browser.bring_to_front > >> browser.maximize > >> end > >> > >> > > > > _______________________________________________ > > 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/20070413/450cd40d/attachment-0001.html From manishs at gs-lab.com Fri Apr 13 11:42:23 2007 From: manishs at gs-lab.com (Manish Sapariya) Date: Fri, 13 Apr 2007 21:12:23 +0530 Subject: [Wtr-general] 'method_missing': document (WIN32OLERuntimeError) In-Reply-To: References: <7ac2300c0704050514x1eb951c7q7296ac95fddd5b58@mail.gmail.com> <461F035C.4010000@pettichord.com> <461F2AAA.1000609@gs-lab.com> Message-ID: <461FA4DF.6010301@gs-lab.com> Hi, Thanks it works. :-) However I noted that even the site says ver 1.5.1.1165, the actual gem file is 1164. Neverthless, it works as expected. Thanks, Manish Charley Baker wrote: > Hi Manish, > > Try using the latest gem on the watir site, 1165. There's a bit of a > work around for this issue in place until we get around to a longer > term fix. It's the same cross site scripting frame issue which has > been discussed on this list previously. > > -Charley > > On 4/13/07, *Manish Sapariya* > wrote: > > Hi, > I am facing same problem in 1.5, not sure if its the same. I had > sent query regarding this on list, but had no replies. It happens > always when I do > > goto ("www.hotmail.com ") > > Is there any known bug in 1.5 latest gem? > Any directions so that I can give more inputs to debug problem. > > Watir Version: watir-1.5.1.1158. > > > Thanks and Regards, > Manish > > > Bret Pettichord wrote: > > aidy lewis wrote: > > > >> I am getting this error: > >> > >> 'method_missing': document (WIN32OLERuntimeError) > >> > >> that lies @ie.document > >> > >> I am using 1.4.1. > >> > >> Here is my code > >> > >> > >> > >> require 'watir' > >> include Watir > >> require 'test\unit' > >> > >> $ie = Watir:: IE.new > >> def browser;$ie;end > >> > >> module Login > >> USERNAME = browser.text_field(:name, 'user_name') > >> PASSWORD = browser.text_field(:name, 'password') > >> REMEMBER_ME = browser.checkbox(:name, 'remember_me') > >> SIGN_IN = browser.button(:value, 'Sign in') > >> end > >> > >> module Mission > >> LOG_OUT = browser.link (:text, /Log-out/) > >> end > >> > >> class TC_Mission < Test::Unit::TestCase > >> include Login > >> > >> > >> def setup > >> browser.goto(' www.something.com ') > >> > >> > > Right here add: > > browser.wait > > > > This bug is fixed in 1.5. > > > > > >> browser.bring_to_front > >> browser.maximize > >> end > >> > >> > > > > _______________________________________________ > > 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 > > > > -- > This message has been scanned for viruses and > dangerous content by *MailScanner* , and is > believed to be clean. > ------------------------------------------------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From charley.baker at gmail.com Fri Apr 13 11:57:33 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 13 Apr 2007 09:57:33 -0600 Subject: [Wtr-general] 'method_missing': document (WIN32OLERuntimeError) In-Reply-To: <461FA4DF.6010301@gs-lab.com> References: <7ac2300c0704050514x1eb951c7q7296ac95fddd5b58@mail.gmail.com> <461F035C.4010000@pettichord.com> <461F2AAA.1000609@gs-lab.com> <461FA4DF.6010301@gs-lab.com> Message-ID: The gem pulls it's version number from watir.rb which gets updated when it gets checked in. The last change was to winclicker which brings the supporting files up to version 1165 though the gem says 1164. -Charley On 4/13/07, Manish Sapariya wrote: > > Hi, > Thanks it works. :-) > However I noted that even the site says ver 1.5.1.1165, > the actual gem file is 1164. Neverthless, it works as expected. > Thanks, > Manish > > Charley Baker wrote: > > Hi Manish, > > > > Try using the latest gem on the watir site, 1165. There's a bit of a > > work around for this issue in place until we get around to a longer > > term fix. It's the same cross site scripting frame issue which has > > been discussed on this list previously. > > > > -Charley > > > > On 4/13/07, *Manish Sapariya* > > wrote: > > > > Hi, > > I am facing same problem in 1.5, not sure if its the same. I had > > sent query regarding this on list, but had no replies. It happens > > always when I do > > > > goto ("www.hotmail.com ") > > > > Is there any known bug in 1.5 latest gem? > > Any directions so that I can give more inputs to debug problem. > > > > Watir Version: watir-1.5.1.1158. > > > > > > Thanks and Regards, > > Manish > > > > > > Bret Pettichord wrote: > > > aidy lewis wrote: > > > > > >> I am getting this error: > > >> > > >> 'method_missing': document (WIN32OLERuntimeError) > > >> > > >> that lies @ie.document > > >> > > >> I am using 1.4.1. > > >> > > >> Here is my code > > >> > > >> > > >> > > >> require 'watir' > > >> include Watir > > >> require 'test\unit' > > >> > > >> $ie = Watir:: IE.new > > >> def browser;$ie;end > > >> > > >> module Login > > >> USERNAME = browser.text_field(:name, 'user_name') > > >> PASSWORD = browser.text_field(:name, 'password') > > >> REMEMBER_ME = browser.checkbox(:name, 'remember_me') > > >> SIGN_IN = browser.button(:value, 'Sign in') > > >> end > > >> > > >> module Mission > > >> LOG_OUT = browser.link (:text, /Log-out/) > > >> end > > >> > > >> class TC_Mission < Test::Unit::TestCase > > >> include Login > > >> > > >> > > >> def setup > > >> browser.goto(' www.something.com ') > > >> > > >> > > > Right here add: > > > browser.wait > > > > > > This bug is fixed in 1.5. > > > > > > > > >> browser.bring_to_front > > >> browser.maximize > > >> end > > >> > > >> > > > > > > _______________________________________________ > > > 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 > > > > > > > > -- > > This message has been scanned for viruses and > > dangerous content by *MailScanner* , and > is > > believed to be clean. > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > 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/20070413/01a54879/attachment.html From paul_hammer at hotmail.com Fri Apr 13 12:36:45 2007 From: paul_hammer at hotmail.com (Paul Hammer) Date: Fri, 13 Apr 2007 16:36:45 +0000 Subject: [Wtr-general] selecting an item from a list using a regular expression Message-ID: I have items I'm trying to pick from a select list of this form: - For example, the list might be: 4 - Denver 5 - Atlanta 1950 - New York City The items in the list are always changing, and I want to pick an item by just the number. So, this actually works to select the last item in the list above: @ie.select_list( :name , "groupID").select(/1950 - /) However, I have the number (the groupDI) in a variable. So the question is: How does one get the value of a variable into a regular expression? Paul Hammer _________________________________________________________________ Download Messenger. Join the i?m Initiative. Help make a difference today. http://im.live.com/messenger/im/home/?source=TAGHM_APR07 From christopher.mcmahon at gmail.com Fri Apr 13 12:50:21 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 13 Apr 2007 10:50:21 -0600 Subject: [Wtr-general] selecting an item from a list using a regular expression In-Reply-To: References: Message-ID: <72799cd70704130950o6d4a529bu1432479600cdaec9@mail.gmail.com> > How does one get the value of a variable into a regular expression? require 'test/unit' class TC_Spike < Test::Unit::TestCase def test_1950 var = 1950 data = "xxx1950xxx" assert_match(/#{var}/,data) end end From arkie at compli.com Fri Apr 13 13:07:18 2007 From: arkie at compli.com (Alan Ark) Date: Fri, 13 Apr 2007 12:07:18 -0500 Subject: [Wtr-general] How to post a failed message when the assert fails In-Reply-To: <32788017.2101176467737638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32788017.2101176467737638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of vamsi Sent: Friday, April 13, 2007 5:35 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] How to post a failed message when the assert fails Hi I am using this function : assert_equal(1,2) --> when i execute this imeediatley will get the error message and stops the script execution. insetad of that , is there any way to post failed message like "expected 1, but it was 2" Thanks in advance. Regards Vamsi _______________________________________________ [Arkie] What happens when you try assert_equal(1,2,"expected 1, but it was 2") I'm pretty sure that the assertions takes in an optional message to be displayed when the assert fails. -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 269.2.0/757 - Release Date: 4/11/2007 5:14 PM From Mark_Cain at RL.gov Fri Apr 13 13:05:09 2007 From: Mark_Cain at RL.gov (Cain, Mark) Date: Fri, 13 Apr 2007 10:05:09 -0700 Subject: [Wtr-general] JS Alert from a checkbox Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A377E@EX01-2.rl.gov> I have a JS Alert that popups from clicking a checkbox. How can I use the click_no_wait functionality for the 'set' method of the checkbox? Thanks, ____________________ Mark L. Cain LMIT - E*STARS(r) ~ Lead Test Engineer 1981 Snyder, MSIN: G3-62, Richland, WA 99354 Mark_Cain at RL.gov 509.376.5458 "640 Kilobytes of computer memory ought to be enough for anybody." - Bill Gates, 1981 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070413/3d7f1fe6/attachment-0001.html From paul_hammer at hotmail.com Fri Apr 13 13:33:29 2007 From: paul_hammer at hotmail.com (Paul Hammer) Date: Fri, 13 Apr 2007 17:33:29 +0000 Subject: [Wtr-general] selecting an item from a list using a regularexpression In-Reply-To: <72799cd70704130950o6d4a529bu1432479600cdaec9@mail.gmail.com> Message-ID: Thanks Chris. That works fine. Paul >From: "Chris McMahon" >Reply-To: wtr-general at rubyforge.org >To: wtr-general at rubyforge.org >Subject: Re: [Wtr-general] selecting an item from a list using a >regularexpression >Date: Fri, 13 Apr 2007 10:50:21 -0600 > > > How does one get the value of a variable into a regular expression? > >require 'test/unit' > >class TC_Spike < Test::Unit::TestCase > def test_1950 > >var = 1950 >data = "xxx1950xxx" > >assert_match(/#{var}/,data) >end >end >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _________________________________________________________________ Get a FREE Web site, company branded e-mail and more from Microsoft Office Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/ From sbtang1 at hotmail.com Fri Apr 13 17:25:42 2007 From: sbtang1 at hotmail.com (Steve Tangsombatvisit) Date: Fri, 13 Apr 2007 14:25:42 -0700 Subject: [Wtr-general] Finding out how much space remain on a drive? References: <40478836.1173304594473.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi folks, Is there a quick and easy way to find out how much disk space remains on a drive using Ruby, or how much space is currently being used? Thanks, Steve From vikashkumar051 at yahoo.co.in Sat Apr 14 08:10:41 2007 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Sat, 14 Apr 2007 17:40:41 +0530 (IST) Subject: [Wtr-general] problem in attaching to browser using FireWatir Message-ID: <533935.26965.qm@web7803.mail.in.yahoo.com> I am trying to attach to a browser using title, If I am using watir, I can just attach to a browser using: require 'watir' ie = Watir::IE.attach(:title,"Google") But, In case of firewatir, I am facing problem, i.e. when I use : require 'firewatir' ff = FireWatir::Firefox.attach(:title,"Google") I am getting the below error message: NoMethodError: undefined method `attach' for FireWatir::Firefox:Class But, with some changes with the code I can attach to some another browser: require 'firewatir' ff = FireWatir::Firefox.start("www.yahoo.com") ff_new = ff.attach(:title,"Google") But, I don't want to open a browser, my requirement is to just attach to the existing browser, is there is some way of doing this, as we can do with "watir". Please, help me out. Thanks in advance Vikash Send a FREE SMS to your friend's mobile from Yahoo! Messenger. Get it now at http://in.messenger.yahoo.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070414/d7f77e77/attachment.html From phlip2005 at gmail.com Sat Apr 14 12:03:45 2007 From: phlip2005 at gmail.com (Phlip) Date: Sat, 14 Apr 2007 09:03:45 -0700 Subject: [Wtr-general] [ANN] Test Driven Ajax - assert_xpath, assert_javascript, & assert_ajax Message-ID: <025801c77eae$7c44ee50$6401a8c0@Marley> Railsers et al: Anyone developing Ajax applications needs to read my new Short Cut, at O'Reilly: http://www.oreilly.com/catalog/9780596510657/ "Test Driven Ajax (on Rails)" The paper shows how to write an Ajax website using these new assertions: . assert_xml - check that HTML is XHTML and parsable . assert_xpath - parse XHTML and extract specific details . assert_js - parse JavaScript (without Regexp!) for details . assert_ajax - run assertions when an Ajax command completes The paper shows how to grow a test runner in a web page. It tests a target website inside an IFRAME. -- Phlip http://flea.sourceforge.net/PiglegToo_1.html From angrez at gmail.com Sun Apr 15 23:51:13 2007 From: angrez at gmail.com (Angrez Singh) Date: Mon, 16 Apr 2007 09:21:13 +0530 Subject: [Wtr-general] problem in attaching to browser using FireWatir In-Reply-To: <533935.26965.qm@web7803.mail.in.yahoo.com> References: <533935.26965.qm@web7803.mail.in.yahoo.com> Message-ID: Hi Vikash, Can you please clarify what you want to do? What I think is, there is a browser and you want to attach to it? Correct? But how you open that browser is my question? Regards, Angrez On 4/14/07, VIKASH KUMAR wrote: > > I am trying to attach to a browser using title, If I am using watir, I can > just attach to a browser using: > > > > require 'watir' > > ie = Watir::IE.attach(:title,"Google") > > > > But, In case of firewatir, I am facing problem, i.e. when I use : > > require 'firewatir' > > ff = FireWatir::Firefox.attach(:title,"Google") > > > > I am getting the below error message: > > NoMethodError: undefined method `attach' for FireWatir::Firefox:Class > > > > But, with some changes with the code I can attach to some another browser: > > require 'firewatir' > > ff = FireWatir::Firefox.start("www.yahoo.com") > > ff_new = ff.attach(:title,"Google") > > > > But, I don't want to open a browser, my requirement is to just attach to > the existing browser, is there is some way of doing this, as we can do with > "watir". > > > > Please, help me out. > > Thanks in advance > > Vikash > > > > > > ------------------------------ > Check out what you're missing if you're not on Yahoo! Messenger > > _______________________________________________ > 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/20070416/3a0de1bf/attachment.html From forum-watir-users at openqa.org Mon Apr 16 00:57:47 2007 From: forum-watir-users at openqa.org (Neel) Date: Sun, 15 Apr 2007 23:57:47 CDT Subject: [Wtr-general] I am having doubts in Selenium and ajax. In-Reply-To: <32788017.2101176467737638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <33543554.13921176699497135.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> When i click a link ,an ajax form opens there it self. Using selenium i can get the form but am not able to enter the values. Its throwing me an error Element not found, But i used the correct element only. I tried using wait_for_page_to_load() also. then its throwing me Time out error. So wat should i do to over come this problem?? From vikashkumar051 at yahoo.co.in Mon Apr 16 03:49:58 2007 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Mon, 16 Apr 2007 13:19:58 +0530 (IST) Subject: [Wtr-general] problem in attaching to browser using FireWatir Message-ID: <37920.54619.qm@web7809.mail.in.yahoo.com> Hi Angrez, My requirement is to just attach the script to some already open browser, I have open that browser manually. Thanks & Regards, Vikash >Hi Vikash, >Can you please clarify what you want to do? What I think is, there is a >browser and you want to attach to it? Correct? Yes, there is a browser and I want my script to attach with that browser. >But how you open that browser is my question? I have opened that browser manually, there is some title in that, and using this title I want to attach the script, as we can attach to some already open page in watir viz. ie = Watir::IE.attach(:title,"Google") >Regards, >Angrez >> I am trying to attach to a browser using title, If I am using watir, I can >> just attach to a browser using: >> require 'watir' >> ie = Watir::IE.attach(:title,"Google") >> But, In case of firewatir, I am facing problem, i.e. when I use : >> require 'firewatir' >> ff = FireWatir::Firefox.attach(:title,"Google") >> I am getting the below error message: >> NoMethodError: undefined method `attach' for FireWatir::Firefox:Class >> But, with some changes with the code I can attach to some another browser: >> require 'firewatir' >> ff = FireWatir::Firefox.start("www.yahoo.com") >> ff_new = ff.attach(:title,"Google") >> But, I don't want to open a browser, my requirement is to just attach to >> the existing browser, is there is some way of doing this, as we can do with >> "watir". >> Please, help me out. >> Thanks in advance >> Vikash Send a FREE SMS to your friend's mobile from Yahoo! Messenger. Get it now at http://in.messenger.yahoo.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070416/26308a81/attachment.html From forum-watir-users at openqa.org Mon Apr 16 04:36:31 2007 From: forum-watir-users at openqa.org (vamsi) Date: Mon, 16 Apr 2007 03:36:31 CDT Subject: [Wtr-general] How to verify the values in the tages In-Reply-To: <72799cd70704120825j2688ede9r8ca849dd048b317a@mail.gmail.com> Message-ID: <27064685.3551176712621355.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> thanks for your help and it is working for single return... however i have 2 carriage returns after first line. ex: data="first line second line" so it will appear as "first line \r\n\r\r second line" ... could you please help what need to be added for regular expression to solve this issue. Thanks in Advance. Regards Vamsi From WKruse at multichoice.co.za Mon Apr 16 08:30:59 2007 From: WKruse at multichoice.co.za (Walter Kruse) Date: Mon, 16 Apr 2007 14:30:59 +0200 Subject: [Wtr-general] [OT] - array nightmare Message-ID: Hi list Off topic, but I am sure there is a better way to do what I'm doing. As my test script runs, I have a script which reads the windows event log every 5 minutes and produces three flat files with the output according to different criteria. The way I read the logs is with Microsoft's dumpel.exe utility which is called with system() and parameters from ruby. But, I need a continuous log file, so at the beginning of the script I create a master log file. Everytime the three new temp log files are written, I read the data into an array. I also read the master log file into an array. Then I have a simple if: oldbuffer = logfile.to_a newbuffer = nil newbuffer = rebootedarray.to_a | clearedarray.to_a | temparray.to_a newbuffer.each {|item| if not oldbuffer.include?(item) oldbuffer.push(item) if item > ' ' end } logfile.truncate 0 oldbuffer = oldbuffer.sort.uniq logfile.puts(oldbuffer) The new array replaces all the data previously in the master log file. I get a lot of redundant whitespace for some reason. It really is a hack - there must be a better way to do it... Walter Kruse Senior Test Analyst www.OBS-Consulting.com 082 660 7288 http://www.ou-ryperd.net ************************************************************************************************************************** Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and destroy the original message. ************************************************************************************************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070416/92d01876/attachment-0001.html From Mark_Cain at RL.gov Mon Apr 16 09:56:53 2007 From: Mark_Cain at RL.gov (Cain, Mark) Date: Mon, 16 Apr 2007 06:56:53 -0700 Subject: [Wtr-general] JS Alert from a checkbox In-Reply-To: <4440693B7CFF2440ABC2E0BE480DABA10A377E@EX01-2.rl.gov> References: <4440693B7CFF2440ABC2E0BE480DABA10A377E@EX01-2.rl.gov> Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A3780@EX01-2.rl.gov> Does anyone have an answer to this? I can't seem to get the click_no_wait to work for checkboxes. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Friday, April 13, 2007 10:05 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] JS Alert from a checkbox I have a JS Alert that popups from clicking a checkbox. How can I use the click_no_wait functionality for the 'set' method of the checkbox? Thanks, ____________________ Mark L. Cain LMIT - E*STARS(r) ~ Lead Test Engineer 1981 Snyder, MSIN: G3-62, Richland, WA 99354 Mark_Cain at RL.gov 509.376.5458 "640 Kilobytes of computer memory ought to be enough for anybody." - Bill Gates, 1981 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070416/7f4081da/attachment.html From christopher.mcmahon at gmail.com Mon Apr 16 12:02:24 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 16 Apr 2007 10:02:24 -0600 Subject: [Wtr-general] How to verify the values in the tages In-Reply-To: <27064685.3551176712621355.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <72799cd70704120825j2688ede9r8ca849dd048b317a@mail.gmail.com> <27064685.3551176712621355.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70704160902n42db1999h13fe978b81d40838@mail.gmail.com> "\s+" means "match any white space characters", so the regex will match any number of tabs, spaces, crs, and/or lfs. On 4/16/07, vamsi wrote: > thanks for your help and it is working for single return... however i have 2 carriage returns after first line. > > ex: data="first line > > second line" > > so it will appear as "first line \r\n\r\r second line" ... > > could you please help what need to be added for regular expression to solve this issue. > > Thanks in Advance. > > Regards > Vamsi > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From christopher.mcmahon at gmail.com Mon Apr 16 12:10:58 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 16 Apr 2007 10:10:58 -0600 Subject: [Wtr-general] [OT] - array nightmare In-Reply-To: References: Message-ID: <72799cd70704160910j3586eb09tbefd394d9602e77c@mail.gmail.com> > The new array replaces all the data previously in the master log file. I get > a lot of redundant whitespace for some reason. It really is a hack ? there > must be a better way to do it? > I'm not sure what the expected result here should be. Seems like a reasonable approach. What part is the hackiest? From michael.a.bolton at gmail.com Mon Apr 16 16:34:26 2007 From: michael.a.bolton at gmail.com (Michael Bolton) Date: Mon, 16 Apr 2007 16:34:26 -0400 Subject: [Wtr-general] Finding out how much space remain on a drive? In-Reply-To: Message-ID: <063201c78066$a05ce310$6701a8c0@Koko> On my Windows XP system, this appears to work: class Dir def Dir.free_space dir = `dir` dir =~ /([0-9,]*)\sbytes free/ bytes_free = $1.delete(",") return bytes_free.to_i end end puts Dir.free_space.to_s ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Steve Tangsombatvisit Sent: April 13, 2007 5:26 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Finding out how much space remain on a drive? Hi folks, Is there a quick and easy way to find out how much disk space remains on a drive using Ruby, or how much space is currently being used? Thanks, Steve _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Mon Apr 16 17:50:39 2007 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 16 Apr 2007 16:50:39 -0500 Subject: [Wtr-general] How to post a failed message when the assert fails In-Reply-To: <32788017.2101176467737638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32788017.2101176467737638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4623EFAF.5030700@pettichord.com> vamsi wrote: > I am using this function : assert_equal(1,2) --> when i execute this imeediatley will get the error message and stops the script execution. > > insetad of that , is there any way to post failed message like "expected 1, but it was 2" > require 'test/unit/assertions' module Watir # Verification methods module Assertions include Test::Unit::Assertions # Log a failure if the boolean is true. The message is the failure # message logged. # Whether true or false, the assertion count is incremented. def verify boolean, message = 'verify failed.' add_assertion add_failure message, caller unless boolean end def verify_equal expected, actual, message=nil full_message = build_message(message, < expected but was . EOT verify(expected == actual, full_message) end def verify_match pattern, string, message=nil pattern = case(pattern) when String Regexp.new(Regexp.escape(pattern)) else pattern end full_message = build_message(message, " expected to be =~\n.", string, pattern) verify(string =~ pattern, full_message) end end end # Tests # 3 tests, 10 assertions, 4 failures, 0 errors class VerifyTests < Watir::TestCase def test_verify verify true assert true verify false assert true end def test_verify_equal verify_equal 1, 1 verify_equal 1, 2 verify_equal 3, 4 end def test_verify_match verify_match /\d*/, '123' verify_match 'foo', 'foobar' verify_match '...', 'A' end end From forum-watir-users at openqa.org Tue Apr 17 01:42:51 2007 From: forum-watir-users at openqa.org (vamsi) Date: Tue, 17 Apr 2007 00:42:51 CDT Subject: [Wtr-general] How to verify the values in the tages In-Reply-To: <72799cd70704160902n42db1999h13fe978b81d40838@mail.gmail.com> Message-ID: <32855123.321176788601722.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> i'm sorry, '\s+' is not working for multiple Carry returns( new line sapces) could you please assist me any other alternative? Regards Vamsi From christopher.mcmahon at gmail.com Tue Apr 17 01:49:01 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 16 Apr 2007 23:49:01 -0600 Subject: [Wtr-general] How to verify the values in the tages In-Reply-To: <32855123.321176788601722.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <72799cd70704160902n42db1999h13fe978b81d40838@mail.gmail.com> <32855123.321176788601722.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70704162249jea8385ak653603e5d5202676@mail.gmail.com> On 4/16/07, vamsi wrote: > i'm sorry, '\s+' is not working for multiple Carry returns( new line sapces) could you please assist me any other alternative? > You'll have to supply more detailed information: what code are you using, what error are you getting? From WKruse at multichoice.co.za Tue Apr 17 02:00:20 2007 From: WKruse at multichoice.co.za (Walter Kruse) Date: Tue, 17 Apr 2007 08:00:20 +0200 Subject: [Wtr-general] [OT] - array nightmare In-Reply-To: <72799cd70704160910j3586eb09tbefd394d9602e77c@mail.gmail.com> References: <72799cd70704160910j3586eb09tbefd394d9602e77c@mail.gmail.com> Message-ID: Hi Chris I think the biggest issue is the difference between File.read and IO.readlines, and understanding when an array or a string is returned. I'm not comfortable with truncating the original file either. What I would like to do is get the latest data, see what's not in the main file, and append it. What I do now, is get the latest data, put the existing file into an array, merge the two and hack it with Array.sort.uniq, truncate the file and insert the new data. Anyway, as I said, off topic so don't worry too much - this solves a sort-term problem. Kind regards Walter -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: 16 April 2007 06:11 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] [OT] - array nightmare > The new array replaces all the data previously in the master log file. I get > a lot of redundant whitespace for some reason. It really is a hack - there > must be a better way to do it... > I'm not sure what the expected result here should be. Seems like a reasonable approach. What part is the hackiest? _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ************************************************************************************************************************** Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and destroy the original message. ************************************************************************************************************************** From forum-watir-users at openqa.org Tue Apr 17 02:01:20 2007 From: forum-watir-users at openqa.org (vamsi) Date: Tue, 17 Apr 2007 01:01:20 CDT Subject: [Wtr-general] How to verify the values in the tages In-Reply-To: <72799cd70704160902n42db1999h13fe978b81d40838@mail.gmail.com> Message-ID: <33602755.681176789710257.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> require 'test/unit' class TC_Spike < Test::Unit::TestCase def test_crlf data = "first line second line" assert_match(,data, /first line\s+second line/) end end error: "first line\r\n\r\nsecond line" expected but acutal was "/fist line\s+secondling/" Thanks for your support From forum-watir-users at openqa.org Tue Apr 17 04:59:48 2007 From: forum-watir-users at openqa.org (Sadeesh Vinoth) Date: Tue, 17 Apr 2007 03:59:48 CDT Subject: [Wtr-general] Watir and smartclient Message-ID: <25168087.2801176800418516.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, Can we use Watir for testing applications developed using smartclient. (Smartclient will use javascript elements instead of HTML elements.) Thanks, Sadeesh Vinoth T From forum-watir-users at openqa.org Tue Apr 17 05:19:51 2007 From: forum-watir-users at openqa.org (radha) Date: Tue, 17 Apr 2007 04:19:51 CDT Subject: [Wtr-general] Reading sheet in Excel Book using name of the Sheet Message-ID: <36397392.2851176801621596.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I have more than one sheet in excel work book for my test data.. *I want to refer each sheet using name of the sheet.* I know how to refer each sheet by number excel = WIN32OLE::new('excel.Application') workbook = excel.Workbooks.Open('C:\Documents and Settings\kennedyn\My Documents\WATIR_RUBY\excel_testdata2.xls') worksheet = workbook.Worksheets(1) #get hold of the first worksheet worksheet.Select From forum-watir-users at openqa.org Tue Apr 17 05:21:55 2007 From: forum-watir-users at openqa.org (Sadeesh Vinoth) Date: Tue, 17 Apr 2007 04:21:55 CDT Subject: [Wtr-general] Reading sheet in Excel Book using name of the Sheet In-Reply-To: <36397392.2851176801621596.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <27596408.2901176801745680.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> You can give the name of each sheet in double quotes instead of sheet number. From forum-watir-users at openqa.org Tue Apr 17 09:27:47 2007 From: forum-watir-users at openqa.org (Madhu) Date: Tue, 17 Apr 2007 08:27:47 CDT Subject: [Wtr-general] Will WATIR support MS SQL 2005, if so what are the connections to include. Message-ID: <31639138.9901176816497540.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, help me out Can WATIR support MS SQL 2005. Presently i'm using ruby SciTE. I'm unable to locate any doints or ideas as to how to connect my application with the MS sql 2005. If any of u have a solution share it with me :) From jfitisoff at yahoo.com Tue Apr 17 10:53:32 2007 From: jfitisoff at yahoo.com (John Fitisoff) Date: Tue, 17 Apr 2007 07:53:32 -0700 (PDT) Subject: [Wtr-general] Will WATIR support MS SQL 2005, if so what are the connections to include. In-Reply-To: <31639138.9901176816497540.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <359044.64829.qm@web54106.mail.re2.yahoo.com> http://www.ruby-forum.com/topic/64065 --- Madhu wrote: > Hi, help me out > Can WATIR support MS SQL 2005. > Presently i'm using ruby SciTE. > I'm unable to locate any doints or ideas as to how > to connect my application with the MS sql 2005. > If any of u have a solution share it with me :) > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From bret at pettichord.com Tue Apr 17 11:47:39 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 17 Apr 2007 10:47:39 -0500 Subject: [Wtr-general] How to verify the values in the tages In-Reply-To: <33602755.681176789710257.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <33602755.681176789710257.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4624EC1B.3000501@pettichord.com> vamsi wrote: > require 'test/unit' > > class TC_Spike < Test::Unit::TestCase > def test_crlf > > data = "first line > > second line" > > assert_match(,data, /first line\s+second line/) > end > end > > error: "first line\r\n\r\nsecond line" expected but acutal was "/fist line\s+secondling/" > Please show your original script. The one that says Do you want to continue
Click on continue Button. Bret From bret at pettichord.com Tue Apr 17 11:49:46 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 17 Apr 2007 10:49:46 -0500 Subject: [Wtr-general] [OT] - array nightmare In-Reply-To: References: <72799cd70704160910j3586eb09tbefd394d9602e77c@mail.gmail.com> Message-ID: <4624EC9A.6000309@pettichord.com> Walter Kruse wrote: > Anyway, as I said, off topic so don't worry too much - this solves a > sort-term problem. > Just to be clear. I don't consider this line of questions to be off topic. Yes technically they are Ruby questions rather than Watir questions, but the are welcome on this forum. Bret From christopher.mcmahon at gmail.com Tue Apr 17 11:53:55 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 17 Apr 2007 09:53:55 -0600 Subject: [Wtr-general] [OT] - array nightmare In-Reply-To: References: <72799cd70704160910j3586eb09tbefd394d9602e77c@mail.gmail.com> Message-ID: <72799cd70704170853jfc3a58ar81042060afcadac8@mail.gmail.com> > I'm not comfortable with truncating the original file either. What I > would like to do is get the latest data, see what's not in the main > file, and append it. I'm reading this sentence as a set of requirements. Assuming that the arrays are small enough to not blow out the RAM on the machine, I'd do it like this: ########################## main_file = ['a','b','c',' '] latest_data = ['c','x'] not_in_main_file = latest_data - main_file puts "not in main file: " puts not_in_main_file puts "" new_log = main_file + not_in_main_file puts "new log contents after addition: " puts new_log From christopher.mcmahon at gmail.com Tue Apr 17 11:55:51 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 17 Apr 2007 09:55:51 -0600 Subject: [Wtr-general] How to verify the values in the tages In-Reply-To: <33602755.681176789710257.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <72799cd70704160902n42db1999h13fe978b81d40838@mail.gmail.com> <33602755.681176789710257.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70704170855m113fd374naf82f19a9d72454d@mail.gmail.com> > error: "first line\r\n\r\nsecond line" expected but acutal was "/fist line\s+secondling/" Your application has badly misspelled the message to the user. From prema.arya at gmail.com Tue Apr 17 11:57:23 2007 From: prema.arya at gmail.com (Prema Arya) Date: Tue, 17 Apr 2007 21:27:23 +0530 Subject: [Wtr-general] FireWatir 1.0.2 released Message-ID: <27915010704170857y1753b5bcpa3a804d94e770344@mail.gmail.com> Hi, We have released FireWatir Version 1.0.2. This version is platform independent. Though not tested on Linux and Mac by FireWatir team due to lack of resources/time, its been used by people on different platforms. In this version we concentrated more on filling gaps between scripts written for Watir and FireWatir, your continuous feedback helped us a lot. Along with the bug fixes, this version includes: 1. to_s for all the elements which returns element specific attributes along with attributes that apply to all the elements. 2. Iterators for all the elements. 3. show_all_objects. 4. Support to wait for Firefox to load the page in case there is redirect on the page that is currently loading. 5. Code documentation. - You can download the new gem *firewater-1.0.2.gem * and xpi (for Linux also courtesy *Viktor Zigo*) from : http://code.google.com/p/firewatir/downloads/list - You can download the code from svn branch http://firewatir.googlecode.com/svn/trunk/ - The release notes lists all the new features in detail at http://code.google.com/p/firewatir/wiki/ReleaseNotes - The installation guide document : http://code.google.com/p/firewatir/downloads/list - The installation guide for different OS : http://code.google.com/p/firewatir/wiki/FireWatir_Installation - If you find any issue using it, please mail to Firewatir google group (firewatir at googlegroups.com) or log an issue to the issue tracker at http://code.google.com/p/firewatir/issues/list . Hope you will have good experience using the new version of FireWatir! Regards, FireWatir Team. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070417/119fc1c7/attachment.html From forum-watir-users at openqa.org Tue Apr 17 15:24:28 2007 From: forum-watir-users at openqa.org (Gary) Date: Tue, 17 Apr 2007 14:24:28 CDT Subject: [Wtr-general] Verifying Values of Cookies Message-ID: <40764017.11911176837899019.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am somewhat new to watir, and I am trying to figure out how to read and assert the value(s) of multiple cookies that are set by our software. Is this even possible with watir? I have seen some references to cookie manager, but it seems to be unsupported and generally unused. Some snippets of code or examples would really come in handy. Thanks in advance, lokispeak From esjewett at gmail.com Tue Apr 17 21:23:34 2007 From: esjewett at gmail.com (Ethan Jewett) Date: Tue, 17 Apr 2007 20:23:34 -0500 Subject: [Wtr-general] JS Alert from a checkbox In-Reply-To: <4440693B7CFF2440ABC2E0BE480DABA10A3780@EX01-2.rl.gov> References: <4440693B7CFF2440ABC2E0BE480DABA10A377E@EX01-2.rl.gov> <4440693B7CFF2440ABC2E0BE480DABA10A3780@EX01-2.rl.gov> Message-ID: <68f4a0e80704171823x5a1e8ab0q9975a03c466cf07f@mail.gmail.com> This (http://jira.openqa.org/browse/WTR-146) ticket and patch outlines a possible framework for dealing with this throughout watir. Might be a decent reason to vote for the feature on Jira. In the meantime, the method of modifying the methods in watir.rb in the patch should work for your problem as well, but you'll be stuck patching watir.rb every time you install. Ethan On 4/16/07, Cain, Mark wrote: > > > > > Does anyone have an answer to this? I can't seem to get the click_no_wait > to work for checkboxes. > > > > > > --Mark > > > > ________________________________ > > > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of > Cain, Mark > Sent: Friday, April 13, 2007 10:05 AM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] JS Alert from a checkbox > > > > > I have a JS Alert that popups from clicking a checkbox. How can I use the > click_no_wait functionality for the 'set' method of the checkbox? > > > > Thanks, > > ____________________ > Mark L. Cain > LMIT - E*STARS(r) ~ Lead Test Engineer > 1981 Snyder, MSIN: G3-62, Richland, WA 99354 > Mark_Cain at RL.gov > 509.376.5458 > "640 Kilobytes of computer memory ought to be enough for anybody." - Bill > Gates, 1981 > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From charley.baker at gmail.com Tue Apr 17 22:35:08 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 17 Apr 2007 20:35:08 -0600 Subject: [Wtr-general] Will WATIR support MS SQL 2005, if so what are the connections to include. In-Reply-To: <359044.64829.qm@web54106.mail.re2.yahoo.com> References: <31639138.9901176816497540.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <359044.64829.qm@web54106.mail.re2.yahoo.com> Message-ID: As John's link points out, this is not a watir related question but one covered by other libraries in Ruby, notably either dbi which is mentioned in this posting and likely ActiveRecord. It's important to make the distinction and understand the difference between Ruby as a programming languages and the libraries that are written in Ruby, Watir being one of them, dbi is another, rubyforge has quite a few more. If you understand this distinction then you can use google and rubyforge to search for information that might be able to help out (i.e. 'ruby database mssql' or something of the sort). This is more of a general message rather than entirely specific to your posting. We certainly have off topic or tangentially related conversations here and there which is great, but I find several people new to Ruby and Watir who don't seem to understand the distinction between the two. Maybe this needs to go into the FAQ? -Charley On 4/17/07, John Fitisoff wrote: > > http://www.ruby-forum.com/topic/64065 > > --- Madhu wrote: > > > Hi, help me out > > Can WATIR support MS SQL 2005. > > Presently i'm using ruby SciTE. > > I'm unable to locate any doints or ideas as to how > > to connect my application with the MS sql 2005. > > If any of u have a solution share it with me :) > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.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/20070417/73aafd6c/attachment.html From jim_matt at swbell.net Tue Apr 17 23:59:02 2007 From: jim_matt at swbell.net (jim_matt) Date: Tue, 17 Apr 2007 22:59:02 -0500 Subject: [Wtr-general] OLE error code:80070005 in Access is denied. References: <080e01c77d5f$3fcc30a0$6401a8c0@Jimsxp> <461F0247.9090702@pettichord.com> Message-ID: <01c001c7816d$e6f67b80$6501a8c0@Jimsxp> Thanks Bret, I dropped back to Watir version 1.5.1.1145 and the problem went away. Jim ----- Original Message ----- From: "Bret Pettichord" To: Sent: Thursday, April 12, 2007 11:08 PM Subject: Re: [Wtr-general] OLE error code:80070005 in Access is denied. > jim_matt wrote: >> Hi guys, >> >> I got the following error and am having trouble getting around it: >> >> d:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in >> `method_missing': document (WIN32OLERuntimeError) >> OLE error code:80070005 in >> Access is denied. > Use a previous gem. Or build from trunk. > > Bret > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From charley.baker at gmail.com Wed Apr 18 00:13:48 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 17 Apr 2007 21:13:48 -0700 Subject: [Wtr-general] OLE error code:80070005 in Access is denied. In-Reply-To: <01c001c7816d$e6f67b80$6501a8c0@Jimsxp> References: <080e01c77d5f$3fcc30a0$6401a8c0@Jimsxp> <461F0247.9090702@pettichord.com> <01c001c7816d$e6f67b80$6501a8c0@Jimsxp> Message-ID: Or you can use the latest version of Watir and it will also go away and give you more functionality: http://wiki.openqa.org/display/WTR/2007/04/12/Watir+Development+Gem+1.5.1.1165+Released The workaround isn't ideal, but should solve this issue for the majority of users. -Charley On 4/17/07, jim_matt wrote: > > Thanks Bret, > > I dropped back to Watir version 1.5.1.1145 and the problem went away. > > Jim > > ----- Original Message ----- > From: "Bret Pettichord" > To: > Sent: Thursday, April 12, 2007 11:08 PM > Subject: Re: [Wtr-general] OLE error code:80070005 in Access is > denied. > > > > jim_matt wrote: > >> Hi guys, > >> > >> I got the following error and am having trouble getting around it: > >> > >> d:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in > >> `method_missing': document (WIN32OLERuntimeError) > >> OLE error code:80070005 in > >> Access is denied. > > Use a previous gem. Or build from trunk. > > > > Bret > > _______________________________________________ > > 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/20070417/740479d6/attachment.html From forum-watir-users at openqa.org Wed Apr 18 01:09:59 2007 From: forum-watir-users at openqa.org (radha) Date: Wed, 18 Apr 2007 00:09:59 CDT Subject: [Wtr-general] Reading sheet in Excel Book using name of the Sheet In-Reply-To: <36397392.2851176801621596.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <30858906.14641176873029840.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks.. your solution is working fine. From Mark_Cain at RL.gov Wed Apr 18 09:50:47 2007 From: Mark_Cain at RL.gov (Cain, Mark) Date: Wed, 18 Apr 2007 06:50:47 -0700 Subject: [Wtr-general] JS Alert from a checkbox In-Reply-To: <68f4a0e80704171823x5a1e8ab0q9975a03c466cf07f@mail.gmail.com> References: <4440693B7CFF2440ABC2E0BE480DABA10A377E@EX01-2.rl.gov><4440693B7CFF2440ABC2E0BE480DABA10A3780@EX01-2.rl.gov> <68f4a0e80704171823x5a1e8ab0q9975a03c466cf07f@mail.gmail.com> Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A3786@EX01-2.rl.gov> Well until that happens here is the solution to this particular dilemma. This could be modified make other non-click elements (that have a JSPopup from the OnClick event). reguire 'thread' def startClicker(ie, button) # Strart a new thread that will dismiss the JSPopup. t = Thread.new { w = WinClicker.new hwnd = $ie.enabled_popup(10) if nil == hwnd w.clickWindowsButton_hwnd(hwnd, button) t.join w = nil } End ... # Start the thread before it gets locked by the JSPopup startClicker( $ie, 'OK') $ie.checkBox( :name, "read_instructions").set As usual there is probably a better way of doing this...if you do improve this please pass it on. --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Ethan Jewett Sent: Tuesday, April 17, 2007 6:24 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] JS Alert from a checkbox This (http://jira.openqa.org/browse/WTR-146) ticket and patch outlines a possible framework for dealing with this throughout watir. Might be a decent reason to vote for the feature on Jira. In the meantime, the method of modifying the methods in watir.rb in the patch should work for your problem as well, but you'll be stuck patching watir.rb every time you install. Ethan On 4/16/07, Cain, Mark wrote: > > > > > Does anyone have an answer to this? I can't seem to get the click_no_wait > to work for checkboxes. > > > > > > --Mark > > > > ________________________________ > > > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of > Cain, Mark > Sent: Friday, April 13, 2007 10:05 AM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] JS Alert from a checkbox > > > > > I have a JS Alert that popups from clicking a checkbox. How can I use the > click_no_wait functionality for the 'set' method of the checkbox? > > > > Thanks, > > ____________________ > Mark L. Cain > LMIT - E*STARS(r) ~ Lead Test Engineer > 1981 Snyder, MSIN: G3-62, Richland, WA 99354 > Mark_Cain at RL.gov > 509.376.5458 > "640 Kilobytes of computer memory ought to be enough for anybody." - Bill > Gates, 1981 > > > _______________________________________________ > 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 forum-watir-users at openqa.org Wed Apr 18 20:43:56 2007 From: forum-watir-users at openqa.org (Bach Le) Date: Wed, 18 Apr 2007 19:43:56 CDT Subject: [Wtr-general] unknown property or method `readyState' In-Reply-To: Message-ID: <37754625.26911176943466557.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Charley, I just installed 1165 today and I have noticed the same error that was mentioned in this thread. The error revolves around the following piece of code: documents_to_wait_for = [@ie.document] while doc = documents_to_wait_for.shift until doc.readyState == "complete" sleep 0.2; s.spin end and specific the line that says doc.readyState. The page I am testing has lots of frames and this is possibly what is causing this error. It usually says 'method_missing' when it executes this line and crashes the entire script. I've also only noticed it when the page I am testing is running a bit slow -Bach From charley.baker at gmail.com Wed Apr 18 20:59:55 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 18 Apr 2007 17:59:55 -0700 Subject: [Wtr-general] Verifying Values of Cookies In-Reply-To: <40764017.11911176837899019.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <40764017.11911176837899019.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Gary, This will grab the cookies and put them into an array: require 'watir' include Watir ie = IE.start('http://www.yahoo.com') arr = ie.document.cookie.split(';') # multiple cookies are separated by ;s arr.each {|a| puts a.to_s} -Charley On 4/17/07, Gary wrote: > > I am somewhat new to watir, and I am trying to figure out how to read and > assert the value(s) of multiple cookies that are set by our software. Is > this even possible with watir? I have seen some references to cookie > manager, but it seems to be unsupported and generally unused. Some snippets > of code or examples would really come in handy. > > Thanks in advance, > lokispeak > _______________________________________________ > 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/20070418/811904b4/attachment.html From vikashkumar051 at yahoo.co.in Thu Apr 19 02:08:15 2007 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Thu, 19 Apr 2007 11:38:15 +0530 (IST) Subject: [Wtr-general] problem in attaching to browser using FireWatir Message-ID: <72325.89607.qm@web7811.mail.in.yahoo.com> Hi Angrez, My requirement is to just attach the script to some already open browser as we can attach to some already open page in watir viz. ie = Watir::IE.attach(:title,"Google"), I have open that browser manually. Thanks & Regards, Vikash >Hi Vikash, >Can you please clarify what you want to do? What I think is, there is a >browser and you want to attach to it? Correct? >But how you open that browser is my question? >Regards, >Angrez >> I am trying to attach to a browser using title, If I am using watir, I can >> just attach to a browser using: >> require 'watir' >> ie = Watir::IE.attach(:title,"Google") >> But, In case of firewatir, I am facing problem, i.e. when I use : >> require 'firewatir' >> ff = FireWatir::Firefox.attach(:title,"Google") >> I am getting the below error message: >> NoMethodError: undefined method `attach' for FireWatir::Firefox:Class >> But, with some changes with the code I can attach to some another browser: >> require 'firewatir' >> ff = FireWatir::Firefox.start("www.yahoo.com";) >> ff_new = ff.attach(:title,"Google") >> But, I don't want to open a browser, my requirement is to just attach to >> the existing browser, is there is some way of doing this, as we can do with >> "watir". >> Please, help me out. >> Thanks in advance >> Vikash Send a FREE SMS to your friend's mobile from Yahoo! Messenger. Get it now at http://in.messenger.yahoo.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070419/192e9e8e/attachment-0001.html From michael.a.bolton at gmail.com Thu Apr 19 03:06:20 2007 From: michael.a.bolton at gmail.com (Michael Bolton) Date: Thu, 19 Apr 2007 03:06:20 -0400 Subject: [Wtr-general] How to verify the values in the tages In-Reply-To: <72799cd70704170855m113fd374naf82f19a9d72454d@mail.gmail.com> Message-ID: <022c01c78251$3e586210$fde73d0a@Koko> I wonder about that--Test::Unit doesn't spell the word "acutal", does it? Also, if what Vamsi has rendered below has been transcribed accurately, the comma before "data" in the assert_match line would screw things up. Vamsi--is that message copied and pasted from the screen by using the Windows clipboard, or are you reading it and typing it into your message? On the other hand, the purpose of using Watir is to find problems. When we can't "make something work" under Watir, it's worth considering the idea that we might have found a bug in the application under test--right? ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: April 17, 2007 11:56 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How to verify the values in the tages >def test_crlf >data = "first line >second line" >assert_match(,data, /first line\s+second line/) end end >error: "first line\r\n\r\nsecond line" expected but acutal was "/fist line\s+secondling/" Your application has badly misspelled the message to the user. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From angrez at gmail.com Thu Apr 19 03:13:09 2007 From: angrez at gmail.com (Angrez Singh) Date: Thu, 19 Apr 2007 12:43:09 +0530 Subject: [Wtr-general] problem in attaching to browser using FireWatir In-Reply-To: <72325.89607.qm@web7811.mail.in.yahoo.com> References: <72325.89607.qm@web7811.mail.in.yahoo.com> Message-ID: Hi Vikash, As of now you can't do that in Firewatir. You can only attach to windows using an instance of Firefox. This is by design as we have to maintain all the browser instances that are currently opened and close them accordingly. Will try to come up with a solution which works like Watir but as of now you can't do that. Regards, Angrez On 4/19/07, VIKASH KUMAR wrote: > > Hi Angrez, > > My requirement is to just attach the script to some already open browser > as we can attach to some already open page in watir viz. ie = Watir:: > IE.attach(:title,"Google"), I have open that browser manually. > Thanks & Regards, > Vikash > > > >Hi Vikash, > >Can you please clarify what you want to do? What I think is, there is a > >browser and you want to attach to it? Correct? > >But how you open that browser is my question? > >Regards, > >Angrez > >> I am trying to attach to a browser using title, If I am using watir, I > can > >> just attach to a browser using: > >> require 'watir' > >> ie = Watir::IE.attach(:title,"Google") > >> But, In case of firewatir, I am facing problem, i.e. when I use : > >> require 'firewatir' > >> ff = FireWatir::Firefox.attach(:title,"Google") > >> I am getting the below error message: > >> NoMethodError: undefined method `attach' for FireWatir::Firefox:Class > >> But, with some changes with the code I can attach to some another > browser: > >> require 'firewatir' > >> ff = FireWatir::Firefox.start("www.yahoo.com";) > >> ff_new = ff.attach(:title,"Google") > >> But, I don't want to open a browser, my requirement is to just attach > to > >> the existing browser, is there is some way of doing this, as we can do > with > >> "watir". > >> Please, help me out. > >> Thanks in advance > >> Vikash > > ------------------------------ > Check out what you're missing if you're not on Yahoo! Messenger > > _______________________________________________ > 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/20070419/93fa088d/attachment.html From forum-watir-users at openqa.org Thu Apr 19 10:27:34 2007 From: forum-watir-users at openqa.org (Sadeesh Vinoth) Date: Thu, 19 Apr 2007 09:27:34 CDT Subject: [Wtr-general] Watir and smartclient In-Reply-To: <25168087.2801176800418516.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <34624701.35901176992884248.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Can anyone help me. From angrez at gmail.com Thu Apr 19 10:41:32 2007 From: angrez at gmail.com (Angrez Singh) Date: Thu, 19 Apr 2007 20:11:32 +0530 Subject: [Wtr-general] Watir and smartclient In-Reply-To: <34624701.35901176992884248.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <25168087.2801176800418516.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <34624701.35901176992884248.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Sadeesh, Is it possible for you to post the sample output as in how it looks? Certainly looking at the output one could be able to help in telling whether you can use Watir for testing or not. Regards, Angrez On 4/19/07, Sadeesh Vinoth wrote: > > Can anyone help me. > _______________________________________________ > 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/20070419/2d71664e/attachment.html From sergio.pinon at us.g4s.com Thu Apr 19 10:32:50 2007 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Thu, 19 Apr 2007 07:32:50 -0700 Subject: [Wtr-general] Watir and smartclient In-Reply-To: <34624701.35901176992884248.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <25168087.2801176800418516.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <34624701.35901176992884248.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4D7FC2322B85B848A0A766D1D364D436E9C17F@bugatti.ems.securicor.com> What is that you are looking for help with? -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sadeesh Vinoth Sent: Thursday, April 19, 2007 7:28 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Watir and smartclient Can anyone help me. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From areed at relocationcentral.com Thu Apr 19 11:15:59 2007 From: areed at relocationcentral.com (Adam Reed) Date: Thu, 19 Apr 2007 10:15:59 -0500 Subject: [Wtr-general] Watir and smartclient In-Reply-To: <4D7FC2322B85B848A0A766D1D364D436E9C17F@bugatti.ems.securicor.com> References: <25168087.2801176800418516.JavaMail.oqa-j2ee@openqa01.managed.contegix.com><34624701.35901176992884248.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <4D7FC2322B85B848A0A766D1D364D436E9C17F@bugatti.ems.securicor.com> Message-ID: <36B5DBA88E027F47812ED877C6A978D801372DA1@rc-mail.relocationcentral.com> Sadeesh sent this to the list yesterday: Hi, Can we use Watir for testing applications developed using smartclient. (Smartclient will use javascript elements instead of HTML elements.) Thanks, Sadeesh Vinoth T _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Thursday, April 19, 2007 9:33 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Watir and smartclient What is that you are looking for help with? -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sadeesh Vinoth Sent: Thursday, April 19, 2007 7:28 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Watir and smartclient Can anyone help me. _______________________________________________ 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 sergio.pinon at us.g4s.com Thu Apr 19 11:39:34 2007 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Thu, 19 Apr 2007 08:39:34 -0700 Subject: [Wtr-general] Watir and smartclient In-Reply-To: <36B5DBA88E027F47812ED877C6A978D801372DA1@rc-mail.relocationcentral.com> References: <25168087.2801176800418516.JavaMail.oqa-j2ee@openqa01.managed.contegix.com><34624701.35901176992884248.JavaMail.oqa-j2ee@openqa01.managed.contegix.com><4D7FC2322B85B848A0A766D1D364D436E9C17F@bugatti.ems.securicor.com> <36B5DBA88E027F47812ED877C6A978D801372DA1@rc-mail.relocationcentral.com> Message-ID: <4D7FC2322B85B848A0A766D1D364D436E9C187@bugatti.ems.securicor.com> I was looking for that. I didn't see that message in my list. I must have accidentally deleted it. Thanks Adam. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Adam Reed Sent: Thursday, April 19, 2007 8:16 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Watir and smartclient Sadeesh sent this to the list yesterday: Hi, Can we use Watir for testing applications developed using smartclient. (Smartclient will use javascript elements instead of HTML elements.) Thanks, Sadeesh Vinoth T _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Thursday, April 19, 2007 9:33 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Watir and smartclient What is that you are looking for help with? -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sadeesh Vinoth Sent: Thursday, April 19, 2007 7:28 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Watir and smartclient Can anyone help me. _______________________________________________ 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 From areed at relocationcentral.com Thu Apr 19 12:07:38 2007 From: areed at relocationcentral.com (Adam Reed) Date: Thu, 19 Apr 2007 11:07:38 -0500 Subject: [Wtr-general] unknown property or method `readyState' In-Reply-To: <37754625.26911176943466557.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <37754625.26911176943466557.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <36B5DBA88E027F47812ED877C6A978D801372DA2@rc-mail.relocationcentral.com> You know, I've been user the older dev version of watir and just started receiving this error two days ago. Older scripts that were working fine, all of a sudden stall out indefinitely, and give the readyState error when I abort them. I just upgraded to 1165 today, and still have the same problem. The page I am browsing uses no frames (all divs). I've also found that a simple script such as one that goes to 10 different urls, with no validations, assertions or other processing crashes after the fourth link. It doesn't seem to matter what this fourth URL is (ie, not a problem with the page itself, it can be anything). WIN32OLERuntimeError: Unknown property or method 'readyState' HRESULT error code:0x800706ba The RPC server is unavailable ...watir.rb:1669:in 'method_missing' ...watir.rb:1669:in 'wait' ...watir.rb:1551:in 'goto' Any answers on this yet? Adam -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bach Le Sent: Wednesday, April 18, 2007 7:44 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] unknown property or method `readyState' Hi Charley, I just installed 1165 today and I have noticed the same error that was mentioned in this thread. The error revolves around the following piece of code: documents_to_wait_for = [@ie.document] while doc = documents_to_wait_for.shift until doc.readyState == "complete" sleep 0.2; s.spin end and specific the line that says doc.readyState. The page I am testing has lots of frames and this is possibly what is causing this error. It usually says 'method_missing' when it executes this line and crashes the entire script. I've also only noticed it when the page I am testing is running a bit slow -Bach _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From rdewolfe at Credant.com Thu Apr 19 13:35:58 2007 From: rdewolfe at Credant.com (Russ DeWolfe) Date: Thu, 19 Apr 2007 12:35:58 -0500 Subject: [Wtr-general] Accessing an id element with a table Message-ID: I have finally found my Table cell that I want to click: ie.table(:index,8)[3][5].click However, this TD has an id, and when I try to access it by id like this: ie.table(:id,'idinfo').click watir/ruby cannot find the element, can anyone tell me the correct way to get to this element by id? I tried this too: ie.((table(:index,8)[3][5]))(:id,"idinfo').click Russ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070419/11731f4c/attachment-0001.html From zeljko.filipin at gmail.com Thu Apr 19 14:37:09 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 19 Apr 2007 20:37:09 +0200 Subject: [Wtr-general] Accessing an id element with a table In-Reply-To: References: Message-ID: Hi Russ, Try ie.cell(:id,'idinfo').click Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070419/ff2c463d/attachment.html From pgits at cisco.com Thu Apr 19 16:31:21 2007 From: pgits at cisco.com (Peter Gits (pgits)) Date: Thu, 19 Apr 2007 16:31:21 -0400 Subject: [Wtr-general] click not clicking? Message-ID: In the irb, I have successfully traversed down to the table item that I wish to click on, I can flash it properly, but I can't seem to get the 'click' method to succeed? Perhaps I need to restart irb and get back to the appropriate spot in case something got messed up. Here is the raw html   Registration & Records anything special that I am missing? nested5 = ie.table(:index, 6) => #, @down_load_time=0.032, @error_checkers=[#], @defau tSleepTime=0.1, @activeObjectHighLightColor="yellow", @enable_spinner=false, @u l_list=[""], @pageHasReloaded=false, @logger=#, @dev=#>, @formatter=nil, @default_formatter=#>, @typingspeed=0.08, @f rm=nil>, @originalColor=nil, @o=#> => nil irb(main):127:0> nested5[3][2].click() => "" irb(main):128:0> nested5[3][2].click => "" irb(main):129:0> nested5[3][2].focus => nil irb(main):130:0> nested5[3][2].focus() => nil irb(main):131:0> nested5[3][2].fireEvent("onClick") => "" irb(main):132:0> nested5[3][2].fireEvent("onMouseover") => "" irb(main):133:0> nested5[3][2].fireEvent("onMouseover") => "" irb(main):134:0> nested5[3][2].fireEvent("onFocus") => "" irb(main):135:0> nested5[3][2].click => "" It flashes, does the fireEvent, but doesn't change the page? Cheers, Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070419/45c28f6a/attachment.html From paul.rogers at shaw.ca Thu Apr 19 17:19:53 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 19 Apr 2007 15:19:53 -0600 Subject: [Wtr-general] click not clicking? In-Reply-To: References: Message-ID: looks to me like you are clicking the table cell, but the thing you want to click is the link in that cell. try this nested5[3][2].link(:index,1).click -------------- next part -------------- In the irb, I have successfully traversed down to the table item that I wish to click on, I can flash it properly, but I can't seem to get the 'click' method to succeed? Perhaps I need to restart irb and get back to the appropriate spot in case something got messed up. Here is the raw html   Registration & Records anything special that I am missing? nested5 = ie.table(:index, 6) => #, @down_load_time=0.032, @error_checkers=[#], @defau tSleepTime=0.1, @activeObjectHighLightColor="yellow", @enable_spinner=false, @u l_list=[""], @pageHasReloaded=false, @logger=#, @dev=#>, @formatter=nil, @default_formatter=#>, @typingspeed=0.08, @f rm=nil>, @originalColor=nil, @o=#> => nil irb(main):127:0> nested5[3][2].click() => "" irb(main):128:0> nested5[3][2].click => "" irb(main):129:0> nested5[3][2].focus => nil irb(main):130:0> nested5[3][2].focus() => nil irb(main):131:0> nested5[3][2].fireEvent("onClick") => "" irb(main):132:0> nested5[3][2].fireEvent("onMouseover") => "" irb(main):133:0> nested5[3][2].fireEvent("onMouseover") => "" irb(main):134:0> nested5[3][2].fireEvent("onFocus") => "" irb(main):135:0> nested5[3][2].click => "" It flashes, does the fireEvent, but doesn't change the page? Cheers, Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070419/e0fbe64e/attachment.html -------------- next part -------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Thu Apr 19 17:22:43 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 19 Apr 2007 15:22:43 -0600 Subject: [Wtr-general] Accessing an id element with a table In-Reply-To: References: Message-ID: The table CELL has an id. I think you can click a cell directly ie.cell(:id , 'idonfo').click -------------- next part -------------- I have finally found my Table cell that I want to click: ie.table(:index,8)[3][5].click However, this TD has an id, and when I try to access it by id like this: ie.table(:id,'idinfo').click watir/ruby cannot find the element, can anyone tell me the correct way to get to this element by id? I tried this too: ie.((table(:index,8)[3][5]))(:id,"idinfo').click Russ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070419/78324994/attachment.html -------------- next part -------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Thu Apr 19 18:03:35 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 19 Apr 2007 17:03:35 -0500 Subject: [Wtr-general] unknown property or method `readyState' In-Reply-To: <36B5DBA88E027F47812ED877C6A978D801372DA2@rc-mail.relocationcentral.com> References: <37754625.26911176943466557.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <36B5DBA88E027F47812ED877C6A978D801372DA2@rc-mail.relocationcentral.com> Message-ID: <4627E737.9070309@pettichord.com> Adam Reed wrote: > You know, I've been user the older dev version of watir and just started > receiving this error two days ago. Older scripts that were working > fine, all of a sudden stall out indefinitely, and give the readyState > error when I abort them. I just upgraded to 1165 today, and still have > the same problem. > > The page I am browsing uses no frames (all divs). I've also found that > a simple script such as one that goes to 10 different urls, with no > validations, assertions or other processing crashes after the fourth > link. It doesn't seem to matter what this fourth URL is (ie, not a > problem with the page itself, it can be anything). > > WIN32OLERuntimeError: Unknown property or method 'readyState' > HRESULT error code:0x800706ba > The RPC server is unavailable > ...watir.rb:1669:in 'method_missing' > ...watir.rb:1669:in 'wait' > ...watir.rb:1551:in 'goto' > > Any answers on this yet? > > Adam > My understanding it that this problem was introduced in build 1.5.1.1158. Previous build 1.5.1.1145 does not show this problem. Specifically I introduced it when i committed the recursive frames patch from bug 107 Here are the comments i made when i made this fix: Fix by Xavier Noria for http://jira.openqa.org/browse/WTR-107 I made a few additional changes to Xavier's patch: most dramatically i also removed the pre-existing rescue block, which did not make sense to me. I wish we had unit tests for this, but we don't. I decided that it was worth the risk... Well, clearly, the risk was more than i realized at the time. At the same time, if you are getting an RPC server unavailable error, then there is nothing i can do to fix it. To me, I have seen happen after you close an IE window. Unfortunately IE#close is asynchronous and thus unreliable. I don't use it personally, instead preferring to use IE#kill which is in contrib and currently untested. Maybe it is time to promote it. Could anyone who is getting these errors, please post the stack traces, like Adam. This is a hard problem to fix because it is intermittent and we can only really guess as to whether we really understand your problem. Bret From crasch at gmail.com Thu Apr 19 18:26:04 2007 From: crasch at gmail.com (Christopher Rasch) Date: Thu, 19 Apr 2007 18:26:04 -0400 Subject: [Wtr-general] How to install Firewatir on Mac OS X Tiger (Intel) Message-ID: <1177021564.9485.1185554313@webmail.messagingengine.com> Hi, I've put a tutorial describing how I got Firewatir (firewatir-1.0.2) working with Firefox (version 2.0.0.3) on my Mac OS X Tiger (Intel) box here: http://crasch.livejournal.com/550521.html Suggestions for improvement are welcome. Chris -- Christopher Rasch crasch at fastmail.fm From crasch at gmail.com Thu Apr 19 18:25:25 2007 From: crasch at gmail.com (Christopher Rasch) Date: Thu, 19 Apr 2007 18:25:25 -0400 Subject: [Wtr-general] (no subject) Message-ID: <1177021525.9368.1185554313@webmail.messagingengine.com> Hi, I've put a tutorial describing how I got Firewatir (firewatir-1.0.2) working with Firefox (version 2.0.0.3) on my Mac OS X Tiger (Intel) box here: http://crasch.livejournal.com/550521.html Suggestions for improvement are welcome. Chris -- Christopher Rasch crasch at fastmail.fm From pgits at cisco.com Thu Apr 19 22:21:22 2007 From: pgits at cisco.com (Peter Gits (pgits)) Date: Thu, 19 Apr 2007 22:21:22 -0400 Subject: [Wtr-general] click not clicking? Message-ID: Paul Rogers thanks for the quick turn-around on this, you were correct. Cheers, Peter M. Gits Re: [Wtr-general] click not clicking? Paul Rogers Thu, 19 Apr 2007 14:23:41 -0700 looks to me like you are clicking the table cell, but the thing you want to click is the link in that cell. try this nested5[3][2].link(:index,1).click In the irb, I have successfully traversed down to the table item that I wish to click on, I can flash it properly, but I can't seem to get the 'click' method to succeed? Perhaps I need to restart irb and get back to the appropriate spot in case something got messed up. Here is the raw html   Registration & Records anything special that I am missing? nested5 = ie.table(:index, 6) => #, @down_load_time=0.032, @error_checkers=[#], @defau tSleepTime=0.1, @activeObjectHighLightColor="yellow", @enable_spinner=false, @u l_list=[""], @pageHasReloaded=false, @logger=#, @dev=#>, @formatter=nil, @default_formatter=#>, @typingspeed=0.08, @f rm=nil>, @originalColor=nil, @o=#> => nil irb(main):127:0> nested5[3][2].click() => "" irb(main):128:0> nested5[3][2].click => "" irb(main):129:0> nested5[3][2].focus => nil irb(main):130:0> nested5[3][2].focus() => nil irb(main):131:0> nested5[3][2].fireEvent("onClick") => "" irb(main):132:0> nested5[3][2].fireEvent("onMouseover") => "" irb(main):133:0> nested5[3][2].fireEvent("onMouseover") => "" irb(main):134:0> nested5[3][2].fireEvent("onFocus") => "" irb(main):135:0> nested5[3][2].click => "" It flashes, does the fireEvent, but doesn't change the page? Cheers, Peter _______________________________________________ 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 renard at nc.rr.com Thu Apr 19 23:05:06 2007 From: renard at nc.rr.com (Bernard Kenik) Date: Thu, 19 Apr 2007 23:05:06 -0400 Subject: [Wtr-general] watir unit tests Message-ID: <46282DE2.2090407@nc.rr.com> I have installed Watir gem 1.5.1.1164 (actually 1165) results of core_tests.rb C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.1.1164\unittests>core_tests.rb Loaded suite C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/unittests/core_tests Started .................................................................................... .................................................................................... ................................ Finished in 151.25 seconds. 202 tests, 1121 assertions, 0 failures, 0 errors ######################################################## results of non_core_tests.rb 21 tests, 1 assertions, 1 failures, 30 errors C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/unittests/../watir.rb:1721:in `method_missing': unknown property or method `quit' (WIN32OLERuntimeError) HRESULT error code:0x800706ba The RPC server is unavailable. from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/unittests/../watir.rb:1721:in `close' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/unittests/../unittests/setup.rb:3 from c:/ruby/lib/ruby/1.8/test/unit.rb:278 typical error message: 31) Error: test_simple(TC_PopUps): WIN32OLERuntimeError: unknown property or method `navigate' HRESULT error code:0x800706ba The RPC server is unavailable. C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/unittests/../watir.rb:1687:in `method_missing' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/unittests/../watir.rb:1687:in `goto' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/unittests/../unittests/popups_test.rb:11:in `setup' Question: Am I missing in my Watir installation? ######################################################################################### Results of open_close_tests.rb C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.1.1164\unittests>open_close_tests.rb Loaded suite C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/unittests/open_close_tes ts Started . Finished in 64.407 seconds. 1 tests, 20 assertions, 0 failures, 0 errors ##################################################### Results of xpath_tests.rb C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.1.1164\unittests>xpath_tests.rb Loaded suite C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/unittests/xpath_tests Started /******* snip *********/ Finished in 102.594 seconds. ####################################################### Results of window_tests.rb Hangs when the "Press a button" dialog shows up. 92 tests, 393 assertions, 0 failures, 0 errors From jhe at resilience.com Thu Apr 19 23:33:20 2007 From: jhe at resilience.com (jhe) Date: Fri, 20 Apr 2007 11:33:20 +0800 Subject: [Wtr-general] How to save file via File download dialog In-Reply-To: <000d01c77bfe$f76b4320$b064a8c0@synapse.com> Message-ID: Dear all, I need to download a file, it popup a dialog when click the link, I use the following code to do it, --------------------------------------------------------------- def test_d $ie.goto(@@test_site + "/cgi-bin/summary.cgi") $ie.button(:caption, "Save").click_no_wait sleep 0.4 assert dialog.exists? sleep 0.4 dialog.button('Save').click end --------------------------------------------------------------- But it stops at the line: assert dialog.exists? It output this message: is not true. Can anybody know how to click the button and save the download file? Thanks in advance. Regards, Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070420/85c93ceb/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 22554 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20070420/85c93ceb/attachment-0001.jpe From forum-watir-users at openqa.org Fri Apr 20 02:09:43 2007 From: forum-watir-users at openqa.org (vamsi) Date: Fri, 20 Apr 2007 01:09:43 CDT Subject: [Wtr-general] Calling Function Error - like No test were specified Message-ID: <36422332.5191177049413725.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, Getting an Calling fuction error .... Please find the script and error message below. require 'watir' include Watir require 'test/unit' require 'test/unit/ui/console/testrunner' require 'win32ole' class maintestManage < Test::Unit::TestCase def maintestManage maintest.test1() maintest.test2() maintest.test3() end end module maintestAPI class maintest def maintest.test1() $ie = IE.new $ie.goto('www.xxx.com) $ie.text_field(:id, 'UserID').set('ABCD1234') $ie.text_field(:id, PWD).set('123456') $ie.button(:id, 'Login').click end def maintest.test2() end def maintest.test3() $ie.link(:url, 'Logout.aspx').click $ie.close end end end Error Message: 1) Failure: default_test(maintestManage) [maintestmanagesignonAPI.rb:28]: No tests were specified. Kindly help me into this.... Thansk in Advance. Regards Vamsi From prema.arya at gmail.com Fri Apr 20 02:13:21 2007 From: prema.arya at gmail.com (Prema Arya) Date: Fri, 20 Apr 2007 11:43:21 +0530 Subject: [Wtr-general] (no subject) In-Reply-To: <1177021525.9368.1185554313@webmail.messagingengine.com> References: <1177021525.9368.1185554313@webmail.messagingengine.com> Message-ID: <27915010704192313yb60756cif29e2969dd95ebe@mail.gmail.com> Cool!! Thanks a lot. On 4/20/07, Christopher Rasch wrote: > > Hi, > > I've put a tutorial describing how I got Firewatir (firewatir-1.0.2) > working with Firefox (version 2.0.0.3) on my Mac OS X Tiger (Intel) box > here: > > http://crasch.livejournal.com/550521.html > > Suggestions for improvement are welcome. > > Chris > -- > Christopher Rasch > crasch at fastmail.fm > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- Prema Arya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070420/9822d67a/attachment.html From charley.baker at gmail.com Fri Apr 20 02:45:49 2007 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 19 Apr 2007 23:45:49 -0700 Subject: [Wtr-general] Calling Function Error - like No test were specified In-Reply-To: <36422332.5191177049413725.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36422332.5191177049413725.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hmmm, there's quite a lot going on here. Where to begin. Classnames must be capitalized: class MainTestManage not class mainTestManage I'm not sure why you've defined a module nor why you're explicitly naming your class names in your module with the as class methods. You maintestManage class is inheriting from TestCase but has no tests defined since test methods called by TestCase need to be defined by using test at the beginning of the method name. Here's a quick hack to your example though I may be missing the actual jist of what you're attempting to do. require 'watir' include Watir require 'test/unit' require 'test/unit/ui/console/testrunner' #require 'win32ole' #already loaded by watir class MaintestManage < Test::Unit::TestCase def setup $ie = IE.start('www.xxx.com) # moving this into the setup method end def test_manage # removed main from the beginning so it's a test case mt = MainTestAPI::MainTest.new mt.test1() mt.test2() # this test does nothing mt.test3() end def teardown # adding ie.close to the teardown, since you're calling all your tests in the main test anyhow $ie.close sleep 1 end end module MaintestAPI # module names like class names begin with a capital letter class MainTest # classes begin with capital letter, removed previous class name from your method definitions, not necessary def test1() $ie.text_field(:id, 'UserID').set('ABCD1234') $ie.text_field(:id, PWD).set('123456') $ie.button(:id, 'Login').click end def test2() end def test3() $ie.link(:url, 'Logout.aspx').click end end end Hopefully this help explain some things, or if not maybe explain your reasoning behind your particular version. -Charley On 4/19/07, vamsi wrote: > > Hi, > > Getting an Calling fuction error .... Please find the script and error > message below. > > require 'watir' > include Watir > require 'test/unit' > require 'test/unit/ui/console/testrunner' > require 'win32ole' > class maintestManage < Test::Unit::TestCase > def maintestManage > maintest.test1() > maintest.test2() > maintest.test3() > end > end > module maintestAPI > class maintest > def maintest.test1() > $ie = IE.new > $ie.goto('www.xxx.com) > $ie.text_field(:id, 'UserID').set('ABCD1234') > $ie.text_field(:id, PWD).set('123456') > $ie.button(:id, 'Login').click > end > def maintest.test2() > > end > def maintest.test3() > $ie.link(:url, 'Logout.aspx').click > $ie.close > end > end > end > > > Error Message: 1) Failure: > default_test(maintestManage) [maintestmanagesignonAPI.rb:28]: > No tests were specified. > > > Kindly help me into this.... > Thansk in Advance. > > Regards > Vamsi > _______________________________________________ > 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/20070419/998af65e/attachment.html From forum-watir-users at openqa.org Fri Apr 20 06:56:54 2007 From: forum-watir-users at openqa.org (vamsi) Date: Fri, 20 Apr 2007 05:56:54 CDT Subject: [Wtr-general] NoMethodError: undefined method `assert_equal' for # Hi, could anyone help me to resolve this error: NoMethodError: undefined method `assert_equal' for # Thanks in Advance. Regards Vamsi From zeljko.filipin at gmail.com Fri Apr 20 07:23:57 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 20 Apr 2007 13:23:57 +0200 Subject: [Wtr-general] NoMethodError: undefined method `assert_equal' for # References: <39059296.7921177066645545.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Vamsi, Adding require 'test/unit/assertions' include Test::Unit::Assertions to the top of your script should help. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070420/1353d3e2/attachment.html From areed at relocationcentral.com Fri Apr 20 09:47:41 2007 From: areed at relocationcentral.com (Adam Reed) Date: Fri, 20 Apr 2007 08:47:41 -0500 Subject: [Wtr-general] unknown property or method `readyState' In-Reply-To: <4627E737.9070309@pettichord.com> References: <37754625.26911176943466557.JavaMail.oqa-j2ee@openqa01.managed.contegix.com><36B5DBA88E027F47812ED877C6A978D801372DA2@rc-mail.relocationcentral.com> <4627E737.9070309@pettichord.com> Message-ID: <36B5DBA88E027F47812ED877C6A978D801372DA5@rc-mail.relocationcentral.com> The RPC server unavailable error must be from when I manually close the IE window after the script has stalled out -- so far that I can tell, this is the only way to actually view the error, otherwise ruby/IE will hang out indefinitely. It can be ignored. I did notice that I was able to "jump start" the application by clicking another link on the page. This also seems random/intermittent, however. If this other link is clicked sometimes the script picks up where it left off, usually causing any assertions you had for the correct page to fail, etc. Adam -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Thursday, April 19, 2007 5:04 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] unknown property or method `readyState' Adam Reed wrote: > You know, I've been user the older dev version of watir and just > started receiving this error two days ago. Older scripts that were > working fine, all of a sudden stall out indefinitely, and give the > readyState error when I abort them. I just upgraded to 1165 today, > and still have the same problem. > > The page I am browsing uses no frames (all divs). I've also found > that a simple script such as one that goes to 10 different urls, with > no validations, assertions or other processing crashes after the > fourth link. It doesn't seem to matter what this fourth URL is (ie, > not a problem with the page itself, it can be anything). > > WIN32OLERuntimeError: Unknown property or method 'readyState' > HRESULT error code:0x800706ba > The RPC server is unavailable > ...watir.rb:1669:in 'method_missing' > ...watir.rb:1669:in 'wait' > ...watir.rb:1551:in 'goto' > > Any answers on this yet? > > Adam > My understanding it that this problem was introduced in build 1.5.1.1158. Previous build 1.5.1.1145 does not show this problem. Specifically I introduced it when i committed the recursive frames patch from bug 107 Here are the comments i made when i made this fix: Fix by Xavier Noria for http://jira.openqa.org/browse/WTR-107 I made a few additional changes to Xavier's patch: most dramatically i also removed the pre-existing rescue block, which did not make sense to me. I wish we had unit tests for this, but we don't. I decided that it was worth the risk... Well, clearly, the risk was more than i realized at the time. At the same time, if you are getting an RPC server unavailable error, then there is nothing i can do to fix it. To me, I have seen happen after you close an IE window. Unfortunately IE#close is asynchronous and thus unreliable. I don't use it personally, instead preferring to use IE#kill which is in contrib and currently untested. Maybe it is time to promote it. Could anyone who is getting these errors, please post the stack traces, like Adam. This is a hard problem to fix because it is intermittent and we can only really guess as to whether we really understand your problem. Bret _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From renard at nc.rr.com Fri Apr 20 23:00:03 2007 From: renard at nc.rr.com (Bernard Kenik) Date: Fri, 20 Apr 2007 23:00:03 -0400 Subject: [Wtr-general] Controlling a Browser's Menubar (or whatever it is called) Message-ID: <46297E33.9060601@nc.rr.com> I have a script which: 1. goes to a site 2. moves to the login page 3. login 4. moves to an interactive database 5. specify the desired data by means of checkboxes, select_lists, and buttons 6. the result is the specified data displayed in a table. What I would prefer to do at this point is to download the displayed page. To do this, I need to: 1. Select "Save As..." from the "File" menu. 2. A "Save Webpages" dialog window shows up. 3. I need to clear and fill in the "Save in:" text_field. 4. I need to clear and fill in the "File name:" text_field 5. Click on the "Save" button Question: How can I access the objects that part of the Browser window and part of the rendered webpage? The IE Developer Toolbar is unable to access anything outside the webpage. Thank you for any assistance you can provide From jeff.fry at gmail.com Sun Apr 22 03:04:45 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Sun, 22 Apr 2007 00:04:45 -0700 Subject: [Wtr-general] Accessing a custom input field Message-ID: <970956b0704220004p9bf667eq626e039cbc103ae4@mail.gmail.com> Hi gang, I have been trying unsuccessfully to access the username field on: http://sandbox.freebase.com/signin/signin In the HTML source, all I see is:
which is included above: include("metaweb/account/SignInComponent.js"); Using Firebug & IE Dom Explorer, I see the following snippet:
Username or Email
I am running watir-1.5.1.1145 I've (unsuccessfully) tried: @ie.text_field(:afterText, "Username or Email").set(@user) @ie.text_field(:beforeText, "Username or Email").set(@user) @ie.text_field(:name, "Username or Email").set(@user) ...but I'm uncertain if .text_field is the right method to use here. I checked out the .div method as well, but can't see how to map it to the field I'm trying to add data to. Any suggestions? Thanks, Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070422/e0dc7e17/attachment.html From bret at pettichord.com Sun Apr 22 14:17:51 2007 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 22 Apr 2007 13:17:51 -0500 Subject: [Wtr-general] Accessing a custom input field In-Reply-To: <970956b0704220004p9bf667eq626e039cbc103ae4@mail.gmail.com> References: <970956b0704220004p9bf667eq626e039cbc103ae4@mail.gmail.com> Message-ID: <462BA6CF.3010604@pettichord.com> Jeff Fry wrote: > Hi gang, > > I have been trying unsuccessfully to access the username field on: > http://sandbox.freebase.com/signin/signin > > > In the HTML source, all I see is: >
div> > which is included above: > include("metaweb/account/SignInComponent.js"); > Using Firebug & IE Dom Explorer, I see the following snippet: >
>
>
Username or Email
> >
> > I am running watir-1.5.1.1145 > I've (unsuccessfully) tried: > @ie.text_field(:afterText, "Username or Email").set(@user) > @ie.text_field(:beforeText, "Username or Email").set(@user) > @ie.text_field(:name, "Username or Email").set(@user) > > ...but I'm uncertain if .text_field is the right method to use here. I > checked out the .div method as well, but can't see how to map it to > the field I'm trying to add data to. > > Any suggestions? @ie.text_field(:class, "TextInput-input").set(@user) or @ie.div(:class"TextInput username").text_field(:index, 1).set(@user) From bret at pettichord.com Sun Apr 22 14:20:11 2007 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 22 Apr 2007 13:20:11 -0500 Subject: [Wtr-general] Controlling a Browser's Menubar (or whatever it is called) In-Reply-To: <46297E33.9060601@nc.rr.com> References: <46297E33.9060601@nc.rr.com> Message-ID: <462BA75B.4070700@pettichord.com> Bernard Kenik wrote: > I have a script which: > > 1. goes to a site > 2. moves to the login page > 3. login > 4. moves to an interactive database > 5. specify the desired data by means of checkboxes, select_lists, and > buttons > 6. the result is the specified data displayed in a table. > > What I would prefer to do at this point is to download the displayed page. > > To do this, I need to: > > 1. Select "Save As..." from the "File" menu. > 2. A "Save Webpages" dialog window shows up. > 3. I need to clear and fill in the "Save in:" text_field. > 4. I need to clear and fill in the "File name:" text_field > 5. Click on the "Save" button > > Question: How can I access the objects that part of the Browser window and > part of the rendered webpage? > > The IE Developer Toolbar is unable to access anything outside the webpage. > > Thank you for any assistance you can provide > An easier approach would just be write @ie.html to a file. From charley.baker at gmail.com Sun Apr 22 22:23:02 2007 From: charley.baker at gmail.com (Charley Baker) Date: Sun, 22 Apr 2007 20:23:02 -0600 Subject: [Wtr-general] I am having doubts in Selenium and ajax. In-Reply-To: <33543554.13921176699497135.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32788017.2101176467737638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <33543554.13921176699497135.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: If you're using Watir 1.5.1, you can call wait_until for a control to exist. Take a look at this, your needs might be different but it may give you some direction: http://wiki.openqa.org/display/WTR/Simple+Ajax+examples I'll add more examples at some point but the basic concept holds. -Charley On 4/15/07, Neel wrote: > > When i click a link ,an ajax > form opens there it self. Using selenium i can get the form but am not > able to enter the values. Its throwing me an error Element not found, > But i used the correct element only. I tried > using wait_for_page_to_load() also. then its throwing me Time out > error. So wat should i do to over come this problem?? > _______________________________________________ > 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/20070422/56acaaad/attachment.html From shalinigupta2006 at gmail.com Mon Apr 23 02:17:01 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Mon, 23 Apr 2007 11:47:01 +0530 Subject: [Wtr-general] (no subject) Message-ID: <7523f5800704222317i5187ae3cqf3c002837136139@mail.gmail.com> shalinigupta2006 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070423/bfbe191a/attachment.html From forum-watir-users at openqa.org Mon Apr 23 05:07:28 2007 From: forum-watir-users at openqa.org (Maloy kanti debnath) Date: Mon, 23 Apr 2007 04:07:28 CDT Subject: [Wtr-general] command to get a future date Message-ID: <34862705.6501177319278381.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> hi people, In my application i have a calander and i need to select a that is 7 days from today (ie 30th April) . Now the question is ..... Is there any command by which i can directly get this future date ? ...... if there is no direct command, then i will have to try writing a piece of code, which might be quite tediou, for this. thanks in advance, Maloy From ajitesh.srinetra at gmail.com Mon Apr 23 10:02:58 2007 From: ajitesh.srinetra at gmail.com (Ajitesh Srinetra) Date: Mon, 23 Apr 2007 19:32:58 +0530 Subject: [Wtr-general] NoMethodError: undefined method `assert_equal' Message-ID: <4f6da15b0704230702i3fc3ff26hecce84fba2b343c3@mail.gmail.com> Adding require 'test/unit/assertions' include Test::Unit::Assertions will help.A lot of examples for assertions is provided in unit tests examples .Please follow them in your testcases Ajitesh -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070423/840b7966/attachment.html From ajitesh.srinetra at gmail.com Mon Apr 23 10:08:08 2007 From: ajitesh.srinetra at gmail.com (Ajitesh Srinetra) Date: Mon, 23 Apr 2007 19:38:08 +0530 Subject: [Wtr-general] How to save file via File download dialog Message-ID: <4f6da15b0704230708v20c05668td4c9a9eda5852f91@mail.gmail.com> You can use content_frame(@ie).fileField(:id, 'file_name').set("D:/files/filename.txt") for uploading the file Ajitesh srinetra -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070423/106ad400/attachment.html From ajitesh.srinetra at gmail.com Mon Apr 23 10:10:48 2007 From: ajitesh.srinetra at gmail.com (Ajitesh Srinetra) Date: Mon, 23 Apr 2007 19:40:48 +0530 Subject: [Wtr-general] How to save file via File download dialog Message-ID: <4f6da15b0704230710q6c1c82e9u631ddc7e6a755ac1@mail.gmail.com> You can use ie.fileField(:id, 'file_name').set("D:/Files/filename.txt") Ajitesh Srinetra -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070423/7a1de3f6/attachment.html From charley.baker at gmail.com Mon Apr 23 10:24:47 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 23 Apr 2007 08:24:47 -0600 Subject: [Wtr-general] command to get a future date In-Reply-To: <34862705.6501177319278381.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <34862705.6501177319278381.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Use ruby's date class. d = Date.today d = d + 7 puts d.day() -Charley On 4/23/07, Maloy kanti debnath wrote: > > hi people, > In my application i have a calander and i need to select a > that is 7 days from today (ie 30th April) . Now the question is ..... Is > there any command by which i can directly get this future date ? ...... if > there is no direct command, then i will have to try writing a piece of code, > which might be quite tediou, for this. > > thanks in advance, > Maloy > _______________________________________________ > 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/20070423/b7c21ddf/attachment-0001.html From bret at pettichord.com Mon Apr 23 14:12:47 2007 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 23 Apr 2007 13:12:47 -0500 Subject: [Wtr-general] Documenting Watir 1.5 Message-ID: Many of you have noticed that new features for Watir 1.5 are not always well documented. I have created a page to include features new to Watir 1.5. http://wiki.openqa.org/display/WTR/Watir+1.5+Summary This page is currently incomplete. I would appreciate your help with it. Anyone registered on OpenQA can edit this page. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070423/3c066d93/attachment.html From forum-watir-users at openqa.org Mon Apr 23 18:48:13 2007 From: forum-watir-users at openqa.org (Jason) Date: Mon, 23 Apr 2007 17:48:13 CDT Subject: [Wtr-general] Watir T-shirt Message-ID: <35860969.14651177368523847.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I ran this by Bret and he suggested posting it on the Wtr-General to get some feedback from others. So please let me know what you think. I would like to have a Watir t-shirt to spread the word about Watir. We can put these up on the website for people to purchase them. Here is what I envision- You will have a choice of either a black or white t-shirt (both short-sleeve and long-sleeve). On the front we can have the Watir logo on the left breast area, and on the back a block of code. I created this class below as a possible example. require Watir class TC_future_of_automated_test_testing def test_Watir_is_the_test_tool_of_the_future ie.goto(@start_page) assert_equal('Watir- The Future of Automated Testing', ie.title) end def setup @start_page= 'http://wtr.rubyforge.com' end end Please remember that this is a t-shirt and aimed and increasing Watir usage/awareness to others. Let me know what you think and if you'd be interested in one. Cheers, Jason From christopher.mcmahon at gmail.com Mon Apr 23 19:03:09 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 23 Apr 2007 17:03:09 -0600 Subject: [Wtr-general] Watir T-shirt In-Reply-To: <35860969.14651177368523847.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <35860969.14651177368523847.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70704231603u7f3bed1bme0dd93a2f12f938a@mail.gmail.com> On 4/23/07, Jason wrote: > I ran this by Bret and he suggested posting it on the Wtr-General to get some feedback from others. So please let me know what you think. I'd wear it to next year's http://mtnwestruby.org, so no hurry. :) But I like the idea. From paul.rogers at shaw.ca Mon Apr 23 19:08:34 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 23 Apr 2007 17:08:34 -0600 Subject: [Wtr-general] Watir T-shirt In-Reply-To: <35860969.14651177368523847.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <35860969.14651177368523847.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: I hope you try the code before making the t-shirts ;-) ----- Original Message ----- From: Jason Date: Monday, April 23, 2007 4:48 pm Subject: [Wtr-general] Watir T-shirt > I ran this by Bret and he suggested posting it on the Wtr-General > to get some feedback from others. So please let me know what you > think. > > I would like to have a Watir t-shirt to spread the word about > Watir. We can put these up on the website for people to purchase > them. Here is what I envision- You will have a choice of either a > black or white t-shirt (both short-sleeve and long-sleeve). On > the front we can have the Watir logo on the left breast area, and > on the back a block of code. I created this class below as a > possible example. > > require Watir > > class TC_future_of_automated_test_testing > > def test_Watir_is_the_test_tool_of_the_future > ie.goto(@start_page) > assert_equal('Watir- The Future of Automated Testing', > ie.title) end > > def setup > @start_page= 'http://wtr.rubyforge.com' > end > > end > > Please remember that this is a t-shirt and aimed and increasing > Watir usage/awareness to others. Let me know what you think and > if you'd be interested in one. > > Cheers, > Jason > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From charley.baker at gmail.com Mon Apr 23 21:41:41 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 23 Apr 2007 19:41:41 -0600 Subject: [Wtr-general] Watir T-shirt In-Reply-To: References: <35860969.14651177368523847.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Good idea, I'd buy one and agreed the code should actually work. :) It's only dev code that doesn't work. :P -c On 4/23/07, Paul Rogers wrote: > > > I hope you try the code before making the t-shirts ;-) > ----- Original Message ----- > From: Jason > Date: Monday, April 23, 2007 4:48 pm > Subject: [Wtr-general] Watir T-shirt > > > I ran this by Bret and he suggested posting it on the Wtr-General > > to get some feedback from others. So please let me know what you > > think. > > > > I would like to have a Watir t-shirt to spread the word about > > Watir. We can put these up on the website for people to purchase > > them. Here is what I envision- You will have a choice of either a > > black or white t-shirt (both short-sleeve and long-sleeve). On > > the front we can have the Watir logo on the left breast area, and > > on the back a block of code. I created this class below as a > > possible example. > > > > require Watir > > > > class TC_future_of_automated_test_testing > > > > def test_Watir_is_the_test_tool_of_the_future > > ie.goto(@start_page) > > assert_equal('Watir- The Future of Automated Testing', > > ie.title) end > > > > def setup > > @start_page= 'http://wtr.rubyforge.com' > > end > > > > end > > > > Please remember that this is a t-shirt and aimed and increasing > > Watir usage/awareness to others. Let me know what you think and > > if you'd be interested in one. > > > > Cheers, > > Jason > > _______________________________________________ > > 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/20070423/3778e96c/attachment.html From christopher.mcmahon at gmail.com Mon Apr 23 22:20:59 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 23 Apr 2007 20:20:59 -0600 Subject: [Wtr-general] OT: commercial toolset based on Selenium Message-ID: <72799cd70704231920t44c904a3mbfbf92eda7af5588@mail.gmail.com> http://www.realityqa.com/ Patrick Lightbody of Selenium RC fame is a part of this. Looks pretty good from here. From WKruse at multichoice.co.za Tue Apr 24 00:44:04 2007 From: WKruse at multichoice.co.za (Walter Kruse) Date: Tue, 24 Apr 2007 06:44:04 +0200 Subject: [Wtr-general] Watir T-shirt In-Reply-To: <35860969.14651177368523847.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <35860969.14651177368523847.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: I'm in. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jason Sent: 24 April 2007 12:48 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Watir T-shirt I ran this by Bret and he suggested posting it on the Wtr-General to get some feedback from others. So please let me know what you think. I would like to have a Watir t-shirt to spread the word about Watir. We can put these up on the website for people to purchase them. Here is what I envision- You will have a choice of either a black or white t-shirt (both short-sleeve and long-sleeve). On the front we can have the Watir logo on the left breast area, and on the back a block of code. I created this class below as a possible example. require Watir class TC_future_of_automated_test_testing def test_Watir_is_the_test_tool_of_the_future ie.goto(@start_page) assert_equal('Watir- The Future of Automated Testing', ie.title) end def setup @start_page= 'http://wtr.rubyforge.com' end end Please remember that this is a t-shirt and aimed and increasing Watir usage/awareness to others. Let me know what you think and if you'd be interested in one. Cheers, Jason _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ************************************************************************************************************************** Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and destroy the original message. ************************************************************************************************************************** From shalinigupta2006 at gmail.com Tue Apr 24 00:45:31 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Tue, 24 Apr 2007 10:15:31 +0530 Subject: [Wtr-general] Watir T-shirt In-Reply-To: References: <35860969.14651177368523847.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <7523f5800704232145y32dd09d4od15423e6eeb37c29@mail.gmail.com> i'm in On 4/24/07, Walter Kruse wrote: > > I'm in. > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jason > Sent: 24 April 2007 12:48 AM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] Watir T-shirt > > I ran this by Bret and he suggested posting it on the Wtr-General to get > some feedback from others. So please let me know what you think. > > I would like to have a Watir t-shirt to spread the word about Watir. We > can put these up on the website for people to purchase them. Here is > what I envision- You will have a choice of either a black or white > t-shirt (both short-sleeve and long-sleeve). On the front we can have > the Watir logo on the left breast area, and on the back a block of code. > I created this class below as a possible example. > > require Watir > > class TC_future_of_automated_test_testing > > def test_Watir_is_the_test_tool_of_the_future > ie.goto(@start_page) > assert_equal('Watir- The Future of Automated Testing', > ie.title) > end > > def setup > @start_page= 'http://wtr.rubyforge.com' > end > > end > > Please remember that this is a t-shirt and aimed and increasing Watir > usage/awareness to others. Let me know what you think and if you'd be > interested in one. > > Cheers, > Jason > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > ************************************************************************************************************************** > Everything in this e-mail and attachments relating to the official > business of MultiChoice Africa is proprietary to > the company. Any view or opinion expressed in this message may be the view > of the individual and should not automatically > be ascribed to the company. If you are not the intended recipient, you > may not peruse, use, disseminate, distribute or > copy this message. If you have received this message in error, please > notify the sender immediately by email, facsimile > or telephone and destroy the original message. > > ************************************************************************************************************************** > _______________________________________________ > 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/20070424/f4ca233d/attachment-0001.html From shalinigupta2006 at gmail.com Tue Apr 24 00:49:09 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Tue, 24 Apr 2007 10:19:09 +0530 Subject: [Wtr-general] NoMethodError: undefined method `assert_equal' In-Reply-To: <4f6da15b0704230702i3fc3ff26hecce84fba2b343c3@mail.gmail.com> References: <4f6da15b0704230702i3fc3ff26hecce84fba2b343c3@mail.gmail.com> Message-ID: <7523f5800704232149n284ee8ddh88a41f327475d793@mail.gmail.com> Hi Ajitesh, I am Shalini gupta.Hope u'll be fine.I am also working on watir.I have problem with java popups.i am able to handle that.but how to get text on popup i dont know.please help me regarding this.Thanks in Advance. Regards and Thanks Shalini Gupta On 4/23/07, Ajitesh Srinetra wrote: > > Adding > > require 'test/unit/assertions' > include Test::Unit::Assertions > > will help.A lot of examples for assertions is provided in unit tests > examples .Please follow them in your testcases > > Ajitesh > > > > _______________________________________________ > 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/20070424/5624a9f3/attachment.html From shalinigupta2006 at gmail.com Tue Apr 24 01:11:09 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Tue, 24 Apr 2007 10:41:09 +0530 Subject: [Wtr-general] Problem in popups. Message-ID: <7523f5800704232211r77a70d33k8464eeb9ef8516a4@mail.gmail.com> Hi All, I am new to ruby.I got the solution how to handle popups but still im getting the same proble whem i runnig that through the exe file .and i also have problem in how to get text of a popup window. Regards And Thanks Shalini Gupta -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070424/14c1bf71/attachment.html From satti_mg at yahoo.com Tue Apr 24 01:04:13 2007 From: satti_mg at yahoo.com (sathya shankar) Date: Mon, 23 Apr 2007 22:04:13 -0700 (PDT) Subject: [Wtr-general] Watir T-shirt In-Reply-To: <35860969.14651177368523847.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <851803.54132.qm@web31714.mail.mud.yahoo.com> +1 Sathya --- Jason wrote: > I ran this by Bret and he suggested posting it on > the Wtr-General to get some feedback from others. > So please let me know what you think. > > I would like to have a Watir t-shirt to spread the > word about Watir. We can put these up on the > website for people to purchase them. Here is what I > envision- You will have a choice of either a black > or white t-shirt (both short-sleeve and > long-sleeve). On the front we can have the Watir > logo on the left breast area, and on the back a > block of code. I created this class below as a > possible example. > > require Watir > > class TC_future_of_automated_test_testing > > def test_Watir_is_the_test_tool_of_the_future > ie.goto(@start_page) > assert_equal('Watir- The Future of > Automated Testing', ie.title) > end > > def setup > @start_page= 'http://wtr.rubyforge.com' > end > > end > > Please remember that this is a t-shirt and aimed and > increasing Watir usage/awareness to others. Let me > know what you think and if you'd be interested in > one. > > Cheers, > Jason > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From shalinigupta2006 at gmail.com Tue Apr 24 01:42:50 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Tue, 24 Apr 2007 11:12:50 +0530 Subject: [Wtr-general] How do I click the "OK" button on a java alert? Message-ID: <7523f5800704232242p2a611cagde203a3d4079774b@mail.gmail.com> Hi all, I got the answer how to click on 'ok' button. But still i have two problems --- that code is not working when im trying to run that code through the exe file of that ruby file which is using that code. and second one is i want to capure the text of that popup.. please help me regarding this.. Thanks IN advance Regards Shalini Gupta -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070424/97031e15/attachment.html From forum-watir-users at openqa.org Tue Apr 24 01:46:25 2007 From: forum-watir-users at openqa.org (Sadeesh Vinoth) Date: Tue, 24 Apr 2007 00:46:25 CDT Subject: [Wtr-general] Watir and smartclient In-Reply-To: Message-ID: <23987061.1871177393615717.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Angrez, Please find the source of web page developed using smartlcient, Please let me know weather watir can be used for this. Source. SmartClient SDK - Component Data Binding example Thanks, Sadeesh From jeff.fry at gmail.com Tue Apr 24 03:34:55 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Tue, 24 Apr 2007 00:34:55 -0700 Subject: [Wtr-general] Helping with Watir's documentation Message-ID: <970956b0704240034k18159ca3s778d73d517f1e90b@mail.gmail.com> I offered to Brett, off list, to help some with watir documentation. It started with Brett answering a question of mine on the list, letting me know that divs and text_fields can be accessed by :class, in addition to the ways that are currently documented in the rdoc. I asked if I could be of help in getting the rdoc to reflect recent changes, which led to a larger conversation with Brett, Paul and Charley about documentation wish lists.... On 4/23/07, Bret Pettichord wrote: > If you can learn how to update rdoc, that is great. That means learning > how to create a svn working copy, edit the rdoc text (the easiest part), > generate the rdoc files using rake (not so hard, really) so that you can > check your work, and then generate a patch file with your changes (not > really hard if you use subclipse or tortoise), then that would be great. > Sadly, i have found that this is beyond the ability of most of the testers > who, like you have volunteered to help. > > So maybe the next step would be simply to clearly document how to do all > of this. Publicly. > I started playing with this tonight, and went as far as: 1. installing eclipse + rdt, subclipse at home 2. importing https://svn.openqa.org/svn/watir/trunk 3. making a trivial edit to the comments that generate the rdoc, and 4. writing up a (still very rough) 'how to' for the above: http://wiki.openqa.org/display/WTR/How+To+Update+RDOC+and+Submit+Patches As yet, the documentation is certainly incomplete and possibly inaccurate. I reference it at this point only for folks who are interested in checking out, correcting, or improving upon a work in progress. I plan to flesh out/correct the eclipse instructions (they are not yet sufficient to get someone running the ruby apps) as well as to add: 1. generating the rdoc with rake, and 2. wrapping changes into a patch file with subclipse. [brett] I suggest that you also use either the wtr-general mailing list or > the wtr-development list for your future questions. That way our suggestions > will be archived and others can also learn by watching. > I'll start out the conversation on wtr-general. If anyone thinks this conversation belongs more on wtr-development, please just say so. [me] I have a 2-3 hours/week this week and next week that I could give to > > it, and at least a day that I could give to it the week of May 6th. After > > that I'll be starting a new job at http://metaweb.com ...where I expect > > to be using watir more than I've had occasion to so far...but also suspect > > that I'll be overwhelmed and not of much help for a month or two after I > > start. > > > > My inclination is to send something to wtr-general asking for > > suggestions of things that need changing in the rdocs - and have people post > > those todos as subtasks to an rdoc item in Jira (or in the wiki?). Then I > > can write as much as I am able, and if there is still undone work I can > > leave it in a form that others can take and run with afterwards. > > > > That sounds fine. My bet, however, would be that you'd do better to simply > try reading through the archives to find questions that people have asked > whose answers aren't already in the doc. I actually have a thunderbird > (imap) archive of wtr-general with many of these threads flagged. I wonder > if there is a way i could package this up and send it to you? > That sounds great. I did a bit of quick research and turned up: http://kb.mozillazine.org/Moving_your_profile_folder http://kb.mozillazine.org/Profile_backup Brett, do you have any private data that would need to be taken out of the archive? If so, it might be complicated. If not, it seems like these links might light the way. Let me know. Like Charley said, a big hole is the user's guide. Most of it needs to be > tweaked to be accurate, but to be really helpful and current, it probably > needs half of it to be replaced. I'd love to see bold edit of it. The > mechanics of editing that are somewhat easier. Since no one has touched that > file in ages, you could simply submit your replacement, without concern for > patches and svn. > My first inclination is to add anything I know is missing to the rdoc (perhaps because I depend so heavily on the rdoc when I code). That said, the User Guide is clearly important. If there are others who have more energy for updating the rdoc and y'all think the User Guide is more in need of volunteer help I could easily be persuaded to work there first. I should finish by saying that I have a few days worth of time to contribute over the next three weeks, and then probably no time for a month or two. There's clearly more need for watir doc help than I'll be able to do in that timeframe. Part of the reason we are moving this conversation on list is so that if anyone reading this wants to join in, you know you can. Please do! - Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070424/0c09ba4b/attachment-0001.html From cancer9920 at gmail.com Tue Apr 24 04:42:04 2007 From: cancer9920 at gmail.com (ankur bajpai) Date: Tue, 24 Apr 2007 14:12:04 +0530 Subject: [Wtr-general] Watir T-shirt In-Reply-To: References: <35860969.14651177368523847.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: thats a gr8 idea.....lets go ahead!!! On 4/24/07, Walter Kruse wrote: > > I'm in. > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jason > Sent: 24 April 2007 12:48 AM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] Watir T-shirt > > I ran this by Bret and he suggested posting it on the Wtr-General to get > some feedback from others. So please let me know what you think. > > I would like to have a Watir t-shirt to spread the word about Watir. We > can put these up on the website for people to purchase them. Here is > what I envision- You will have a choice of either a black or white > t-shirt (both short-sleeve and long-sleeve). On the front we can have > the Watir logo on the left breast area, and on the back a block of code. > I created this class below as a possible example. > > require Watir > > class TC_future_of_automated_test_testing > > def test_Watir_is_the_test_tool_of_the_future > ie.goto(@start_page) > assert_equal('Watir- The Future of Automated Testing', > ie.title) > end > > def setup > @start_page= 'http://wtr.rubyforge.com' > end > > end > > Please remember that this is a t-shirt and aimed and increasing Watir > usage/awareness to others. Let me know what you think and if you'd be > interested in one. > > Cheers, > Jason > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > ************************************************************************************************************************** > Everything in this e-mail and attachments relating to the official > business of MultiChoice Africa is proprietary to > the company. Any view or opinion expressed in this message may be the view > of the individual and should not automatically > be ascribed to the company. If you are not the intended recipient, you > may not peruse, use, disseminate, distribute or > copy this message. If you have received this message in error, please > notify the sender immediately by email, facsimile > or telephone and destroy the original message. > > ************************************************************************************************************************** > _______________________________________________ > 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/20070424/8b8513ef/attachment.html From jhe at resilience.com Tue Apr 24 05:06:44 2007 From: jhe at resilience.com (jhe) Date: Tue, 24 Apr 2007 17:06:44 +0800 Subject: [Wtr-general] How to save file via File download dialog In-Reply-To: <4f6da15b0704230708v20c05668td4c9a9eda5852f91@mail.gmail.com> Message-ID: Well, it seems that your method is for uploading the file, but my question is how to automatically download a file. Regards, Jason _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Ajitesh Srinetra Sent: 2007?4?23? 22:08 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How to save file via File download dialog You can use content_frame(@ie).fileField(:id, 'file_name').set("D:/files/filename.txt") for uploading the file Ajitesh srinetra -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070424/5fcd5c50/attachment.html From jhe at resilience.com Tue Apr 24 05:09:27 2007 From: jhe at resilience.com (jhe) Date: Tue, 24 Apr 2007 17:09:27 +0800 Subject: [Wtr-general] How to save file via File download dialog In-Reply-To: <4f6da15b0704230710q6c1c82e9u631ddc7e6a755ac1@mail.gmail.com> Message-ID: As I known, it is also for uploading file. Is it also available for downloading? Regards, Jason _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Ajitesh Srinetra Sent: 2007?4?23? 22:11 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How to save file via File download dialog You can use ie.fileField(:id, 'file_name').set("D:/Files/filename.txt") Ajitesh Srinetra -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070424/fb524fb0/attachment.html From shalinigupta2006 at gmail.com Tue Apr 24 05:23:35 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Tue, 24 Apr 2007 14:53:35 +0530 Subject: [Wtr-general] Javascript dialogs - reading and closing Message-ID: <7523f5800704240223m3eed807axcff6b9f43d1080ae@mail.gmail.com> HI, I have tried your code to capture text from popup window. but i am getting a problem. because of this line of ur code assert_js_dialog do @ie.button(:value, "Alert test").click end it runs the script indefinately. please solve my problem.. i tried this as... ##////////////////////////////////////////////////////////////////////////////////////////////////// ## ## Watir script ## ##////////////////////////////////////////////////////////////////////////////////////////////////// ####requires require 'watir' require 'test/unit' require 'test/unit/ui/console/testrunner' require 'test/unit/assertions' #require 'watir/setFileDialog' #require 'popups_test' #require 'enabled_popup' #logger requires require 'example_logger1' require 'workbookfunction' #java_pophadler requires require 'WindowHelper' require 'win32ole' require 'js_dialog' #require 'winClickers' ####includes include Watir class TC_PSC_userlogin < Test::Unit::TestCase def start #open the IE browser $ie = IE.new #create a logger filePrefix = "logger" $logger = LoggerFactory.start_xml_logger(filePrefix) $ie.set_logger($logger) ##Excel file functions $lgn=Excel_file.new #making object of workbookfunction $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") ##java popup hadling #$pop=Jave_PopUps.new ##making object of javapopup end #----- js_dialog.rb ----- #require 'win32ole' # # Use AutoIt to read and close Javascript dialog windows # module JavascriptDialog # # Target javascript dialogs with this window title # WINDOW_TITLE = "Microsoft Internet Explorer" class << self # # Return the text contained in a javascript dialog (e.g. an "alert()") # if such a dialog is present or appears within +wait_seconds+. # def text(wait_seconds = 1) # sleep 0.3 autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) if wait_seconds s = autoit.WinGetText(WINDOW_TITLE) s unless s == "1" end # # Close any active javascript dialog # def close autoit.WinClose WINDOW_TITLE end # # Press the "OK" button on a javascript dialog # def ok autoit.ControlClick(WINDOW_TITLE, "", "OK") end # # Press the "Cancel" button on a javascript dialog # def cancel autoit.ControlClick(WINDOW_TITLE, "", "Cancel") end # # Press the "Yes" button on a javascript dialog # def yes autoit.ControlClick(WINDOW_TITLE, "", "Yes") end # # Press the "No" button on a javascript dialog # def no autoit.ControlClick(WINDOW_TITLE, "", "No") end private # # Return an AutoIt COM object, creating it if it doesn't already # exist # def autoit unless defined? @@autoit @@autoit = WIN32OLE.new("AutoItX3.Control") end @@autoit end end end module Test::Unit::Assertions # # Passes if a Javascript dialog appears within +wait_seconds+ and its # text matches the given (optional) pattern. # # Use like this: # assert_js_dialog do # watir_command_to_make_dialog_appear # end # Or like this: # assert_js_dialog /Text to find in the dialog/, "Cancel" do # watir_command_to_make_dialog_appear # end # def assert_js_dialog(pattern = //, action = "close", message = nil) _wrap_assertion do begin pipe = IO.popen("ruby exetry.rb #{action}") yield window_text = pipe.read rescue "" pipe.close unless window_text.empty? assert_block(build_message(message, " not found in JavaScript dialog.", pattern)) do window_text.match(pattern) end else raise Test::Unit::AssertionFailedError.new( build_message(message, "No JavaScript window found.")) end ensure pipe.close if pipe && !pipe.closed? end end end end # test - will close and print the text of an opened javascript dialog if # run as "ruby js_dialog.rb" if $0 == __FILE__ action = ARGV.shift || "close" print JavascriptDialog.text || "" JavascriptDialog.send action end def test_PSCLogin #call start method... start #fires up the IE browser and a logger object #variables-URL test_site = 'https://www.philipnow.com/envcss/' $logger.log("## PSCUser_Login_Logoff_4") $logger.log("") $logger.log("Description- Do not enter anything in the E-mail Address and Password field and click Login button.") #logs only to corelogger file $logger.log("Expected Output-The user should not be able to login.") $logger.log("") $logger.log("Step 1: Go to the Philipnow.com :- 'https://www.philipnow.com/envcss/'") $ie.goto(test_site) $logger.log(" Action-1: entered " + test_site + " in the address bar.") $logger.log(":Step 2: Do not enter any thing in user id") val_userid=$lgn.TakeData("a",1,$wrk_sht) $ie.text_field(:name, "username").set(val_userid.to_s) $logger.log(" Action-2: entered Nothing in in e-mail address") $logger.log(":Step-3: Do not enter any thing in password field") val_password=$lgn.TakeData("b",1,$wrk_sht) $ie.text_field(:name,"password").set(val_password.to_s) $logger.log(":Action-3: entered Nothing in password field") #$pop.startClicker("OK",3) assert_js_dialog do $ie.button(:name, "login").click end $logger.log(":Step-4: Click the Login button") $pop.text(1) $logger.log("Action-4: clicked the Login button.") begin assert($ie.contains_text("Welcome to Client Self-service Portal, Alex Reyes!") ) $logger.log("*FAILED*." + e.message + "\n" + e.backtrace.join("\n")) $logger.log("Test Failed:Expected result has not been achieved:- User is able to login ") $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail Address and Password field and click Login button.","Expected Output-The user should not be able to login.","TEST FAILED:") #logs to both the XML file and corelogger rescue => e $logger.log("Test Passed:Expected result has been achieved:- User is not able to login ") $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail Address and Password field and click Login button.","Expected Output-The user should not be able to login.","TEST PASSED:") #logs to both the XML file and corelogger end $ie.close $logger.log("Close excel file") $lgn.excel_close $logger.log("Closed excel file") $logger.log "## End of test: PSC login\n" end end please help!!! Thanks in Advance Regards and Thnaks Shalini gupta -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070424/de90c0fb/attachment-0001.html From shalinigupta2006 at gmail.com Tue Apr 24 06:34:21 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Tue, 24 Apr 2007 16:04:21 +0530 Subject: [Wtr-general] how to capture text of a popup window..... Message-ID: <7523f5800704240334x595440e2x45eff0cd88ad02db@mail.gmail.com> Hi all, I got the answer how to click on 'ok' button. But still i have two problems --- that code is not working when im trying to run that code through the exe file of that ruby file which is using that code. and second one is i want to capure the text of that popup.. i tried this with no success #----- js_dialog.rb ----- require 'win32ole' require 'test/unit' require 'test/unit/ui/console/testrunner' # # Use AutoIt to read and close Javascript dialog windows # module JavascriptDialog # # Target javascript dialogs with this window title # WINDOW_TITLE = "Microsoft Internet Explorer" class << self # # Return the text contained in a javascript dialog (e.g. an "alert()") # if such a dialog is present or appears within +wait_seconds+. # def text(wait_seconds = 1) # sleep 0.3 autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) if wait_seconds s = autoit.WinGetText(WINDOW_TITLE) s unless s == "1" end # # Close any active javascript dialog # def close autoit.WinClose WINDOW_TITLE end # # Press the "OK" button on a javascript dialog # def ok autoit.ControlClick(WINDOW_TITLE, "", "OK") end # # Press the "Cancel" button on a javascript dialog # def cancel autoit.ControlClick(WINDOW_TITLE, "", "Cancel") end # # Press the "Yes" button on a javascript dialog # def yes autoit.ControlClick(WINDOW_TITLE, "", "Yes") end # # Press the "No" button on a javascript dialog # def no autoit.ControlClick(WINDOW_TITLE, "", "No") end private # # Return an AutoIt COM object, creating it if it doesn't already # exist # def autoit unless defined? @@autoit @@autoit = WIN32OLE.new("AutoItX3.Control") end @@autoit end end end module Test::Unit::Assertions # # Passes if a Javascript dialog appears within +wait_seconds+ and its # text matches the given (optional) pattern. # # Use like this: # assert_js_dialog do # watir_command_to_make_dialog_appear # end # Or like this: # assert_js_dialog /Text to find in the dialog/, "Cancel" do # watir_command_to_make_dialog_appear # end # def assert_js_dialog(pattern = //, action = "close", message = nil) _wrap_assertion do begin pipe = IO.popen("ruby exetry.rb #{action}") yield window_text = pipe.read rescue "" pipe.close unless window_text.empty? assert_block(build_message(message, " not found in JavaScript dialog.", pattern)) do window_text.match(pattern) end else raise Test::Unit::AssertionFailedError.new( build_message(message, "No JavaScript window found.")) end ensure pipe.close if pipe && !pipe.closed? end end end end # test - will close and print the text of an opened javascript dialog if # run as "ruby js_dialog.rb" if $0 == __FILE__ action = ARGV.shift || "close" print JavascriptDialog.text || "" JavascriptDialog.send action end please help me regarding this.. Thanks IN advance Regards Shalini Gupta -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070424/5eac955f/attachment.html From shalinigupta2006 at gmail.com Tue Apr 24 08:06:55 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Tue, 24 Apr 2007 17:36:55 +0530 Subject: [Wtr-general] how to capture text from popup window Message-ID: <7523f5800704240506r1ea4d805hf441fd95d664a1bf@mail.gmail.com> HI List, Please help regarding popup. How to get the text of a popup window.. its very urgent please help. Regards Shalini gupta -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070424/691deecc/attachment.html From angrez at gmail.com Tue Apr 24 08:41:15 2007 From: angrez at gmail.com (Angrez Singh) Date: Tue, 24 Apr 2007 18:11:15 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704240506r1ea4d805hf441fd95d664a1bf@mail.gmail.com> References: <7523f5800704240506r1ea4d805hf441fd95d664a1bf@mail.gmail.com> Message-ID: Hi, As far as I know, clicking some button on Pop up window happens in a different process (different from current process in which your script is running). Correct me if I am wrong here? You can get the text using AutoIt3 and WinGetText method. The only thing you need to find out is how you communicate data or the text between two different processes. Regards, Angrez On 4/24/07, SHALINI GUPTA wrote: > > HI List, > > Please help regarding popup. > How to get the text of a popup window.. > its very urgent please help. > > Regards > Shalini gupta > > _______________________________________________ > 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/20070424/27b25f81/attachment.html From forum-watir-users at openqa.org Tue Apr 24 10:14:37 2007 From: forum-watir-users at openqa.org (Eoin) Date: Tue, 24 Apr 2007 09:14:37 CDT Subject: [Wtr-general] How to incorporate my Watir script into Nunit Message-ID: <23828856.1441177424107171.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I've Watir,Ruby,Nunit up and running. I've a Watir script that runs ok standalone so now I want to incorporate it into Nunit. *WatirTest.rb* require 'watir' require 'test/unit' require 'test/unit/assertions' include Watir class WatirTest < Test::Unit::TestCase def setup @ie = IE.new @ie.goto("http://www.google.com") end def test_Valid assert(@ie.contains_text('Google'), 'This unit test should always pass.') end def test_Invalid assert(!@ie.contains_text('Google'), 'This unit test should always fail.') end def teardown @ie.close end end *TestWaitir.cs* using System; using System.Collections.Generic; using System.Text; using NUnit.Framework; namespace Rap.Web.Test { [TestFixture] public class TestRubyWatir { [Test] [Category("Watir")] //Description="Verifies you may run standard NUnit-only tests." public void NUnitOnly_NoRubyAttrib() { Assert.IsTrue(true, "This NUnit-only test should always pass."); } [Test] public void WatirTest_Valid() { //RTE.ExecuteTest(); WatirAssert.TestPassed("WatirTest.rb"); } } } The first method "NunitOnly_NoRubyAttrib() works and shows up in Nunit. How do I get the second method to work "WatirTest_Valid" to take in my Watir script and run in Nunit. Any help would be greatly appreciated. I'm new to these tools so apologies in advance if my question is general. From paul.rogers at shaw.ca Tue Apr 24 10:52:18 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 Apr 2007 08:52:18 -0600 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: References: <7523f5800704240506r1ea4d805hf441fd95d664a1bf@mail.gmail.com> Message-ID: there is stuff in the winclicker to do it too. We've got the javascript pop up text back to the main app by saving it to a file Paul -------------- next part -------------- Hi, As far as I know, clicking some button on Pop up window happens in a different process (different from current process in which your script is running). Correct me if I am wrong here? You can get the text using AutoIt3 and WinGetText method. The only thing you need to find out is how you communicate data or the text between two different processes. Regards, Angrez On 4/24/07, SHALINI GUPTA wrote: > > HI List, > > Please help regarding popup. > How to get the text of a popup window.. > its very urgent please help. > > Regards > Shalini gupta > > _______________________________________________ > 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/20070424/5319d67d/attachment.html -------------- next part -------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Tue Apr 24 11:38:02 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 24 Apr 2007 09:38:02 -0600 Subject: [Wtr-general] Watir T-shirt (need the logo?) Message-ID: <72799cd70704240838y1f3acb8bgc7327ba66d29bc36@mail.gmail.com> I still have the enormous file of the high-def Watir logo Jonathan Kohl sent me back in the day. Let me know if you need a copy of the file. From charley.baker at gmail.com Tue Apr 24 12:36:23 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 24 Apr 2007 10:36:23 -0600 Subject: [Wtr-general] NoMethodError: undefined method `assert_equal' In-Reply-To: <7523f5800704232149n284ee8ddh88a41f327475d793@mail.gmail.com> References: <4f6da15b0704230702i3fc3ff26hecce84fba2b343c3@mail.gmail.com> <7523f5800704232149n284ee8ddh88a41f327475d793@mail.gmail.com> Message-ID: You can get the text of the window using AutoIt, in javascript popups the text is usually in the first or second static text control: oPopup = Watir::autoit # Change into the WinTitleMatchMode that supports classnames and handles oPopup.AutoItSetOption("WinTitleMatchMode", 4) 0.upto(timeout) { |i| ret = oPopup.WinWait("Window Title","",1) win_text = oPopup.WinGetText("Window Title") if 1 == ret && !(win_text == '') then bPopupFound = true oPopup.WinActivate("Window Title",'') win_text = oPopup.ControlGetText(what, '', 'Static2').strip if '' == win_text then win_text = oPopup.ControlGetText(what, '', 'Static1').strip end break end Change Window Title to match what you're looking for, js popups can be found by classname as well: 'classname=#32770' instead of title. -Charley On 4/23/07, SHALINI GUPTA wrote: > > Hi Ajitesh, > > I am Shalini gupta.Hope u'll be fine.I am also working on watir.I have > problem with java popups.i am able to handle that.but how to get text on > popup i dont know.please help me regarding this.Thanks in Advance. > > Regards and Thanks > Shalini Gupta > > On 4/23/07, Ajitesh Srinetra wrote: > > > > Adding > > > > require 'test/unit/assertions' > > include Test::Unit::Assertions > > > > will help.A lot of examples for assertions is provided in unit tests > > examples .Please follow them in your testcases > > > > Ajitesh > > > > > > > > _______________________________________________ > > 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/20070424/7691aaff/attachment-0001.html From charley.baker at gmail.com Tue Apr 24 12:39:29 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 24 Apr 2007 10:39:29 -0600 Subject: [Wtr-general] Watir and smartclient In-Reply-To: <23987061.1871177393615717.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <23987061.1871177393615717.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: This is the source code, what you really want to look at is the rendered DOM. Take a look at the controls with Microsoft Internet Explorer Developer toolbar: http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038 This will show you the controls and any associated id, name, etc attributes which you can then use with Watir. -Charley On 4/23/07, Sadeesh Vinoth wrote: > > Hi Angrez, > > Please find the source of web page developed using smartlcient, > Please let me know weather watir can be used for this. > > Source. > > > > > > SmartClient SDK - Component Data Binding example > > > > > > > > > > > > > > > Thanks, > Sadeesh > _______________________________________________ > 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/20070424/5e2fe750/attachment-0001.html From charley.baker at gmail.com Tue Apr 24 13:00:20 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 24 Apr 2007 11:00:20 -0600 Subject: [Wtr-general] OT: New version of RDT plugin for Eclipse Message-ID: For all of you who are working with Eclipse and the rdt plugin, there's a new version finally. They haven't updated their main site, but have a news announcement on their base sourceforge project page: Most notably are the inclusion of refactorings, mark occurrences support, improved code completion, better integration with the ruby interpreters, ruby-debug support, go to declaration, and under-the-hood type inferrencing. I've only used it for the past day, but it's a bit nicer than the previous version. Also spending some time monkeying around with NetBeans and it's coming Ruby support which I like for formatting and a couple of other things. Note: This version of rdt requires jre 1.5 or above to run. cheers, Charley -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070424/a5f44e67/attachment.html From rdewolfe at Credant.com Tue Apr 24 13:05:12 2007 From: rdewolfe at Credant.com (Russ DeWolfe) Date: Tue, 24 Apr 2007 12:05:12 -0500 Subject: [Wtr-general] Cannot get Autoit to create a simple control instance Message-ID: I have installed AutoIT, including the dll and the autoitx active x control and here is what I get: irb(main):001:0> require 'win32ole' => true irb(main):002:0> autoit = WIN32OLE.new('AutoItX3.Control') WIN32OLERuntimeError: unknown OLE server: `AutoItX3.Control' HRESULT error code:0x800401f3 Invalid class string from (irb):2:in `initialize' from (irb):2:in `new' from (irb):2 Thanks for the help Russ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070424/c188ac6e/attachment.html From charley.baker at gmail.com Tue Apr 24 13:14:15 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 24 Apr 2007 11:14:15 -0600 Subject: [Wtr-general] Cannot get Autoit to create a simple control instance In-Reply-To: References: Message-ID: Try running the command regsvr32 AutoItX3.dll at the command line where the autoit dll lives. Also make sure you have administrator rights on your machine, otherwise it won't work correctly. -Charley On 4/24/07, Russ DeWolfe wrote: > > I have installed AutoIT, including the dll and the autoitx active x > control and here is what I get: > > irb(main):001:0> require 'win32ole' > => true > irb(main):002:0> autoit = WIN32OLE.new('AutoItX3.Control') > WIN32OLERuntimeError: unknown OLE server: `AutoItX3.Control' > HRESULT error code:0x800401f3 > Invalid class string > from (irb):2:in `initialize' > from (irb):2:in `new' > from (irb):2 > > Thanks for the help > > Russ > > _______________________________________________ > 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/20070424/1551ac72/attachment.html From bret at pettichord.com Wed Apr 25 00:18:39 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 24 Apr 2007 23:18:39 -0500 Subject: [Wtr-general] How to incorporate my Watir script into Nunit In-Reply-To: <23828856.1441177424107171.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <23828856.1441177424107171.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <462ED69F.6040107@pettichord.com> Eoin, Have you looked at this information? http://www.hanselman.com/blog/IntegratingRubyAndWatirWithNUnit.aspx I have another question for you. I've recently been getting Watir to work with Nant and CruiseControl.Net. I am curious what you see as the benefits to integrating Watir with Nunit? Bret From cancer9920 at gmail.com Wed Apr 25 00:42:41 2007 From: cancer9920 at gmail.com (ankur bajpai) Date: Wed, 25 Apr 2007 10:12:41 +0530 Subject: [Wtr-general] Watir T-shirt (need the logo?) In-Reply-To: <72799cd70704240838y1f3acb8bgc7327ba66d29bc36@mail.gmail.com> References: <72799cd70704240838y1f3acb8bgc7327ba66d29bc36@mail.gmail.com> Message-ID: Ya i wud like to have it Chris... On 4/24/07, Chris McMahon wrote: > > I still have the enormous file of the high-def Watir logo Jonathan > Kohl sent me back in the day. Let me know if you need a copy of the > file. > _______________________________________________ > 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/20070425/e6844bc0/attachment.html From bret at pettichord.com Wed Apr 25 00:49:56 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 24 Apr 2007 23:49:56 -0500 Subject: [Wtr-general] Helping with Watir's documentation In-Reply-To: <970956b0704240034k18159ca3s778d73d517f1e90b@mail.gmail.com> References: <970956b0704240034k18159ca3s778d73d517f1e90b@mail.gmail.com> Message-ID: <462EDDF4.7090503@pettichord.com> Jeff Fry wrote: > I started playing with this tonight, and went as far as: > > 1. installing eclipse + rdt, subclipse at home > 2. importing https://svn.openqa.org/svn/watir/trunk > I suggest that you import from https://svn.openqa.org/svn/watir/trunk/watir instead. This will make some things easier for you, especially if you are using Eclipse. I realize that the advice on the openqa.org website suggests you use the url above, but I don't believe this is a part of the openqa.org website that we are able to change. > > 1. making a trivial edit to the comments that generate the rdoc, and > 2. writing up a (still very rough) 'how to' for the above: > http://wiki.openqa.org/display/WTR/How+To+Update+RDOC+and+Submit+Patches > This looks quite good. Thanks. > > That sounds fine. My bet, however, would be that you'd do better > to simply try reading through the archives to find questions that > people have asked whose answers aren't already in the doc. I > actually have a thunderbird (imap) archive of wtr-general with > many of these threads flagged. I wonder if there is a way i could > package this up and send it to you? > > > That sounds great. I did a bit of quick research and turned up: > http://kb.mozillazine.org/Moving_your_profile_folder > http://kb.mozillazine.org/Profile_backup > > Brett, do you have any private data that would need to be taken out of > the archive? If so, it might be complicated. If not, it seems like > these links might light the way. Let me know. That is more than i'd like to send. I am separately sending you a zip file containing the specific mail archive i want to share with you. Hopefully you will be able to read it. > My first inclination is to add anything I know is missing to the rdoc > (perhaps because I depend so heavily on the rdoc when I code). That > said, the User Guide is clearly important. If there are others who > have more energy for updating the rdoc and y'all think the User Guide > is more in need of volunteer help I could easily be persuaded to work > there first. You should focus on what you think is most important. > I should finish by saying that I have a few days worth of time to > contribute over the next three weeks, and then probably no time for a > month or two. There's clearly more need for watir doc help than I'll > be able to do in that timeframe. Part of the reason we are moving this > conversation on list is so that if anyone reading this wants to join > in, you know you can. Please do! Thanks for your help and you willingness to share the process with others. If others have documentation updates for you, how should they send them to you? Wiki? Jira? Email? Bret From angrez at gmail.com Wed Apr 25 00:56:58 2007 From: angrez at gmail.com (Angrez Singh) Date: Wed, 25 Apr 2007 10:26:58 +0530 Subject: [Wtr-general] Watir and smartclient In-Reply-To: References: <23987061.1871177393615717.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Sadeesh, Is it possible for you to post the final HTML that is rendered on the browser? I think you have pasted the source code. Regards, Angrez On 4/24/07, Charley Baker wrote: > > This is the source code, what you really want to look at is the rendered > DOM. Take a look at the controls with Microsoft Internet Explorer Developer > toolbar: > http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038 > > This will show you the controls and any associated id, name, etc > attributes which you can then use with Watir. > > -Charley > > On 4/23/07, Sadeesh Vinoth wrote: > > > > Hi Angrez, > > > > Please find the source of web page developed using smartlcient, > > Please let me know weather watir can be used for this. > > > > Source. > > > > > > > > > > > > SmartClient SDK - Component Data Binding example > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Thanks, > > Sadeesh > > _______________________________________________ > > 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/20070425/bae5b279/attachment-0001.html From shalinigupta2006 at gmail.com Wed Apr 25 01:03:34 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Wed, 25 Apr 2007 10:33:34 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: References: <7523f5800704240506r1ea4d805hf441fd95d664a1bf@mail.gmail.com> Message-ID: <7523f5800704242203q565fe426ge34018cd6f834ecb@mail.gmail.com> hi, thanks for reply!!! but i have used autoit and WinGet Text as:---(with no success) #----- js_dialog.rb ----- require 'win32ole' require 'test/unit' require 'test/unit/ui/console/testrunner' # # Use AutoIt to read and close Javascript dialog windows # module JavascriptDialog # # Target javascript dialogs with this window title # WINDOW_TITLE = "Microsoft Internet Explorer" class << self # # Return the text contained in a javascript dialog (e.g. an "alert()") # if such a dialog is present or appears within +wait_seconds+. # def text(wait_seconds = 1) # sleep 0.3 autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) if wait_seconds s = autoit.WinGetText(WINDOW_TITLE) s unless s == "1" end # # Close any active javascript dialog # def close autoit.WinClose WINDOW_TITLE end # # Press the "OK" button on a javascript dialog # def ok autoit.ControlClick(WINDOW_TITLE, "", "OK") end # # Press the "Cancel" button on a javascript dialog # def cancel autoit.ControlClick(WINDOW_TITLE, "", "Cancel") end # # Press the "Yes" button on a javascript dialog # def yes autoit.ControlClick(WINDOW_TITLE, "", "Yes") end # # Press the "No" button on a javascript dialog # def no autoit.ControlClick(WINDOW_TITLE, "", "No") end private # # Return an AutoIt COM object, creating it if it doesn't already # exist # def autoit unless defined? @@autoit @@autoit = WIN32OLE.new("AutoItX3.Control") end @@autoit end end end module Test::Unit::Assertions # # Passes if a Javascript dialog appears within +wait_seconds+ and its # text matches the given (optional) pattern. # # Use like this: # assert_js_dialog do # watir_command_to_make_dialog_appear # end # Or like this: # assert_js_dialog /Text to find in the dialog/, "Cancel" do # watir_command_to_make_dialog_appear # end # def assert_js_dialog(pattern = //, action = "close", message = nil) _wrap_assertion do begin pipe = IO.popen("ruby exetry.rb #{action}") yield window_text = pipe.read rescue "" pipe.close unless window_text.empty? assert_block(build_message(message, " not found in JavaScript dialog.", pattern)) do window_text.match(pattern) end else raise Test::Unit::AssertionFailedError.new( build_message(message, "No JavaScript window found.")) end ensure pipe.close if pipe && !pipe.closed? end end end end # test - will close and print the text of an opened javascript dialog if # run as "ruby js_dialog.rb" if $0 == __FILE__ action = ARGV.shift || "close" print JavascriptDialog.text || "" JavascriptDialog.send action end if possible then please help me...and give me some code... Regards Shalini Gupta On 4/24/07, Paul Rogers wrote: > > there is stuff in the winclicker to do it too. We've got the javascript > pop up text back to the main app by saving it to a file > > Paul > > Hi, > > As far as I know, clicking some button on Pop up window happens in a > different process (different from current process in which your script is > running). Correct me if I am wrong here? > > You can get the text using AutoIt3 and WinGetText method. The only thing > you need to find out is how you communicate data or the text between two > different processes. > > Regards, > Angrez > > On 4/24/07, SHALINI GUPTA wrote: > > > > HI List, > > > > Please help regarding popup. > > How to get the text of a popup window.. > > its very urgent please help. > > > > Regards > > Shalini gupta > > > > _______________________________________________ > > 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/20070425/b594a47f/attachment.html From angrez at gmail.com Wed Apr 25 01:14:01 2007 From: angrez at gmail.com (Angrez Singh) Date: Wed, 25 Apr 2007 10:44:01 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704242203q565fe426ge34018cd6f834ecb@mail.gmail.com> References: <7523f5800704240506r1ea4d805hf441fd95d664a1bf@mail.gmail.com> <7523f5800704242203q565fe426ge34018cd6f834ecb@mail.gmail.com> Message-ID: Hi, As Paul said that you need to store the text in a file and then read that file in your main process. Because pop up's are handled in different process. So even if you return that value from the method it won't be visible to main process. Write this value to a file and then read the contents. Regards, Angrez On 4/25/07, SHALINI GUPTA wrote: > > hi, > > thanks for reply!!! > > but i have used autoit and WinGet Text as:---(with no success) > > #----- js_dialog.rb ----- > > require 'win32ole' > require 'test/unit' > require 'test/unit/ui/console/testrunner' > # > # Use AutoIt to read and close Javascript dialog windows > # > module JavascriptDialog > > # > # Target javascript dialogs with this window title > # > WINDOW_TITLE = "Microsoft Internet Explorer" > > class << self > > # > # Return the text contained in a javascript dialog (e.g. an > "alert()") > # if such a dialog is present or appears within +wait_seconds+. > # > def text(wait_seconds = 1) > # sleep 0.3 > autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) if > wait_seconds > s = autoit.WinGetText(WINDOW_TITLE) > s unless s == "1" > end > > # > # Close any active javascript dialog > # > def close > autoit.WinClose WINDOW_TITLE > end > > # > # Press the "OK" button on a javascript dialog > # > def ok > autoit.ControlClick(WINDOW_TITLE, "", "OK") > end > # > # Press the "Cancel" button on a javascript dialog > # > def cancel > autoit.ControlClick(WINDOW_TITLE, "", "Cancel") > end > # > # Press the "Yes" button on a javascript dialog > # > def yes > autoit.ControlClick(WINDOW_TITLE, "", "Yes") > end > # > # Press the "No" button on a javascript dialog > # > def no > autoit.ControlClick(WINDOW_TITLE, "", "No") > end > > private > > # > # Return an AutoIt COM object, creating it if it doesn't > already > # exist > # > def autoit > unless defined? @@autoit > @@autoit = WIN32OLE.new("AutoItX3.Control") > end > @@autoit > end > end > end > > module Test::Unit::Assertions > # > # Passes if a Javascript dialog appears within +wait_seconds+ and its > # text matches the given (optional) pattern. > # > # Use like this: > # assert_js_dialog do > # watir_command_to_make_dialog_appear > # end > # Or like this: > # assert_js_dialog /Text to find in the dialog/, "Cancel" do > # watir_command_to_make_dialog_appear > # end > # > def assert_js_dialog(pattern = //, action = "close", message = nil) > _wrap_assertion do > begin > pipe = IO.popen("ruby exetry.rb #{action}") > yield > window_text = pipe.read rescue "" > pipe.close > unless window_text.empty? > assert_block(build_message(message, > " not found in JavaScript dialog.", pattern)) > do > window_text.match(pattern) > end > else > raise Test::Unit:: AssertionFailedError.new( > build_message(message, "No JavaScript window > found.")) > end > ensure > pipe.close if pipe && !pipe.closed? > end > end > end > end > > # test - will close and print the text of an opened javascript dialog if > # run as "ruby js_dialog.rb" > if $0 == __FILE__ > action = ARGV.shift || "close" > print JavascriptDialog.text || "" > JavascriptDialog.send action > end > > if possible then please help me...and give me some code... > > Regards > Shalini Gupta > > > On 4/24/07, Paul Rogers wrote: > > > > there is stuff in the winclicker to do it too. We've got the javascript > > pop up text back to the main app by saving it to a file > > > > Paul > > > > Hi, > > > > As far as I know, clicking some button on Pop up window happens in a > > different process (different from current process in which your script is > > running). Correct me if I am wrong here? > > > > You can get the text using AutoIt3 and WinGetText method. The only thing > > you need to find out is how you communicate data or the text between two > > different processes. > > > > Regards, > > Angrez > > > > On 4/24/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > HI List, > > > > > > Please help regarding popup. > > > How to get the text of a popup window.. > > > its very urgent please help. > > > > > > Regards > > > Shalini gupta > > > > > > _______________________________________________ > > > 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 > > > > > _______________________________________________ > 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/20070425/ee49e279/attachment-0001.html From shalinigupta2006 at gmail.com Wed Apr 25 01:34:03 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Wed, 25 Apr 2007 11:04:03 +0530 Subject: [Wtr-general] NoMethodError: undefined method `assert_equal' In-Reply-To: References: <4f6da15b0704230702i3fc3ff26hecce84fba2b343c3@mail.gmail.com> <7523f5800704232149n284ee8ddh88a41f327475d793@mail.gmail.com> Message-ID: <7523f5800704242234h6e1b69b3mcea23fd12b4b84ee@mail.gmail.com> hi, I have used this as... $oPopup=Watir::autoit $oPopup.AutoItSetOption("WinTitleMatchMode", 4) 0.upto(timeout) |i| ret = $oPopup.WinWait("Microsoft Internet Explorer","",1) win_text = $oPopup.WinGetText("Microsoft Internet Explorer") if 1 == ret && !(win_text == '') then bPopupFound = true $oPopup.WinActivate("Microsoft Internet Explorer",'') win_text = $oPopup.ControlGetText(what, '', 'Static2').strip puts win_text.to_s if '' == win_text then win_text = $oPopup.ControlGetText(what, '', 'Static1').strip end break end but its is giving error:-- >ruby exetry.rb c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- autoit (LoadError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from exetry.rb:12 >Exit code: 1 tell me for this is autoit is required i have installed that in my PC... but still it is giving that error.. when i made 'oPopup' object of WIN32OLE AS: oPopup=WIN32OLE.new("AutoItX3.Control") It was not giving that error.. that it is giving this error:- exetry.rb:139: syntax error, unexpected kEND, expecting '}' when i remove '{' this it is giving this error:- test_PSCLogin(TC_PSC_userlogin): ArgumentError: wrong number of arguments (0 for 1) exetry.rb:93:in `timeout' exetry.rb:93:in `test_PSCLogin' please help me regarding this..its very urgent.. Thanks In advance.. Regards Shalini Gupta On 4/24/07, Charley Baker wrote: > > You can get the text of the window using AutoIt, in javascript popups the > text is usually in the first or second static text control: > oPopup = Watir::autoit > # Change into the WinTitleMatchMode that supports classnames > and handles > oPopup.AutoItSetOption("WinTitleMatchMode", 4) > 0.upto(timeout) { |i| > ret = oPopup.WinWait("Window Title","",1) > win_text = oPopup.WinGetText("Window Title") > if 1 == ret && !(win_text == '') then > bPopupFound = true > oPopup.WinActivate("Window Title",'') > win_text = oPopup.ControlGetText(what, '', > 'Static2').strip > if '' == win_text then win_text = > oPopup.ControlGetText(what, '', 'Static1').strip end > break > end > > Change Window Title to match what you're looking for, js popups can be > found by classname as well: 'classname=#32770' instead of title. > > -Charley > > > On 4/23/07, SHALINI GUPTA wrote: > > > > Hi Ajitesh, > > > > I am Shalini gupta.Hope u'll be fine.I am also working on watir.I have > > problem with java popups.i am able to handle that.but how to get text on > > popup i dont know.please help me regarding this.Thanks in Advance. > > > > Regards and Thanks > > Shalini Gupta > > > > On 4/23/07, Ajitesh Srinetra < ajitesh.srinetra at gmail.com > wrote: > > > > > > Adding > > > > > > require 'test/unit/assertions' > > > include Test::Unit::Assertions > > > > > > will help.A lot of examples for assertions is provided in unit tests > > > examples .Please follow them in your testcases > > > > > > Ajitesh > > > > > > > > > > > > _______________________________________________ > > > 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/20070425/e5651354/attachment.html From shalinigupta2006 at gmail.com Wed Apr 25 01:45:14 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Wed, 25 Apr 2007 11:15:14 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: References: <7523f5800704240506r1ea4d805hf441fd95d664a1bf@mail.gmail.com> <7523f5800704242203q565fe426ge34018cd6f834ecb@mail.gmail.com> Message-ID: <7523f5800704242245i4f690a2eh27a6a48c23f756a5@mail.gmail.com> hi, Thanks for quick reply... please tell me how can i write output of one method to a file.... my method is.. def text(wait_seconds = 1) # sleep 0.3 autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) if wait_seconds s = autoit.WinGetText(WINDOW_TITLE) s unless s == "1" end please help me.. Thanks In Advance Regards Shalini Gupta On 4/25/07, Angrez Singh wrote: > > Hi, > As Paul said that you need to store the text in a file and then read that > file in your main process. Because pop up's are handled in different > process. So even if you return that value from the method it won't be > visible to main process. Write this value to a file and then read the > contents. > > Regards, > Angrez > > On 4/25/07, SHALINI GUPTA wrote: > > > > hi, > > > > thanks for reply!!! > > > > but i have used autoit and WinGet Text as:---(with no success) > > > > #----- js_dialog.rb ----- > > > > require 'win32ole' > > require 'test/unit' > > require 'test/unit/ui/console/testrunner' > > # > > # Use AutoIt to read and close Javascript dialog windows > > # > > module JavascriptDialog > > > > # > > # Target javascript dialogs with this window title > > # > > WINDOW_TITLE = "Microsoft Internet Explorer" > > > > class << self > > > > # > > # Return the text contained in a javascript dialog (e.g. an > > "alert()") > > # if such a dialog is present or appears within +wait_seconds+. > > # > > def text(wait_seconds = 1) > > # sleep 0.3 > > autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) if > > wait_seconds > > s = autoit.WinGetText(WINDOW_TITLE) > > s unless s == "1" > > end > > > > # > > # Close any active javascript dialog > > # > > def close > > autoit.WinClose WINDOW_TITLE > > end > > > > # > > # Press the "OK" button on a javascript dialog > > # > > def ok > > autoit.ControlClick(WINDOW_TITLE, "", "OK") > > end > > # > > # Press the "Cancel" button on a javascript dialog > > # > > def cancel > > autoit.ControlClick(WINDOW_TITLE, "", "Cancel") > > end > > # > > # Press the "Yes" button on a javascript dialog > > # > > def yes > > autoit.ControlClick(WINDOW_TITLE, "", "Yes") > > end > > # > > # Press the "No" button on a javascript dialog > > # > > def no > > autoit.ControlClick(WINDOW_TITLE, "", "No") > > end > > > > private > > > > # > > # Return an AutoIt COM object, creating it if it doesn't > > already > > # exist > > # > > def autoit > > unless defined? @@autoit > > @@autoit = WIN32OLE.new("AutoItX3.Control") > > end > > @@autoit > > end > > end > > end > > > > module Test::Unit::Assertions > > # > > # Passes if a Javascript dialog appears within +wait_seconds+ and > > its > > # text matches the given (optional) pattern. > > # > > # Use like this: > > # assert_js_dialog do > > # watir_command_to_make_dialog_appear > > # end > > # Or like this: > > # assert_js_dialog /Text to find in the dialog/, "Cancel" do > > # watir_command_to_make_dialog_appear > > # end > > # > > def assert_js_dialog(pattern = //, action = "close", message = nil) > > _wrap_assertion do > > begin > > pipe = IO.popen("ruby exetry.rb #{action}") > > yield > > window_text = pipe.read rescue "" > > pipe.close > > unless window_text.empty? > > assert_block(build_message(message, > > " not found in JavaScript dialog.", pattern)) > > do > > window_text.match(pattern) > > end > > else > > raise Test::Unit:: AssertionFailedError.new( > > build_message(message, "No JavaScript window > > found.")) > > end > > ensure > > pipe.close if pipe && !pipe.closed? > > end > > end > > end > > end > > > > # test - will close and print the text of an opened javascript dialog if > > # run as "ruby js_dialog.rb" > > if $0 == __FILE__ > > action = ARGV.shift || "close" > > print JavascriptDialog.text || "" > > JavascriptDialog.send action > > end > > > > if possible then please help me...and give me some code... > > > > Regards > > Shalini Gupta > > > > > > On 4/24/07, Paul Rogers < paul.rogers at shaw.ca> wrote: > > > > > > there is stuff in the winclicker to do it too. We've got the > > > javascript pop up text back to the main app by saving it to a file > > > > > > Paul > > > > > > Hi, > > > > > > As far as I know, clicking some button on Pop up window happens in a > > > different process (different from current process in which your script is > > > running). Correct me if I am wrong here? > > > > > > You can get the text using AutoIt3 and WinGetText method. The only > > > thing you need to find out is how you communicate data or the text between > > > two different processes. > > > > > > Regards, > > > Angrez > > > > > > On 4/24/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > > HI List, > > > > > > > > Please help regarding popup. > > > > How to get the text of a popup window.. > > > > its very urgent please help. > > > > > > > > Regards > > > > Shalini gupta > > > > > > > > _______________________________________________ > > > > 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 > > > > > > > > > _______________________________________________ > > 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/20070425/4eb16863/attachment-0001.html From forum-watir-users at openqa.org Wed Apr 25 01:54:05 2007 From: forum-watir-users at openqa.org (joe fu) Date: Wed, 25 Apr 2007 00:54:05 CDT Subject: [Wtr-general] How to move the mouse to point to an object? Message-ID: <25528448.6811177480476018.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I'm trying to automate the step to move the mouse over an object so that it'll display the hover text on the object. i've tried to use object.fire_event("onmouseover"), but doesn't seem to work. any suggestion? thanks -joe From shalinigupta2006 at gmail.com Wed Apr 25 02:05:05 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Wed, 25 Apr 2007 11:35:05 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704242245i4f690a2eh27a6a48c23f756a5@mail.gmail.com> References: <7523f5800704240506r1ea4d805hf441fd95d664a1bf@mail.gmail.com> <7523f5800704242203q565fe426ge34018cd6f834ecb@mail.gmail.com> <7523f5800704242245i4f690a2eh27a6a48c23f756a5@mail.gmail.com> Message-ID: <7523f5800704242305p107dbc59id5b136d1ba7a2d0c@mail.gmail.com> hi, i have tried to write this as def text(wait_seconds = 1) # sleep 0.3 autoit = WIN32OLE.new("AutoItX3.Control") autoit.WinWait("Microsoft Internet Explorer", nil, wait_seconds) if wait_seconds s = autoit.WinGetText("Microsoft Internet Explorer") $File = File.open("c:\\test.txt", "w") $File.puts(s.to_s) s unless s == "1" end but it is printing only 1..in the file. please help. shalini gupta On 4/25/07, SHALINI GUPTA wrote: > > hi, > Thanks for quick reply... > > please tell me how can i write output of one method to a file.... > > my method is.. > def text(wait_seconds = 1) > # sleep 0.3 > autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) if > wait_seconds > s = autoit.WinGetText(WINDOW_TITLE) > s unless s == "1" > end > please help me.. > > Thanks In Advance > Regards > Shalini Gupta > > On 4/25/07, Angrez Singh wrote: > > > > Hi, > > As Paul said that you need to store the text in a file and then read > > that file in your main process. Because pop up's are handled in different > > process. So even if you return that value from the method it won't be > > visible to main process. Write this value to a file and then read the > > contents. > > > > Regards, > > Angrez > > > > On 4/25/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > hi, > > > > > > thanks for reply!!! > > > > > > but i have used autoit and WinGet Text as:---(with no success) > > > > > > #----- js_dialog.rb ----- > > > > > > require 'win32ole' > > > require 'test/unit' > > > require 'test/unit/ui/console/testrunner' > > > # > > > # Use AutoIt to read and close Javascript dialog windows > > > # > > > module JavascriptDialog > > > > > > # > > > # Target javascript dialogs with this window title > > > # > > > WINDOW_TITLE = "Microsoft Internet Explorer" > > > > > > class << self > > > > > > # > > > # Return the text contained in a javascript dialog (e.g. an > > > "alert()") > > > # if such a dialog is present or appears within > > > +wait_seconds+. > > > # > > > def text(wait_seconds = 1) > > > # sleep 0.3 > > > autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) if > > > wait_seconds > > > s = autoit.WinGetText(WINDOW_TITLE) > > > s unless s == "1" > > > end > > > > > > # > > > # Close any active javascript dialog > > > # > > > def close > > > autoit.WinClose WINDOW_TITLE > > > end > > > > > > # > > > # Press the "OK" button on a javascript dialog > > > # > > > def ok > > > autoit.ControlClick(WINDOW_TITLE, "", "OK") > > > end > > > # > > > # Press the "Cancel" button on a javascript dialog > > > # > > > def cancel > > > autoit.ControlClick(WINDOW_TITLE, "", "Cancel") > > > end > > > # > > > # Press the "Yes" button on a javascript dialog > > > # > > > def yes > > > autoit.ControlClick(WINDOW_TITLE, "", "Yes") > > > end > > > # > > > # Press the "No" button on a javascript dialog > > > # > > > def no > > > autoit.ControlClick(WINDOW_TITLE, "", "No") > > > end > > > > > > private > > > > > > # > > > # Return an AutoIt COM object, creating it if it doesn't > > > already > > > # exist > > > # > > > def autoit > > > unless defined? @@autoit > > > @@autoit = WIN32OLE.new("AutoItX3.Control") > > > end > > > @@autoit > > > end > > > end > > > end > > > > > > module Test::Unit::Assertions > > > # > > > # Passes if a Javascript dialog appears within +wait_seconds+ and > > > its > > > # text matches the given (optional) pattern. > > > # > > > # Use like this: > > > # assert_js_dialog do > > > # watir_command_to_make_dialog_appear > > > # end > > > # Or like this: > > > # assert_js_dialog /Text to find in the dialog/, "Cancel" do > > > # watir_command_to_make_dialog_appear > > > # end > > > # > > > def assert_js_dialog(pattern = //, action = "close", message = > > > nil) > > > _wrap_assertion do > > > begin > > > pipe = IO.popen("ruby exetry.rb #{action}") > > > yield > > > window_text = pipe.read rescue "" > > > pipe.close > > > unless window_text.empty? > > > assert_block(build_message(message, > > > " not found in JavaScript dialog.", > > > pattern)) do > > > window_text.match(pattern) > > > end > > > else > > > raise Test::Unit:: AssertionFailedError.new( > > > build_message(message, "No JavaScript window > > > found.")) > > > end > > > ensure > > > pipe.close if pipe && !pipe.closed? > > > end > > > end > > > end > > > end > > > > > > # test - will close and print the text of an opened javascript dialog > > > if > > > # run as "ruby js_dialog.rb" > > > if $0 == __FILE__ > > > action = ARGV.shift || "close" > > > print JavascriptDialog.text || "" > > > JavascriptDialog.send action > > > end > > > > > > if possible then please help me...and give me some code... > > > > > > Regards > > > Shalini Gupta > > > > > > > > > On 4/24/07, Paul Rogers < paul.rogers at shaw.ca> wrote: > > > > > > > > there is stuff in the winclicker to do it too. We've got the > > > > javascript pop up text back to the main app by saving it to a file > > > > > > > > Paul > > > > > > > > Hi, > > > > > > > > As far as I know, clicking some button on Pop up window happens in a > > > > different process (different from current process in which your script is > > > > running). Correct me if I am wrong here? > > > > > > > > You can get the text using AutoIt3 and WinGetText method. The only > > > > thing you need to find out is how you communicate data or the text between > > > > two different processes. > > > > > > > > Regards, > > > > Angrez > > > > > > > > On 4/24/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > > > > HI List, > > > > > > > > > > Please help regarding popup. > > > > > How to get the text of a popup window.. > > > > > its very urgent please help. > > > > > > > > > > Regards > > > > > Shalini gupta > > > > > > > > > > _______________________________________________ > > > > > 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 > > > > > > > > > > > > > _______________________________________________ > > > 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/20070425/53fb3035/attachment.html From zeljko.filipin at gmail.com Wed Apr 25 04:07:41 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 25 Apr 2007 10:07:41 +0200 Subject: [Wtr-general] How to move the mouse to point to an object? In-Reply-To: <25528448.6811177480476018.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <25528448.6811177480476018.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Joe, Please post html of that object (and a few lines before and after) so we could take a look. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070425/37588624/attachment.html From jhe at resilience.com Wed Apr 25 05:04:54 2007 From: jhe at resilience.com (jhe) Date: Wed, 25 Apr 2007 17:04:54 +0800 Subject: [Wtr-general] Does watir support file download? In-Reply-To: Message-ID: Dear all, Is there a way to download file and save it to hard disk? Thanks in advance. Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070425/ac28988f/attachment-0001.html From forum-watir-users at openqa.org Wed Apr 25 06:01:59 2007 From: forum-watir-users at openqa.org (Eoin) Date: Wed, 25 Apr 2007 05:01:59 CDT Subject: [Wtr-general] How to incorporate my Watir script into Nunit In-Reply-To: <462ED69F.6040107@pettichord.com> Message-ID: <25500279.7761177495349845.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Bret, I've looked at that link allright Bret but haven't got it working yet. The reason I'm trying to integrate Watir with Nunit is that my project team use Nunit to run unit tests for the data acccess layer of our .NET project. Therefore it was decided it was best to try and run our web app unit tests with Nunit as well. We also use Nant for building our project. From tunde.jinadu at gmail.com Wed Apr 25 07:36:39 2007 From: tunde.jinadu at gmail.com (Tunde Jinadu) Date: Wed, 25 Apr 2007 12:36:39 +0100 Subject: [Wtr-general] Button identification Message-ID: <1624b0140704250436m760da71eq83e6213650315297@mail.gmail.com> Hi, Apart from id: Value: Name: How else can a button be recognised, I'm having problems with a button being recognised, if i run the script in isolation, the button in question is selected (as well as if I do the flash method from a console session) but if if I call the script using Load 'scriptname.rb' the script skips past the button I've identified using each of id:, Value: or Name: I prefer not to post the code as I'd have the post details of the source code as well, just another means of identifying a button will suffice for now, if it does not work I'll come back to you. script detail if spreadsheetdata[:internet_end] == "/ApplyCards/ProductDetails.aspx" ie.goto(test_site) load 'internetApply.rb' internetApply(ie, spreadsheetdata) continue else end -- In theory, there is no difference between theory and practice; In practice, there is. Chuck Reid -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070425/52c0588f/attachment.html From zeljko.filipin at gmail.com Wed Apr 25 08:05:32 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 25 Apr 2007 14:05:32 +0200 Subject: [Wtr-general] Button identification In-Reply-To: <1624b0140704250436m760da71eq83e6213650315297@mail.gmail.com> References: <1624b0140704250436m760da71eq83e6213650315297@mail.gmail.com> Message-ID: Hi Tunde, In watir 1.5 I think you can use any attribute of a tag (like class), but I am not sure about that. ie.button(:class, "my_class").click you can also use index ie.button(:index, 1).click or html ie.button(:html, /fancy_attribute='something'/).click or xpath ie.button(:xpath , "//button[@fancy_attribute='something']/") or multiple attributes ie.button(:name => "my_name", :index => 2 ).click Enough? :) If you can post html of that button, it would be easier to answer. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070425/cc2eb9da/attachment.html From tunde.jinadu at gmail.com Wed Apr 25 09:08:39 2007 From: tunde.jinadu at gmail.com (Tunde Jinadu) Date: Wed, 25 Apr 2007 14:08:39 +0100 Subject: [Wtr-general] Button identification In-Reply-To: References: <1624b0140704250436m760da71eq83e6213650315297@mail.gmail.com> Message-ID: <1624b0140704250608xc496782n161a61eddbba2a98@mail.gmail.com> Here you go On 4/25/07, ?eljko Filipin wrote: > > Hi Tunde, > > In watir 1.5 I think you can use any attribute of a tag (like class), but > I am not sure about that. > > ie.button(:class, "my_class").click > > you can also use index > > ie.button (:index, 1).click > > or html > > ie.button(:html, /fancy_attribute='something'/).click > > or xpath > > ie.button(:xpath , "// button[@fancy_attribute='something']/") > > or multiple attributes > > ie.button(:name => "my_name", :index => 2 ).click > > Enough? :) > > If you can post html of that button, it would be easier to answer. > > Zeljko > -- > ZeljkoFilipin.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- In theory, there is no difference between theory and practice; In practice, there is. Chuck Reid -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070425/da20a22b/attachment.html From prema.arya at gmail.com Wed Apr 25 10:00:37 2007 From: prema.arya at gmail.com (Prema Arya) Date: Wed, 25 Apr 2007 19:30:37 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704242305p107dbc59id5b136d1ba7a2d0c@mail.gmail.com> References: <7523f5800704240506r1ea4d805hf441fd95d664a1bf@mail.gmail.com> <7523f5800704242203q565fe426ge34018cd6f834ecb@mail.gmail.com> <7523f5800704242245i4f690a2eh27a6a48c23f756a5@mail.gmail.com> <7523f5800704242305p107dbc59id5b136d1ba7a2d0c@mail.gmail.com> Message-ID: <27915010704250700j77e48d3cge6ab032c216eb0c0@mail.gmail.com> Hi Shalini, Just try this code (modified your code a little) def text(wait_seconds = 1) # sleep 0.3 autoit = WIN32OLE.new("AutoItX3.Control") autoit.WinWait("Microsoft Internet Explorer", nil, wait_seconds) if wait_seconds s = autoit.WinGetText("Microsoft Internet Explorer") file = File.open("c:\\test.txt", "w") # DONT MAKE YOUR VARIABLES GLOBAL UNNECESSARILY file.puts(s) file.close s unless s == "1" # NOT SURE WHY YOU ARE DOING THIS end Let me know if this works. Regards, Prema On 4/25/07, SHALINI GUPTA wrote: > > hi, > > i have tried to write this as > > def text(wait_seconds = 1) > # sleep 0.3 > autoit = WIN32OLE.new("AutoItX3.Control") > autoit.WinWait("Microsoft Internet Explorer", nil, > wait_seconds) if wait_seconds > s = autoit.WinGetText("Microsoft Internet Explorer") > $File = File.open("c:\\test.txt", "w") > $File.puts(s.to_s) > s unless s == "1" > end > > but it is printing only 1..in the file. > please help. > > shalini gupta > > On 4/25/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > hi, > > Thanks for quick reply... > > > > please tell me how can i write output of one method to a file.... > > > > my method is.. > > def text(wait_seconds = 1) > > # sleep 0.3 > > autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) if > > wait_seconds > > s = autoit.WinGetText(WINDOW_TITLE) > > s unless s == "1" > > end > > please help me.. > > > > Thanks In Advance > > Regards > > Shalini Gupta > > > > On 4/25/07, Angrez Singh wrote: > > > > > > Hi, > > > As Paul said that you need to store the text in a file and then read > > > that file in your main process. Because pop up's are handled in different > > > process. So even if you return that value from the method it won't be > > > visible to main process. Write this value to a file and then read the > > > contents. > > > > > > Regards, > > > Angrez > > > > > > On 4/25/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > > hi, > > > > > > > > thanks for reply!!! > > > > > > > > but i have used autoit and WinGet Text as:---(with no success) > > > > > > > > #----- js_dialog.rb ----- > > > > > > > > require 'win32ole' > > > > require 'test/unit' > > > > require 'test/unit/ui/console/testrunner' > > > > # > > > > # Use AutoIt to read and close Javascript dialog windows > > > > # > > > > module JavascriptDialog > > > > > > > > # > > > > # Target javascript dialogs with this window title > > > > # > > > > WINDOW_TITLE = "Microsoft Internet Explorer" > > > > > > > > class << self > > > > > > > > # > > > > # Return the text contained in a javascript dialog (e.g. an > > > > "alert()") > > > > # if such a dialog is present or appears within > > > > +wait_seconds+. > > > > # > > > > def text(wait_seconds = 1) > > > > # sleep 0.3 > > > > autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) if > > > > wait_seconds > > > > s = autoit.WinGetText(WINDOW_TITLE) > > > > s unless s == "1" > > > > end > > > > > > > > # > > > > # Close any active javascript dialog > > > > # > > > > def close > > > > autoit.WinClose WINDOW_TITLE > > > > end > > > > > > > > # > > > > # Press the "OK" button on a javascript dialog > > > > # > > > > def ok > > > > autoit.ControlClick(WINDOW_TITLE, "", "OK") > > > > end > > > > # > > > > # Press the "Cancel" button on a javascript dialog > > > > # > > > > def cancel > > > > autoit.ControlClick(WINDOW_TITLE, "", "Cancel") > > > > end > > > > # > > > > # Press the "Yes" button on a javascript dialog > > > > # > > > > def yes > > > > autoit.ControlClick(WINDOW_TITLE, "", "Yes") > > > > end > > > > # > > > > # Press the "No" button on a javascript dialog > > > > # > > > > def no > > > > autoit.ControlClick(WINDOW_TITLE, "", "No") > > > > end > > > > > > > > private > > > > > > > > # > > > > # Return an AutoIt COM object, creating it if it doesn't > > > > already > > > > # exist > > > > # > > > > def autoit > > > > unless defined? @@autoit > > > > @@autoit = WIN32OLE.new("AutoItX3.Control") > > > > end > > > > @@autoit > > > > end > > > > end > > > > end > > > > > > > > module Test::Unit::Assertions > > > > # > > > > # Passes if a Javascript dialog appears within +wait_seconds+ > > > > and its > > > > # text matches the given (optional) pattern. > > > > # > > > > # Use like this: > > > > # assert_js_dialog do > > > > # watir_command_to_make_dialog_appear > > > > # end > > > > # Or like this: > > > > # assert_js_dialog /Text to find in the dialog/, "Cancel" do > > > > # watir_command_to_make_dialog_appear > > > > # end > > > > # > > > > def assert_js_dialog(pattern = //, action = "close", message = > > > > nil) > > > > _wrap_assertion do > > > > begin > > > > pipe = IO.popen("ruby exetry.rb #{action}") > > > > yield > > > > window_text = pipe.read rescue "" > > > > pipe.close > > > > unless window_text.empty? > > > > assert_block(build_message(message, > > > > " not found in JavaScript dialog.", > > > > pattern)) do > > > > window_text.match(pattern) > > > > end > > > > else > > > > raise Test::Unit:: AssertionFailedError.new( > > > > build_message(message, "No JavaScript window > > > > found.")) > > > > end > > > > ensure > > > > pipe.close if pipe && !pipe.closed? > > > > end > > > > end > > > > end > > > > end > > > > > > > > # test - will close and print the text of an opened javascript > > > > dialog if > > > > # run as "ruby js_dialog.rb" > > > > if $0 == __FILE__ > > > > action = ARGV.shift || "close" > > > > print JavascriptDialog.text || "" > > > > JavascriptDialog.send action > > > > end > > > > > > > > if possible then please help me...and give me some code... > > > > > > > > Regards > > > > Shalini Gupta > > > > > > > > > > > > On 4/24/07, Paul Rogers < paul.rogers at shaw.ca> wrote: > > > > > > > > > > there is stuff in the winclicker to do it too. We've got the > > > > > javascript pop up text back to the main app by saving it to a file > > > > > > > > > > > > > > > Paul > > > > > > > > > > Hi, > > > > > > > > > > As far as I know, clicking some button on Pop up window happens in > > > > > a different process (different from current process in which your script is > > > > > running). Correct me if I am wrong here? > > > > > > > > > > You can get the text using AutoIt3 and WinGetText method. The only > > > > > thing you need to find out is how you communicate data or the text between > > > > > two different processes. > > > > > > > > > > Regards, > > > > > Angrez > > > > > > > > > > On 4/24/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > > > > > > HI List, > > > > > > > > > > > > Please help regarding popup. > > > > > > How to get the text of a popup window.. > > > > > > its very urgent please help. > > > > > > > > > > > > Regards > > > > > > Shalini gupta > > > > > > > > > > > > _______________________________________________ > > > > > > 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 > > > > > > > > > > > > > > > > > _______________________________________________ > > > > 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 > -- Prema Arya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070425/adf8dbde/attachment-0001.html From prema.arya at gmail.com Wed Apr 25 10:00:40 2007 From: prema.arya at gmail.com (Prema Arya) Date: Wed, 25 Apr 2007 19:30:40 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704242305p107dbc59id5b136d1ba7a2d0c@mail.gmail.com> References: <7523f5800704240506r1ea4d805hf441fd95d664a1bf@mail.gmail.com> <7523f5800704242203q565fe426ge34018cd6f834ecb@mail.gmail.com> <7523f5800704242245i4f690a2eh27a6a48c23f756a5@mail.gmail.com> <7523f5800704242305p107dbc59id5b136d1ba7a2d0c@mail.gmail.com> Message-ID: <27915010704250700n398071b8h6f169a639a19d28c@mail.gmail.com> Hi Shalini, Just try this code (modified your code a little) def text(wait_seconds = 1) # sleep 0.3 autoit = WIN32OLE.new("AutoItX3.Control") autoit.WinWait("Microsoft Internet Explorer", nil, wait_seconds) if wait_seconds s = autoit.WinGetText("Microsoft Internet Explorer") file = File.open("c:\\test.txt", "w") # DONT MAKE YOUR VARIABLES GLOBAL UNNECESSARILY file.puts(s) file.close s unless s == "1" # NOT SURE WHY YOU ARE DOING THIS end Let me know if this works. Regards, Prema On 4/25/07, SHALINI GUPTA wrote: > > hi, > > i have tried to write this as > > def text(wait_seconds = 1) > # sleep 0.3 > autoit = WIN32OLE.new("AutoItX3.Control") > autoit.WinWait("Microsoft Internet Explorer", nil, > wait_seconds) if wait_seconds > s = autoit.WinGetText ("Microsoft Internet Explorer") > $File = File.open("c:\\test.txt", "w") > $File.puts(s.to_s) > s unless s == "1" > end > > but it is printing only 1..in the file. > please help. > > shalini gupta > > On 4/25/07, SHALINI GUPTA < shalinigupta2006 at gmail.com > wrote: > > > > hi, > > Thanks for quick reply... > > > > please tell me how can i write output of one method to a file.... > > > > my method is.. > > def text(wait_seconds = 1) > > # sleep 0.3 > > autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) if > > wait_seconds > > s = autoit.WinGetText(WINDOW_TITLE) > > s unless s == "1" > > end > > please help me.. > > > > Thanks In Advance > > Regards > > Shalini Gupta > > > > On 4/25/07, Angrez Singh wrote: > > > > > > Hi, > > > As Paul said that you need to store the text in a file and then read > > > that file in your main process. Because pop up's are handled in different > > > process. So even if you return that value from the method it won't be > > > visible to main process. Write this value to a file and then read the > > > contents. > > > > > > Regards, > > > Angrez > > > > > > On 4/25/07, SHALINI GUPTA < shalinigupta2006 at gmail.com > wrote: > > > > > > > > hi, > > > > > > > > thanks for reply!!! > > > > > > > > but i have used autoit and WinGet Text as:---(with no success) > > > > > > > > #----- js_dialog.rb ----- > > > > > > > > require 'win32ole' > > > > require 'test/unit' > > > > require 'test/unit/ui/console/testrunner' > > > > # > > > > # Use AutoIt to read and close Javascript dialog windows > > > > # > > > > module JavascriptDialog > > > > > > > > # > > > > # Target javascript dialogs with this window title > > > > # > > > > WINDOW_TITLE = "Microsoft Internet Explorer" > > > > > > > > class << self > > > > > > > > # > > > > # Return the text contained in a javascript dialog (e.g. an > > > > "alert()") > > > > # if such a dialog is present or appears within > > > > +wait_seconds+. > > > > # > > > > def text(wait_seconds = 1) > > > > # sleep 0.3 > > > > autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) if > > > > wait_seconds > > > > s = autoit.WinGetText(WINDOW_TITLE) > > > > s unless s == "1" > > > > end > > > > > > > > # > > > > # Close any active javascript dialog > > > > # > > > > def close > > > > autoit.WinClose WINDOW_TITLE > > > > end > > > > > > > > # > > > > # Press the "OK" button on a javascript dialog > > > > # > > > > def ok > > > > autoit.ControlClick(WINDOW_TITLE, "", "OK") > > > > end > > > > # > > > > # Press the "Cancel" button on a javascript dialog > > > > # > > > > def cancel > > > > autoit.ControlClick (WINDOW_TITLE, "", "Cancel") > > > > end > > > > # > > > > # Press the "Yes" button on a javascript dialog > > > > # > > > > def yes > > > > autoit.ControlClick(WINDOW_TITLE, "", "Yes") > > > > end > > > > # > > > > # Press the "No" button on a javascript dialog > > > > # > > > > def no > > > > autoit.ControlClick(WINDOW_TITLE, "", "No") > > > > end > > > > > > > > private > > > > > > > > # > > > > # Return an AutoIt COM object, creating it if it doesn't > > > > already > > > > # exist > > > > # > > > > def autoit > > > > unless defined? @@autoit > > > > @@autoit = WIN32OLE.new("AutoItX3.Control") > > > > end > > > > @@autoit > > > > end > > > > end > > > > end > > > > > > > > module Test::Unit::Assertions > > > > # > > > > # Passes if a Javascript dialog appears within +wait_seconds+ > > > > and its > > > > # text matches the given (optional) pattern. > > > > # > > > > # Use like this: > > > > # assert_js_dialog do > > > > # watir_command_to_make_dialog_appear > > > > # end > > > > # Or like this: > > > > # assert_js_dialog /Text to find in the dialog/, "Cancel" do > > > > # watir_command_to_make_dialog_appear > > > > # end > > > > # > > > > def assert_js_dialog(pattern = //, action = "close", message = > > > > nil) > > > > _wrap_assertion do > > > > begin > > > > pipe = IO.popen("ruby exetry.rb #{action}") > > > > yield > > > > window_text = pipe.read rescue "" > > > > pipe.close > > > > unless window_text.empty? > > > > assert_block(build_message(message, > > > > " not found in JavaScript dialog.", > > > > pattern)) do > > > > window_text.match(pattern) > > > > end > > > > else > > > > raise Test::Unit:: AssertionFailedError.new( > > > > build_message(message, "No JavaScript window > > > > found.")) > > > > end > > > > ensure > > > > pipe.close if pipe && !pipe.closed? > > > > end > > > > end > > > > end > > > > end > > > > > > > > # test - will close and print the text of an opened javascript > > > > dialog if > > > > # run as "ruby js_dialog.rb" > > > > if $0 == __FILE__ > > > > action = ARGV.shift || "close" > > > > print JavascriptDialog.text || "" > > > > JavascriptDialog.send action > > > > end > > > > > > > > if possible then please help me...and give me some code... > > > > > > > > Regards > > > > Shalini Gupta > > > > > > > > > > > > On 4/24/07, Paul Rogers < paul.rogers at shaw.ca > wrote: > > > > > > > > > > there is stuff in the winclicker to do it too. We've got the > > > > > javascript pop up text back to the main app by saving it to a file > > > > > > > > > > > > > > > Paul > > > > > > > > > > Hi, > > > > > > > > > > As far as I know, clicking some button on Pop up window happens in > > > > > a different process (different from current process in which your script is > > > > > running). Correct me if I am wrong here? > > > > > > > > > > You can get the text using AutoIt3 and WinGetText method. The only > > > > > thing you need to find out is how you communicate data or the text between > > > > > two different processes. > > > > > > > > > > Regards, > > > > > Angrez > > > > > > > > > > On 4/24/07, SHALINI GUPTA < shalinigupta2006 at gmail.com > wrote: > > > > > > > > > > > > HI List, > > > > > > > > > > > > Please help regarding popup. > > > > > > How to get the text of a popup window.. > > > > > > its very urgent please help. > > > > > > > > > > > > Regards > > > > > > Shalini gupta > > > > > > > > > > > > _______________________________________________ > > > > > > 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 > > > > > > > > > > > > > > > > > _______________________________________________ > > > > 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 > -- Prema Arya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070425/40e0021a/attachment.html From zeljko.filipin at gmail.com Wed Apr 25 10:45:05 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 25 Apr 2007 16:45:05 +0200 Subject: [Wtr-general] Button identification In-Reply-To: <1624b0140704250608xc496782n161a61eddbba2a98@mail.gmail.com> References: <1624b0140704250436m760da71eq83e6213650315297@mail.gmail.com> <1624b0140704250608xc496782n161a61eddbba2a98@mail.gmail.com> Message-ID: It looks to me that the problem is in internetApply.rb. Can you post it? Or just the part where button is clicked? -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070425/bb88a23e/attachment-0001.html From tunde.jinadu at gmail.com Wed Apr 25 11:06:26 2007 From: tunde.jinadu at gmail.com (Tunde Jinadu) Date: Wed, 25 Apr 2007 16:06:26 +0100 Subject: [Wtr-general] Button identification In-Reply-To: References: <1624b0140704250436m760da71eq83e6213650315297@mail.gmail.com> <1624b0140704250608xc496782n161a61eddbba2a98@mail.gmail.com> Message-ID: <1624b0140704250806w53d42d0cr5bef7c48d5b60d8f@mail.gmail.com> ie.button(:value,"Next").click the issue it works for all the other pages that have "Next" buttons but when it gets to the particular page my script skips past the page and looks at my next action on the original script as "Next" is the last action on internetApply script On 4/25/07, ?eljko Filipin wrote: > > It looks to me that the problem is in internetApply.rb. Can you post it? > Or just the part where button is clicked? > -- > ZeljkoFilipin.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- In theory, there is no difference between theory and practice; In practice, there is. Chuck Reid -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070425/e9edc63e/attachment.html From dara.lillis at kiodex.com Wed Apr 25 12:04:58 2007 From: dara.lillis at kiodex.com (Lillis, Dara) Date: Wed, 25 Apr 2007 09:04:58 -0700 Subject: [Wtr-general] OT: New version of RDT plugin for Eclipse In-Reply-To: Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E024E07AE@ehost011-27.exch011.intermedia.net> one thing I've noticed that's slightly weird is that when I use click_no_wait from eclipse using the new rdt (eclipse 3.2, with rdt 0.9 RC1), what looks like a dos window pops up for a fraction of a second. the method still works and the popup causes me no problems, but is mildly annoying (and didn't happen before). anyone else see this? maybe it's an Eclipse configuration setting or something... ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Charley Baker Sent: Tuesday, April 24, 2007 1:00 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] OT: New version of RDT plugin for Eclipse For all of you who are working with Eclipse and the rdt plugin, there's a new version finally. They haven't updated their main site, but have a news announcement on their base sourceforge project page: Most notably are the inclusion of refactorings, mark occurrences support, improved code completion, better integration with the ruby interpreters, ruby-debug support, go to declaration, and under-the-hood type inferrencing. I've only used it for the past day, but it's a bit nicer than the previous version. Also spending some time monkeying around with NetBeans and it's coming Ruby support which I like for formatting and a couple of other things. Note: This version of rdt requires jre 1.5 or above to run. cheers, Charley -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070425/c26a940c/attachment.html From rdewolfe at Credant.com Wed Apr 25 12:47:05 2007 From: rdewolfe at Credant.com (Russ DeWolfe) Date: Wed, 25 Apr 2007 11:47:05 -0500 Subject: [Wtr-general] Get a class value Message-ID: I want to get the value in the class parameter of a TD tag or better yet build an array with a bunch of them in it, but just getting this one will be a start: Windows -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070425/46d4e9d4/attachment.html From charley.baker at gmail.com Wed Apr 25 13:13:17 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 25 Apr 2007 11:13:17 -0600 Subject: [Wtr-general] Get a class value In-Reply-To: References: Message-ID: With Watir 1.5 ie.cell(:id, 'tab.policies.WINDOWS').attribute_value('classname') -Charley On 4/25/07, Russ DeWolfe wrote: > > I want to get the value in the class parameter of a TD tag or better yet > build an array with a bunch of them in it, but just getting this one will be > a start: > > 'showTab("WINDOWS","WINDOWS","PPC","PALM","SMARTPHONE","SYMBIAN","RIM","GATEKEEPER")' > noWrap> > Windows > > > _______________________________________________ > 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/20070425/9a8ff92b/attachment.html From forum-watir-users at openqa.org Wed Apr 25 15:08:20 2007 From: forum-watir-users at openqa.org (joe fu) Date: Wed, 25 Apr 2007 14:08:20 CDT Subject: [Wtr-general] How to move the mouse to point to an object? In-Reply-To: <25528448.6811177480476018.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <36063811.11191177528130704.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> i've tried to do ie.div(:id, "calendarStripDateLabelDock").fire_event("onmouseover") but doesn't work for me. you can also try it with the steps below: goto mail.yahoo.com enter user: f323_cal1 password: testing mouse over the Today's date on the Calendar Strip at the bottom.
TUE, 4/24 - WED, 4/25
From charley.baker at gmail.com Wed Apr 25 16:28:50 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 25 Apr 2007 14:28:50 -0600 Subject: [Wtr-general] How to move the mouse to point to an object? In-Reply-To: <36063811.11191177528130704.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <25528448.6811177480476018.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <36063811.11191177528130704.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hmm, good question, I don't seem to be able to access it either. Thanks for the public example, I'll look at it some more and see if I can't trigger it. -c On 4/25/07, joe fu wrote: > > i've tried to do ie.div(:id, > "calendarStripDateLabelDock").fire_event("onmouseover") but doesn't work > for me. > you can also try it with the steps below: > goto mail.yahoo.com > enter user: f323_cal1 password: testing > mouse over the Today's date on the Calendar Strip at the bottom. > > > >
style="left: 200px; top: 499px; height: 22px; width: 939px; -moz-user-focus: > ignore; -moz-user-select: none; display: block;"> >
>
>
style="-moz-user-focus: ignore; -moz-user-select: none;"> >
>
style="-moz-user-focus: ignore; -moz-user-select: none;"> >
style="-moz-user-focus: ignore; -moz-user-select: none;">TUE, 4/24 - WED, > 4/25
>
id="calendarStripAllDayEventsDock" style="-moz-user-focus: ignore; > -moz-user-select: none;"/> >
>
style="width: 714px; -moz-user-focus: ignore; -moz-user-select: none;"> >
>
> _______________________________________________ > 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/20070425/b9014e23/attachment.html From paul.rogers at shaw.ca Wed Apr 25 16:39:13 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 25 Apr 2007 14:39:13 -0600 Subject: [Wtr-general] How to move the mouse to point to an object? References: <25528448.6811177480476018.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <36063811.11191177528130704.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <024c01c78779$c9292d20$6400a8c0@laptop> looking at the html its done using css, not a fire_event Im no css expert, but I think this will be really difficult for us to do in watir ----- Original Message ----- From: Charley Baker To: wtr-general at rubyforge.org Sent: Wednesday, April 25, 2007 2:28 PM Subject: Re: [Wtr-general] How to move the mouse to point to an object? Hmm, good question, I don't seem to be able to access it either. Thanks for the public example, I'll look at it some more and see if I can't trigger it. -c On 4/25/07, joe fu wrote: i've tried to do ie.div(:id, "calendarStripDateLabelDock").fire_event("onmouseover") but doesn't work for me. you can also try it with the steps below: goto mail.yahoo.com enter user: f323_cal1 password: testing mouse over the Today's date on the Calendar Strip at the bottom.
TUE, 4/24 - WED, 4/25
_______________________________________________ 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/20070425/69209306/attachment-0001.html From paul.rogers at shaw.ca Wed Apr 25 16:52:38 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 25 Apr 2007 14:52:38 -0600 Subject: [Wtr-general] canoo2watir Message-ID: <026701c7877b$a9575ab0$6400a8c0@laptop> This is something Ive been thinking about for a while. Canoo ( http://webtest.canoo.com/ ) is a layer above htmlUnit that takes an xml file and runs it against a web site, clicking buttons, doing assertions etc. Ive written some code that takes this xml format and converts it to a watir script ( well, almost ) Is this likely to be of use to more than just Lisa Crispin? Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070425/1d28c4c9/attachment.html From bret at pettichord.com Wed Apr 25 16:54:32 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 25 Apr 2007 15:54:32 -0500 Subject: [Wtr-general] OT: New version of RDT plugin for Eclipse In-Reply-To: <35AF30C7B5EBFA4DBC854B5B9DF66B0E024E07AE@ehost011-27.exch011.intermedia.net> References: <35AF30C7B5EBFA4DBC854B5B9DF66B0E024E07AE@ehost011-27.exch011.intermedia.net> Message-ID: <462FC008.70700@pettichord.com> Lillis, Dara wrote: > one thing I've noticed that's slightly weird is that when I use > click_no_wait from eclipse using the new rdt (eclipse 3.2, with rdt > 0.9 RC1), what looks like a dos window pops up for a fraction of a > second. the method still works and the popup causes me no problems, > but is mildly annoying (and didn't happen before). > > anyone else see this? maybe it's an Eclipse configuration setting or > something... Yes, i do. Previously you saw this behavior if you specified rubyw.exe (instead of ruby.exe) as the "installed interpreter". Now you only get to specify the directory for this (now called a "VM"). RDT seems to be using rubyw.exe on its own initiative. The main problem with this is that previously, the console output would be captured. Now it is thrown away. Bret From charley.baker at gmail.com Wed Apr 25 17:02:55 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 25 Apr 2007 15:02:55 -0600 Subject: [Wtr-general] canoo2watir In-Reply-To: <026701c7877b$a9575ab0$6400a8c0@laptop> References: <026701c7877b$a9575ab0$6400a8c0@laptop> Message-ID: Could be interesting, I'd looked at webtest when evaluating tools a while back. And as Elizabeth Hendrickson often says...'Show me the code'. It's always helpful and demonstrates the point pretty well and if people want to learn or add on then it gives them a good base. Perhaps it's one other tool than can be run under the Watir api, the others being watir:ie, firefox, safari, selenium. -c On 4/25/07, Paul Rogers wrote: > > > > This is something Ive been thinking about for a while. > > Canoo ( http://webtest.canoo.com/ ) is a layer above htmlUnit that takes > an xml file and runs it against a web site, clicking buttons, doing > assertions etc. > Ive written some code that takes this xml format and converts it to a > watir script ( well, almost ) > > Is this likely to be of use to more than just Lisa Crispin? > > 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/20070425/d721bfba/attachment.html From paul.rogers at shaw.ca Wed Apr 25 17:13:57 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 25 Apr 2007 15:13:57 -0600 Subject: [Wtr-general] canoo2watir References: <026701c7877b$a9575ab0$6400a8c0@laptop> Message-ID: <028d01c7877e$a3191eb0$6400a8c0@laptop> my thinking was that people who have canoo tests can now ( ok soon ) run those same tests on a real browser. I also thought there was a recorder for canoo, that records from a proxy, but I seem to be mistaken. I'll get the code a bit better then do a proper announcement Paul ----- Original Message ----- From: Charley Baker To: wtr-general at rubyforge.org Sent: Wednesday, April 25, 2007 3:02 PM Subject: Re: [Wtr-general] canoo2watir Could be interesting, I'd looked at webtest when evaluating tools a while back. And as Elizabeth Hendrickson often says...'Show me the code'. It's always helpful and demonstrates the point pretty well and if people want to learn or add on then it gives them a good base. Perhaps it's one other tool than can be run under the Watir api, the others being watir:ie, firefox, safari, selenium. -c On 4/25/07, Paul Rogers wrote: This is something Ive been thinking about for a while. Canoo ( http://webtest.canoo.com/ ) is a layer above htmlUnit that takes an xml file and runs it against a web site, clicking buttons, doing assertions etc. Ive written some code that takes this xml format and converts it to a watir script ( well, almost ) Is this likely to be of use to more than just Lisa Crispin? Paul _______________________________________________ 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/20070425/710f886e/attachment.html From bret at pettichord.com Wed Apr 25 17:25:59 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 25 Apr 2007 16:25:59 -0500 Subject: [Wtr-general] Fwd: + Hackety Hack + In-Reply-To: <20070425203833.GE28530@beekeeper.hobix.com> References: <20070425203833.GE28530@beekeeper.hobix.com> Message-ID: Here is what looks like a very useful tool for learning Ruby. This is from the author of Why's Poignant Guide to Ruby. http://hacketyhack.net/ http://code.whytheluckystiff.net/hacketyhack/wiki/GetHacketyHack Bret ---------- Forwarded message ---------- From: why the lucky stiff Date: Apr 25, 2007 3:38 PM Subject: + Hackety Hack + To: poignant-watchers at rubyforge.org, poignant-stiffs at rubyforge.org Friends of the (Poignant) Guide, Any of you remember that /SECRET PROJECT/ from the beginning of March? I needed some folks using Windows to shell out some precious time to see if I could help them learn Ruby. The secret project is: Hackety Hack. It's a Windows program for learning Ruby with lots of fun examples: downloading mp3s, writing blogs, chatware, and so on. AND, WELL, >>MOTHER CAREY'S CHICKENS<< IT WORKED!! I ended up with 50 participants, about half stuck with it and we saw some amazing progress. I've asked the participants to blog about their experiences, here are the first few: * http://www.greaterbostonrubyandrails.com/HacketyHackBlog.html * http://ostracons.com/entry/272/programmed * http://willscott.name/2007/04/23/HacketyHack Thankyou to the fine, fine people who applied themselves to make this happen. It was one of those beautiful, unforgettable times that really changed my life!! Truly adventure-sized!! _why _______________________________________________ poignant-stiffs mailing list poignant-stiffs at rubyforge.org http://rubyforge.org/mailman/listinfo/poignant-stiffs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070425/0b597c50/attachment.html From charley.baker at gmail.com Wed Apr 25 17:26:39 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 25 Apr 2007 15:26:39 -0600 Subject: [Wtr-general] canoo2watir In-Reply-To: <028d01c7877e$a3191eb0$6400a8c0@laptop> References: <026701c7877b$a9575ab0$6400a8c0@laptop> <028d01c7877e$a3191eb0$6400a8c0@laptop> Message-ID: i think you're right about a recorder. it's been a while, but that sounds awfully familiar. On 4/25/07, Paul Rogers wrote: > > my thinking was that people who have canoo tests can now ( ok soon ) run > those same tests on a real browser. > I also thought there was a recorder for canoo, that records from a proxy, > but I seem to be mistaken. > > I'll get the code a bit better then do a proper announcement > > Paul > > ----- Original Message ----- > *From:* Charley Baker > *To:* wtr-general at rubyforge.org > *Sent:* Wednesday, April 25, 2007 3:02 PM > *Subject:* Re: [Wtr-general] canoo2watir > > Could be interesting, I'd looked at webtest when evaluating tools a while > back. And as Elizabeth Hendrickson often says...'Show me the code'. It's > always helpful and demonstrates the point pretty well and if people want to > learn or add on then it gives them a good base. Perhaps it's one other tool > than can be run under the Watir api, the others being watir:ie, firefox, > safari, selenium. > > -c > > On 4/25/07, Paul Rogers wrote: > > > > > > > > This is something Ive been thinking about for a while. > > > > Canoo ( http://webtest.canoo.com/ ) is a layer above htmlUnit that takes > > an xml file and runs it against a web site, clicking buttons, doing > > assertions etc. > > Ive written some code that takes this xml format and converts it to a > > watir script ( well, almost ) > > > > Is this likely to be of use to more than just Lisa Crispin? > > > > Paul > > > > _______________________________________________ > > 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/20070425/a578677a/attachment-0001.html From charley.baker at gmail.com Wed Apr 25 23:14:49 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 25 Apr 2007 21:14:49 -0600 Subject: [Wtr-general] Fwd: + Hackety Hack + In-Reply-To: References: <20070425203833.GE28530@beekeeper.hobix.com> Message-ID: Why's Poignant Guide is excellent. It takes learning to program to a new and otherwise other worldly angle. I've been recommending it, you'll either love it or hate it. It'd be nice to work on his basic conceptual view and present a basic programming using Ruby class, wearing bunny suits of course. -c On 4/25/07, Bret Pettichord wrote: > > Here is what looks like a very useful tool for learning Ruby. This is from > the author of Why's Poignant Guide to Ruby. > > http://hacketyhack.net/ > http://code.whytheluckystiff.net/hacketyhack/wiki/GetHacketyHack > > Bret > > ---------- Forwarded message ---------- > From: why the lucky stiff > Date: Apr 25, 2007 3:38 PM > Subject: + Hackety Hack + > To: poignant-watchers at rubyforge.org, poignant-stiffs at rubyforge.org > > Friends of the (Poignant) Guide, > > Any of you remember that /SECRET PROJECT/ from the beginning of March? > I needed some folks using Windows to shell out some precious time to > see if I could help them learn Ruby. > > The secret project is: Hackety Hack. It's a Windows program for > learning Ruby with lots of fun examples: downloading mp3s, writing > blogs, chatware, and so on. > > AND, WELL, >>MOTHER CAREY'S CHICKENS<< IT WORKED!! > > I ended up with 50 participants, about half stuck with it and we saw > some amazing progress. I've asked the participants to blog about > their experiences, here are the first few: > > * http://www.greaterbostonrubyandrails.com/HacketyHackBlog.html > * http://ostracons.com/entry/272/programmed > * http://willscott.name/2007/04/23/HacketyHack > > Thankyou to the fine, fine people who applied themselves to make > this happen. It was one of those beautiful, unforgettable times > that really changed my life!! Truly adventure-sized!! > > _why > _______________________________________________ > poignant-stiffs mailing list > poignant-stiffs at rubyforge.org > http://rubyforge.org/mailman/listinfo/poignant-stiffs > > _______________________________________________ > 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/20070425/9ff20a70/attachment.html From christopher.mcmahon at gmail.com Wed Apr 25 23:26:03 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 25 Apr 2007 21:26:03 -0600 Subject: [Wtr-general] Fwd: + Hackety Hack + In-Reply-To: References: <20070425203833.GE28530@beekeeper.hobix.com> Message-ID: <72799cd70704252026j1f68633s7ad30ce1b666db4c@mail.gmail.com> t'd be nice to work on his basic conceptual view and present > a basic programming using Ruby class, wearing bunny suits of course. With ukuleles. Propose it for Agile2008. I am *so* there. -Chris From shalinigupta2006 at gmail.com Thu Apr 26 00:54:46 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 26 Apr 2007 10:24:46 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <27915010704250700j77e48d3cge6ab032c216eb0c0@mail.gmail.com> References: <7523f5800704240506r1ea4d805hf441fd95d664a1bf@mail.gmail.com> <7523f5800704242203q565fe426ge34018cd6f834ecb@mail.gmail.com> <7523f5800704242245i4f690a2eh27a6a48c23f756a5@mail.gmail.com> <7523f5800704242305p107dbc59id5b136d1ba7a2d0c@mail.gmail.com> <27915010704250700j77e48d3cge6ab032c216eb0c0@mail.gmail.com> Message-ID: <7523f5800704252154n7caac4dfpc233c7b2eaab708a@mail.gmail.com> hi Prema, Sorry it not working.. It is printing 1 in text file. please help!! Regards Shalini Gupta On 4/25/07, Prema Arya wrote: > > Hi Shalini, > > Just try this code (modified your code a little) > def text(wait_seconds = 1) > # sleep 0.3 > autoit = WIN32OLE.new("AutoItX3.Control") > autoit.WinWait("Microsoft Internet Explorer", nil, > wait_seconds) if wait_seconds > s = autoit.WinGetText("Microsoft Internet Explorer") > file = File.open("c:\\test.txt", "w") # DONT MAKE > YOUR VARIABLES GLOBAL UNNECESSARILY > file.puts(s) > file.close > s unless s == "1" # NOT SURE WHY YOU ARE DOING THIS > end > Let me know if this works. > > Regards, > Prema > > On 4/25/07, SHALINI GUPTA wrote: > > > > hi, > > > > i have tried to write this as > > > > def text(wait_seconds = 1) > > # sleep 0.3 > > autoit = WIN32OLE.new("AutoItX3.Control") > > autoit.WinWait("Microsoft Internet Explorer", nil, > > wait_seconds) if wait_seconds > > s = autoit.WinGetText ("Microsoft Internet Explorer") > > $File = File.open("c:\\test.txt", "w") > > $File.puts(s.to_s) > > s unless s == "1" > > end > > > > but it is printing only 1..in the file. > > please help. > > > > shalini gupta > > > > On 4/25/07, SHALINI GUPTA < shalinigupta2006 at gmail.com > wrote: > > > > > > hi, > > > Thanks for quick reply... > > > > > > please tell me how can i write output of one method to a file.... > > > > > > my method is.. > > > def text(wait_seconds = 1) > > > # sleep 0.3 > > > autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) if > > > wait_seconds > > > s = autoit.WinGetText(WINDOW_TITLE) > > > s unless s == "1" > > > end > > > please help me.. > > > > > > Thanks In Advance > > > Regards > > > Shalini Gupta > > > > > > On 4/25/07, Angrez Singh wrote: > > > > > > > > Hi, > > > > As Paul said that you need to store the text in a file and then read > > > > that file in your main process. Because pop up's are handled in different > > > > process. So even if you return that value from the method it won't be > > > > visible to main process. Write this value to a file and then read the > > > > contents. > > > > > > > > Regards, > > > > Angrez > > > > > > > > On 4/25/07, SHALINI GUPTA < shalinigupta2006 at gmail.com > wrote: > > > > > > > > > > hi, > > > > > > > > > > thanks for reply!!! > > > > > > > > > > but i have used autoit and WinGet Text as:---(with no success) > > > > > > > > > > #----- js_dialog.rb ----- > > > > > > > > > > require 'win32ole' > > > > > require 'test/unit' > > > > > require 'test/unit/ui/console/testrunner' > > > > > # > > > > > # Use AutoIt to read and close Javascript dialog windows > > > > > # > > > > > module JavascriptDialog > > > > > > > > > > # > > > > > # Target javascript dialogs with this window title > > > > > # > > > > > WINDOW_TITLE = "Microsoft Internet Explorer" > > > > > > > > > > class << self > > > > > > > > > > # > > > > > # Return the text contained in a javascript dialog (e.g. > > > > > an "alert()") > > > > > # if such a dialog is present or appears within > > > > > +wait_seconds+. > > > > > # > > > > > def text(wait_seconds = 1) > > > > > # sleep 0.3 > > > > > autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) if > > > > > wait_seconds > > > > > s = autoit.WinGetText(WINDOW_TITLE) > > > > > s unless s == "1" > > > > > end > > > > > > > > > > # > > > > > # Close any active javascript dialog > > > > > # > > > > > def close > > > > > autoit.WinClose WINDOW_TITLE > > > > > end > > > > > > > > > > # > > > > > # Press the "OK" button on a javascript dialog > > > > > # > > > > > def ok > > > > > autoit.ControlClick(WINDOW_TITLE, "", "OK") > > > > > end > > > > > # > > > > > # Press the "Cancel" button on a javascript dialog > > > > > # > > > > > def cancel > > > > > autoit.ControlClick (WINDOW_TITLE, "", "Cancel") > > > > > end > > > > > # > > > > > # Press the "Yes" button on a javascript dialog > > > > > # > > > > > def yes > > > > > autoit.ControlClick(WINDOW_TITLE, "", "Yes") > > > > > end > > > > > # > > > > > # Press the "No" button on a javascript dialog > > > > > # > > > > > def no > > > > > autoit.ControlClick(WINDOW_TITLE, "", "No") > > > > > end > > > > > > > > > > private > > > > > > > > > > # > > > > > # Return an AutoIt COM object, creating it if it > > > > > doesn't already > > > > > # exist > > > > > # > > > > > def autoit > > > > > unless defined? @@autoit > > > > > @@autoit = WIN32OLE.new("AutoItX3.Control") > > > > > end > > > > > @@autoit > > > > > end > > > > > end > > > > > end > > > > > > > > > > module Test::Unit::Assertions > > > > > # > > > > > # Passes if a Javascript dialog appears within +wait_seconds+ > > > > > and its > > > > > # text matches the given (optional) pattern. > > > > > # > > > > > # Use like this: > > > > > # assert_js_dialog do > > > > > # watir_command_to_make_dialog_appear > > > > > # end > > > > > # Or like this: > > > > > # assert_js_dialog /Text to find in the dialog/, "Cancel" do > > > > > # watir_command_to_make_dialog_appear > > > > > # end > > > > > # > > > > > def assert_js_dialog(pattern = //, action = "close", message = > > > > > nil) > > > > > _wrap_assertion do > > > > > begin > > > > > pipe = IO.popen("ruby exetry.rb #{action}") > > > > > yield > > > > > window_text = pipe.read rescue "" > > > > > pipe.close > > > > > unless window_text.empty? > > > > > assert_block(build_message(message, > > > > > " not found in JavaScript dialog.", > > > > > pattern)) do > > > > > window_text.match(pattern) > > > > > end > > > > > else > > > > > raise Test::Unit:: AssertionFailedError.new( > > > > > build_message(message, "No JavaScript > > > > > window found.")) > > > > > end > > > > > ensure > > > > > pipe.close if pipe && !pipe.closed? > > > > > end > > > > > end > > > > > end > > > > > end > > > > > > > > > > # test - will close and print the text of an opened javascript > > > > > dialog if > > > > > # run as "ruby js_dialog.rb" > > > > > if $0 == __FILE__ > > > > > action = ARGV.shift || "close" > > > > > print JavascriptDialog.text || "" > > > > > JavascriptDialog.send action > > > > > end > > > > > > > > > > if possible then please help me...and give me some code... > > > > > > > > > > Regards > > > > > Shalini Gupta > > > > > > > > > > > > > > > On 4/24/07, Paul Rogers < paul.rogers at shaw.ca > wrote: > > > > > > > > > > > > there is stuff in the winclicker to do it too. We've got the > > > > > > javascript pop up text back to the main app by saving it to a file > > > > > > > > > > > > > > > > > > Paul > > > > > > > > > > > > Hi, > > > > > > > > > > > > As far as I know, clicking some button on Pop up window happens > > > > > > in a different process (different from current process in which your script > > > > > > is running). Correct me if I am wrong here? > > > > > > > > > > > > You can get the text using AutoIt3 and WinGetText method. The > > > > > > only thing you need to find out is how you communicate data or the text > > > > > > between two different processes. > > > > > > > > > > > > Regards, > > > > > > Angrez > > > > > > > > > > > > On 4/24/07, SHALINI GUPTA < shalinigupta2006 at gmail.com > wrote: > > > > > > > > > > > > > > HI List, > > > > > > > > > > > > > > Please help regarding popup. > > > > > > > How to get the text of a popup window.. > > > > > > > its very urgent please help. > > > > > > > > > > > > > > Regards > > > > > > > Shalini gupta > > > > > > > > > > > > > > _______________________________________________ > > > > > > > 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 > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > 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 > > > > > > -- > Prema Arya > _______________________________________________ > 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/20070426/66307b67/attachment-0001.html From angrez at gmail.com Thu Apr 26 01:18:38 2007 From: angrez at gmail.com (Angrez Singh) Date: Thu, 26 Apr 2007 10:48:38 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704252154n7caac4dfpc233c7b2eaab708a@mail.gmail.com> References: <7523f5800704240506r1ea4d805hf441fd95d664a1bf@mail.gmail.com> <7523f5800704242203q565fe426ge34018cd6f834ecb@mail.gmail.com> <7523f5800704242245i4f690a2eh27a6a48c23f756a5@mail.gmail.com> <7523f5800704242305p107dbc59id5b136d1ba7a2d0c@mail.gmail.com> <27915010704250700j77e48d3cge6ab032c216eb0c0@mail.gmail.com> <7523f5800704252154n7caac4dfpc233c7b2eaab708a@mail.gmail.com> Message-ID: Hi Shalini, Can you post the entire code? How you are calling this text function? How you are handling the pop up? - Angrez On 4/26/07, SHALINI GUPTA wrote: > > hi Prema, > > Sorry it not working.. > It is printing 1 in text file. > please help!! > > Regards > Shalini Gupta > > On 4/25/07, Prema Arya < prema.arya at gmail.com> wrote: > > > > Hi Shalini, > > > > Just try this code (modified your code a little) > > def text(wait_seconds = 1) > > # sleep 0.3 > > autoit = WIN32OLE.new("AutoItX3.Control") > > autoit.WinWait("Microsoft Internet Explorer", nil, > > wait_seconds) if wait_seconds > > s = autoit.WinGetText("Microsoft Internet Explorer") > > file = File.open("c:\\test.txt", "w") # DONT MAKE > > YOUR VARIABLES GLOBAL UNNECESSARILY > > file.puts(s) > > file.close > > s unless s == "1" # NOT SURE WHY YOU ARE DOING > > THIS > > end > > Let me know if this works. > > > > Regards, > > Prema > > > > On 4/25/07, SHALINI GUPTA wrote: > > > > > > hi, > > > > > > i have tried to write this as > > > > > > def text(wait_seconds = 1) > > > # sleep 0.3 > > > autoit = WIN32OLE.new("AutoItX3.Control") > > > autoit.WinWait("Microsoft Internet Explorer", nil, > > > wait_seconds) if wait_seconds > > > s = autoit.WinGetText ("Microsoft Internet Explorer") > > > $File = File.open("c:\\test.txt", "w") > > > $File.puts(s.to_s) > > > s unless s == "1" > > > end > > > > > > but it is printing only 1..in the file. > > > please help. > > > > > > shalini gupta > > > > > > On 4/25/07, SHALINI GUPTA < shalinigupta2006 at gmail.com > wrote: > > > > > > > > hi, > > > > Thanks for quick reply... > > > > > > > > please tell me how can i write output of one method to a file.... > > > > > > > > my method is.. > > > > def text(wait_seconds = 1) > > > > # sleep 0.3 > > > > autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) if > > > > wait_seconds > > > > s = autoit.WinGetText(WINDOW_TITLE) > > > > s unless s == "1" > > > > end > > > > please help me.. > > > > > > > > Thanks In Advance > > > > Regards > > > > Shalini Gupta > > > > > > > > On 4/25/07, Angrez Singh wrote: > > > > > > > > > > Hi, > > > > > As Paul said that you need to store the text in a file and then > > > > > read that file in your main process. Because pop up's are handled in > > > > > different process. So even if you return that value from the method it won't > > > > > be visible to main process. Write this value to a file and then read the > > > > > contents. > > > > > > > > > > Regards, > > > > > Angrez > > > > > > > > > > On 4/25/07, SHALINI GUPTA < shalinigupta2006 at gmail.com > wrote: > > > > > > > > > > > > hi, > > > > > > > > > > > > thanks for reply!!! > > > > > > > > > > > > but i have used autoit and WinGet Text as:---(with no success) > > > > > > > > > > > > #----- js_dialog.rb ----- > > > > > > > > > > > > require 'win32ole' > > > > > > require 'test/unit' > > > > > > require 'test/unit/ui/console/testrunner' > > > > > > # > > > > > > # Use AutoIt to read and close Javascript dialog windows > > > > > > # > > > > > > module JavascriptDialog > > > > > > > > > > > > # > > > > > > # Target javascript dialogs with this window title > > > > > > # > > > > > > WINDOW_TITLE = "Microsoft Internet Explorer" > > > > > > > > > > > > class << self > > > > > > > > > > > > # > > > > > > # Return the text contained in a javascript dialog (e.g. > > > > > > an "alert()") > > > > > > # if such a dialog is present or appears within > > > > > > +wait_seconds+. > > > > > > # > > > > > > def text(wait_seconds = 1) > > > > > > # sleep 0.3 > > > > > > autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) if > > > > > > wait_seconds > > > > > > s = autoit.WinGetText(WINDOW_TITLE) > > > > > > s unless s == "1" > > > > > > end > > > > > > > > > > > > # > > > > > > # Close any active javascript dialog > > > > > > # > > > > > > def close > > > > > > autoit.WinClose WINDOW_TITLE > > > > > > end > > > > > > > > > > > > # > > > > > > # Press the "OK" button on a javascript dialog > > > > > > # > > > > > > def ok > > > > > > autoit.ControlClick(WINDOW_TITLE, "", "OK") > > > > > > end > > > > > > # > > > > > > # Press the "Cancel" button on a javascript dialog > > > > > > # > > > > > > def cancel > > > > > > autoit.ControlClick (WINDOW_TITLE, "", "Cancel") > > > > > > end > > > > > > # > > > > > > # Press the "Yes" button on a javascript dialog > > > > > > # > > > > > > def yes > > > > > > autoit.ControlClick(WINDOW_TITLE, "", "Yes") > > > > > > end > > > > > > # > > > > > > # Press the "No" button on a javascript dialog > > > > > > # > > > > > > def no > > > > > > autoit.ControlClick(WINDOW_TITLE, "", "No") > > > > > > end > > > > > > > > > > > > private > > > > > > > > > > > > # > > > > > > # Return an AutoIt COM object, creating it if it > > > > > > doesn't already > > > > > > # exist > > > > > > # > > > > > > def autoit > > > > > > unless defined? @@autoit > > > > > > @@autoit = WIN32OLE.new("AutoItX3.Control") > > > > > > end > > > > > > @@autoit > > > > > > end > > > > > > end > > > > > > end > > > > > > > > > > > > module Test::Unit::Assertions > > > > > > # > > > > > > # Passes if a Javascript dialog appears within > > > > > > +wait_seconds+ and its > > > > > > # text matches the given (optional) pattern. > > > > > > # > > > > > > # Use like this: > > > > > > # assert_js_dialog do > > > > > > # watir_command_to_make_dialog_appear > > > > > > # end > > > > > > # Or like this: > > > > > > # assert_js_dialog /Text to find in the dialog/, "Cancel" > > > > > > do > > > > > > # watir_command_to_make_dialog_appear > > > > > > # end > > > > > > # > > > > > > def assert_js_dialog(pattern = //, action = "close", message > > > > > > = nil) > > > > > > _wrap_assertion do > > > > > > begin > > > > > > pipe = IO.popen("ruby exetry.rb #{action}") > > > > > > yield > > > > > > window_text = pipe.read rescue "" > > > > > > pipe.close > > > > > > unless window_text.empty? > > > > > > assert_block(build_message(message, > > > > > > " not found in JavaScript dialog.", > > > > > > pattern)) do > > > > > > window_text.match(pattern) > > > > > > end > > > > > > else > > > > > > raise Test::Unit:: AssertionFailedError.new( > > > > > > build_message(message, "No JavaScript > > > > > > window found.")) > > > > > > end > > > > > > ensure > > > > > > pipe.close if pipe && !pipe.closed? > > > > > > end > > > > > > end > > > > > > end > > > > > > end > > > > > > > > > > > > # test - will close and print the text of an opened javascript > > > > > > dialog if > > > > > > # run as "ruby js_dialog.rb" > > > > > > if $0 == __FILE__ > > > > > > action = ARGV.shift || "close" > > > > > > print JavascriptDialog.text || "" > > > > > > JavascriptDialog.send action > > > > > > end > > > > > > > > > > > > if possible then please help me...and give me some code... > > > > > > > > > > > > Regards > > > > > > Shalini Gupta > > > > > > > > > > > > > > > > > > On 4/24/07, Paul Rogers < paul.rogers at shaw.ca > wrote: > > > > > > > > > > > > > > there is stuff in the winclicker to do it too. We've got the > > > > > > > javascript pop up text back to the main app by saving it to a file > > > > > > > > > > > > > > > > > > > > > Paul > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > As far as I know, clicking some button on Pop up window > > > > > > > happens in a different process (different from current process in which your > > > > > > > script is running). Correct me if I am wrong here? > > > > > > > > > > > > > > You can get the text using AutoIt3 and WinGetText method. The > > > > > > > only thing you need to find out is how you communicate data or the text > > > > > > > between two different processes. > > > > > > > > > > > > > > Regards, > > > > > > > Angrez > > > > > > > > > > > > > > On 4/24/07, SHALINI GUPTA < shalinigupta2006 at gmail.com > > > > > > > > wrote: > > > > > > > > > > > > > > > > HI List, > > > > > > > > > > > > > > > > Please help regarding popup. > > > > > > > > How to get the text of a popup window.. > > > > > > > > its very urgent please help. > > > > > > > > > > > > > > > > Regards > > > > > > > > Shalini gupta > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > 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 > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > 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 > > > > > > > > > > > -- > > Prema Arya > > _______________________________________________ > > 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/20070426/264c6894/attachment-0001.html From shalinigupta2006 at gmail.com Thu Apr 26 01:54:27 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 26 Apr 2007 11:24:27 +0530 Subject: [Wtr-general] how to capture text from popup window Message-ID: <7523f5800704252254k4994d690tfa6c5d6a7f4c0095@mail.gmail.com> Hi, my code is as... ####requires require 'watir' #require 'autoit' require 'test/unit' require 'test/unit/ui/console/testrunner' require 'test/unit/assertions' #require 'watir/setFileDialog' #require 'popups_test' #require 'enabled_popup' #logger requires require 'example_logger1' require 'workbookfunction' #java_pophadler requires require 'WindowHelper' require 'win32ole' #require 'javapopup' #require 'winClickers' ####includes include Watir class TC_PSC_userlogin < Test::Unit::TestCase 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 of function StartClicker end def text(wait_seconds = 2) sleep 0.3 autoit = WIN32OLE.new("AutoItX3.Control") autoit.WinWait("Microsoft Internet Explorer", nil, wait_seconds) if wait_seconds s = autoit.WinGetText("Microsoft Internet Explorer") file = File.open("c:\\test.txt", "w") # DONT MAKE YOUR VARIABLES GLOBAL UNNECESSARILY file.puts(s.to_s) puts s file.close #s unless s == "1" # NOT SURE WHY YOU ARE DOING THIS end def start #open the IE browser $ie = IE.new #create a logger filePrefix = "logger" $logger = LoggerFactory.start_xml_logger(filePrefix) $ie.set_logger($logger) ##Excel file functions $lgn=Excel_file.new #making object of workbookfunction $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") ##java popup hadling #$pop=Jave_PopUps.new ##making object of javapopup #$oPopup = Watir::autoit end def test_PSCLogin #call start method... start #fires up the IE browser and a logger object #variables-URL test_site = 'https://www.philipnow.com/envcss/' $logger.log("## PSCUser_Login_Logoff_4") $logger.log("") $logger.log("Description- Do not enter anything in the E-mail Address and Password field and click Login button.") #logs only to corelogger file $logger.log("Expected Output-The user should not be able to login.") $logger.log("") $logger.log("Step 1: Go to the Philipnow.com :- ' https://www.philipnow.com/envcss/'") $ie.goto(test_site) $logger.log(" Action-1: entered " + test_site + " in the address bar.") $logger.log(":Step 2: Do not enter any thing in user id") val_userid=$lgn.TakeData("a",1,$wrk_sht) $ie.text_field(:name, "username").set(val_userid.to_s) $logger.log(" Action-2: entered Nothing in in e-mail address") $logger.log(":Step-3: Do not enter any thing in password field") val_password=$lgn.TakeData("b",1,$wrk_sht) $ie.text_field(:name,"password").set(val_password.to_s) $logger.log(":Action-3: entered Nothing in password field") =begin oPopup = Watir::autoit # Change into the WinTitleMatchMode that supports classnames and handles oPopup.AutoItSetOption("WinTitleMatchMode", 4) 0.upto(timeout) { |i|} ret = oPopup.WinWait("Microsoft Internet Explorer","",1) win_text = oPopup.WinGetText("Microsoft Internet Explorer") if 1 == ret && !(win_text == '') then bPopupFound = true oPopup.WinActivate("Microsoft Internet Explorer",'') win_text = oPopup.ControlGetText(what, '', 'Static2').strip if '' == win_text then win_text = oPopup.ControlGetText(what, '', 'Static1').strip end break =end startClicker("OK",3) #require 'js_dialog' #assert_js_dialog do $ie.button(:name, "login").click text(2) #end $logger.log(":Step-4: Click the Login button") $logger.log("Action-4: clicked the Login button.") begin assert($ie.contains_text("Welcome to Client Self-service Portal, Alex Reyes!") ) $logger.log("*FAILED*." + e.message + "\n" + e.backtrace.join("\n")) $logger.log("Test Failed:Expected result has not been achieved:- User is able to login ") $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail Address and Password field and click Login button.","Expected Output-The user should not be able to login.","TEST FAILED:") #logs to both the XML file and corelogger rescue => e $logger.log("Test Passed:Expected result has been achieved:- User is not able to login ") $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail Address and Password field and click Login button.","Expected Output-The user should not be able to login.","TEST PASSED:") #logs to both the XML file and corelogger end $ie.close $logger.log("Close excel file") $lgn.excel_close $logger.log("Closed excel file") $logger.log "## End of test: PSC login\n" end end Regards shalini gupta -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070426/31ded90c/attachment.html From shalinigupta2006 at gmail.com Thu Apr 26 02:13:53 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 26 Apr 2007 11:43:53 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704252254k4994d690tfa6c5d6a7f4c0095@mail.gmail.com> References: <7523f5800704252254k4994d690tfa6c5d6a7f4c0095@mail.gmail.com> Message-ID: <7523f5800704252313t776efde9qebe640e42c6d89b5@mail.gmail.com> hi, please some one reply.. its urgent.. Regards Shalini Gupta On 4/26/07, SHALINI GUPTA wrote: > > Hi, > > my code is as... > > > ####requires > > require 'watir' > #require 'autoit' > > require 'test/unit' > require 'test/unit/ui/console/testrunner' > require 'test/unit/assertions' > #require 'watir/setFileDialog' > #require 'popups_test' > #require 'enabled_popup' > > > #logger requires > require 'example_logger1' > require 'workbookfunction' > > #java_pophadler requires > require 'WindowHelper' > require 'win32ole' > #require 'javapopup' > #require 'winClickers' > > > > > ####includes > include Watir > > > class TC_PSC_userlogin < Test::Unit::TestCase > > 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 of function StartClicker > end > > def text(wait_seconds = 2) > sleep 0.3 > autoit = WIN32OLE.new("AutoItX3.Control ") > autoit.WinWait("Microsoft Internet Explorer", nil, > wait_seconds) if wait_seconds > s = autoit.WinGetText("Microsoft Internet Explorer") > file = File.open ("c:\\test.txt", "w") # DONT MAKE > YOUR VARIABLES GLOBAL UNNECESSARILY > file.puts(s.to_s) > puts s > file.close > #s unless s == "1" # NOT SURE WHY YOU ARE DOING > THIS > end > > def start > #open the IE browser > $ie = IE.new > > #create a logger > filePrefix = "logger" > $logger = LoggerFactory.start_xml_logger(filePrefix) > $ie.set_logger($logger) > > ##Excel file functions > $lgn=Excel_file.new #making object of workbookfunction > $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") > > ##java popup hadling > #$pop=Jave_PopUps.new ##making object of javapopup > #$oPopup = Watir::autoit > end > > > > > > > > > def test_PSCLogin > > > #call start method... > start #fires up the IE browser and a logger object > > #variables-URL > test_site = 'https://www.philipnow.com/envcss/' > $logger.log("## PSCUser_Login_Logoff_4") > $logger.log("") > $logger.log("Description- Do not enter anything in the E-mail Address > and Password field and click Login button.") #logs only to corelogger file > $logger.log("Expected Output-The user should not be able to login.") > $logger.log("") > $logger.log("Step 1: Go to the Philipnow.com :- 'https://www.philipnow.com/envcss/' > ") > $ie.goto(test_site) > $logger.log(" Action-1: entered " + test_site + " in the address bar.") > $logger.log(":Step 2: Do not enter any thing in user id") > val_userid=$lgn.TakeData("a",1,$wrk_sht) > $ie.text_field(:name, "username").set(val_userid.to_s) > $logger.log(" Action-2: entered Nothing in in e-mail address") > > $logger.log(":Step-3: Do not enter any thing in password field") > val_password=$lgn.TakeData("b",1,$wrk_sht) > $ie.text_field(:name,"password").set(val_password.to_s) > $logger.log(":Action-3: entered Nothing in password field") > > > =begin oPopup = Watir::autoit > # Change into the WinTitleMatchMode that supports classnames > and handles > oPopup.AutoItSetOption("WinTitleMatchMode", 4) > 0.upto (timeout) { |i|} > ret = oPopup.WinWait("Microsoft Internet Explorer","",1) > win_text = oPopup.WinGetText("Microsoft Internet > Explorer") > if 1 == ret && !(win_text == '') then > bPopupFound = true > oPopup.WinActivate("Microsoft Internet Explorer",'') > win_text = oPopup.ControlGetText(what, '', > 'Static2').strip > if '' == win_text then win_text = > oPopup.ControlGetText(what, '', 'Static1').strip end > break > =end > > startClicker("OK",3) > > #require 'js_dialog' > #assert_js_dialog do > > $ie.button(:name, "login").click > text(2) > > #end > > > > $logger.log(":Step-4: Click the Login button") > > > $logger.log("Action-4: clicked the Login button.") > > > begin > assert($ie.contains_text("Welcome to Client Self-service Portal, > Alex Reyes!") ) > $logger.log("*FAILED*." + e.message + "\n" + e.backtrace.join > ("\n")) > $logger.log("Test Failed:Expected result has not been achieved:- > User is able to login ") > $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do not > enter anything in the E-mail Address and Password field and click Login > button.","Expected Output-The user should not be able to login.","TEST > FAILED:") #logs to both the XML file and corelogger > rescue => e > $logger.log("Test Passed:Expected result has been achieved:- User > is not able to login ") > $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do not > enter anything in the E-mail Address and Password field and click Login > button.","Expected Output-The user should not be able to login.","TEST > PASSED:") #logs to both the XML file and corelogger > end > > $ie.close > $logger.log("Close excel file") > $lgn.excel_close > $logger.log("Closed excel file") > $logger.log "## End of test: PSC login\n" > end > end > Regards > shalini gupta > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070426/0f89af80/attachment-0001.html From angrez at gmail.com Thu Apr 26 02:31:02 2007 From: angrez at gmail.com (Angrez Singh) Date: Thu, 26 Apr 2007 12:01:02 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704252313t776efde9qebe640e42c6d89b5@mail.gmail.com> References: <7523f5800704252254k4994d690tfa6c5d6a7f4c0095@mail.gmail.com> <7523f5800704252313t776efde9qebe640e42c6d89b5@mail.gmail.com> Message-ID: hi, this is simplest code that you can have: start_jsalert_clicker $ie.button(:name,[some_name]).click read_js_popup_contents # This only clicks ok button. Change teh path accordingly. def start_jsalert_clicker Thread.new{ system("rubyw \"d:\\installations\\ruby\\lib\\ruby\\gems\\1.8\\gems\\watir- 1.5.1.1145\\unittests\\jscriptExtraAlert.rb\"") } end # read file contents def read_js_popup_contents file = File.open("c:\\popup.txt") lines = file.readline while lines == "" lines = file.readline end lines = file.readlines file.close return lines end You need to modify WindowHelper.rb (in watir directory) class to enter text into the file before clicking OK button. def push_alert_button @autoit.WinWait "Windows Internet Explorer", "" text = @autoit.WinGetText "Windows Internet Explorer" file = File.open("c:\\popup.txt", "w") file.puts text file.close @autoit.Send "{ENTER}" end Hope this helps - Angrez On 4/26/07, SHALINI GUPTA wrote: > > hi, > please some one reply.. > its urgent.. > > Regards > Shalini Gupta > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > Hi, > > > > my code is as... > > > > > > ####requires > > > > require 'watir' > > #require 'autoit' > > > > require 'test/unit' > > require 'test/unit/ui/console/testrunner' > > require 'test/unit/assertions' > > #require 'watir/setFileDialog' > > #require 'popups_test' > > #require 'enabled_popup' > > > > > > #logger requires > > require 'example_logger1' > > require 'workbookfunction' > > > > #java_pophadler requires > > require 'WindowHelper' > > require 'win32ole' > > #require 'javapopup' > > #require 'winClickers' > > > > > > > > > > ####includes > > include Watir > > > > > > class TC_PSC_userlogin < Test::Unit::TestCase > > > > 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 of function StartClicker > > end > > > > def text(wait_seconds = 2) > > sleep 0.3 > > autoit = WIN32OLE.new("AutoItX3.Control ") > > autoit.WinWait("Microsoft Internet Explorer", nil, > > wait_seconds) if wait_seconds > > s = autoit.WinGetText("Microsoft Internet Explorer") > > file = File.open ("c:\\test.txt", "w") # DONT MAKE > > YOUR VARIABLES GLOBAL UNNECESSARILY > > file.puts(s.to_s) > > puts s > > file.close > > #s unless s == "1" # NOT SURE WHY YOU ARE DOING > > THIS > > end > > > > def start > > #open the IE browser > > $ie = IE.new > > > > #create a logger > > filePrefix = "logger" > > $logger = LoggerFactory.start_xml_logger(filePrefix) > > $ie.set_logger($logger) > > > > ##Excel file functions > > $lgn=Excel_file.new #making object of workbookfunction > > $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") > > > > ##java popup hadling > > #$pop=Jave_PopUps.new ##making object of javapopup > > #$oPopup = Watir::autoit > > end > > > > > > > > > > > > > > > > > > def test_PSCLogin > > > > > > #call start method... > > start #fires up the IE browser and a logger object > > > > #variables-URL > > test_site = 'https://www.philipnow.com/envcss/' > > $logger.log("## PSCUser_Login_Logoff_4") > > $logger.log("") > > $logger.log("Description- Do not enter anything in the E-mail Address > > and Password field and click Login button.") #logs only to corelogger file > > $logger.log("Expected Output-The user should not be able to login.") > > $logger.log("") > > $logger.log("Step 1: Go to the Philipnow.com :- 'https://www.philipnow.com/envcss/' > > ") > > $ie.goto(test_site) > > $logger.log(" Action-1: entered " + test_site + " in the address > > bar.") > > $logger.log(":Step 2: Do not enter any thing in user id") > > val_userid=$lgn.TakeData("a",1,$wrk_sht) > > $ie.text_field(:name, "username").set(val_userid.to_s) > > $logger.log(" Action-2: entered Nothing in in e-mail address") > > > > $logger.log(":Step-3: Do not enter any thing in password field") > > val_password=$lgn.TakeData("b",1,$wrk_sht) > > $ie.text_field(:name,"password").set(val_password.to_s) > > $logger.log(":Action-3: entered Nothing in password field") > > > > > > =begin oPopup = Watir::autoit > > # Change into the WinTitleMatchMode that supports classnames > > and handles > > oPopup.AutoItSetOption("WinTitleMatchMode", 4) > > 0.upto (timeout) { |i|} > > ret = oPopup.WinWait("Microsoft Internet Explorer","",1) > > win_text = oPopup.WinGetText("Microsoft Internet > > Explorer") > > if 1 == ret && !(win_text == '') then > > bPopupFound = true > > oPopup.WinActivate("Microsoft Internet Explorer",'') > > win_text = oPopup.ControlGetText(what, '', > > 'Static2').strip > > if '' == win_text then win_text = > > oPopup.ControlGetText(what, '', 'Static1').strip end > > break > > =end > > > > startClicker("OK",3) > > > > #require 'js_dialog' > > #assert_js_dialog do > > > > $ie.button(:name, "login").click > > text(2) > > > > #end > > > > > > > > $logger.log(":Step-4: Click the Login button") > > > > > > $logger.log("Action-4: clicked the Login button.") > > > > > > begin > > assert($ie.contains_text("Welcome to Client Self-service Portal, > > Alex Reyes!") ) > > $logger.log("*FAILED*." + e.message + "\n" + e.backtrace.join > > ("\n")) > > $logger.log("Test Failed:Expected result has not been achieved:- > > User is able to login ") > > $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do > > not enter anything in the E-mail Address and Password field and click Login > > button.","Expected Output-The user should not be able to login.","TEST > > FAILED:") #logs to both the XML file and corelogger > > rescue => e > > $logger.log("Test Passed:Expected result has been achieved:- > > User is not able to login ") > > $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do > > not enter anything in the E-mail Address and Password field and click Login > > button.","Expected Output-The user should not be able to login.","TEST > > PASSED:") #logs to both the XML file and corelogger > > end > > > > $ie.close > > $logger.log("Close excel file") > > $lgn.excel_close > > $logger.log("Closed excel file") > > $logger.log "## End of test: PSC login\n" > > end > > end > > Regards > > shalini gupta > > > > > > > > > _______________________________________________ > 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/20070426/3bf44ebe/attachment.html From shalinigupta2006 at gmail.com Thu Apr 26 03:09:00 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 26 Apr 2007 12:39:00 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: References: <7523f5800704252254k4994d690tfa6c5d6a7f4c0095@mail.gmail.com> <7523f5800704252313t776efde9qebe640e42c6d89b5@mail.gmail.com> Message-ID: <7523f5800704260009s73e0b477s3d139aedba4b1f89@mail.gmail.com> HI, Sorry..its also not working. i have done all the things told by u.. but i think push_alert_button doesnt work. as i was using wincliker class to handle popup.. that time popup was handled properly but now its not working.. my previous startClicker method is:- 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 #nd of function StartClicker end Regards shalini gupta On 4/26/07, Angrez Singh wrote: > > hi, > > this is simplest code that you can have: > > start_jsalert_clicker > $ie.button(:name,[some_name]).click > read_js_popup_contents > > # This only clicks ok button. Change teh path accordingly. > def start_jsalert_clicker > Thread.new{ system("rubyw > \"d:\\installations\\ruby\\lib\\ruby\\gems\\1.8\\gems\\watir- > 1.5.1.1145\\unittests\\jscriptExtraAlert.rb\"") } > end > > # read file contents > def read_js_popup_contents > file = File.open("c:\\popup.txt") > lines = file.readline > while lines == "" > lines = file.readline > end > lines = file.readlines > file.close > return lines > end > > > You need to modify WindowHelper.rb (in watir directory) class to enter > text into the file before clicking OK button. > > def push_alert_button > @autoit.WinWait "Windows Internet Explorer", "" > text = @autoit.WinGetText "Windows Internet Explorer" > file = File.open("c:\\popup.txt", "w") > file.puts text > file.close > @autoit.Send "{ENTER}" > end > > Hope this helps > > - Angrez > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > hi, > > please some one reply.. > > its urgent.. > > > > Regards > > Shalini Gupta > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > Hi, > > > > > > my code is as... > > > > > > > > > ####requires > > > > > > require 'watir' > > > #require 'autoit' > > > > > > require 'test/unit' > > > require 'test/unit/ui/console/testrunner' > > > require 'test/unit/assertions' > > > #require 'watir/setFileDialog' > > > #require 'popups_test' > > > #require 'enabled_popup' > > > > > > > > > #logger requires > > > require 'example_logger1' > > > require 'workbookfunction' > > > > > > #java_pophadler requires > > > require 'WindowHelper' > > > require 'win32ole' > > > #require 'javapopup' > > > #require 'winClickers' > > > > > > > > > > > > > > > ####includes > > > include Watir > > > > > > > > > class TC_PSC_userlogin < Test::Unit::TestCase > > > > > > 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 of function StartClicker > > > end > > > > > > def text(wait_seconds = 2) > > > sleep 0.3 > > > autoit = WIN32OLE.new("AutoItX3.Control ") > > > autoit.WinWait("Microsoft Internet Explorer", nil, > > > wait_seconds) if wait_seconds > > > s = autoit.WinGetText("Microsoft Internet Explorer") > > > file = File.open ("c:\\test.txt", "w") # DONT > > > MAKE YOUR VARIABLES GLOBAL UNNECESSARILY > > > file.puts(s.to_s) > > > puts s > > > file.close > > > #s unless s == "1" # NOT SURE WHY YOU ARE DOING > > > THIS > > > end > > > > > > def start > > > #open the IE browser > > > $ie = IE.new > > > > > > #create a logger > > > filePrefix = "logger" > > > $logger = LoggerFactory.start_xml_logger(filePrefix) > > > $ie.set_logger($logger) > > > > > > ##Excel file functions > > > $lgn=Excel_file.new #making object of workbookfunction > > > $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") > > > > > > ##java popup hadling > > > #$pop=Jave_PopUps.new ##making object of javapopup > > > #$oPopup = Watir::autoit > > > end > > > > > > > > > > > > > > > > > > > > > > > > > > > def test_PSCLogin > > > > > > > > > #call start method... > > > start #fires up the IE browser and a logger object > > > > > > #variables-URL > > > test_site = 'https://www.philipnow.com/envcss/' > > > $logger.log("## PSCUser_Login_Logoff_4") > > > $logger.log("") > > > $logger.log("Description- Do not enter anything in the E-mail > > > Address and Password field and click Login button.") #logs only to > > > corelogger file > > > $logger.log("Expected Output-The user should not be able to > > > login.") > > > $logger.log("") > > > $logger.log("Step 1: Go to the Philipnow.com :- 'https://www.philipnow.com/envcss/' > > > ") > > > $ie.goto(test_site) > > > $logger.log(" Action-1: entered " + test_site + " in the address > > > bar.") > > > $logger.log(":Step 2: Do not enter any thing in user id") > > > val_userid=$lgn.TakeData("a",1,$wrk_sht) > > > $ie.text_field(:name, "username").set(val_userid.to_s) > > > $logger.log(" Action-2: entered Nothing in in e-mail address") > > > > > > $logger.log(":Step-3: Do not enter any thing in password field") > > > val_password=$lgn.TakeData("b",1,$wrk_sht) > > > $ie.text_field(:name,"password").set(val_password.to_s) > > > $logger.log(":Action-3: entered Nothing in password field") > > > > > > > > > =begin oPopup = Watir::autoit > > > # Change into the WinTitleMatchMode that supports > > > classnames and handles > > > oPopup.AutoItSetOption("WinTitleMatchMode", 4) > > > 0.upto (timeout) { |i|} > > > ret = oPopup.WinWait("Microsoft Internet > > > Explorer","",1) > > > win_text = oPopup.WinGetText("Microsoft Internet > > > Explorer") > > > if 1 == ret && !(win_text == '') then > > > bPopupFound = true > > > oPopup.WinActivate("Microsoft Internet > > > Explorer",'') > > > win_text = oPopup.ControlGetText(what, '', > > > 'Static2').strip > > > if '' == win_text then win_text = > > > oPopup.ControlGetText(what, '', 'Static1').strip end > > > break > > > =end > > > > > > startClicker("OK",3) > > > > > > #require 'js_dialog' > > > #assert_js_dialog do > > > > > > $ie.button(:name, "login").click > > > text(2) > > > > > > #end > > > > > > > > > > > > $logger.log(":Step-4: Click the Login button") > > > > > > > > > $logger.log("Action-4: clicked the Login button.") > > > > > > > > > begin > > > assert($ie.contains_text("Welcome to Client Self-service > > > Portal, Alex Reyes!") ) > > > $logger.log("*FAILED*." + e.message + "\n" + e.backtrace.join > > > ("\n")) > > > $logger.log("Test Failed:Expected result has not been > > > achieved:- User is able to login ") > > > $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do > > > not enter anything in the E-mail Address and Password field and click Login > > > button.","Expected Output-The user should not be able to login.","TEST > > > FAILED:") #logs to both the XML file and corelogger > > > rescue => e > > > $logger.log("Test Passed:Expected result has been achieved:- > > > User is not able to login ") > > > $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do > > > not enter anything in the E-mail Address and Password field and click Login > > > button.","Expected Output-The user should not be able to login.","TEST > > > PASSED:") #logs to both the XML file and corelogger > > > end > > > > > > $ie.close > > > $logger.log("Close excel file") > > > $lgn.excel_close > > > $logger.log("Closed excel file") > > > $logger.log "## End of test: PSC login\n" > > > end > > > end > > > Regards > > > shalini gupta > > > > > > > > > > > > > > > _______________________________________________ > > 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/20070426/4198177e/attachment-0001.html From angrez at gmail.com Thu Apr 26 03:16:35 2007 From: angrez at gmail.com (Angrez Singh) Date: Thu, 26 Apr 2007 12:46:35 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704260009s73e0b477s3d139aedba4b1f89@mail.gmail.com> References: <7523f5800704252254k4994d690tfa6c5d6a7f4c0095@mail.gmail.com> <7523f5800704252313t776efde9qebe640e42c6d89b5@mail.gmail.com> <7523f5800704260009s73e0b477s3d139aedba4b1f89@mail.gmail.com> Message-ID: Hi, Simply saying its not working won't be of any help :). Did you get any errors, exceptions? Make sure that IE is in focus when you use the code. Is autoit installed properly? Same code works fine for me. I am able to get the text of Javascript pop up. Regards, Angrez On 4/26/07, SHALINI GUPTA wrote: > > HI, > Sorry..its also not working. > i have done all the things told by u.. > but i think push_alert_button doesnt work. > > as i was using wincliker class to handle popup.. > that time popup was handled properly > > but now its not working.. > > my previous startClicker method is:- > 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 > #nd of function StartClicker > end > > Regards > shalini gupta > > On 4/26/07, Angrez Singh wrote: > > > > hi, > > > > this is simplest code that you can have: > > > > start_jsalert_clicker > > $ie.button(:name,[some_name]).click > > read_js_popup_contents > > > > # This only clicks ok button. Change teh path accordingly. > > def start_jsalert_clicker > > Thread.new{ system("rubyw > > \"d:\\installations\\ruby\\lib\\ruby\\gems\\1.8\\gems\\watir- > > 1.5.1.1145\\unittests\\jscriptExtraAlert.rb\"") } > > end > > > > # read file contents > > def read_js_popup_contents > > file = File.open("c:\\popup.txt") > > lines = file.readline > > while lines == "" > > lines = file.readline > > end > > lines = file.readlines > > file.close > > return lines > > end > > > > > > You need to modify WindowHelper.rb (in watir directory) class to enter > > text into the file before clicking OK button. > > > > def push_alert_button > > @autoit.WinWait "Windows Internet Explorer", "" > > text = @autoit.WinGetText "Windows Internet Explorer" > > file = File.open("c:\\popup.txt", "w") > > file.puts text > > file.close > > @autoit.Send "{ENTER}" > > end > > > > Hope this helps > > > > - Angrez > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > hi, > > > please some one reply.. > > > its urgent.. > > > > > > Regards > > > Shalini Gupta > > > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > > Hi, > > > > > > > > my code is as... > > > > > > > > > > > > ####requires > > > > > > > > require 'watir' > > > > #require 'autoit' > > > > > > > > require 'test/unit' > > > > require 'test/unit/ui/console/testrunner' > > > > require 'test/unit/assertions' > > > > #require 'watir/setFileDialog' > > > > #require 'popups_test' > > > > #require 'enabled_popup' > > > > > > > > > > > > #logger requires > > > > require 'example_logger1' > > > > require 'workbookfunction' > > > > > > > > #java_pophadler requires > > > > require 'WindowHelper' > > > > require 'win32ole' > > > > #require 'javapopup' > > > > #require 'winClickers' > > > > > > > > > > > > > > > > > > > > ####includes > > > > include Watir > > > > > > > > > > > > class TC_PSC_userlogin < Test::Unit::TestCase > > > > > > > > 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 of function StartClicker > > > > end > > > > > > > > def text(wait_seconds = 2) > > > > sleep 0.3 > > > > autoit = WIN32OLE.new("AutoItX3.Control ") > > > > autoit.WinWait("Microsoft Internet Explorer", nil, > > > > wait_seconds) if wait_seconds > > > > s = autoit.WinGetText("Microsoft Internet Explorer") > > > > file = File.open ("c:\\test.txt", "w") # DONT > > > > MAKE YOUR VARIABLES GLOBAL UNNECESSARILY > > > > file.puts(s.to_s) > > > > puts s > > > > file.close > > > > #s unless s == "1" # NOT SURE WHY YOU ARE > > > > DOING THIS > > > > end > > > > > > > > def start > > > > #open the IE browser > > > > $ie = IE.new > > > > > > > > #create a logger > > > > filePrefix = "logger" > > > > $logger = LoggerFactory.start_xml_logger(filePrefix) > > > > $ie.set_logger($logger) > > > > > > > > ##Excel file functions > > > > $lgn=Excel_file.new #making object of workbookfunction > > > > $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") > > > > > > > > ##java popup hadling > > > > #$pop=Jave_PopUps.new ##making object of javapopup > > > > #$oPopup = Watir::autoit > > > > end > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > def test_PSCLogin > > > > > > > > > > > > #call start method... > > > > start #fires up the IE browser and a logger object > > > > > > > > #variables-URL > > > > test_site = 'https://www.philipnow.com/envcss/' > > > > $logger.log("## PSCUser_Login_Logoff_4") > > > > $logger.log("") > > > > $logger.log("Description- Do not enter anything in the E-mail > > > > Address and Password field and click Login button.") #logs only to > > > > corelogger file > > > > $logger.log("Expected Output-The user should not be able to > > > > login.") > > > > $logger.log("") > > > > $logger.log("Step 1: Go to the Philipnow.com :- 'https://www.philipnow.com/envcss/' > > > > ") > > > > $ie.goto(test_site) > > > > $logger.log(" Action-1: entered " + test_site + " in the address > > > > bar.") > > > > $logger.log(":Step 2: Do not enter any thing in user id") > > > > val_userid=$lgn.TakeData("a",1,$wrk_sht) > > > > $ie.text_field(:name, "username").set(val_userid.to_s) > > > > $logger.log(" Action-2: entered Nothing in in e-mail address") > > > > > > > > $logger.log(":Step-3: Do not enter any thing in password field") > > > > val_password=$lgn.TakeData("b",1,$wrk_sht) > > > > $ie.text_field(:name,"password").set(val_password.to_s) > > > > $logger.log(":Action-3: entered Nothing in password field") > > > > > > > > > > > > =begin oPopup = Watir::autoit > > > > # Change into the WinTitleMatchMode that supports > > > > classnames and handles > > > > oPopup.AutoItSetOption("WinTitleMatchMode", 4) > > > > 0.upto (timeout) { |i|} > > > > ret = oPopup.WinWait("Microsoft Internet > > > > Explorer","",1) > > > > win_text = oPopup.WinGetText("Microsoft Internet > > > > Explorer") > > > > if 1 == ret && !(win_text == '') then > > > > bPopupFound = true > > > > oPopup.WinActivate("Microsoft Internet > > > > Explorer",'') > > > > win_text = oPopup.ControlGetText(what, '', > > > > 'Static2').strip > > > > if '' == win_text then win_text = > > > > oPopup.ControlGetText(what, '', 'Static1').strip end > > > > break > > > > =end > > > > > > > > startClicker("OK",3) > > > > > > > > #require 'js_dialog' > > > > #assert_js_dialog do > > > > > > > > $ie.button(:name, "login").click > > > > text(2) > > > > > > > > #end > > > > > > > > > > > > > > > > $logger.log(":Step-4: Click the Login button") > > > > > > > > > > > > $logger.log("Action-4: clicked the Login button.") > > > > > > > > > > > > begin > > > > assert($ie.contains_text("Welcome to Client Self-service > > > > Portal, Alex Reyes!") ) > > > > $logger.log("*FAILED*." + e.message + "\n" + > > > > e.backtrace.join("\n")) > > > > $logger.log("Test Failed:Expected result has not been > > > > achieved:- User is able to login ") > > > > $logger.log_results( > > > > "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail > > > > Address and Password field and click Login button.","Expected Output-The > > > > user should not be able to login.","TEST FAILED:") #logs to both the XML > > > > file and corelogger > > > > rescue => e > > > > $logger.log("Test Passed:Expected result has been > > > > achieved:- User is not able to login ") > > > > $logger.log_results( > > > > "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail > > > > Address and Password field and click Login button.","Expected Output-The > > > > user should not be able to login.","TEST PASSED:") #logs to both the XML > > > > file and corelogger > > > > end > > > > > > > > $ie.close > > > > $logger.log("Close excel file") > > > > $lgn.excel_close > > > > $logger.log("Closed excel file") > > > > $logger.log "## End of test: PSC login\n" > > > > end > > > > end > > > > Regards > > > > shalini gupta > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > 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/20070426/2070e2f3/attachment.html From shalinigupta2006 at gmail.com Thu Apr 26 03:20:46 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 26 Apr 2007 12:50:46 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704260009s73e0b477s3d139aedba4b1f89@mail.gmail.com> References: <7523f5800704252254k4994d690tfa6c5d6a7f4c0095@mail.gmail.com> <7523f5800704252313t776efde9qebe640e42c6d89b5@mail.gmail.com> <7523f5800704260009s73e0b477s3d139aedba4b1f89@mail.gmail.com> Message-ID: <7523f5800704260020g86d7faj18d1e12461fc6a7e@mail.gmail.com> hi, please help!! its very urgent Regards Shalini Gupta On 4/26/07, SHALINI GUPTA wrote: > > HI, > Sorry..its also not working. > i have done all the things told by u.. > but i think push_alert_button doesnt work. > > as i was using wincliker class to handle popup.. > that time popup was handled properly > > but now its not working.. > > my previous startClicker method is:- > 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 > #nd of function StartClicker > end > > Regards > shalini gupta > > On 4/26/07, Angrez Singh wrote: > > > > hi, > > > > this is simplest code that you can have: > > > > start_jsalert_clicker > > $ie.button(:name,[some_name]).click > > read_js_popup_contents > > > > # This only clicks ok button. Change teh path accordingly. > > def start_jsalert_clicker > > Thread.new{ system("rubyw > > \"d:\\installations\\ruby\\lib\\ruby\\gems\\1.8\\gems\\watir- > > 1.5.1.1145\\unittests\\jscriptExtraAlert.rb\"") } > > end > > > > # read file contents > > def read_js_popup_contents > > file = File.open("c:\\popup.txt") > > lines = file.readline > > while lines == "" > > lines = file.readline > > end > > lines = file.readlines > > file.close > > return lines > > end > > > > > > You need to modify WindowHelper.rb (in watir directory) class to enter > > text into the file before clicking OK button. > > > > def push_alert_button > > @autoit.WinWait "Windows Internet Explorer", "" > > text = @autoit.WinGetText "Windows Internet Explorer" > > file = File.open("c:\\popup.txt", "w") > > file.puts text > > file.close > > @autoit.Send "{ENTER}" > > end > > > > Hope this helps > > > > - Angrez > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > hi, > > > please some one reply.. > > > its urgent.. > > > > > > Regards > > > Shalini Gupta > > > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > > Hi, > > > > > > > > my code is as... > > > > > > > > > > > > ####requires > > > > > > > > require 'watir' > > > > #require 'autoit' > > > > > > > > require 'test/unit' > > > > require 'test/unit/ui/console/testrunner' > > > > require 'test/unit/assertions' > > > > #require 'watir/setFileDialog' > > > > #require 'popups_test' > > > > #require 'enabled_popup' > > > > > > > > > > > > #logger requires > > > > require 'example_logger1' > > > > require 'workbookfunction' > > > > > > > > #java_pophadler requires > > > > require 'WindowHelper' > > > > require 'win32ole' > > > > #require 'javapopup' > > > > #require 'winClickers' > > > > > > > > > > > > > > > > > > > > ####includes > > > > include Watir > > > > > > > > > > > > class TC_PSC_userlogin < Test::Unit::TestCase > > > > > > > > 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 of function StartClicker > > > > end > > > > > > > > def text(wait_seconds = 2) > > > > sleep 0.3 > > > > autoit = WIN32OLE.new("AutoItX3.Control ") > > > > autoit.WinWait("Microsoft Internet Explorer", nil, > > > > wait_seconds) if wait_seconds > > > > s = autoit.WinGetText("Microsoft Internet Explorer") > > > > file = File.open ("c:\\test.txt", "w") # DONT > > > > MAKE YOUR VARIABLES GLOBAL UNNECESSARILY > > > > file.puts(s.to_s) > > > > puts s > > > > file.close > > > > #s unless s == "1" # NOT SURE WHY YOU ARE > > > > DOING THIS > > > > end > > > > > > > > def start > > > > #open the IE browser > > > > $ie = IE.new > > > > > > > > #create a logger > > > > filePrefix = "logger" > > > > $logger = LoggerFactory.start_xml_logger(filePrefix) > > > > $ie.set_logger($logger) > > > > > > > > ##Excel file functions > > > > $lgn=Excel_file.new #making object of workbookfunction > > > > $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") > > > > > > > > ##java popup hadling > > > > #$pop=Jave_PopUps.new ##making object of javapopup > > > > #$oPopup = Watir::autoit > > > > end > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > def test_PSCLogin > > > > > > > > > > > > #call start method... > > > > start #fires up the IE browser and a logger object > > > > > > > > #variables-URL > > > > test_site = 'https://www.philipnow.com/envcss/' > > > > $logger.log("## PSCUser_Login_Logoff_4") > > > > $logger.log("") > > > > $logger.log("Description- Do not enter anything in the E-mail > > > > Address and Password field and click Login button.") #logs only to > > > > corelogger file > > > > $logger.log("Expected Output-The user should not be able to > > > > login.") > > > > $logger.log("") > > > > $logger.log("Step 1: Go to the Philipnow.com :- 'https://www.philipnow.com/envcss/' > > > > ") > > > > $ie.goto(test_site) > > > > $logger.log(" Action-1: entered " + test_site + " in the address > > > > bar.") > > > > $logger.log(":Step 2: Do not enter any thing in user id") > > > > val_userid=$lgn.TakeData("a",1,$wrk_sht) > > > > $ie.text_field(:name, "username").set(val_userid.to_s) > > > > $logger.log(" Action-2: entered Nothing in in e-mail address") > > > > > > > > $logger.log(":Step-3: Do not enter any thing in password field") > > > > val_password=$lgn.TakeData("b",1,$wrk_sht) > > > > $ie.text_field(:name,"password").set(val_password.to_s) > > > > $logger.log(":Action-3: entered Nothing in password field") > > > > > > > > > > > > =begin oPopup = Watir::autoit > > > > # Change into the WinTitleMatchMode that supports > > > > classnames and handles > > > > oPopup.AutoItSetOption("WinTitleMatchMode", 4) > > > > 0.upto (timeout) { |i|} > > > > ret = oPopup.WinWait("Microsoft Internet > > > > Explorer","",1) > > > > win_text = oPopup.WinGetText("Microsoft Internet > > > > Explorer") > > > > if 1 == ret && !(win_text == '') then > > > > bPopupFound = true > > > > oPopup.WinActivate("Microsoft Internet > > > > Explorer",'') > > > > win_text = oPopup.ControlGetText(what, '', > > > > 'Static2').strip > > > > if '' == win_text then win_text = > > > > oPopup.ControlGetText(what, '', 'Static1').strip end > > > > break > > > > =end > > > > > > > > startClicker("OK",3) > > > > > > > > #require 'js_dialog' > > > > #assert_js_dialog do > > > > > > > > $ie.button(:name, "login").click > > > > text(2) > > > > > > > > #end > > > > > > > > > > > > > > > > $logger.log(":Step-4: Click the Login button") > > > > > > > > > > > > $logger.log("Action-4: clicked the Login button.") > > > > > > > > > > > > begin > > > > assert($ie.contains_text("Welcome to Client Self-service > > > > Portal, Alex Reyes!") ) > > > > $logger.log("*FAILED*." + e.message + "\n" + > > > > e.backtrace.join("\n")) > > > > $logger.log("Test Failed:Expected result has not been > > > > achieved:- User is able to login ") > > > > $logger.log_results( > > > > "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail > > > > Address and Password field and click Login button.","Expected Output-The > > > > user should not be able to login.","TEST FAILED:") #logs to both the XML > > > > file and corelogger > > > > rescue => e > > > > $logger.log("Test Passed:Expected result has been > > > > achieved:- User is not able to login ") > > > > $logger.log_results( > > > > "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail > > > > Address and Password field and click Login button.","Expected Output-The > > > > user should not be able to login.","TEST PASSED:") #logs to both the XML > > > > file and corelogger > > > > end > > > > > > > > $ie.close > > > > $logger.log("Close excel file") > > > > $lgn.excel_close > > > > $logger.log("Closed excel file") > > > > $logger.log "## End of test: PSC login\n" > > > > end > > > > end > > > > Regards > > > > shalini gupta > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > 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/20070426/8b2a74d8/attachment-0001.html From shalinigupta2006 at gmail.com Thu Apr 26 03:27:42 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 26 Apr 2007 12:57:42 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: References: <7523f5800704252254k4994d690tfa6c5d6a7f4c0095@mail.gmail.com> <7523f5800704252313t776efde9qebe640e42c6d89b5@mail.gmail.com> <7523f5800704260009s73e0b477s3d139aedba4b1f89@mail.gmail.com> Message-ID: <7523f5800704260027y3c61053dq429cdfa5409f57c4@mail.gmail.com> hi, thanks!! i have just started using watir.I am very new to it. should i install autoit seperately...i think it is installed automatically with watir.or ru talking about autoit tool.. Regards Shalini On 4/26/07, Angrez Singh wrote: > > Hi, > > Simply saying its not working won't be of any help :). Did you get any > errors, exceptions? Make sure that IE is in focus when you use the code. Is > autoit installed properly? Same code works fine for me. I am able to get the > text of Javascript pop up. > > Regards, > Angrez > > On 4/26/07, SHALINI GUPTA wrote: > > > > HI, > > Sorry..its also not working. > > i have done all the things told by u.. > > but i think push_alert_button doesnt work. > > > > as i was using wincliker class to handle popup.. > > that time popup was handled properly > > > > but now its not working.. > > > > my previous startClicker method is:- > > 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 > > #nd of function StartClicker > > end > > > > Regards > > shalini gupta > > > > On 4/26/07, Angrez Singh < angrez at gmail.com> wrote: > > > > > > hi, > > > > > > this is simplest code that you can have: > > > > > > start_jsalert_clicker > > > $ie.button(:name,[some_name]).click > > > read_js_popup_contents > > > > > > # This only clicks ok button. Change teh path accordingly. > > > def start_jsalert_clicker > > > Thread.new{ system("rubyw > > > \"d:\\installations\\ruby\\lib\\ruby\\gems\\1.8\\gems\\watir- > > > 1.5.1.1145\\unittests\\jscriptExtraAlert.rb\"") } > > > end > > > > > > # read file contents > > > def read_js_popup_contents > > > file = File.open("c:\\popup.txt") > > > lines = file.readline > > > while lines == "" > > > lines = file.readline > > > end > > > lines = file.readlines > > > file.close > > > return lines > > > end > > > > > > > > > You need to modify WindowHelper.rb (in watir directory) class to enter > > > text into the file before clicking OK button. > > > > > > def push_alert_button > > > @autoit.WinWait "Windows Internet Explorer", "" > > > text = @autoit.WinGetText "Windows Internet Explorer" > > > file = File.open("c:\\popup.txt", "w") > > > file.puts text > > > file.close > > > @autoit.Send "{ENTER}" > > > end > > > > > > Hope this helps > > > > > > - Angrez > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > hi, > > > > please some one reply.. > > > > its urgent.. > > > > > > > > Regards > > > > Shalini Gupta > > > > > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > > > > Hi, > > > > > > > > > > my code is as... > > > > > > > > > > > > > > > ####requires > > > > > > > > > > require 'watir' > > > > > #require 'autoit' > > > > > > > > > > require 'test/unit' > > > > > require 'test/unit/ui/console/testrunner' > > > > > require 'test/unit/assertions' > > > > > #require 'watir/setFileDialog' > > > > > #require 'popups_test' > > > > > #require 'enabled_popup' > > > > > > > > > > > > > > > #logger requires > > > > > require 'example_logger1' > > > > > require 'workbookfunction' > > > > > > > > > > #java_pophadler requires > > > > > require 'WindowHelper' > > > > > require 'win32ole' > > > > > #require 'javapopup' > > > > > #require 'winClickers' > > > > > > > > > > > > > > > > > > > > > > > > > ####includes > > > > > include Watir > > > > > > > > > > > > > > > class TC_PSC_userlogin < Test::Unit::TestCase > > > > > > > > > > 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 of function StartClicker > > > > > end > > > > > > > > > > def text(wait_seconds = 2) > > > > > sleep 0.3 > > > > > autoit = WIN32OLE.new("AutoItX3.Control ") > > > > > autoit.WinWait("Microsoft Internet Explorer", nil, > > > > > wait_seconds) if wait_seconds > > > > > s = autoit.WinGetText("Microsoft Internet Explorer") > > > > > file = File.open ("c:\\test.txt", "w") # > > > > > DONT MAKE YOUR VARIABLES GLOBAL UNNECESSARILY > > > > > file.puts(s.to_s) > > > > > puts s > > > > > file.close > > > > > #s unless s == "1" # NOT SURE WHY YOU ARE > > > > > DOING THIS > > > > > end > > > > > > > > > > def start > > > > > #open the IE browser > > > > > $ie = IE.new > > > > > > > > > > #create a logger > > > > > filePrefix = "logger" > > > > > $logger = LoggerFactory.start_xml_logger(filePrefix) > > > > > $ie.set_logger($logger) > > > > > > > > > > ##Excel file functions > > > > > $lgn=Excel_file.new #making object of workbookfunction > > > > > $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") > > > > > > > > > > ##java popup hadling > > > > > #$pop=Jave_PopUps.new ##making object of javapopup > > > > > #$oPopup = Watir::autoit > > > > > end > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > def test_PSCLogin > > > > > > > > > > > > > > > #call start method... > > > > > start #fires up the IE browser and a logger object > > > > > > > > > > #variables-URL > > > > > test_site = 'https://www.philipnow.com/envcss/' > > > > > $logger.log("## PSCUser_Login_Logoff_4") > > > > > $logger.log("") > > > > > $logger.log("Description- Do not enter anything in the E-mail > > > > > Address and Password field and click Login button.") #logs only to > > > > > corelogger file > > > > > $logger.log("Expected Output-The user should not be able to > > > > > login.") > > > > > $logger.log("") > > > > > $logger.log("Step 1: Go to the Philipnow.com :- 'https://www.philipnow.com/envcss/' > > > > > ") > > > > > $ie.goto(test_site) > > > > > $logger.log(" Action-1: entered " + test_site + " in the > > > > > address bar.") > > > > > $logger.log(":Step 2: Do not enter any thing in user id") > > > > > val_userid=$lgn.TakeData("a",1,$wrk_sht) > > > > > $ie.text_field(:name, "username").set(val_userid.to_s) > > > > > $logger.log(" Action-2: entered Nothing in in e-mail address") > > > > > > > > > > $logger.log(":Step-3: Do not enter any thing in password > > > > > field") > > > > > val_password=$lgn.TakeData("b",1,$wrk_sht) > > > > > $ie.text_field(:name,"password").set(val_password.to_s) > > > > > $logger.log(":Action-3: entered Nothing in password field") > > > > > > > > > > > > > > > =begin oPopup = Watir::autoit > > > > > # Change into the WinTitleMatchMode that supports > > > > > classnames and handles > > > > > oPopup.AutoItSetOption("WinTitleMatchMode", 4) > > > > > 0.upto (timeout) { |i|} > > > > > ret = oPopup.WinWait("Microsoft Internet > > > > > Explorer","",1) > > > > > win_text = oPopup.WinGetText("Microsoft Internet > > > > > Explorer") > > > > > if 1 == ret && !(win_text == '') then > > > > > bPopupFound = true > > > > > oPopup.WinActivate("Microsoft Internet > > > > > Explorer",'') > > > > > win_text = oPopup.ControlGetText(what, '', > > > > > 'Static2').strip > > > > > if '' == win_text then win_text = > > > > > oPopup.ControlGetText(what, '', 'Static1').strip end > > > > > break > > > > > =end > > > > > > > > > > startClicker("OK",3) > > > > > > > > > > #require 'js_dialog' > > > > > #assert_js_dialog do > > > > > > > > > > $ie.button(:name, "login").click > > > > > text(2) > > > > > > > > > > #end > > > > > > > > > > > > > > > > > > > > $logger.log(":Step-4: Click the Login button") > > > > > > > > > > > > > > > $logger.log("Action-4: clicked the Login button.") > > > > > > > > > > > > > > > begin > > > > > assert($ie.contains_text("Welcome to Client Self-service > > > > > Portal, Alex Reyes!") ) > > > > > $logger.log("*FAILED*." + e.message + "\n" + > > > > > e.backtrace.join("\n")) > > > > > $logger.log("Test Failed:Expected result has not been > > > > > achieved:- User is able to login ") > > > > > $logger.log_results( > > > > > "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail > > > > > Address and Password field and click Login button.","Expected Output-The > > > > > user should not be able to login.","TEST FAILED:") #logs to both the XML > > > > > file and corelogger > > > > > rescue => e > > > > > $logger.log("Test Passed:Expected result has been > > > > > achieved:- User is not able to login ") > > > > > $logger.log_results( > > > > > "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail > > > > > Address and Password field and click Login button.","Expected Output-The > > > > > user should not be able to login.","TEST PASSED:") #logs to both the XML > > > > > file and corelogger > > > > > end > > > > > > > > > > $ie.close > > > > > $logger.log("Close excel file") > > > > > $lgn.excel_close > > > > > $logger.log("Closed excel file") > > > > > $logger.log "## End of test: PSC login\n" > > > > > end > > > > > end > > > > > Regards > > > > > shalini gupta > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > 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 > > > > > _______________________________________________ > 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/20070426/c133ffde/attachment.html From angrez at gmail.com Thu Apr 26 03:32:52 2007 From: angrez at gmail.com (Angrez Singh) Date: Thu, 26 Apr 2007 13:02:52 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704260027y3c61053dq429cdfa5409f57c4@mail.gmail.com> References: <7523f5800704252254k4994d690tfa6c5d6a7f4c0095@mail.gmail.com> <7523f5800704252313t776efde9qebe640e42c6d89b5@mail.gmail.com> <7523f5800704260009s73e0b477s3d139aedba4b1f89@mail.gmail.com> <7523f5800704260027y3c61053dq429cdfa5409f57c4@mail.gmail.com> Message-ID: Hi, Did you get any exceptions, errors etc while using the code I provided? Regards, Angrez On 4/26/07, SHALINI GUPTA wrote: > > hi, > thanks!! > > i have just started using watir.I am very new to it. > should i install autoit seperately...i think it is installed automatically > with watir.or ru talking about autoit tool.. > > Regards > Shalini > > On 4/26/07, Angrez Singh wrote: > > > > Hi, > > > > Simply saying its not working won't be of any help :). Did you get any > > errors, exceptions? Make sure that IE is in focus when you use the code. Is > > autoit installed properly? Same code works fine for me. I am able to get the > > text of Javascript pop up. > > > > Regards, > > Angrez > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > HI, > > > Sorry..its also not working. > > > i have done all the things told by u.. > > > but i think push_alert_button doesnt work. > > > > > > as i was using wincliker class to handle popup.. > > > that time popup was handled properly > > > > > > but now its not working.. > > > > > > my previous startClicker method is:- > > > 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 > > > #nd of function StartClicker > > > end > > > > > > Regards > > > shalini gupta > > > > > > On 4/26/07, Angrez Singh < angrez at gmail.com> wrote: > > > > > > > > hi, > > > > > > > > this is simplest code that you can have: > > > > > > > > start_jsalert_clicker > > > > $ie.button(:name,[some_name]).click > > > > read_js_popup_contents > > > > > > > > # This only clicks ok button. Change teh path accordingly. > > > > def start_jsalert_clicker > > > > Thread.new{ system("rubyw > > > > \"d:\\installations\\ruby\\lib\\ruby\\gems\\1.8\\gems\\watir- > > > > 1.5.1.1145\\unittests\\jscriptExtraAlert.rb\"") } > > > > end > > > > > > > > # read file contents > > > > def read_js_popup_contents > > > > file = File.open("c:\\popup.txt") > > > > lines = file.readline > > > > while lines == "" > > > > lines = file.readline > > > > end > > > > lines = file.readlines > > > > file.close > > > > return lines > > > > end > > > > > > > > > > > > You need to modify WindowHelper.rb (in watir directory) class to > > > > enter text into the file before clicking OK button. > > > > > > > > def push_alert_button > > > > @autoit.WinWait "Windows Internet Explorer", "" > > > > text = @autoit.WinGetText "Windows Internet Explorer" > > > > file = File.open("c:\\popup.txt", "w") > > > > file.puts text > > > > file.close > > > > @autoit.Send "{ENTER}" > > > > end > > > > > > > > Hope this helps > > > > > > > > - Angrez > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > > > hi, > > > > > please some one reply.. > > > > > its urgent.. > > > > > > > > > > Regards > > > > > Shalini Gupta > > > > > > > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > > > > > > Hi, > > > > > > > > > > > > my code is as... > > > > > > > > > > > > > > > > > > ####requires > > > > > > > > > > > > require 'watir' > > > > > > #require 'autoit' > > > > > > > > > > > > require 'test/unit' > > > > > > require 'test/unit/ui/console/testrunner' > > > > > > require 'test/unit/assertions' > > > > > > #require 'watir/setFileDialog' > > > > > > #require 'popups_test' > > > > > > #require 'enabled_popup' > > > > > > > > > > > > > > > > > > #logger requires > > > > > > require 'example_logger1' > > > > > > require 'workbookfunction' > > > > > > > > > > > > #java_pophadler requires > > > > > > require 'WindowHelper' > > > > > > require 'win32ole' > > > > > > #require 'javapopup' > > > > > > #require 'winClickers' > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ####includes > > > > > > include Watir > > > > > > > > > > > > > > > > > > class TC_PSC_userlogin < Test::Unit::TestCase > > > > > > > > > > > > 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 of function StartClicker > > > > > > end > > > > > > > > > > > > def text(wait_seconds = 2) > > > > > > sleep 0.3 > > > > > > autoit = WIN32OLE.new("AutoItX3.Control ") > > > > > > autoit.WinWait("Microsoft Internet Explorer", nil, > > > > > > wait_seconds) if wait_seconds > > > > > > s = autoit.WinGetText("Microsoft Internet Explorer") > > > > > > file = File.open ("c:\\test.txt", "w") # > > > > > > DONT MAKE YOUR VARIABLES GLOBAL UNNECESSARILY > > > > > > file.puts(s.to_s) > > > > > > puts s > > > > > > file.close > > > > > > #s unless s == "1" # NOT SURE WHY YOU ARE > > > > > > DOING THIS > > > > > > end > > > > > > > > > > > > def start > > > > > > #open the IE browser > > > > > > $ie = IE.new > > > > > > > > > > > > #create a logger > > > > > > filePrefix = "logger" > > > > > > $logger = LoggerFactory.start_xml_logger(filePrefix) > > > > > > $ie.set_logger($logger) > > > > > > > > > > > > ##Excel file functions > > > > > > $lgn=Excel_file.new #making object of workbookfunction > > > > > > $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") > > > > > > > > > > > > ##java popup hadling > > > > > > #$pop=Jave_PopUps.new ##making object of javapopup > > > > > > #$oPopup = Watir::autoit > > > > > > end > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > def test_PSCLogin > > > > > > > > > > > > > > > > > > #call start method... > > > > > > start #fires up the IE browser and a logger object > > > > > > > > > > > > #variables-URL > > > > > > test_site = 'https://www.philipnow.com/envcss/' > > > > > > $logger.log("## PSCUser_Login_Logoff_4") > > > > > > $logger.log("") > > > > > > $logger.log("Description- Do not enter anything in the E-mail > > > > > > Address and Password field and click Login button.") #logs only to > > > > > > corelogger file > > > > > > $logger.log("Expected Output-The user should not be able to > > > > > > login.") > > > > > > $logger.log("") > > > > > > $logger.log("Step 1: Go to the Philipnow.com :- 'https://www.philipnow.com/envcss/' > > > > > > ") > > > > > > $ie.goto(test_site) > > > > > > $logger.log(" Action-1: entered " + test_site + " in the > > > > > > address bar.") > > > > > > $logger.log(":Step 2: Do not enter any thing in user id") > > > > > > val_userid=$lgn.TakeData("a",1,$wrk_sht) > > > > > > $ie.text_field(:name, "username").set(val_userid.to_s) > > > > > > $logger.log(" Action-2: entered Nothing in in e-mail > > > > > > address") > > > > > > > > > > > > $logger.log(":Step-3: Do not enter any thing in password > > > > > > field") > > > > > > val_password=$lgn.TakeData("b",1,$wrk_sht) > > > > > > $ie.text_field(:name,"password").set(val_password.to_s) > > > > > > $logger.log(":Action-3: entered Nothing in password field") > > > > > > > > > > > > > > > > > > =begin oPopup = Watir::autoit > > > > > > # Change into the WinTitleMatchMode that supports > > > > > > classnames and handles > > > > > > oPopup.AutoItSetOption("WinTitleMatchMode", 4) > > > > > > 0.upto (timeout) { |i|} > > > > > > ret = oPopup.WinWait("Microsoft Internet > > > > > > Explorer","",1) > > > > > > win_text = oPopup.WinGetText("Microsoft Internet > > > > > > Explorer") > > > > > > if 1 == ret && !(win_text == '') then > > > > > > bPopupFound = true > > > > > > oPopup.WinActivate("Microsoft Internet > > > > > > Explorer",'') > > > > > > win_text = oPopup.ControlGetText(what, '', > > > > > > 'Static2').strip > > > > > > if '' == win_text then win_text = > > > > > > oPopup.ControlGetText(what, '', 'Static1').strip end > > > > > > break > > > > > > =end > > > > > > > > > > > > startClicker("OK",3) > > > > > > > > > > > > #require 'js_dialog' > > > > > > #assert_js_dialog do > > > > > > > > > > > > $ie.button(:name, "login").click > > > > > > text(2) > > > > > > > > > > > > #end > > > > > > > > > > > > > > > > > > > > > > > > $logger.log(":Step-4: Click the Login button") > > > > > > > > > > > > > > > > > > $logger.log("Action-4: clicked the Login button.") > > > > > > > > > > > > > > > > > > begin > > > > > > assert($ie.contains_text("Welcome to Client Self-service > > > > > > Portal, Alex Reyes!") ) > > > > > > $logger.log("*FAILED*." + e.message + "\n" + > > > > > > e.backtrace.join("\n")) > > > > > > $logger.log("Test Failed:Expected result has not been > > > > > > achieved:- User is able to login ") > > > > > > $logger.log_results( > > > > > > "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail > > > > > > Address and Password field and click Login button.","Expected Output-The > > > > > > user should not be able to login.","TEST FAILED:") #logs to both the XML > > > > > > file and corelogger > > > > > > rescue => e > > > > > > $logger.log("Test Passed:Expected result has been > > > > > > achieved:- User is not able to login ") > > > > > > $logger.log_results( > > > > > > "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail > > > > > > Address and Password field and click Login button.","Expected Output-The > > > > > > user should not be able to login.","TEST PASSED:") #logs to both the XML > > > > > > file and corelogger > > > > > > end > > > > > > > > > > > > $ie.close > > > > > > $logger.log("Close excel file") > > > > > > $lgn.excel_close > > > > > > $logger.log("Closed excel file") > > > > > > $logger.log "## End of test: PSC login\n" > > > > > > end > > > > > > end > > > > > > Regards > > > > > > shalini gupta > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > 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 > > > > > > > > > _______________________________________________ > > 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/20070426/8ce63669/attachment-0001.html From shalinigupta2006 at gmail.com Thu Apr 26 03:35:51 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 26 Apr 2007 13:05:51 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: References: <7523f5800704252254k4994d690tfa6c5d6a7f4c0095@mail.gmail.com> <7523f5800704252313t776efde9qebe640e42c6d89b5@mail.gmail.com> <7523f5800704260009s73e0b477s3d139aedba4b1f89@mail.gmail.com> <7523f5800704260027y3c61053dq429cdfa5409f57c4@mail.gmail.com> Message-ID: <7523f5800704260035jd45ec82uf3195170eb185326@mail.gmail.com> HI, No im not getting any exception,error.. but it becomes silent ...like not doing any thing... just command promt remains open.. nothing happens.. regards shalini gupta On 4/26/07, Angrez Singh wrote: > > Hi, > > Did you get any exceptions, errors etc while using the code I provided? > > Regards, > Angrez > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > hi, > > thanks!! > > > > i have just started using watir.I am very new to it. > > should i install autoit seperately...i think it is installed > > automatically with watir.or ru talking about autoit tool.. > > > > Regards > > Shalini > > > > On 4/26/07, Angrez Singh < angrez at gmail.com> wrote: > > > > > > Hi, > > > > > > Simply saying its not working won't be of any help :). Did you get any > > > errors, exceptions? Make sure that IE is in focus when you use the code. Is > > > autoit installed properly? Same code works fine for me. I am able to get the > > > text of Javascript pop up. > > > > > > Regards, > > > Angrez > > > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > > HI, > > > > Sorry..its also not working. > > > > i have done all the things told by u.. > > > > but i think push_alert_button doesnt work. > > > > > > > > as i was using wincliker class to handle popup.. > > > > that time popup was handled properly > > > > > > > > but now its not working.. > > > > > > > > my previous startClicker method is:- > > > > 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 > > > > #nd of function StartClicker > > > > end > > > > > > > > Regards > > > > shalini gupta > > > > > > > > On 4/26/07, Angrez Singh < angrez at gmail.com> wrote: > > > > > > > > > > hi, > > > > > > > > > > this is simplest code that you can have: > > > > > > > > > > start_jsalert_clicker > > > > > $ie.button(:name,[some_name]).click > > > > > read_js_popup_contents > > > > > > > > > > # This only clicks ok button. Change teh path accordingly. > > > > > def start_jsalert_clicker > > > > > Thread.new{ system("rubyw > > > > > \"d:\\installations\\ruby\\lib\\ruby\\gems\\1.8\\gems\\watir- > > > > > 1.5.1.1145\\unittests\\jscriptExtraAlert.rb\"") } > > > > > end > > > > > > > > > > # read file contents > > > > > def read_js_popup_contents > > > > > file = File.open("c:\\popup.txt") > > > > > lines = file.readline > > > > > while lines == "" > > > > > lines = file.readline > > > > > end > > > > > lines = file.readlines > > > > > file.close > > > > > return lines > > > > > end > > > > > > > > > > > > > > > You need to modify WindowHelper.rb (in watir directory) class to > > > > > enter text into the file before clicking OK button. > > > > > > > > > > def push_alert_button > > > > > @autoit.WinWait "Windows Internet Explorer", "" > > > > > text = @autoit.WinGetText "Windows Internet Explorer" > > > > > file = File.open("c:\\popup.txt", "w") > > > > > file.puts text > > > > > file.close > > > > > @autoit.Send "{ENTER}" > > > > > end > > > > > > > > > > Hope this helps > > > > > > > > > > - Angrez > > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > > > > > hi, > > > > > > please some one reply.. > > > > > > its urgent.. > > > > > > > > > > > > Regards > > > > > > Shalini Gupta > > > > > > > > > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > my code is as... > > > > > > > > > > > > > > > > > > > > > ####requires > > > > > > > > > > > > > > require 'watir' > > > > > > > #require 'autoit' > > > > > > > > > > > > > > require 'test/unit' > > > > > > > require 'test/unit/ui/console/testrunner' > > > > > > > require 'test/unit/assertions' > > > > > > > #require 'watir/setFileDialog' > > > > > > > #require 'popups_test' > > > > > > > #require 'enabled_popup' > > > > > > > > > > > > > > > > > > > > > #logger requires > > > > > > > require 'example_logger1' > > > > > > > require 'workbookfunction' > > > > > > > > > > > > > > #java_pophadler requires > > > > > > > require 'WindowHelper' > > > > > > > require 'win32ole' > > > > > > > #require 'javapopup' > > > > > > > #require 'winClickers' > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ####includes > > > > > > > include Watir > > > > > > > > > > > > > > > > > > > > > class TC_PSC_userlogin < Test::Unit::TestCase > > > > > > > > > > > > > > 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 of function StartClicker > > > > > > > end > > > > > > > > > > > > > > def text(wait_seconds = 2) > > > > > > > sleep 0.3 > > > > > > > autoit = WIN32OLE.new("AutoItX3.Control ") > > > > > > > autoit.WinWait("Microsoft Internet Explorer", nil, > > > > > > > wait_seconds) if wait_seconds > > > > > > > s = autoit.WinGetText("Microsoft Internet > > > > > > > Explorer") > > > > > > > file = File.open ("c:\\test.txt", "w") # > > > > > > > DONT MAKE YOUR VARIABLES GLOBAL UNNECESSARILY > > > > > > > file.puts(s.to_s) > > > > > > > puts s > > > > > > > file.close > > > > > > > #s unless s == "1" # NOT SURE WHY YOU > > > > > > > ARE DOING THIS > > > > > > > end > > > > > > > > > > > > > > def start > > > > > > > #open the IE browser > > > > > > > $ie = IE.new > > > > > > > > > > > > > > #create a logger > > > > > > > filePrefix = "logger" > > > > > > > $logger = LoggerFactory.start_xml_logger(filePrefix) > > > > > > > $ie.set_logger($logger) > > > > > > > > > > > > > > ##Excel file functions > > > > > > > $lgn=Excel_file.new #making object of workbookfunction > > > > > > > $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") > > > > > > > > > > > > > > ##java popup hadling > > > > > > > #$pop=Jave_PopUps.new ##making object of javapopup > > > > > > > #$oPopup = Watir::autoit > > > > > > > end > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > def test_PSCLogin > > > > > > > > > > > > > > > > > > > > > #call start method... > > > > > > > start #fires up the IE browser and a logger object > > > > > > > > > > > > > > #variables-URL > > > > > > > test_site = 'https://www.philipnow.com/envcss/' > > > > > > > $logger.log("## PSCUser_Login_Logoff_4") > > > > > > > $logger.log("") > > > > > > > $logger.log("Description- Do not enter anything in the > > > > > > > E-mail Address and Password field and click Login button.") #logs only to > > > > > > > corelogger file > > > > > > > $logger.log("Expected Output-The user should not be able to > > > > > > > login.") > > > > > > > $logger.log("") > > > > > > > $logger.log("Step 1: Go to the Philipnow.com :- 'https://www.philipnow.com/envcss/' > > > > > > > ") > > > > > > > $ie.goto(test_site) > > > > > > > $logger.log(" Action-1: entered " + test_site + " in the > > > > > > > address bar.") > > > > > > > $logger.log(":Step 2: Do not enter any thing in user id") > > > > > > > val_userid=$lgn.TakeData("a",1,$wrk_sht) > > > > > > > $ie.text_field(:name, "username").set(val_userid.to_s) > > > > > > > $logger.log(" Action-2: entered Nothing in in e-mail > > > > > > > address") > > > > > > > > > > > > > > $logger.log(":Step-3: Do not enter any thing in password > > > > > > > field") > > > > > > > val_password=$lgn.TakeData("b",1,$wrk_sht) > > > > > > > $ie.text_field(:name,"password").set(val_password.to_s) > > > > > > > $logger.log(":Action-3: entered Nothing in password field") > > > > > > > > > > > > > > > > > > > > > =begin oPopup = Watir::autoit > > > > > > > # Change into the WinTitleMatchMode that supports > > > > > > > classnames and handles > > > > > > > oPopup.AutoItSetOption("WinTitleMatchMode", 4) > > > > > > > 0.upto (timeout) { |i|} > > > > > > > ret = oPopup.WinWait("Microsoft Internet > > > > > > > Explorer","",1) > > > > > > > win_text = oPopup.WinGetText("Microsoft > > > > > > > Internet Explorer") > > > > > > > if 1 == ret && !(win_text == '') then > > > > > > > bPopupFound = true > > > > > > > oPopup.WinActivate("Microsoft Internet > > > > > > > Explorer",'') > > > > > > > win_text = oPopup.ControlGetText(what, > > > > > > > '', 'Static2').strip > > > > > > > if '' == win_text then win_text = > > > > > > > oPopup.ControlGetText(what, '', 'Static1').strip end > > > > > > > break > > > > > > > =end > > > > > > > > > > > > > > startClicker("OK",3) > > > > > > > > > > > > > > #require 'js_dialog' > > > > > > > #assert_js_dialog do > > > > > > > > > > > > > > $ie.button(:name, "login").click > > > > > > > text(2) > > > > > > > > > > > > > > #end > > > > > > > > > > > > > > > > > > > > > > > > > > > > $logger.log(":Step-4: Click the Login button") > > > > > > > > > > > > > > > > > > > > > $logger.log("Action-4: clicked the Login button.") > > > > > > > > > > > > > > > > > > > > > begin > > > > > > > assert($ie.contains_text("Welcome to Client > > > > > > > Self-service Portal, Alex Reyes!") ) > > > > > > > $logger.log("*FAILED*." + e.message + "\n" + > > > > > > > e.backtrace.join("\n")) > > > > > > > $logger.log("Test Failed:Expected result has not been > > > > > > > achieved:- User is able to login ") > > > > > > > $logger.log_results( > > > > > > > "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail > > > > > > > Address and Password field and click Login button.","Expected Output-The > > > > > > > user should not be able to login.","TEST FAILED:") #logs to both the XML > > > > > > > file and corelogger > > > > > > > rescue => e > > > > > > > $logger.log("Test Passed:Expected result has been > > > > > > > achieved:- User is not able to login ") > > > > > > > $logger.log_results( > > > > > > > "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail > > > > > > > Address and Password field and click Login button.","Expected Output-The > > > > > > > user should not be able to login.","TEST PASSED:") #logs to both the XML > > > > > > > file and corelogger > > > > > > > end > > > > > > > > > > > > > > $ie.close > > > > > > > $logger.log("Close excel file") > > > > > > > $lgn.excel_close > > > > > > > $logger.log("Closed excel file") > > > > > > > $logger.log "## End of test: PSC login\n" > > > > > > > end > > > > > > > end > > > > > > > Regards > > > > > > > shalini gupta > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > 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 > > > > > > > > > > > > > _______________________________________________ > > > 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/20070426/9eae556c/attachment-0001.html From shalinigupta2006 at gmail.com Thu Apr 26 04:19:26 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 26 Apr 2007 13:49:26 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704260118x13751fb6x5e20d0dfe20fc74a@mail.gmail.com> References: <7523f5800704252254k4994d690tfa6c5d6a7f4c0095@mail.gmail.com> <7523f5800704252313t776efde9qebe640e42c6d89b5@mail.gmail.com> <7523f5800704260009s73e0b477s3d139aedba4b1f89@mail.gmail.com> <7523f5800704260027y3c61053dq429cdfa5409f57c4@mail.gmail.com> <7523f5800704260035jd45ec82uf3195170eb185326@mail.gmail.com> <7523f5800704260045m37ec0d7ard587adb710f7afd1@mail.gmail.com> <7523f5800704260118x13751fb6x5e20d0dfe20fc74a@mail.gmail.com> Message-ID: <7523f5800704260119t313c1cb9r23d967052eddd9f7@mail.gmail.com> On 4/26/07, SHALINI GUPTA wrote: > > HI ALL, > Please help!! > its urgent!! > > Regards > Shalini > > On 4/26/07, SHALINI GUPTA wrote: > > > > > > > > ---------- Forwarded message ---------- > > From: SHALINI GUPTA > > Date: Apr 26, 2007 1:05 PM > > Subject: Re: [Wtr-general] how to capture text from popup window > > To: wtr-general at rubyforge.org > > > > HI, > > No im not getting any exception,error.. > > but it becomes silent ...like not doing any thing... > > just command promt remains open.. > > > > nothing happens.. > > > > regards > > shalini gupta > > > > On 4/26/07, Angrez Singh wrote: > > > > > > Hi, > > > > > > Did you get any exceptions, errors etc while using the code I > > > provided? > > > > > > Regards, > > > Angrez > > > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > > hi, > > > > thanks!! > > > > > > > > i have just started using watir.I am very new to it. > > > > should i install autoit seperately...i think it is installed > > > > automatically with watir.or ru talking about autoit tool.. > > > > > > > > Regards > > > > Shalini > > > > > > > > On 4/26/07, Angrez Singh < angrez at gmail.com> wrote: > > > > > > > > > > Hi, > > > > > > > > > > Simply saying its not working won't be of any help :). Did you get > > > > > any errors, exceptions? Make sure that IE is in focus when you use the code. > > > > > Is autoit installed properly? Same code works fine for me. I am able to get > > > > > the text of Javascript pop up. > > > > > > > > > > Regards, > > > > > Angrez > > > > > > > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > > > > > > HI, > > > > > > Sorry..its also not working. > > > > > > i have done all the things told by u.. > > > > > > but i think push_alert_button doesnt work. > > > > > > > > > > > > as i was using wincliker class to handle popup.. > > > > > > that time popup was handled properly > > > > > > > > > > > > but now its not working.. > > > > > > > > > > > > my previous startClicker method is:- > > > > > > 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 > > > > > > #nd of function StartClicker > > > > > > end > > > > > > > > > > > > Regards > > > > > > shalini gupta > > > > > > > > > > > > On 4/26/07, Angrez Singh < angrez at gmail.com> wrote: > > > > > > > > > > > > > > hi, > > > > > > > > > > > > > > this is simplest code that you can have: > > > > > > > > > > > > > > start_jsalert_clicker > > > > > > > $ie.button(:name,[some_name]).click > > > > > > > read_js_popup_contents > > > > > > > > > > > > > > # This only clicks ok button. Change teh path accordingly. > > > > > > > def start_jsalert_clicker > > > > > > > Thread.new{ system("rubyw > > > > > > > \"d:\\installations\\ruby\\lib\\ruby\\gems\\1.8\\gems\\watir- > > > > > > > 1.5.1.1145\\unittests\\jscriptExtraAlert.rb\"") } > > > > > > > end > > > > > > > > > > > > > > # read file contents > > > > > > > def read_js_popup_contents > > > > > > > file = File.open("c:\\popup.txt") > > > > > > > lines = file.readline > > > > > > > while lines == "" > > > > > > > lines = file.readline > > > > > > > end > > > > > > > lines = file.readlines > > > > > > > file.close > > > > > > > return lines > > > > > > > end > > > > > > > > > > > > > > > > > > > > > You need to modify WindowHelper.rb (in watir directory) class > > > > > > > to enter text into the file before clicking OK button. > > > > > > > > > > > > > > def push_alert_button > > > > > > > @autoit.WinWait "Windows Internet Explorer", "" > > > > > > > text = @autoit.WinGetText "Windows Internet Explorer" > > > > > > > file = File.open("c:\\popup.txt", "w") > > > > > > > file.puts text > > > > > > > file.close > > > > > > > @autoit.Send "{ENTER}" > > > > > > > end > > > > > > > > > > > > > > Hope this helps > > > > > > > > > > > > > > - Angrez > > > > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > > > > > > > > > hi, > > > > > > > > please some one reply.. > > > > > > > > its urgent.. > > > > > > > > > > > > > > > > Regards > > > > > > > > Shalini Gupta > > > > > > > > > > > > > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > > > my code is as... > > > > > > > > > > > > > > > > > > > > > > > > > > > ####requires > > > > > > > > > > > > > > > > > > require 'watir' > > > > > > > > > #require 'autoit' > > > > > > > > > > > > > > > > > > require 'test/unit' > > > > > > > > > require 'test/unit/ui/console/testrunner' > > > > > > > > > require 'test/unit/assertions' > > > > > > > > > #require 'watir/setFileDialog' > > > > > > > > > #require 'popups_test' > > > > > > > > > #require 'enabled_popup' > > > > > > > > > > > > > > > > > > > > > > > > > > > #logger requires > > > > > > > > > require 'example_logger1' > > > > > > > > > require 'workbookfunction' > > > > > > > > > > > > > > > > > > #java_pophadler requires > > > > > > > > > require 'WindowHelper' > > > > > > > > > require 'win32ole' > > > > > > > > > #require 'javapopup' > > > > > > > > > #require 'winClickers' > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ####includes > > > > > > > > > include Watir > > > > > > > > > > > > > > > > > > > > > > > > > > > class TC_PSC_userlogin < Test::Unit::TestCase > > > > > > > > > > > > > > > > > > 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 of function StartClicker > > > > > > > > > end > > > > > > > > > > > > > > > > > > def text(wait_seconds = 2) > > > > > > > > > sleep 0.3 > > > > > > > > > autoit = WIN32OLE.new("AutoItX3.Control ") > > > > > > > > > autoit.WinWait("Microsoft Internet Explorer", > > > > > > > > > nil, wait_seconds) if wait_seconds > > > > > > > > > s = autoit.WinGetText("Microsoft Internet > > > > > > > > > Explorer") > > > > > > > > > file = File.open ("c:\\test.txt", > > > > > > > > > "w") # DONT MAKE YOUR VARIABLES GLOBAL UNNECESSARILY > > > > > > > > > file.puts(s.to_s) > > > > > > > > > puts s > > > > > > > > > file.close > > > > > > > > > #s unless s == "1" # NOT SURE WHY > > > > > > > > > YOU ARE DOING THIS > > > > > > > > > end > > > > > > > > > > > > > > > > > > def start > > > > > > > > > #open the IE browser > > > > > > > > > $ie = IE.new > > > > > > > > > > > > > > > > > > #create a logger > > > > > > > > > filePrefix = "logger" > > > > > > > > > $logger = LoggerFactory.start_xml_logger(filePrefix) > > > > > > > > > $ie.set_logger($logger) > > > > > > > > > > > > > > > > > > ##Excel file functions > > > > > > > > > $lgn=Excel_file.new #making object of workbookfunction > > > > > > > > > $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") > > > > > > > > > > > > > > > > > > ##java popup hadling > > > > > > > > > #$pop=Jave_PopUps.new ##making object of javapopup > > > > > > > > > #$oPopup = Watir::autoit > > > > > > > > > end > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > def test_PSCLogin > > > > > > > > > > > > > > > > > > > > > > > > > > > #call start method... > > > > > > > > > start #fires up the IE browser and a logger object > > > > > > > > > > > > > > > > > > #variables-URL > > > > > > > > > test_site = 'https://www.philipnow.com/envcss/' > > > > > > > > > $logger.log("## PSCUser_Login_Logoff_4") > > > > > > > > > $logger.log("") > > > > > > > > > $logger.log("Description- Do not enter anything in the > > > > > > > > > E-mail Address and Password field and click Login button.") #logs only to > > > > > > > > > corelogger file > > > > > > > > > $logger.log("Expected Output-The user should not be > > > > > > > > > able to login.") > > > > > > > > > $logger.log("") > > > > > > > > > $logger.log("Step 1: Go to the Philipnow.com :- 'https://www.philipnow.com/envcss/' > > > > > > > > > ") > > > > > > > > > $ie.goto(test_site) > > > > > > > > > $logger.log(" Action-1: entered " + test_site + " in > > > > > > > > > the address bar.") > > > > > > > > > $logger.log(":Step 2: Do not enter any thing in user > > > > > > > > > id") > > > > > > > > > val_userid=$lgn.TakeData("a",1,$wrk_sht) > > > > > > > > > $ie.text_field(:name, "username").set(val_userid.to_s) > > > > > > > > > $logger.log(" Action-2: entered Nothing in in e-mail > > > > > > > > > address") > > > > > > > > > > > > > > > > > > $logger.log(":Step-3: Do not enter any thing in > > > > > > > > > password field") > > > > > > > > > val_password=$lgn.TakeData("b",1,$wrk_sht) > > > > > > > > > $ie.text_field(:name,"password").set(val_password.to_s) > > > > > > > > > $logger.log(":Action-3: entered Nothing in password > > > > > > > > > field") > > > > > > > > > > > > > > > > > > > > > > > > > > > =begin oPopup = Watir::autoit > > > > > > > > > # Change into the WinTitleMatchMode that > > > > > > > > > supports classnames and handles > > > > > > > > > oPopup.AutoItSetOption("WinTitleMatchMode", 4) > > > > > > > > > 0.upto (timeout) { |i|} > > > > > > > > > ret = oPopup.WinWait("Microsoft Internet > > > > > > > > > Explorer","",1) > > > > > > > > > win_text = oPopup.WinGetText("Microsoft > > > > > > > > > Internet Explorer") > > > > > > > > > if 1 == ret && !(win_text == '') then > > > > > > > > > bPopupFound = true > > > > > > > > > oPopup.WinActivate("Microsoft Internet > > > > > > > > > Explorer",'') > > > > > > > > > win_text = oPopup.ControlGetText(what, > > > > > > > > > '', 'Static2').strip > > > > > > > > > if '' == win_text then win_text = > > > > > > > > > oPopup.ControlGetText(what, '', 'Static1').strip end > > > > > > > > > break > > > > > > > > > =end > > > > > > > > > > > > > > > > > > startClicker("OK",3) > > > > > > > > > > > > > > > > > > #require 'js_dialog' > > > > > > > > > #assert_js_dialog do > > > > > > > > > > > > > > > > > > $ie.button(:name, "login").click > > > > > > > > > text(2) > > > > > > > > > > > > > > > > > > #end > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > $logger.log(":Step-4: Click the Login button") > > > > > > > > > > > > > > > > > > > > > > > > > > > $logger.log("Action-4: clicked the Login button.") > > > > > > > > > > > > > > > > > > > > > > > > > > > begin > > > > > > > > > assert($ie.contains_text("Welcome to Client > > > > > > > > > Self-service Portal, Alex Reyes!") ) > > > > > > > > > $logger.log("*FAILED*." + e.message + "\n" + > > > > > > > > > e.backtrace.join("\n")) > > > > > > > > > $logger.log("Test Failed:Expected result has not > > > > > > > > > been achieved:- User is able to login ") > > > > > > > > > $logger.log_results( > > > > > > > > > "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail > > > > > > > > > Address and Password field and click Login button.","Expected Output-The > > > > > > > > > user should not be able to login.","TEST FAILED:") #logs to both the XML > > > > > > > > > file and corelogger > > > > > > > > > rescue => e > > > > > > > > > $logger.log("Test Passed:Expected result has been > > > > > > > > > achieved:- User is not able to login ") > > > > > > > > > $logger.log_results( > > > > > > > > > "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail > > > > > > > > > Address and Password field and click Login button.","Expected Output-The > > > > > > > > > user should not be able to login.","TEST PASSED:") #logs to both the XML > > > > > > > > > file and corelogger > > > > > > > > > end > > > > > > > > > > > > > > > > > > $ie.close > > > > > > > > > $logger.log("Close excel file") > > > > > > > > > $lgn.excel_close > > > > > > > > > $logger.log("Closed excel file") > > > > > > > > > $logger.log "## End of test: PSC login\n" > > > > > > > > > end > > > > > > > > > end > > > > > > > > > Regards > > > > > > > > > shalini gupta > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > 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 > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > 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/20070426/a11b8ad8/attachment-0001.html From angrez at gmail.com Thu Apr 26 04:56:58 2007 From: angrez at gmail.com (Angrez Singh) Date: Thu, 26 Apr 2007 14:26:58 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704260119t313c1cb9r23d967052eddd9f7@mail.gmail.com> References: <7523f5800704252254k4994d690tfa6c5d6a7f4c0095@mail.gmail.com> <7523f5800704260009s73e0b477s3d139aedba4b1f89@mail.gmail.com> <7523f5800704260027y3c61053dq429cdfa5409f57c4@mail.gmail.com> <7523f5800704260035jd45ec82uf3195170eb185326@mail.gmail.com> <7523f5800704260045m37ec0d7ard587adb710f7afd1@mail.gmail.com> <7523f5800704260118x13751fb6x5e20d0dfe20fc74a@mail.gmail.com> <7523f5800704260119t313c1cb9r23d967052eddd9f7@mail.gmail.com> Message-ID: hi, Did notepad or wordpad gets open when you execute the script? I hope you changed the path in your script before executing the script that I provided? Can you post the contents of command prompt that you get? Regards, Angrez On 4/26/07, SHALINI GUPTA wrote: > > > > On 4/26/07, SHALINI GUPTA wrote: > > > > HI ALL, > > Please help!! > > its urgent!! > > > > Regards > > Shalini > > > > On 4/26/07, SHALINI GUPTA wrote: > > > > > > > > > > > > ---------- Forwarded message ---------- > > > From: SHALINI GUPTA > > > Date: Apr 26, 2007 1:05 PM > > > Subject: Re: [Wtr-general] how to capture text from popup window > > > To: wtr-general at rubyforge.org > > > > > > HI, > > > No im not getting any exception,error.. > > > but it becomes silent ...like not doing any thing... > > > just command promt remains open.. > > > > > > nothing happens.. > > > > > > regards > > > shalini gupta > > > > > > On 4/26/07, Angrez Singh wrote: > > > > > > > > Hi, > > > > > > > > Did you get any exceptions, errors etc while using the code I > > > > provided? > > > > > > > > Regards, > > > > Angrez > > > > > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > > > > hi, > > > > > thanks!! > > > > > > > > > > i have just started using watir.I am very new to it. > > > > > should i install autoit seperately...i think it is installed > > > > > automatically with watir.or ru talking about autoit tool.. > > > > > > > > > > Regards > > > > > Shalini > > > > > > > > > > On 4/26/07, Angrez Singh < angrez at gmail.com> wrote: > > > > > > > > > > > > Hi, > > > > > > > > > > > > Simply saying its not working won't be of any help :). Did you > > > > > > get any errors, exceptions? Make sure that IE is in focus when you use the > > > > > > code. Is autoit installed properly? Same code works fine for me. I am able > > > > > > to get the text of Javascript pop up. > > > > > > > > > > > > Regards, > > > > > > Angrez > > > > > > > > > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > > > > > > > > > > > HI, > > > > > > > Sorry..its also not working. > > > > > > > i have done all the things told by u.. > > > > > > > but i think push_alert_button doesnt work. > > > > > > > > > > > > > > as i was using wincliker class to handle popup.. > > > > > > > that time popup was handled properly > > > > > > > > > > > > > > but now its not working.. > > > > > > > > > > > > > > my previous startClicker method is:- > > > > > > > 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 > > > > > > > #nd of function StartClicker > > > > > > > end > > > > > > > > > > > > > > Regards > > > > > > > shalini gupta > > > > > > > > > > > > > > On 4/26/07, Angrez Singh < angrez at gmail.com> wrote: > > > > > > > > > > > > > > > > hi, > > > > > > > > > > > > > > > > this is simplest code that you can have: > > > > > > > > > > > > > > > > start_jsalert_clicker > > > > > > > > $ie.button(:name,[some_name]).click > > > > > > > > read_js_popup_contents > > > > > > > > > > > > > > > > # This only clicks ok button. Change teh path accordingly. > > > > > > > > def start_jsalert_clicker > > > > > > > > Thread.new{ system("rubyw > > > > > > > > \"d:\\installations\\ruby\\lib\\ruby\\gems\\1.8\\gems\\watir- > > > > > > > > 1.5.1.1145\\unittests\\jscriptExtraAlert.rb\"") } > > > > > > > > end > > > > > > > > > > > > > > > > # read file contents > > > > > > > > def read_js_popup_contents > > > > > > > > file = File.open("c:\\popup.txt") > > > > > > > > lines = file.readline > > > > > > > > while lines == "" > > > > > > > > lines = file.readline > > > > > > > > end > > > > > > > > lines = file.readlines > > > > > > > > file.close > > > > > > > > return lines > > > > > > > > end > > > > > > > > > > > > > > > > > > > > > > > > You need to modify WindowHelper.rb (in watir directory) > > > > > > > > class to enter text into the file before clicking OK button. > > > > > > > > > > > > > > > > def push_alert_button > > > > > > > > @autoit.WinWait "Windows Internet Explorer", "" > > > > > > > > text = @autoit.WinGetText "Windows Internet > > > > > > > > Explorer" > > > > > > > > file = File.open("c:\\popup.txt", "w") > > > > > > > > file.puts text > > > > > > > > file.close > > > > > > > > @autoit.Send "{ENTER}" > > > > > > > > end > > > > > > > > > > > > > > > > Hope this helps > > > > > > > > > > > > > > > > - Angrez > > > > > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> > > > > > > > > wrote: > > > > > > > > > > > > > > > > > hi, > > > > > > > > > please some one reply.. > > > > > > > > > its urgent.. > > > > > > > > > > > > > > > > > > Regards > > > > > > > > > Shalini Gupta > > > > > > > > > > > > > > > > > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > > > > > my code is as... > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ####requires > > > > > > > > > > > > > > > > > > > > require 'watir' > > > > > > > > > > #require 'autoit' > > > > > > > > > > > > > > > > > > > > require 'test/unit' > > > > > > > > > > require 'test/unit/ui/console/testrunner' > > > > > > > > > > require 'test/unit/assertions' > > > > > > > > > > #require 'watir/setFileDialog' > > > > > > > > > > #require 'popups_test' > > > > > > > > > > #require 'enabled_popup' > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > #logger requires > > > > > > > > > > require 'example_logger1' > > > > > > > > > > require 'workbookfunction' > > > > > > > > > > > > > > > > > > > > #java_pophadler requires > > > > > > > > > > require 'WindowHelper' > > > > > > > > > > require 'win32ole' > > > > > > > > > > #require 'javapopup' > > > > > > > > > > #require 'winClickers' > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ####includes > > > > > > > > > > include Watir > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > class TC_PSC_userlogin < Test::Unit::TestCase > > > > > > > > > > > > > > > > > > > > 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 of function StartClicker > > > > > > > > > > end > > > > > > > > > > > > > > > > > > > > def text(wait_seconds = 2) > > > > > > > > > > sleep 0.3 > > > > > > > > > > autoit = WIN32OLE.new("AutoItX3.Control ") > > > > > > > > > > autoit.WinWait("Microsoft Internet > > > > > > > > > > Explorer", nil, wait_seconds) if wait_seconds > > > > > > > > > > s = autoit.WinGetText("Microsoft Internet > > > > > > > > > > Explorer") > > > > > > > > > > file = File.open ("c:\\test.txt", > > > > > > > > > > "w") # DONT MAKE YOUR VARIABLES GLOBAL UNNECESSARILY > > > > > > > > > > file.puts(s.to_s) > > > > > > > > > > puts s > > > > > > > > > > file.close > > > > > > > > > > #s unless s == "1" # NOT SURE WHY > > > > > > > > > > YOU ARE DOING THIS > > > > > > > > > > end > > > > > > > > > > > > > > > > > > > > def start > > > > > > > > > > #open the IE browser > > > > > > > > > > $ie = IE.new > > > > > > > > > > > > > > > > > > > > #create a logger > > > > > > > > > > filePrefix = "logger" > > > > > > > > > > $logger = LoggerFactory.start_xml_logger(filePrefix) > > > > > > > > > > > > > > > > > > > > $ie.set_logger($logger) > > > > > > > > > > > > > > > > > > > > ##Excel file functions > > > > > > > > > > $lgn=Excel_file.new #making object of > > > > > > > > > > workbookfunction > > > > > > > > > > $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") > > > > > > > > > > > > > > > > > > > > ##java popup hadling > > > > > > > > > > #$pop=Jave_PopUps.new ##making object of javapopup > > > > > > > > > > #$oPopup = Watir::autoit > > > > > > > > > > end > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > def test_PSCLogin > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > #call start method... > > > > > > > > > > start #fires up the IE browser and a logger object > > > > > > > > > > > > > > > > > > > > #variables-URL > > > > > > > > > > test_site = 'https://www.philipnow.com/envcss/' > > > > > > > > > > $logger.log("## PSCUser_Login_Logoff_4") > > > > > > > > > > $logger.log("") > > > > > > > > > > $logger.log("Description- Do not enter anything in > > > > > > > > > > the E-mail Address and Password field and click Login button.") #logs only > > > > > > > > > > to corelogger file > > > > > > > > > > $logger.log("Expected Output-The user should not be > > > > > > > > > > able to login.") > > > > > > > > > > $logger.log("") > > > > > > > > > > $logger.log("Step 1: Go to the Philipnow.com :- 'https://www.philipnow.com/envcss/' > > > > > > > > > > ") > > > > > > > > > > $ie.goto(test_site) > > > > > > > > > > $logger.log(" Action-1: entered " + test_site + " in > > > > > > > > > > the address bar.") > > > > > > > > > > $logger.log(":Step 2: Do not enter any thing in user > > > > > > > > > > id") > > > > > > > > > > val_userid=$lgn.TakeData("a",1,$wrk_sht) > > > > > > > > > > $ie.text_field(:name, > > > > > > > > > > "username").set(val_userid.to_s) > > > > > > > > > > $logger.log(" Action-2: entered Nothing in in e-mail > > > > > > > > > > address") > > > > > > > > > > > > > > > > > > > > $logger.log(":Step-3: Do not enter any thing in > > > > > > > > > > password field") > > > > > > > > > > val_password=$lgn.TakeData("b",1,$wrk_sht) > > > > > > > > > > > > > > > > > > > > $ie.text_field(:name,"password").set(val_password.to_s) > > > > > > > > > > $logger.log(":Action-3: entered Nothing in password > > > > > > > > > > field") > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > =begin oPopup = Watir::autoit > > > > > > > > > > # Change into the WinTitleMatchMode that > > > > > > > > > > supports classnames and handles > > > > > > > > > > oPopup.AutoItSetOption("WinTitleMatchMode", > > > > > > > > > > 4) > > > > > > > > > > 0.upto (timeout) { |i|} > > > > > > > > > > ret = oPopup.WinWait("Microsoft Internet > > > > > > > > > > Explorer","",1) > > > > > > > > > > win_text = oPopup.WinGetText("Microsoft > > > > > > > > > > Internet Explorer") > > > > > > > > > > if 1 == ret && !(win_text == '') then > > > > > > > > > > bPopupFound = true > > > > > > > > > > oPopup.WinActivate("Microsoft > > > > > > > > > > Internet Explorer",'') > > > > > > > > > > win_text = oPopup.ControlGetText(what, > > > > > > > > > > '', 'Static2').strip > > > > > > > > > > if '' == win_text then win_text = > > > > > > > > > > oPopup.ControlGetText(what, '', 'Static1').strip end > > > > > > > > > > break > > > > > > > > > > =end > > > > > > > > > > > > > > > > > > > > startClicker("OK",3) > > > > > > > > > > > > > > > > > > > > #require 'js_dialog' > > > > > > > > > > #assert_js_dialog do > > > > > > > > > > > > > > > > > > > > $ie.button(:name, "login").click > > > > > > > > > > text(2) > > > > > > > > > > > > > > > > > > > > #end > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > $logger.log(":Step-4: Click the Login button") > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > $logger.log("Action-4: clicked the Login button.") > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > begin > > > > > > > > > > assert($ie.contains_text("Welcome to Client > > > > > > > > > > Self-service Portal, Alex Reyes!") ) > > > > > > > > > > $logger.log("*FAILED*." + e.message + "\n" + > > > > > > > > > > e.backtrace.join("\n")) > > > > > > > > > > $logger.log("Test Failed:Expected result has not > > > > > > > > > > been achieved:- User is able to login ") > > > > > > > > > > $logger.log_results( > > > > > > > > > > "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail > > > > > > > > > > Address and Password field and click Login button.","Expected Output-The > > > > > > > > > > user should not be able to login.","TEST FAILED:") #logs to both the XML > > > > > > > > > > file and corelogger > > > > > > > > > > rescue => e > > > > > > > > > > $logger.log("Test Passed:Expected result has > > > > > > > > > > been achieved:- User is not able to login ") > > > > > > > > > > $logger.log_results( > > > > > > > > > > "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail > > > > > > > > > > Address and Password field and click Login button.","Expected Output-The > > > > > > > > > > user should not be able to login.","TEST PASSED:") #logs to both the XML > > > > > > > > > > file and corelogger > > > > > > > > > > end > > > > > > > > > > > > > > > > > > > > $ie.close > > > > > > > > > > $logger.log("Close excel file") > > > > > > > > > > $lgn.excel_close > > > > > > > > > > $logger.log("Closed excel file") > > > > > > > > > > $logger.log "## End of test: PSC login\n" > > > > > > > > > > end > > > > > > > > > > end > > > > > > > > > > Regards > > > > > > > > > > shalini gupta > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > 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 > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > 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 > > > > > > > > > > > > > > _______________________________________________ > 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/20070426/52964070/attachment-0001.html From shalinigupta2006 at gmail.com Thu Apr 26 05:11:47 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 26 Apr 2007 14:41:47 +0530 Subject: [Wtr-general] how to capture text from popup window Message-ID: <7523f5800704260211m44271521r3d983134fdd928fd@mail.gmail.com> hi, i have used ur code as.. Yes note pad opens.. but nothing is gone in to this now im getting these errors:- 1) Error: test_PSCLogin(TC_PSC_userlogin): EOFError: end of file reached pop_chk.rb:45:in `readline' pop_chk.rb:45:in `read_js_popup_contents' pop_chk.rb:100:in `test_PSCLogin' class TC_PSC_userlogin < Test::Unit::TestCase def start_jsalert_clicker Thread.new{ system("ruby \"c:\\PSC\\jscriptExtraAlert.rb\"") } end # read file contents def read_js_popup_contents file = File.open("c:\\test.txt") lines = file.readline while lines == "" lines = file.readline end lines = file.readlines file.close return lines end - Show quoted text - def start #open the IE browser $ie = IE.new #create a logger filePrefix = "logger" $logger = LoggerFactory.start_xml_logger(filePrefix) $ie.set_logger($logger) ##Excel file functions $lgn=Excel_file.new #making object of workbookfunction $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") ##java popup hadling #$pop=Jave_PopUps.new ##making object of javapopup #$oPopup = Watir::autoit end def test_PSCLogin #call start method... start #fires up the IE browser and a logger object #variables-URL test_site = 'https://www.philipnow.com/envcss/ ' $logger.log("## PSCUser_Login_Logoff_4") $logger.log("") $logger.log("Description- Do not enter anything in the E-mail Address and Password field and click Login button.") #logs only to corelogger file $logger.log("Expected Output-The user should not be able to login.") $logger.log("") $logger.log("Step 1: Go to the Philipnow.com :- 'https://www.philipnow.com/envcss/' ") $ie.goto(test_site) $logger.log(" Action-1: entered " + test_site + " in the address bar.") $logger.log(":Step 2: Do not enter any thing in user id") val_userid=$lgn.TakeData("a",1,$wrk_sht) $ie.text_field(:name, "username").set(val_userid.to_s) $logger.log(" Action-2: entered Nothing in in e-mail address") $logger.log(":Step-3: Do not enter any thing in password field") val_password=$lgn.TakeData("b",1,$wrk_sht) $ie.text_field(:name,"password").set(val_password.to_s) $logger.log(":Action-3: entered Nothing in password field") start_jsalert_clicker $ie.button(:name, "login").click read_js_popup_contents begin assert($ie.contains_text("Welcome to Client Self-service Portal, Alex Reyes!") ) $logger.log("*FAILED*." + e.message + "\n" + e.backtrace.join("\n")) $logger.log("Test Failed:Expected result has not been achieved:- User is able to login ") $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail Address and Password field and click Login button.","Expected Output-The user should not be able to login.","TEST FAILED:") #logs to both the XML file and corelogger rescue => e $logger.log("Test Passed:Expected result has been achieved:- User is not able to login ") $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail Address and Password field and click Login button.","Expected Output-The user should not be able to login.","TEST PASSED:") #logs to both the XML file and corelogger end $ie.close $logger.log("Close excel file") $lgn.excel_close $logger.log("Closed excel file") $logger.log "## End of test: PSC login\n" end end Regards Shalini Gupta -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070426/320c4146/attachment.html From shalinigupta2006 at gmail.com Thu Apr 26 05:27:26 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 26 Apr 2007 14:57:26 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704260203v6252c9a2s5bcedf9c2627ea87@mail.gmail.com> References: <7523f5800704252254k4994d690tfa6c5d6a7f4c0095@mail.gmail.com> <7523f5800704260027y3c61053dq429cdfa5409f57c4@mail.gmail.com> <7523f5800704260035jd45ec82uf3195170eb185326@mail.gmail.com> <7523f5800704260045m37ec0d7ard587adb710f7afd1@mail.gmail.com> <7523f5800704260118x13751fb6x5e20d0dfe20fc74a@mail.gmail.com> <7523f5800704260119t313c1cb9r23d967052eddd9f7@mail.gmail.com> <7523f5800704260203v6252c9a2s5bcedf9c2627ea87@mail.gmail.com> Message-ID: <7523f5800704260227u3ca85293peb56852b51e63c0@mail.gmail.com> hi, have i used correctly or not .. Regards Shalini gupta -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070426/c1da2816/attachment.html From angrez at gmail.com Thu Apr 26 06:48:47 2007 From: angrez at gmail.com (Angrez Singh) Date: Thu, 26 Apr 2007 16:18:47 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704260211m44271521r3d983134fdd928fd@mail.gmail.com> References: <7523f5800704260211m44271521r3d983134fdd928fd@mail.gmail.com> Message-ID: Hi, Did you modified WindowHelper.rb file? You need to update push_alert_button method to log the text of pop up to file c:\test.txt. Regards, Angrez On 4/26/07, SHALINI GUPTA wrote: > > hi, > i have used ur code as.. > Yes note pad opens.. > but nothing is gone in to this > > now im getting these errors:- > 1) Error: > test_PSCLogin(TC_PSC_userlogin): > EOFError: end of file reached > pop_chk.rb:45:in `readline' > pop_chk.rb:45:in `read_js_popup_contents' > pop_chk.rb:100:in `test_PSCLogin' > > > > class TC_PSC_userlogin < Test::Unit::TestCase > def start_jsalert_clicker > Thread.new{ system("ruby \"c:\\PSC\\jscriptExtraAlert.rb\"") } > end > # read file contents > def read_js_popup_contents > file = File.open("c:\\test.txt") > lines = file.readline > while lines == "" > lines = file.readline > end > lines = file.readlines > file.close > return lines > end > > - Show quoted text - > def start > #open the IE browser > $ie = IE.new > > #create a logger > filePrefix = "logger" > $logger = LoggerFactory.start_xml_logger(filePrefix) > $ie.set_logger($logger) > > ##Excel file functions > $lgn=Excel_file.new #making object of workbookfunction > $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") > > ##java popup hadling > #$pop=Jave_PopUps.new ##making object of javapopup > #$oPopup = Watir::autoit > end > > def test_PSCLogin > > > #call start method... > start #fires up the IE browser and a logger object > > #variables-URL > test_site = ' https://www.philipnow.com/envcss/ ' > $logger.log("## PSCUser_Login_Logoff_4") > $logger.log("") > $logger.log("Description- Do not enter anything in the E-mail Address > and Password field and click Login button.") #logs only to corelogger file > $logger.log("Expected Output-The user should not be able to login.") > $logger.log("") > $logger.log("Step 1: Go to the Philipnow.com :- > ' https://www.philipnow.com/envcss/' > ") > $ie.goto(test_site) > $logger.log(" Action-1: entered " + test_site + " in the address bar.") > $logger.log(":Step 2: Do not enter any thing in user id") > val_userid=$lgn.TakeData("a",1,$wrk_sht) > $ie.text_field(:name, "username").set(val_userid.to_s) > $logger.log(" Action-2: entered Nothing in in e-mail address") > > $logger.log(":Step-3: Do not enter any thing in password field") > val_password=$lgn.TakeData("b",1,$wrk_sht) > $ie.text_field(:name,"password").set(val_password.to_s) > $logger.log(":Action-3: entered Nothing in password field") > > start_jsalert_clicker > $ie.button(:name, "login").click > read_js_popup_contents > > begin > assert($ie.contains_text("Welcome to Client Self-service Portal, > Alex Reyes!") ) > $logger.log("*FAILED*." + e.message + "\n" + e.backtrace.join > ("\n")) > $logger.log("Test Failed:Expected result has not been achieved:- > User is able to login ") > $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do not > enter anything in the E-mail Address and Password field and click Login > button.","Expected Output-The user should not be able to login.","TEST > FAILED:") #logs to both the XML file and corelogger > rescue => e > $logger.log("Test Passed:Expected result has been achieved:- User > is not able to login ") > $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do not > enter anything in the E-mail Address and Password field and click Login > button.","Expected Output-The user should not be able to login.","TEST > PASSED:") #logs to both the XML file and corelogger > end > > $ie.close > $logger.log("Close excel file") > $lgn.excel_close > $logger.log("Closed excel file") > $logger.log "## End of test: PSC login\n" > end > end > > Regards > Shalini Gupta > > _______________________________________________ > 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/20070426/d26871c7/attachment.html From shalinigupta2006 at gmail.com Thu Apr 26 06:55:29 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 26 Apr 2007 16:25:29 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: References: <7523f5800704260211m44271521r3d983134fdd928fd@mail.gmail.com> Message-ID: <7523f5800704260355y3b8875d4j95e8687687208908@mail.gmail.com> HI, YES I HAVE MODIFIED THAT REGARDS SHALINI On 4/26/07, Angrez Singh wrote: > > Hi, > > Did you modified WindowHelper.rb file? You need to update > push_alert_button method to log the text of pop up to file c:\test.txt. > > Regards, > Angrez > > On 4/26/07, SHALINI GUPTA wrote: > > > hi, > > i have used ur code as.. > > Yes note pad opens.. > > but nothing is gone in to this > > > > now im getting these errors:- > > 1) Error: > > test_PSCLogin(TC_PSC_userlogin): > > EOFError: end of file reached > > pop_chk.rb:45:in `readline' > > pop_chk.rb:45:in `read_js_popup_contents' > > pop_chk.rb:100:in `test_PSCLogin' > > > > > > > > class TC_PSC_userlogin < Test::Unit::TestCase > > def start_jsalert_clicker > > Thread.new{ system("ruby \"c:\\PSC\\jscriptExtraAlert.rb\"") } > > end > > # read file contents > > def read_js_popup_contents > > file = File.open("c:\\test.txt") > > lines = file.readline > > while lines == "" > > lines = file.readline > > end > > lines = file.readlines > > file.close > > return lines > > end > > > > - Show quoted text - > > def start > > #open the IE browser > > $ie = IE.new > > > > #create a logger > > filePrefix = "logger" > > $logger = LoggerFactory.start_xml_logger(filePrefix) > > $ie.set_logger($logger) > > > > ##Excel file functions > > $lgn=Excel_file.new #making object of workbookfunction > > $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") > > > > ##java popup hadling > > #$pop=Jave_PopUps.new ##making object of javapopup > > #$oPopup = Watir::autoit > > end > > > > def test_PSCLogin > > > > > > #call start method... > > start #fires up the IE browser and a logger object > > > > #variables-URL > > test_site = ' https://www.philipnow.com/envcss/ ' > > $logger.log("## PSCUser_Login_Logoff_4") > > $logger.log("") > > $logger.log("Description- Do not enter anything in the E-mail Address > > and Password field and click Login button.") #logs only to corelogger file > > $logger.log("Expected Output-The user should not be able to login.") > > $logger.log("") > > $logger.log("Step 1: Go to the Philipnow.com :- 'https://www.philipnow.com/envcss/' > > ") > > $ie.goto(test_site) > > $logger.log(" Action-1: entered " + test_site + " in the address > > bar.") > > $logger.log(":Step 2: Do not enter any thing in user id") > > val_userid=$lgn.TakeData("a",1,$wrk_sht) > > $ie.text_field(:name, "username").set(val_userid.to_s) > > $logger.log(" Action-2: entered Nothing in in e-mail address") > > > > $logger.log(":Step-3: Do not enter any thing in password field") > > val_password=$lgn.TakeData("b",1,$wrk_sht) > > $ie.text_field(:name,"password").set(val_password.to_s) > > $logger.log(":Action-3: entered Nothing in password field") > > > > start_jsalert_clicker > > $ie.button(:name, "login").click > > read_js_popup_contents > > > > begin > > assert($ie.contains_text("Welcome to Client Self-service Portal, > > Alex Reyes!") ) > > $logger.log("*FAILED*." + e.message + "\n" + e.backtrace.join > > ("\n")) > > $logger.log("Test Failed:Expected result has not been achieved:- > > User is able to login ") > > $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do > > not enter anything in the E-mail Address and Password field and click Login > > button.","Expected Output-The user should not be able to login.","TEST > > FAILED:") #logs to both the XML file and corelogger > > rescue => e > > $logger.log("Test Passed:Expected result has been achieved:- > > User is not able to login ") > > $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do > > not enter anything in the E-mail Address and Password field and click Login > > button.","Expected Output-The user should not be able to login.","TEST > > PASSED:") #logs to both the XML file and corelogger > > end > > > > $ie.close > > $logger.log("Close excel file") > > $lgn.excel_close > > $logger.log("Closed excel file") > > $logger.log "## End of test: PSC login\n" > > end > > end > > > > Regards > > Shalini Gupta > > > > _______________________________________________ > > 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/20070426/76733f8c/attachment-0001.html From angrez at gmail.com Thu Apr 26 07:11:26 2007 From: angrez at gmail.com (Angrez Singh) Date: Thu, 26 Apr 2007 16:41:26 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704260355y3b8875d4j95e8687687208908@mail.gmail.com> References: <7523f5800704260211m44271521r3d983134fdd928fd@mail.gmail.com> <7523f5800704260355y3b8875d4j95e8687687208908@mail.gmail.com> Message-ID: Hi, Few more questions: 1. Did pop up gets clicked or not? 2. If notepad or wordpad opens what are its contents? 3. Can you post the code for modified WindowHelper.rb file? Regards, Angrez On 4/26/07, SHALINI GUPTA wrote: > > HI, > > YES I HAVE MODIFIED THAT > > REGARDS > SHALINI > On 4/26/07, Angrez Singh wrote: > > > > Hi, > > > > Did you modified WindowHelper.rb file? You need to update > > push_alert_button method to log the text of pop up to file c:\test.txt. > > > > Regards, > > Angrez > > > > On 4/26/07, SHALINI GUPTA wrote: > > > > > hi, > > > i have used ur code as.. > > > Yes note pad opens.. > > > but nothing is gone in to this > > > > > > now im getting these errors:- > > > 1) Error: > > > test_PSCLogin(TC_PSC_userlogin): > > > EOFError: end of file reached > > > pop_chk.rb:45:in `readline' > > > pop_chk.rb:45:in `read_js_popup_contents' > > > pop_chk.rb:100:in `test_PSCLogin' > > > > > > > > > > > > class TC_PSC_userlogin < Test::Unit::TestCase > > > def start_jsalert_clicker > > > Thread.new{ system("ruby \"c:\\PSC\\jscriptExtraAlert.rb\"") } > > > > > > end > > > # read file contents > > > def read_js_popup_contents > > > file = File.open("c:\\test.txt") > > > lines = file.readline > > > while lines == "" > > > lines = file.readline > > > end > > > lines = file.readlines > > > file.close > > > return lines > > > end > > > > > > - Show quoted text - > > > def start > > > #open the IE browser > > > $ie = IE.new > > > > > > #create a logger > > > filePrefix = "logger" > > > $logger = LoggerFactory.start_xml_logger(filePrefix) > > > $ie.set_logger($logger) > > > > > > ##Excel file functions > > > $lgn=Excel_file.new #making object of workbookfunction > > > $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") > > > > > > ##java popup hadling > > > #$pop=Jave_PopUps.new ##making object of javapopup > > > #$oPopup = Watir::autoit > > > end > > > > > > def test_PSCLogin > > > > > > > > > #call start method... > > > start #fires up the IE browser and a logger object > > > > > > #variables-URL > > > test_site = ' https://www.philipnow.com/envcss/ ' > > > $logger.log("## PSCUser_Login_Logoff_4") > > > $logger.log("") > > > $logger.log("Description- Do not enter anything in the E-mail > > > Address and Password field and click Login button.") #logs only to > > > corelogger file > > > $logger.log("Expected Output-The user should not be able to > > > login.") > > > $logger.log("") > > > $logger.log("Step 1: Go to the Philipnow.com:- 'https://www.philipnow.com/envcss/' > > > ") > > > $ie.goto(test_site) > > > $logger.log(" Action-1: entered " + test_site + " in the address > > > bar.") > > > $logger.log(":Step 2: Do not enter any thing in user id") > > > val_userid=$lgn.TakeData("a",1,$wrk_sht) > > > $ie.text_field(:name, "username").set(val_userid.to_s) > > > $logger.log(" Action-2: entered Nothing in in e-mail address") > > > > > > $logger.log(":Step-3: Do not enter any thing in password field") > > > val_password=$lgn.TakeData("b",1,$wrk_sht) > > > $ie.text_field(:name,"password").set(val_password.to_s) > > > $logger.log(":Action-3: entered Nothing in password field") > > > > > > start_jsalert_clicker > > > $ie.button(:name, "login").click > > > read_js_popup_contents > > > > > > begin > > > assert($ie.contains_text("Welcome to Client Self-service > > > Portal, Alex Reyes!") ) > > > $logger.log("*FAILED*." + e.message + "\n" + e.backtrace.join > > > ("\n")) > > > $logger.log("Test Failed:Expected result has not been > > > achieved:- User is able to login ") > > > $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do > > > not enter anything in the E-mail Address and Password field and click Login > > > button.","Expected Output-The user should not be able to login.","TEST > > > FAILED:") #logs to both the XML file and corelogger > > > rescue => e > > > $logger.log("Test Passed:Expected result has been achieved:- > > > User is not able to login ") > > > $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do > > > not enter anything in the E-mail Address and Password field and click Login > > > button.","Expected Output-The user should not be able to login.","TEST > > > PASSED:") #logs to both the XML file and corelogger > > > end > > > > > > $ie.close > > > $logger.log("Close excel file") > > > $lgn.excel_close > > > $logger.log("Closed excel file") > > > $logger.log "## End of test: PSC login\n" > > > end > > > end > > > > > > Regards > > > Shalini Gupta > > > > > > _______________________________________________ > > > 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/20070426/66ecadc2/attachment.html From shalinigupta2006 at gmail.com Thu Apr 26 07:14:41 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 26 Apr 2007 16:44:41 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: References: <7523f5800704260211m44271521r3d983134fdd928fd@mail.gmail.com> <7523f5800704260355y3b8875d4j95e8687687208908@mail.gmail.com> Message-ID: <7523f5800704260414r334c812dlf2585cbd1df2b0b3@mail.gmail.com> HI, POPUP DOENT CLICK NOTHING IN NOTEPAD. WINDOWHELPER.RB:-- class WindowHelper def initialize( ) @autoit = WIN32OLE.new('AutoItX3.Control') end def push_alert_button @autoit.WinWait "Windows Internet Explorer", "" text = @autoit.WinGetText "Windows Internet Explorer" file = File.open("c:\\popup.txt", "w") file.puts text file.close @autoit.Send "{ENTER}" end def push_confirm_button_ok @autoit.WinWait "Microsoft Internet Explorer", "" @autoit.Send "{ENTER}" end def push_confirm_button_cancel @autoit.WinWait "Microsoft Internet Explorer", "" @autoit.Send "{ESCAPE}" end def push_security_alert_yes @autoit.WinWait "Security Alert", "" @autoit.Send "{TAB}" @autoit.Send "{TAB}" @autoit.Send "{SPACE}" end def logon(title,name = 'john doe',password = 'john doe') @autoit.WinWait title, "" @autoit.Send name @autoit.Send "{TAB}" @autoit.Send password @autoit.Send "{ENTER}" end def WindowHelper.check_autoit_installed begin WIN32OLE.new('AutoItX3.Control') rescue raise Watir::Exception::WatirException, "The AutoIt dll must be correctly registered for this feature to work properly" end end end REGARDS SHALINI GUPTA On 4/26/07, Angrez Singh wrote: > > Hi, > > Few more questions: > 1. Did pop up gets clicked or not? > 2. If notepad or wordpad opens what are its contents? > 3. Can you post the code for modified WindowHelper.rb file? > > Regards, > Angrez > > On 4/26/07, SHALINI GUPTA wrote: > > > > HI, > > > > YES I HAVE MODIFIED THAT > > > > REGARDS > > SHALINI > > On 4/26/07, Angrez Singh wrote: > > > > > > Hi, > > > > > > Did you modified WindowHelper.rb file? You need to update > > > push_alert_button method to log the text of pop up to file c:\test.txt. > > > > > > Regards, > > > Angrez > > > > > > On 4/26/07, SHALINI GUPTA wrote: > > > > > > > hi, > > > > i have used ur code as.. > > > > Yes note pad opens.. > > > > but nothing is gone in to this > > > > > > > > now im getting these errors:- > > > > 1) Error: > > > > test_PSCLogin(TC_PSC_userlogin): > > > > EOFError: end of file reached > > > > pop_chk.rb:45:in `readline' > > > > pop_chk.rb:45:in `read_js_popup_contents' > > > > pop_chk.rb:100:in `test_PSCLogin' > > > > > > > > > > > > > > > > class TC_PSC_userlogin < Test::Unit::TestCase > > > > def start_jsalert_clicker > > > > Thread.new{ system("ruby \"c:\\PSC\\jscriptExtraAlert.rb\"") > > > > } > > > > end > > > > # read file contents > > > > def read_js_popup_contents > > > > file = File.open("c:\\test.txt") > > > > lines = file.readline > > > > while lines == "" > > > > lines = file.readline > > > > end > > > > lines = file.readlines > > > > file.close > > > > return lines > > > > end > > > > > > > > - Show quoted text - > > > > def start > > > > #open the IE browser > > > > $ie = IE.new > > > > > > > > #create a logger > > > > filePrefix = "logger" > > > > $logger = LoggerFactory.start_xml_logger(filePrefix) > > > > $ie.set_logger($logger) > > > > > > > > ##Excel file functions > > > > $lgn=Excel_file.new #making object of workbookfunction > > > > $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") > > > > > > > > ##java popup hadling > > > > #$pop=Jave_PopUps.new ##making object of javapopup > > > > #$oPopup = Watir::autoit > > > > end > > > > > > > > def test_PSCLogin > > > > > > > > > > > > #call start method... > > > > start #fires up the IE browser and a logger object > > > > > > > > #variables-URL > > > > test_site = ' https://www.philipnow.com/envcss/ ' > > > > $logger.log("## PSCUser_Login_Logoff_4") > > > > $logger.log("") > > > > $logger.log("Description- Do not enter anything in the E-mail > > > > Address and Password field and click Login button.") #logs only to > > > > corelogger file > > > > $logger.log("Expected Output-The user should not be able to > > > > login.") > > > > $logger.log("") > > > > $logger.log("Step 1: Go to the Philipnow.com:- 'https://www.philipnow.com/envcss/' > > > > ") > > > > $ie.goto(test_site) > > > > $logger.log(" Action-1: entered " + test_site + " in the address > > > > bar.") > > > > $logger.log(":Step 2: Do not enter any thing in user id") > > > > val_userid=$lgn.TakeData("a",1,$wrk_sht) > > > > $ie.text_field(:name, "username").set(val_userid.to_s) > > > > $logger.log(" Action-2: entered Nothing in in e-mail address") > > > > > > > > $logger.log(":Step-3: Do not enter any thing in password field") > > > > val_password=$lgn.TakeData("b",1,$wrk_sht) > > > > $ie.text_field(:name,"password").set(val_password.to_s) > > > > $logger.log(":Action-3: entered Nothing in password field") > > > > > > > > start_jsalert_clicker > > > > $ie.button(:name, "login").click > > > > read_js_popup_contents > > > > > > > > begin > > > > assert($ie.contains_text("Welcome to Client Self-service > > > > Portal, Alex Reyes!") ) > > > > $logger.log("*FAILED*." + e.message + "\n" + > > > > e.backtrace.join("\n")) > > > > $logger.log("Test Failed:Expected result has not been > > > > achieved:- User is able to login ") > > > > $logger.log_results( > > > > "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail > > > > Address and Password field and click Login button.","Expected Output-The > > > > user should not be able to login.","TEST FAILED:") #logs to both the XML > > > > file and corelogger > > > > rescue => e > > > > $logger.log("Test Passed:Expected result has been > > > > achieved:- User is not able to login ") > > > > $logger.log_results( > > > > "PSCUser_Login_Logoff_4","Description-Do not enter anything in the E-mail > > > > Address and Password field and click Login button.","Expected Output-The > > > > user should not be able to login.","TEST PASSED:") #logs to both the XML > > > > file and corelogger > > > > end > > > > > > > > $ie.close > > > > $logger.log("Close excel file") > > > > $lgn.excel_close > > > > $logger.log("Closed excel file") > > > > $logger.log "## End of test: PSC login\n" > > > > end > > > > end > > > > > > > > Regards > > > > Shalini Gupta > > > > > > > > _______________________________________________ > > > > 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 > > > > > _______________________________________________ > 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/20070426/6ea069df/attachment-0001.html From angrez at gmail.com Thu Apr 26 07:20:17 2007 From: angrez at gmail.com (Angrez Singh) Date: Thu, 26 Apr 2007 16:50:17 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704260414r334c812dlf2585cbd1df2b0b3@mail.gmail.com> References: <7523f5800704260211m44271521r3d983134fdd928fd@mail.gmail.com> <7523f5800704260355y3b8875d4j95e8687687208908@mail.gmail.com> <7523f5800704260414r334c812dlf2585cbd1df2b0b3@mail.gmail.com> Message-ID: Hi, Few mistakes: 1. You are adding text to file called popup.txt and reading from test.txt def push_alert_button > @autoit.WinWait "Windows Internet Explorer", "" > text = @autoit.WinGetText "Windows Internet Explorer" > file = File.open("c:\\popup.txt", "w") > file.puts text > file.close > @autoit.Send "{ENTER}" > end > > > # read file contents > > > > > def read_js_popup_contents > > > > > file = File.open("c:\\test.txt") > > > > > lines = file.readline > > > > > while lines == "" > > > > > lines = file.readline > > > > > end > > > > > lines = file.readlines > > > > > file.close > > > > > return lines > > > > > end > > > > > > > > > 2. In push_alert_button why the title that you are searching for is "Windows Internet Explorer"? It should be "Microsoft Internet Explorer" if you are using IE 6.0? That could be the reason that pop is not getting clicked. If you are using IE 7.0 then the code is fine. Otherwise change it. Let me know if changing made above made the code to work. - Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070426/1cb4ee61/attachment.html From shalinigupta2006 at gmail.com Thu Apr 26 07:21:46 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 26 Apr 2007 16:51:46 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: References: <7523f5800704260211m44271521r3d983134fdd928fd@mail.gmail.com> <7523f5800704260355y3b8875d4j95e8687687208908@mail.gmail.com> <7523f5800704260414r334c812dlf2585cbd1df2b0b3@mail.gmail.com> Message-ID: <7523f5800704260421r72283acaka9e3aa4b4d0dd99@mail.gmail.com> HI, YES UR RIGHT THANKS!! REGARDS SHALINI GUPTA On 4/26/07, Angrez Singh wrote: > > Hi, > > Few mistakes: > 1. You are adding text to file called popup.txt and reading from test.txt > > def push_alert_button > > @autoit.WinWait "Windows Internet Explorer", "" > > text = @autoit.WinGetText "Windows Internet Explorer" > > file = File.open("c:\\popup.txt", "w") > > file.puts text > > file.close > > @autoit.Send "{ENTER}" > > end > > > > > # read file contents > > > > > > def read_js_popup_contents > > > > > > file = File.open("c:\\test.txt") > > > > > > lines = file.readline > > > > > > while lines == "" > > > > > > lines = file.readline > > > > > > end > > > > > > lines = file.readlines > > > > > > file.close > > > > > > return lines > > > > > > end > > > > > > > > > > > > 2. In push_alert_button why the title that you are searching for is > "Windows Internet Explorer"? It should be "Microsoft Internet Explorer" if > you are using IE 6.0? That could be the reason that pop is not getting > clicked. If you are using IE 7.0 then the code is fine. Otherwise change > it. > > Let me know if changing made above made the code to work. > > - Angrez > > _______________________________________________ > 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/20070426/f9dd66ae/attachment.html From shalinigupta2006 at gmail.com Thu Apr 26 07:33:41 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 26 Apr 2007 17:03:41 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704260421r72283acaka9e3aa4b4d0dd99@mail.gmail.com> References: <7523f5800704260211m44271521r3d983134fdd928fd@mail.gmail.com> <7523f5800704260355y3b8875d4j95e8687687208908@mail.gmail.com> <7523f5800704260414r334c812dlf2585cbd1df2b0b3@mail.gmail.com> <7523f5800704260421r72283acaka9e3aa4b4d0dd99@mail.gmail.com> Message-ID: <7523f5800704260433o184363c4jce0c8dee42bf9b0f@mail.gmail.com> hi, i have made all the changes told by u.. as:- in my ruby file :- def start_jsalert_clicker Thread.new{ system("ruby \"c:\\PSC\\jscriptExtraAlert.rb\"") } end # read file contents def read_js_popup_contents file = File.open("c:\\test.txt") lines = file.readline while lines == "" lines = file.readline end lines = file.readlines file.close return lines end in windowhelper.rb def push_alert_button @autoit.WinWait "Microsoft Internet Explorer", "" text = @autoit.WinGetText "Microsoft Internet Explorer" file = File.open("c:\\test.txt", "w") file.puts text file.close @autoit.Send "{ENTER}" end but still the error is coming 1) Error: test_PSCLogin(TC_PSC_userlogin): EOFError: end of file reached pop_chk.rb:45:in `readline' pop_chk.rb:45:in `read_js_popup_contents' pop_chk.rb:97:in `test_PSCLogin' 1 tests, 0 assertions, 0 failures, 1 errors regards shalini gupta On 4/26/07, SHALINI GUPTA wrote: > > HI, > YES UR RIGHT THANKS!! > > REGARDS > SHALINI GUPTA > > On 4/26/07, Angrez Singh wrote: > > > > Hi, > > > > Few mistakes: > > 1. You are adding text to file called popup.txt and reading from > > test.txt > > > > def push_alert_button > > > @autoit.WinWait "Windows Internet Explorer", "" > > > text = @autoit.WinGetText "Windows Internet Explorer" > > > file = File.open("c:\\popup.txt", "w") > > > file.puts text > > > file.close > > > @autoit.Send "{ENTER}" > > > end > > > > > > > # read file contents > > > > > > > def read_js_popup_contents > > > > > > > file = File.open("c:\\test.txt") > > > > > > > lines = file.readline > > > > > > > while lines == "" > > > > > > > lines = file.readline > > > > > > > end > > > > > > > lines = file.readlines > > > > > > > file.close > > > > > > > return lines > > > > > > > end > > > > > > > > > > > > > > > 2. In push_alert_button why the title that you are searching for is > > "Windows Internet Explorer"? It should be "Microsoft Internet Explorer" if > > you are using IE 6.0? That could be the reason that pop is not getting > > clicked. If you are using IE 7.0 then the code is fine. Otherwise change > > it. > > > > Let me know if changing made above made the code to work. > > > > - Angrez > > > > _______________________________________________ > > 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/20070426/c1c3388c/attachment.html From shalinigupta2006 at gmail.com Thu Apr 26 07:40:50 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 26 Apr 2007 17:10:50 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704260433o184363c4jce0c8dee42bf9b0f@mail.gmail.com> References: <7523f5800704260211m44271521r3d983134fdd928fd@mail.gmail.com> <7523f5800704260355y3b8875d4j95e8687687208908@mail.gmail.com> <7523f5800704260414r334c812dlf2585cbd1df2b0b3@mail.gmail.com> <7523f5800704260421r72283acaka9e3aa4b4d0dd99@mail.gmail.com> <7523f5800704260433o184363c4jce0c8dee42bf9b0f@mail.gmail.com> Message-ID: <7523f5800704260440n68e68954scdef9539d898ac60@mail.gmail.com> hi, thanks it works... regards shalini gupta On 4/26/07, SHALINI GUPTA wrote: > > hi, > i have made all the changes told by u.. > > as:- > in my ruby file :- > def start_jsalert_clicker > Thread.new{ system("ruby \"c:\\PSC\\jscriptExtraAlert.rb\"") } > end > # read file contents > def read_js_popup_contents > file = File.open("c:\\test.txt") > lines = file.readline > while lines == "" > lines = file.readline > end > lines = file.readlines > file.close > return lines > end > > in windowhelper.rb > def push_alert_button > @autoit.WinWait "Microsoft Internet Explorer", "" > text = @ autoit.WinGetText "Microsoft Internet Explorer" > file = File.open("c:\\test.txt", "w") > file.puts text > file.close > @autoit.Send "{ENTER}" > end > > but still the error is coming > 1) Error: > test_PSCLogin(TC_PSC_userlogin): > EOFError: end of file reached > pop_chk.rb:45:in `readline' > pop_chk.rb:45:in `read_js_popup_contents' > pop_chk.rb:97:in `test_PSCLogin' > > 1 tests, 0 assertions, 0 failures, 1 errors > > regards > shalini gupta > > On 4/26/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > HI, > > YES UR RIGHT THANKS!! > > > > REGARDS > > SHALINI GUPTA > > > > On 4/26/07, Angrez Singh < angrez at gmail.com> wrote: > > > > > > Hi, > > > > > > Few mistakes: > > > 1. You are adding text to file called popup.txt and reading from > > > test.txt > > > > > > def push_alert_button > > > > @autoit.WinWait "Windows Internet Explorer", "" > > > > text = @autoit.WinGetText "Windows Internet Explorer" > > > > file = File.open("c:\\popup.txt", "w") > > > > file.puts text > > > > file.close > > > > @autoit.Send "{ENTER}" > > > > end > > > > > > > > > # read file contents > > > > > > > > def read_js_popup_contents > > > > > > > > file = File.open("c:\\test.txt") > > > > > > > > lines = file.readline > > > > > > > > while lines == "" > > > > > > > > lines = file.readline > > > > > > > > end > > > > > > > > lines = file.readlines > > > > > > > > file.close > > > > > > > > return lines > > > > > > > > end > > > > > > > > > > > > > > > > > > 2. In push_alert_button why the title that you are searching for is > > > "Windows Internet Explorer"? It should be "Microsoft Internet Explorer" if > > > you are using IE 6.0? That could be the reason that pop is not getting > > > clicked. If you are using IE 7.0 then the code is fine. Otherwise > > > change it. > > > > > > Let me know if changing made above made the code to work. > > > > > > - Angrez > > > > > > _______________________________________________ > > > 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/20070426/f5d3d815/attachment-0001.html From rdewolfe at Credant.com Thu Apr 26 09:11:47 2007 From: rdewolfe at Credant.com (Russ DeWolfe) Date: Thu, 26 Apr 2007 08:11:47 -0500 Subject: [Wtr-general] method works in irb but not in script Message-ID: When I run this command on a drop down control, in IRB it works: irb(main):015:0> ie.select_list(:id, "WINDOWS.30423.local_value").getSelectedItems => ["true"] When I run it in the script I get this: ie.select_list(:id, "WINDOWS.30423.local_value").getSelectedItem ./utilities.rb:373:in `getLocalValue': undefined method `getSelectedItem' for # (NoMethodError) from test.rb:36 I have require 'watir' in both cases. Thanks, Russ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070426/422966d4/attachment.html From forum-watir-users at openqa.org Thu Apr 26 09:23:28 2007 From: forum-watir-users at openqa.org (Eoin) Date: Thu, 26 Apr 2007 08:23:28 CDT Subject: [Wtr-general] How to incorporate my Watir script into Nunit In-Reply-To: <25500279.7761177495349845.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <31024402.18651177593838215.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Bret, That link you provided was the way to go allright. Here is my two scripts for anyone trying to ruby scripts to work with Nunit *google.rb* require 'watir' include Watir require 'test/unit' class TestExampleTemplate < Test::Unit::TestCase def test_search ie = IE.new ie.goto("http://www.google.com") ie.text_field(:name, "q").set("pickaxe") ie.button(:value, "Google Search").click assert(ie.contains_text("Programming Ruby, 2nd Ed.")) end end -------- *google.cs* using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; using System.Diagnostics; using NUnit.Framework; namespace Rap.Web.Test //rename to your namespace { [TestFixture] public class TestGoogle { /// /// Verifies a valid Watir test will execute and allow success. /// [Test] [Category("Google")] public void Google() { WatirAssert.TestPassed("google.rb"); } } public class WatirAssert { public static void TestPassed(string rubyFileName) { string output = String.Empty; using (Process p = new Process()) { p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.FileName = "ruby.exe"; p.StartInfo.Arguments = rubyFileName; p.StartInfo.WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory; p.Start(); output = p.StandardOutput.ReadToEnd(); p.WaitForExit(); } Console.Write(output); Trace.Write(output); Regex reg = new Regex(@"(?\d+) tests, (?\d+) assertions, (?\d+) failures, (?\d+) errors", RegexOptions.Compiled); Match m = reg.Match(output); try { int tests = int.Parse(m.Groups["tests"].Value); int assertions = int.Parse(m.Groups["assertions"].Value); int failures = int.Parse(m.Groups["failures"].Value); int errors = int.Parse(m.Groups["errors"].Value); if (tests > 0 && failures > 0) { Assert.Fail(String.Format("WatirAssert: Failures {0}", failures)); } else if (errors > 0) { Assert.Fail(String.Format("WatirAssert: Errors {0}", errors)); } } catch(Exception e) { Assert.Fail("WatirAssert EXCEPTION: " + e.ToString()); } } } } From angrez at gmail.com Thu Apr 26 09:25:50 2007 From: angrez at gmail.com (Angrez Singh) Date: Thu, 26 Apr 2007 18:55:50 +0530 Subject: [Wtr-general] method works in irb but not in script In-Reply-To: References: Message-ID: Hi Russ, irb(main):015:0> ie.select_list(:id, "WINDOWS.30423.local_value > ").getSelectedItems > => ["true"] > > When I run it in the script I get this: > ie.select_list(:id, "WINDOWS.30423.local_value").getSelectedItem > I think you missed 's' at the end . It should be ie.select_list(:id, "WINDOWS.30423.local_value").getSelectedItems Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070426/cf9ed2c0/attachment.html From rdewolfe at Credant.com Thu Apr 26 09:26:23 2007 From: rdewolfe at Credant.com (Russ DeWolfe) Date: Thu, 26 Apr 2007 08:26:23 -0500 Subject: [Wtr-general] Get a class value Message-ID: I get this when I try that solution: NoMethodError: undefined method `attribute_value' for # -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070426/cf848e80/attachment.html From angrez at gmail.com Thu Apr 26 09:27:28 2007 From: angrez at gmail.com (Angrez Singh) Date: Thu, 26 Apr 2007 18:57:28 +0530 Subject: [Wtr-general] Get a class value In-Reply-To: References: Message-ID: Hi Russ, Which watir version are you using? Regards, Angrez On 4/26/07, Russ DeWolfe wrote: > > I get this when I try that solution: > > NoMethodError: undefined method `attribute_value' for > # f0> > > _______________________________________________ > 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/20070426/e232464c/attachment.html From shalinigupta2006 at gmail.com Thu Apr 26 01:49:44 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 26 Apr 2007 11:19:44 +0530 Subject: [Wtr-general] how to capture text from popup window In-Reply-To: <7523f5800704252228r71b688fdic6244c1dc57672e4@mail.gmail.com> References: <7523f5800704240506r1ea4d805hf441fd95d664a1bf@mail.gmail.com> <7523f5800704242203q565fe426ge34018cd6f834ecb@mail.gmail.com> <7523f5800704242245i4f690a2eh27a6a48c23f756a5@mail.gmail.com> <7523f5800704242305p107dbc59id5b136d1ba7a2d0c@mail.gmail.com> <27915010704250700j77e48d3cge6ab032c216eb0c0@mail.gmail.com> <7523f5800704252154n7caac4dfpc233c7b2eaab708a@mail.gmail.com> <7523f5800704252228r71b688fdic6244c1dc57672e4@mail.gmail.com> Message-ID: <7523f5800704252249xf9c233v7125c72856747ec5@mail.gmail.com> hi, This is my entire code... please help!!! CODE::--- ##//////////////////////////// ////////////////////////////////////////////////////////////////////// ## ## Watir script ## ##////////////////////////////////////////////////////////////////////////////////////////////////// ####requires require 'watir' #require 'autoit' require 'test/unit' require 'test/unit/ui/console/testrunner' require 'test/unit/assertions' #require 'watir/setFileDialog' #require 'popups_test' #require 'enabled_popup' #logger requires require 'example_logger1' require 'workbookfunction' #java_pophadler requires require 'WindowHelper' require 'win32ole' #require 'javapopup' #require 'winClickers' ####includes include Watir class TC_PSC_userlogin < Test::Unit::TestCase 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 of function StartClicker end def text(wait_seconds = 2) sleep 0.3 autoit = WIN32OLE.new("AutoItX3.Control ") autoit.WinWait("Microsoft Internet Explorer", nil, wait_seconds) if wait_seconds s = autoit.WinGetText("Microsoft Internet Explorer") file = File.open ("c:\\test.txt", "w") # DONT MAKE YOUR VARIABLES GLOBAL UNNECESSARILY file.puts(s.to_s) puts s file.close #s unless s == "1" # NOT SURE WHY YOU ARE DOING THIS end def start #open the IE browser $ie = IE.new #create a logger ##java popup hadling #$pop=Jave_PopUps.new ##making object of javapopup #$oPopup = Watir::autoit end def test_PSCLogin #call start method... start #fires up the IE browser and a logger object #variables-URL test_site = 'https://www.philipnow.com/envcss/' $logger.log("## PSCUser_Login_Logoff_4") $logger.log("") $logger.log("Description- Do not enter anything in the E-mail Address and Password field and click Login button.") #logs only to corelogger file $logger.log("Expected Output-The user should not be able to login.") $logger.log("") $logger.log("Step 1: Go to the Philipnow.com :- 'https://www.philipnow.com/envcss/' ") $ie.goto(test_site) $logger.log(" Action-1: entered " + test_site + " in the address bar.") $logger.log(":Step 2: Do not enter any thing in user id") val_userid=$lgn.TakeData("a",1,$wrk_sht) $ie.text_field(:name, "username").set(val_userid.to_s) $logger.log(" Action-2: entered Nothing in in e-mail address") $logger.log(":Step-3: Do not enter any thing in password field") val_password=$lgn.TakeData("b",1,$wrk_sht) $ie.text_field(:name,"password").set(val_password.to_s) $logger.log(":Action-3: entered Nothing in password field") ####popup handling##### startClicker("OK",3) text(2) #require 'js_dialog' #assert_js_dialog do $ie.button(:name, "login").click #end $logger.log(":Step-4: Click the Login button") $logger.log("Action-4: clicked the Login button.") Regards Shalini Gupta On 4/26/07, SHALINI GUPTA wrote: > > hi, > > This is my entire code... > > please help!!! > > CODE::--- > > ##////////////////////////////////////////////////////////////////////////////////////////////////// > ## > ## Watir script > ## > ##////////////////////////////////////////////////////////////////////////////////////////////////// > > > > > ####requires > > require 'watir' > #require 'autoit' > > require 'test/unit' > require 'test/unit/ui/console/testrunner' > require 'test/unit/assertions' > #require 'watir/setFileDialog' > #require 'popups_test' > #require 'enabled_popup' > > > #logger requires > require 'example_logger1' > require 'workbookfunction' > > #java_pophadler requires > require 'WindowHelper' > require 'win32ole' > #require 'javapopup' > #require 'winClickers' > > > > > ####includes > include Watir > > > class TC_PSC_userlogin < Test::Unit::TestCase > > 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 of function StartClicker > end > > def text(wait_seconds = 2) > sleep 0.3 > autoit = WIN32OLE.new("AutoItX3.Control ") > autoit.WinWait("Microsoft Internet Explorer", nil, > wait_seconds) if wait_seconds > s = autoit.WinGetText("Microsoft Internet Explorer") > file = File.open ("c:\\test.txt", "w") # DONT MAKE > YOUR VARIABLES GLOBAL UNNECESSARILY > file.puts(s.to_s) > puts s > file.close > #s unless s == "1" # NOT SURE WHY YOU ARE DOING > THIS > end > > def start > #open the IE browser > $ie = IE.new > > #create a logger > filePrefix = "logger" > $logger = LoggerFactory.start_xml_logger(filePrefix) > $ie.set_logger($logger) > > ##Excel file functions > $lgn=Excel_file.new #making object of workbookfunction > $wrk_sht=$lgn.ExcelOpen("c:\\PSC\\PSCuserlogin.xls") > > ##java popup hadling > #$pop=Jave_PopUps.new ##making object of javapopup > #$oPopup = Watir::autoit > end > > > > > > > > > def test_PSCLogin > > > #call start method... > start #fires up the IE browser and a logger object > > #variables-URL > test_site = 'https://www.philipnow.com/envcss/' > $logger.log("## PSCUser_Login_Logoff_4") > $logger.log("") > $logger.log("Description- Do not enter anything in the E-mail Address > and Password field and click Login button.") #logs only to corelogger file > $logger.log("Expected Output-The user should not be able to login.") > $logger.log("") > $logger.log("Step 1: Go to the Philipnow.com :- 'https://www.philipnow.com/envcss/' > ") > $ie.goto(test_site) > $logger.log(" Action-1: entered " + test_site + " in the address bar.") > $logger.log(":Step 2: Do not enter any thing in user id") > val_userid=$lgn.TakeData("a",1,$wrk_sht) > $ie.text_field(:name, "username").set(val_userid.to_s) > $logger.log(" Action-2: entered Nothing in in e-mail address") > > $logger.log(":Step-3: Do not enter any thing in password field") > val_password=$lgn.TakeData("b",1,$wrk_sht) > $ie.text_field(:name,"password").set(val_password.to_s) > $logger.log(":Action-3: entered Nothing in password field") > > > > ####popup handling##### > startClicker("OK",3) > text(2) > #require 'js_dialog' > #assert_js_dialog do > > $ie.button(:name, "login").click > > > #end > > > > $logger.log(":Step-4: Click the Login button") > > > $logger.log("Action-4: clicked the Login button.") > > > begin > assert($ie.contains_text("Welcome to Client Self-service Portal, > Alex Reyes!") ) > $logger.log("*FAILED*." + e.message + "\n" + e.backtrace.join > ("\n")) > $logger.log("Test Failed:Expected result has not been achieved:- > User is able to login ") > $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do not > enter anything in the E-mail Address and Password field and click Login > button.","Expected Output-The user should not be able to login.","TEST > FAILED:") #logs to both the XML file and corelogger > rescue => e > $logger.log("Test Passed:Expected result has been achieved:- User > is not able to login ") > $logger.log_results( "PSCUser_Login_Logoff_4","Description-Do not > enter anything in the E-mail Address and Password field and click Login > button.","Expected Output-The user should not be able to login.","TEST > PASSED:") #logs to both the XML file and corelogger > end > > $ie.close > $logger.log("Close excel file") > $lgn.excel_close > $logger.log("Closed excel file") > $logger.log "## End of test: PSC login\n" > end > end > > > Regards > Shalini Gupta > > On 4/26/07, Angrez Singh wrote: > > > > Hi Shalini, > > > > Can you post the entire code? How you are calling this text function? > > How you are handling the pop up? > > > > - Angrez > > > > On 4/26/07, SHALINI GUPTA wrote: > > > > > > hi Prema, > > > > > > Sorry it not working.. > > > It is printing 1 in text file. > > > please help!! > > > > > > Regards > > > Shalini Gupta > > > > > > On 4/25/07, Prema Arya < prema.arya at gmail.com> wrote: > > > > > > > > Hi Shalini, > > > > > > > > Just try this code (modified your code a little) > > > > def text(wait_seconds = 1) > > > > # sleep 0.3 > > > > autoit = WIN32OLE.new("AutoItX3.Control") > > > > autoit.WinWait("Microsoft Internet Explorer", nil, > > > > wait_seconds) if wait_seconds > > > > s = autoit.WinGetText("Microsoft Internet Explorer") > > > > file = File.open("c:\\test.txt", "w") # DONT > > > > MAKE YOUR VARIABLES GLOBAL UNNECESSARILY > > > > file.puts(s) > > > > file.close > > > > s unless s == "1" # NOT SURE WHY YOU ARE > > > > DOING THIS > > > > end > > > > Let me know if this works. > > > > > > > > Regards, > > > > Prema > > > > > > > > On 4/25/07, SHALINI GUPTA wrote: > > > > > > > > > > hi, > > > > > > > > > > i have tried to write this as > > > > > > > > > > def text(wait_seconds = 1) > > > > > # sleep 0.3 > > > > > autoit = WIN32OLE.new("AutoItX3.Control") > > > > > autoit.WinWait("Microsoft Internet Explorer", nil, > > > > > wait_seconds) if wait_seconds > > > > > s = autoit.WinGetText ("Microsoft Internet Explorer") > > > > > $File = File.open("c:\\test.txt", "w") > > > > > $File.puts(s.to_s) > > > > > s unless s == "1" > > > > > end > > > > > > > > > > but it is printing only 1..in the file. > > > > > please help. > > > > > > > > > > shalini gupta > > > > > > > > > > On 4/25/07, SHALINI GUPTA < shalinigupta2006 at gmail.com > wrote: > > > > > > > > > > > > hi, > > > > > > Thanks for quick reply... > > > > > > > > > > > > please tell me how can i write output of one method to a > > > > > > file.... > > > > > > > > > > > > my method is.. > > > > > > def text(wait_seconds = 1) > > > > > > # sleep 0.3 > > > > > > autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) if > > > > > > wait_seconds > > > > > > s = autoit.WinGetText(WINDOW_TITLE) > > > > > > s unless s == "1" > > > > > > end > > > > > > please help me.. > > > > > > > > > > > > Thanks In Advance > > > > > > Regards > > > > > > Shalini Gupta > > > > > > > > > > > > On 4/25/07, Angrez Singh wrote: > > > > > > > > > > > > > > Hi, > > > > > > > As Paul said that you need to store the text in a file and > > > > > > > then read that file in your main process. Because pop up's are handled in > > > > > > > different process. So even if you return that value from the method it won't > > > > > > > be visible to main process. Write this value to a file and then read the > > > > > > > contents. > > > > > > > > > > > > > > Regards, > > > > > > > Angrez > > > > > > > > > > > > > > On 4/25/07, SHALINI GUPTA < shalinigupta2006 at gmail.com > > > > > > > > wrote: > > > > > > > > > > > > > > > > hi, > > > > > > > > > > > > > > > > thanks for reply!!! > > > > > > > > > > > > > > > > but i have used autoit and WinGet Text as:---(with no > > > > > > > > success) > > > > > > > > > > > > > > > > #----- js_dialog.rb ----- > > > > > > > > > > > > > > > > require 'win32ole' > > > > > > > > require 'test/unit' > > > > > > > > require 'test/unit/ui/console/testrunner' > > > > > > > > # > > > > > > > > # Use AutoIt to read and close Javascript dialog windows > > > > > > > > # > > > > > > > > module JavascriptDialog > > > > > > > > > > > > > > > > # > > > > > > > > # Target javascript dialogs with this window title > > > > > > > > # > > > > > > > > WINDOW_TITLE = "Microsoft Internet Explorer" > > > > > > > > > > > > > > > > class << self > > > > > > > > > > > > > > > > # > > > > > > > > # Return the text contained in a javascript dialog ( > > > > > > > > e.g. an "alert()") > > > > > > > > # if such a dialog is present or appears within > > > > > > > > +wait_seconds+. > > > > > > > > # > > > > > > > > def text(wait_seconds = 1) > > > > > > > > # sleep 0.3 > > > > > > > > autoit.WinWait(WINDOW_TITLE, nil, wait_seconds) > > > > > > > > if wait_seconds > > > > > > > > s = autoit.WinGetText(WINDOW_TITLE) > > > > > > > > s unless s == "1" > > > > > > > > end > > > > > > > > > > > > > > > > # > > > > > > > > # Close any active javascript dialog > > > > > > > > # > > > > > > > > def close > > > > > > > > autoit.WinClose WINDOW_TITLE > > > > > > > > end > > > > > > > > > > > > > > > > # > > > > > > > > # Press the "OK" button on a javascript dialog > > > > > > > > # > > > > > > > > def ok > > > > > > > > autoit.ControlClick(WINDOW_TITLE, "", "OK") > > > > > > > > end > > > > > > > > # > > > > > > > > # Press the "Cancel" button on a javascript dialog > > > > > > > > # > > > > > > > > def cancel > > > > > > > > autoit.ControlClick (WINDOW_TITLE, "", "Cancel") > > > > > > > > end > > > > > > > > # > > > > > > > > # Press the "Yes" button on a javascript dialog > > > > > > > > # > > > > > > > > def yes > > > > > > > > autoit.ControlClick(WINDOW_TITLE, "", "Yes") > > > > > > > > end > > > > > > > > # > > > > > > > > # Press the "No" button on a javascript dialog > > > > > > > > # > > > > > > > > def no > > > > > > > > autoit.ControlClick(WINDOW_TITLE, "", "No") > > > > > > > > end > > > > > > > > > > > > > > > > private > > > > > > > > > > > > > > > > # > > > > > > > > # Return an AutoIt COM object, creating it if it > > > > > > > > doesn't already > > > > > > > > # exist > > > > > > > > # > > > > > > > > def autoit > > > > > > > > unless defined? @@autoit > > > > > > > > @@autoit = WIN32OLE.new(" > > > > > > > > AutoItX3.Control") > > > > > > > > end > > > > > > > > @@autoit > > > > > > > > end > > > > > > > > end > > > > > > > > end > > > > > > > > > > > > > > > > module Test::Unit::Assertions > > > > > > > > # > > > > > > > > # Passes if a Javascript dialog appears within > > > > > > > > +wait_seconds+ and its > > > > > > > > # text matches the given (optional) pattern. > > > > > > > > # > > > > > > > > # Use like this: > > > > > > > > # assert_js_dialog do > > > > > > > > # watir_command_to_make_dialog_appear > > > > > > > > # end > > > > > > > > # Or like this: > > > > > > > > # assert_js_dialog /Text to find in the dialog/, > > > > > > > > "Cancel" do > > > > > > > > # watir_command_to_make_dialog_appear > > > > > > > > # end > > > > > > > > # > > > > > > > > def assert_js_dialog(pattern = //, action = "close", > > > > > > > > message = nil) > > > > > > > > _wrap_assertion do > > > > > > > > begin > > > > > > > > pipe = IO.popen("ruby exetry.rb #{action}") > > > > > > > > yield > > > > > > > > window_text = pipe.read rescue "" > > > > > > > > pipe.close > > > > > > > > unless window_text.empty? > > > > > > > > assert_block(build_message(message, > > > > > > > > " not found in JavaScript > > > > > > > > dialog.", pattern)) do > > > > > > > > window_text.match(pattern) > > > > > > > > end > > > > > > > > else > > > > > > > > raise Test::Unit:: > > > > > > > > AssertionFailedError.new( > > > > > > > > build_message(message, "No > > > > > > > > JavaScript window found.")) > > > > > > > > end > > > > > > > > ensure > > > > > > > > pipe.close if pipe && !pipe.closed? > > > > > > > > end > > > > > > > > end > > > > > > > > end > > > > > > > > end > > > > > > > > > > > > > > > > # test - will close and print the text of an opened > > > > > > > > javascript dialog if > > > > > > > > # run as "ruby js_dialog.rb" > > > > > > > > if $0 == __FILE__ > > > > > > > > action = ARGV.shift || "close" > > > > > > > > print JavascriptDialog.text || "" > > > > > > > > JavascriptDialog.send action > > > > > > > > end > > > > > > > > > > > > > > > > if possible then please help me...and give me some code... > > > > > > > > > > > > > > > > Regards > > > > > > > > Shalini Gupta > > > > > > > > > > > > > > > > > > > > > > > > On 4/24/07, Paul Rogers < paul.rogers at shaw.ca > wrote: > > > > > > > > > > > > > > > > > > there is stuff in the winclicker to do it too. We've got > > > > > > > > > the javascript pop up text back to the main app by saving it to a file > > > > > > > > > > > > > > > > > > > > > > > > > > > Paul > > > > > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > > > As far as I know, clicking some button on Pop up window > > > > > > > > > happens in a different process (different from current process in which your > > > > > > > > > script is running). Correct me if I am wrong here? > > > > > > > > > > > > > > > > > > You can get the text using AutoIt3 and WinGetText method. > > > > > > > > > The only thing you need to find out is how you communicate data or the text > > > > > > > > > between two different processes. > > > > > > > > > > > > > > > > > > Regards, > > > > > > > > > Angrez > > > > > > > > > > > > > > > > > > On 4/24/07, SHALINI GUPTA < shalinigupta2006 at gmail.com > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > HI List, > > > > > > > > > > > > > > > > > > > > Please help regarding popup. > > > > > > > > > > How to get the text of a popup window.. > > > > > > > > > > its very urgent please help. > > > > > > > > > > > > > > > > > > > > Regards > > > > > > > > > > Shalini gupta > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > 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 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > 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 > > > > > > > > > > > > > > > > > > > > > -- > > > > Prema Arya > > > > _______________________________________________ > > > > 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/20070426/d0c9add9/attachment-0001.html From bret at pettichord.com Thu Apr 26 15:13:11 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 26 Apr 2007 14:13:11 -0500 Subject: [Wtr-general] Verifying Values of Cookies In-Reply-To: <40764017.11911176837899019.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <40764017.11911176837899019.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4630F9C7.4060302@pettichord.com> Gary wrote: > I am somewhat new to watir, and I am trying to figure out how to read and assert the value(s) of multiple cookies that are set by our software. Is this even possible with watir? I have seen some references to cookie manager, but it seems to be unsupported and generally unused. Some snippets of code or examples would really come in handy. > Have you looked at the cookie manager code? From forum-watir-users at openqa.org Thu Apr 26 16:25:42 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Thu, 26 Apr 2007 15:25:42 CDT Subject: [Wtr-general] Can Watir do - verify the file opened in PDF or Excel from? Message-ID: <33830378.21251177619172234.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello Watir exporters, I am using selenium RC testing tool writing in JAVA to automate the test cases. I can automate everything in web browser. But the web application does file download or open file in Acrobat Reader, Word or Excel. Once the no web Download file window is open, or view file open in Word/Excel, I could not using selenium to do anything with the files or windows. I need to do the followings with these windows: Enter the file name to download and click OK Make sure the PDF window is open, verify text in the PDF file, and close the file Make sure the Excel window is open, verify data in the worksheet, and close the file Can Watir handle these cases? Thank you for your help! Kui From paul.rogers at shaw.ca Thu Apr 26 16:43:33 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 26 Apr 2007 14:43:33 -0600 Subject: [Wtr-general] Can Watir do - verify the file opened in PDF or Excelfrom? References: <33830378.21251177619172234.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <04ba01c78843$8e7d6f40$6400a8c0@laptop> excel and word should be easy enough - watir doesnt do it directly, but there are plenty of posts out there to guide you through using the ole interface into word/excel from Ruby I dont know how you would do it for pdf though Paul ----- Original Message ----- From: "Kui Zhang" To: Sent: Thursday, April 26, 2007 2:25 PM Subject: [Wtr-general] Can Watir do - verify the file opened in PDF or Excelfrom? > Hello Watir exporters, > > I am using selenium RC testing tool writing in JAVA to automate the test > cases. I can automate everything in web browser. But the web application > does file download or open file in Acrobat Reader, Word or Excel. Once > the no web Download file window is open, or view file open in Word/Excel, > I could not using selenium to do anything with the files or windows. I > need to do the followings with these windows: > > Enter the file name to download and click OK > > Make sure the PDF window is open, verify text in the PDF file, and close > the file > > Make sure the Excel window is open, verify data in the worksheet, and > close the file > > Can Watir handle these cases? > > Thank you for your help! > Kui > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Thu Apr 26 17:00:01 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 26 Apr 2007 15:00:01 -0600 Subject: [Wtr-general] Can Watir do - verify the file opened in PDF or Excelfrom? References: <33830378.21251177619172234.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <04ba01c78843$8e7d6f40$6400a8c0@laptop> Message-ID: <04e001c78845$dbd72720$6400a8c0@laptop> if you have the professional version of acrobat, not the downloadable reader, you can use ole to access it http://www.adobe.com/devnet/acrobat/pdfs/iac_developer_guide.pdf I havent read through to see if its possible to extract the text though ----- Original Message ----- From: "Paul Rogers" To: Sent: Thursday, April 26, 2007 2:43 PM Subject: Re: [Wtr-general] Can Watir do - verify the file opened in PDF or Excelfrom? > excel and word should be easy enough - watir doesnt do it directly, but > there are plenty of posts out there to guide you through using the ole > interface into word/excel from Ruby > > I dont know how you would do it for pdf though > > Paul > > ----- Original Message ----- > From: "Kui Zhang" > To: > Sent: Thursday, April 26, 2007 2:25 PM > Subject: [Wtr-general] Can Watir do - verify the file opened in PDF or > Excelfrom? > > >> Hello Watir exporters, >> >> I am using selenium RC testing tool writing in JAVA to automate the test >> cases. I can automate everything in web browser. But the web application >> does file download or open file in Acrobat Reader, Word or Excel. Once >> the no web Download file window is open, or view file open in Word/Excel, >> I could not using selenium to do anything with the files or windows. I >> need to do the followings with these windows: >> >> Enter the file name to download and click OK >> >> Make sure the PDF window is open, verify text in the PDF file, and close >> the file >> >> Make sure the Excel window is open, verify data in the worksheet, and >> close the file >> >> Can Watir handle these cases? >> >> Thank you for your help! >> Kui >> _______________________________________________ >> 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 charley.baker at gmail.com Thu Apr 26 17:12:50 2007 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 26 Apr 2007 15:12:50 -0600 Subject: [Wtr-general] Can Watir do - verify the file opened in PDF or Excelfrom? In-Reply-To: <04e001c78845$dbd72720$6400a8c0@laptop> References: <33830378.21251177619172234.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <04ba01c78843$8e7d6f40$6400a8c0@laptop> <04e001c78845$dbd72720$6400a8c0@laptop> Message-ID: Since you're already familiar with Java and using that for your Selenium RC tests, I'd recommend you stick to that route. There are some java libraries for reading pdfs as well as likely excel and word files, search on google, I'd recommend the same for interacting with the Windows dialog which must be possible in Java, there's also a java to com bridge library called Jacob which you might look into: http://danadler.com/jacob/ My take is to stay with your current structure unless there's sufficient reason to introduce Watir. -Charley On 4/26/07, Paul Rogers wrote: > > if you have the professional version of acrobat, not the downloadable > reader, you can use ole to access it > > http://www.adobe.com/devnet/acrobat/pdfs/iac_developer_guide.pdf > > I havent read through to see if its possible to extract the text though > > ----- Original Message ----- > From: "Paul Rogers" > To: > Sent: Thursday, April 26, 2007 2:43 PM > Subject: Re: [Wtr-general] Can Watir do - verify the file opened in PDF or > Excelfrom? > > > > excel and word should be easy enough - watir doesnt do it directly, but > > there are plenty of posts out there to guide you through using the ole > > interface into word/excel from Ruby > > > > I dont know how you would do it for pdf though > > > > Paul > > > > ----- Original Message ----- > > From: "Kui Zhang" > > To: > > Sent: Thursday, April 26, 2007 2:25 PM > > Subject: [Wtr-general] Can Watir do - verify the file opened in PDF or > > Excelfrom? > > > > > >> Hello Watir exporters, > >> > >> I am using selenium RC testing tool writing in JAVA to automate the > test > >> cases. I can automate everything in web browser. But the web > application > >> does file download or open file in Acrobat Reader, Word or Excel. Once > >> the no web Download file window is open, or view file open in > Word/Excel, > >> I could not using selenium to do anything with the files or windows. I > >> need to do the followings with these windows: > >> > >> Enter the file name to download and click OK > >> > >> Make sure the PDF window is open, verify text in the PDF file, and > close > >> the file > >> > >> Make sure the Excel window is open, verify data in the worksheet, and > >> close the file > >> > >> Can Watir handle these cases? > >> > >> Thank you for your help! > >> Kui > >> _______________________________________________ > >> 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/20070426/76e3d952/attachment.html From paul.rogers at shaw.ca Thu Apr 26 17:48:48 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 26 Apr 2007 15:48:48 -0600 Subject: [Wtr-general] Can Watir do - verify the file opened in PDF orExcelfrom? References: <33830378.21251177619172234.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <04ba01c78843$8e7d6f40$6400a8c0@laptop> <04e001c78845$dbd72720$6400a8c0@laptop> Message-ID: <051d01c7884c$abc05870$6400a8c0@laptop> this is a java pdf library http://www.pdfbox.org/ used by this http://jpdfunit.sourceforge.net/index.html I was thinking jruby + pdfbox, but Charlies idea is way simpler ----- Original Message ----- From: Charley Baker To: wtr-general at rubyforge.org Sent: Thursday, April 26, 2007 3:12 PM Subject: Re: [Wtr-general] Can Watir do - verify the file opened in PDF orExcelfrom? Since you're already familiar with Java and using that for your Selenium RC tests, I'd recommend you stick to that route. There are some java libraries for reading pdfs as well as likely excel and word files, search on google, I'd recommend the same for interacting with the Windows dialog which must be possible in Java, there's also a java to com bridge library called Jacob which you might look into: http://danadler.com/jacob/ My take is to stay with your current structure unless there's sufficient reason to introduce Watir. -Charley On 4/26/07, Paul Rogers wrote: if you have the professional version of acrobat, not the downloadable reader, you can use ole to access it http://www.adobe.com/devnet/acrobat/pdfs/iac_developer_guide.pdf I havent read through to see if its possible to extract the text though ----- Original Message ----- From: "Paul Rogers" To: Sent: Thursday, April 26, 2007 2:43 PM Subject: Re: [Wtr-general] Can Watir do - verify the file opened in PDF or Excelfrom? > excel and word should be easy enough - watir doesnt do it directly, but > there are plenty of posts out there to guide you through using the ole > interface into word/excel from Ruby > > I dont know how you would do it for pdf though > > Paul > > ----- Original Message ----- > From: "Kui Zhang" > To: > Sent: Thursday, April 26, 2007 2:25 PM > Subject: [Wtr-general] Can Watir do - verify the file opened in PDF or > Excelfrom? > > >> Hello Watir exporters, >> >> I am using selenium RC testing tool writing in JAVA to automate the test >> cases. I can automate everything in web browser. But the web application >> does file download or open file in Acrobat Reader, Word or Excel. Once >> the no web Download file window is open, or view file open in Word/Excel, >> I could not using selenium to do anything with the files or windows. I >> need to do the followings with these windows: >> >> Enter the file name to download and click OK >> >> Make sure the PDF window is open, verify text in the PDF file, and close >> the file >> >> Make sure the Excel window is open, verify data in the worksheet, and >> close the file >> >> Can Watir handle these cases? >> >> Thank you for your help! >> Kui >> _______________________________________________ >> 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 ------------------------------------------------------------------------------ _______________________________________________ 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/20070426/ec1f1884/attachment-0001.html From charley.baker at gmail.com Thu Apr 26 18:08:18 2007 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 26 Apr 2007 16:08:18 -0600 Subject: [Wtr-general] Does watir support file download? In-Reply-To: References: Message-ID: You might check into the image download in Watir 1.5.1: Image::save and Image::fill_save_image_dialog I've not had to do this but it shouldn't be too challenging through either AutoIt or winclicker. -c On 4/25/07, jhe wrote: > > Dear all, > > > > Is there a way to download file and save it to hard disk? > > > > Thanks in advance. > > Jason > > > > _______________________________________________ > 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/20070426/c53c7a95/attachment.html From shalinigupta2006 at gmail.com Fri Apr 27 06:03:19 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Fri, 27 Apr 2007 15:33:19 +0530 Subject: [Wtr-general] How to verify title of a HTML Page Message-ID: <7523f5800704270303u120c4298s3fee649e65f0b3be@mail.gmail.com> hi all, I have a project,In which i have to check that particular tiltle is there or not. itried this with assert(@ie.pageContainsText("some text here")) but it is giving me errors like as.:- log *FAILED*. is not true. c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:48:in `assert_block' c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:500:in `_wrap_assertion' c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:46:in `assert_block' c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:63:in `assert' c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:495:in `_wrap_assertion' c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:61:in `assert' webV2_BR.rb:83:in `enter_URL' webV2_BR.rb:51:in `start' webV2_BR.rb:68:in `test_webV2_start' c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:78:in `__send__' c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:78:in `run' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run' c:/ruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in `run_suite' c:/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:67:in `start_mediator' c:/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in `start' c:/ruby/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in `run' c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run' c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run' c:/ruby/lib/ruby/1.8/test/unit.rb:278 regards shalini gupta -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070427/5d2b3e76/attachment.html From crasch at gmail.com Fri Apr 27 05:36:09 2007 From: crasch at gmail.com (Christopher Rasch) Date: Fri, 27 Apr 2007 02:36:09 -0700 Subject: [Wtr-general] Missing IEDialog.dll? Message-ID: <4631C409.4030600@gmail.com> Hi, I'm trying to set up watir 1.5 running under cygwin (2.510.2.2) on Windows XP Professional (Version 2002, Service Pack 2). Windows XP is in turn running as a virtual OS under Parallels (Build 3170 RC3) running on OS X Tiger 10.4.9 (2.16 GHz Intel Core 2 Duo) I've installed cygwin+cygwin ruby (via cygwin setup.exe)+rubygems-0.9.2 (via tarball)+watir-1.5.1.1164 (via gem) However, when I try to load watir in irb, I get the following error: sh-3.2$ irb irb(main):001:0> require 'rubygems' => true irb(main):002:0> require 'watir' RuntimeError: LoadLibrary: \usr\lib\ruby\gems\1.8\gems\watir-1.5.1.1164\watir\IE Dialog\Release\IEDialog.dll from /usr/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:156:in `ini tialize' from /usr/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:156:in `new ' from /usr/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:156 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `gem_o riginal_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `requi re' from (irb):2 >From a message dated January 31, 2006 (pasted below), it appears I need to hand-copy win32ole.so into my Ruby installation. Is this still a necessity? If so, where can I get win32ole and where should I put it? If not, any suggestions for how to fix it? Thanks! Chris http://rubyforge.org/pipermail/wtr-cvs-auto/2006-January.txt >From bret at rubyforge.org Tue Jan 31 19:50:04 2006 From: bret at rubyforge.org (bret at rubyforge.org) Date: Tue, 31 Jan 2006 19:50:04 -0500 Subject: [Wtr-cvs-auto] [rubyforge-cvs] [Jan 31 19:50] watir/watir/win32ole/test_win32ole.rb Message-ID: <200602010050.k110o44N030803 at rubyforge.org> Update of /var/cvs/wtr/watir/watir/win32ole In directory rubyforge.org:/tmp/cvs-serv30663/watir/win32ole Modified Files: test_win32ole.rb Log Message: Yaxin's test now works with the built IEDialog.dll. (Requires win32ole.so to be hand-copied into your Ruby installation.) From forum-watir-users at openqa.org Fri Apr 27 08:37:44 2007 From: forum-watir-users at openqa.org (John) Date: Fri, 27 Apr 2007 07:37:44 CDT Subject: [Wtr-general] Get text from div Message-ID: <38941987.28071177677494999.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, [code]
     Games 0games 0games     Music 0DG_Unknown_music 1     Pictures 0DG_Unknown_pictures 1     Videos 0DG_Unknown_video 1     My Media 0mymedia839513 1   5 0 0Root839513  0   
[/code] How can I read those XML values? I would be happy to get the whole text which I then can manipulate with string functions, but it would be great to be able to get for instance the value between the tags. Any ideas? Thanks! From zeljko.filipin at gmail.com Fri Apr 27 08:47:19 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 27 Apr 2007 14:47:19 +0200 Subject: [Wtr-general] Get text from div In-Reply-To: <38941987.28071177677494999.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <38941987.28071177677494999.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi John, You can use REXML (http://www.germane-software.com/software/rexml/) to read xml. Let me know if you need more details. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070427/059154b3/attachment.html From forum-watir-users at openqa.org Fri Apr 27 08:56:57 2007 From: forum-watir-users at openqa.org (John) Date: Fri, 27 Apr 2007 07:56:57 CDT Subject: [Wtr-general] Get text from div In-Reply-To: Message-ID: <34231440.28561177678647936.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Zeljko, I have used REXML before, but am I right that you only can read stand-alone XML files with it? Because you need to use "doc = Document.new File.new("mydoc.xml")" and then "doc.root" to get the information you want. In my case the XML data is shown in a HTML page in the browser. How can I get that information with REXML? Thanks for the help! From zeljko.filipin at gmail.com Fri Apr 27 09:06:13 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 27 Apr 2007 15:06:13 +0200 Subject: [Wtr-general] Get text from div In-Reply-To: <34231440.28561177678647936.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <34231440.28561177678647936.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: John, If page is valid XHTML then it is also valid XML, right? In that case you could use REXML. But, I guess that is rarely the case. Try extracting XML data to string (or file) from HTML with regular expression and then access that XML with REXML. Once more, let me know if you need more details. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070427/71c518bd/attachment.html From paul.rogers at shaw.ca Fri Apr 27 09:22:56 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 27 Apr 2007 07:22:56 -0600 Subject: [Wtr-general] How to verify title of a HTML Page References: <7523f5800704270303u120c4298s3fee649e65f0b3be@mail.gmail.com> Message-ID: <059f01c788cf$2b098340$6400a8c0@laptop> assert("my Title" , @ie.title) ----- Original Message ----- From: SHALINI GUPTA To: wtr-general at rubyforge.org ; Wtr-general-request at rubyforge.org Sent: Friday, April 27, 2007 4:03 AM Subject: [Wtr-general] How to verify title of a HTML Page hi all, I have a project,In which i have to check that particular tiltle is there or not. itried this with assert(@ie.pageContainsText("some text here")) but it is giving me errors like as.:- log *FAILED*. is not true. c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:48:in `assert_block' c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:500:in `_wrap_assertion' c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:46:in `assert_block' c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:63:in `assert' c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:495:in `_wrap_assertion' c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:61:in `assert' webV2_BR.rb:83:in `enter_URL' webV2_BR.rb:51:in `start' webV2_BR.rb:68:in `test_webV2_start' c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:78:in `__send__' c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:78:in `run' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run' c:/ruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in `run_suite' c:/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:67:in `start_mediator' c:/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in `start' c:/ruby/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in `run' c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run' c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run' c:/ruby/lib/ruby/1.8/test/unit.rb:278 regards shalini gupta ------------------------------------------------------------------------------ _______________________________________________ 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/20070427/636b945b/attachment-0001.html From bret at pettichord.com Fri Apr 27 10:21:14 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 27 Apr 2007 09:21:14 -0500 Subject: [Wtr-general] Missing IEDialog.dll? In-Reply-To: <4631C409.4030600@gmail.com> References: <4631C409.4030600@gmail.com> Message-ID: <463206DA.1050404@pettichord.com> Christopher Rasch wrote: > RuntimeError: LoadLibrary: > \usr\lib\ruby\gems\1.8\gems\watir-1.5.1.1164\watir\IE > Dialog\Release\IEDialog.dll > I don't understand this error message. But i'm guessing that this DLL might not be compatible with Cygwin. You also probably don't need it: it is only used by the modal dialog support. So you might just try commenting out the line that loads it and see what happens. Bret From crasch at gmail.com Fri Apr 27 16:52:15 2007 From: crasch at gmail.com (Christopher Rasch) Date: Fri, 27 Apr 2007 13:52:15 -0700 Subject: [Wtr-general] Missing IEDialog.dll? In-Reply-To: <463206DA.1050404@pettichord.com> References: <4631C409.4030600@gmail.com> <463206DA.1050404@pettichord.com> Message-ID: <4632627F.9050300@gmail.com> Bret Pettichord wrote: > Christopher Rasch wrote: > >> RuntimeError: LoadLibrary: >> \usr\lib\ruby\gems\1.8\gems\watir-1.5.1.1164\watir\IE >> Dialog\Release\IEDialog.dll >> >> > I don't understand this error message. But i'm guessing that this DLL > might not be compatible with Cygwin. You also probably don't need it: it > is only used by the modal dialog support. So you might just try > commenting out the line that loads it and see what happens. > > Bret > _____________ Hi Bret, Thanks! I commented out the following lines: 156 : GetUnknown = Win32API.new(@@iedialog_file, 'GetUnknown', ['l', 'p'], 'v') 2789: GetUnknown.call(@hwnd, intPointer) I was able to get past that point. ( Although, one of my motivations for using 1.5 rather 1.4.1 is better modal dialog support, so hopefully it can be fixed at some point. ) If you would be so kind, what's your development environment? Do you use cygwin? Which editor/IDE do you use? Chris From forum-watir-users at openqa.org Fri Apr 27 20:29:09 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Fri, 27 Apr 2007 19:29:09 CDT Subject: [Wtr-general] Cannot run example test case Message-ID: <37095361.33131177720180746.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello, I just installed ruby 186-35 and Watir 1.4.1 on windows Xp. Following the instruction to run example test case from the command line, IE browser is not open, the cursor just blinking with nothing displayed in the command window. Please help! Kui From jhe at resilience.com Sat Apr 28 02:43:30 2007 From: jhe at resilience.com (jhe) Date: Sat, 28 Apr 2007 14:43:30 +0800 Subject: [Wtr-general] Does watir support file download? In-Reply-To: Message-ID: Image::save and Image::fill_save_image_dialog seems only could deal with image save issue, but couldn?t solve the problem of file download. I use AutoIt solve it. Thanks for your advice. Regards, Jason _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Charley Baker Sent: 2007?4?27? 6:08 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Does watir support file download? You might check into the image download in Watir 1.5.1: Image::save and Image::fill_save_image_dialog I've not had to do this but it shouldn't be too challenging through either AutoIt or winclicker. -c On 4/25/07, jhe wrote: Dear all, Is there a way to download file and save it to hard disk? Thanks in advance. Jason _______________________________________________ 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/20070428/d4b3b9dd/attachment.html From jhe at resilience.com Sat Apr 28 02:51:09 2007 From: jhe at resilience.com (jhe) Date: Sat, 28 Apr 2007 14:51:09 +0800 Subject: [Wtr-general] How to unzip the zip file using watir/ruby script In-Reply-To: Message-ID: Dear all, I want to extract the content from the winzip file by water/ruby script, which of the following command could achieve the goal, exec, syscall, system, or anything else? Thanks in advance. Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070428/4f0cf8b8/attachment.html From anandsri01 at gmail.com Sat Apr 28 03:04:48 2007 From: anandsri01 at gmail.com (atul srivastava) Date: Sat, 28 Apr 2007 12:34:48 +0530 Subject: [Wtr-general] how click on image with div class & id Message-ID: #$ie.image(:text, /Research and Tools/i).click #$ie.div(:class, "elm", :id, "research").click #$ie.div(:id => "research", :index => 1).click #$document.getElementById("research").click #$ie.image(:xpath,"//*[@id='research']/image").click $ie.div(:class, "elm").images.each {|image| image.flash} -- With Thanks and Regards, Anand Vardhan Srivastava | GlobalLogic India The Leader in Global Product Development B34/1, Sector-59,Noida ,201301 Phone: +91. 4342000 x 4285 Cell Number : +919811228992 Disclaimer: http://www.globallogic.com/email_disclaimer.txt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070428/81ce16c9/attachment.html From forum-watir-users at openqa.org Sat Apr 28 05:53:10 2007 From: forum-watir-users at openqa.org (Naga Harish Kanegolla) Date: Sat, 28 Apr 2007 04:53:10 CDT Subject: [Wtr-general] Watir Assertions Message-ID: <35363767.33961177754020818.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi all, Generally if i fill a form the values entered will go to the database and the data will be visible in the list automatically. So how can I do in watir whether the values are visible in the list ? How do i assert that? Thanks in Advance, Harish From jhe at resilience.com Sun Apr 29 03:55:51 2007 From: jhe at resilience.com (jhe) Date: Sun, 29 Apr 2007 15:55:51 +0800 Subject: [Wtr-general] Do AutoIt3 scripts also work in Firewatir? In-Reply-To: Message-ID: Dear all, I use some AutoIt3 script together with watir script in test case. Do these codes also work in firewatir? Thanks Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070429/2dd51576/attachment-0001.html From forum-watir-users at openqa.org Sun Apr 29 15:28:12 2007 From: forum-watir-users at openqa.org (shqy) Date: Sun, 29 Apr 2007 14:28:12 CDT Subject: [Wtr-general] Why ie.span(:name,"..").click no use? Message-ID: <28777351.681177874922309.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> there is a project for me,the requirement is that "Logs into your gmail account. Concatenate and print out the contents of all emails in your inbox." there is the code: require 'watir' ie = Watir::IE.new ie.goto("http://mail.google.com") ie.text_field(:name, "Email").set("slovenana") ie.text_field(:name, "Passwd").set("shqy111218") ie.button(:name, "null").click sleep 3 ie.show_all_objects ie.frame("main").show_all_objects ie.frame("main") .frame(:name,"v1").show_all_objects ie.frame("main").frame("v1").span(:id,"_upro_mail-noreply at google.com").click but the last sentence:"ie.frame("main").frame("v1").span(:id,"_upro_mail-noreply at google.com").click" seems no response! it only flash one time, but no text changed. ie.button().click......is OK! but why ie.span().click does not work well? Thanks! From forum-watir-users at openqa.org Sun Apr 29 16:38:37 2007 From: forum-watir-users at openqa.org (shqy) Date: Sun, 29 Apr 2007 15:38:37 CDT Subject: [Wtr-general] Problem automating Gmail In-Reply-To: <57488975.1173821179754.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <34590967.741177879147924.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> there is the same problem for me! Have you known how to solve this problem?Please help me! Thanks in Advance From bret at pettichord.com Sun Apr 29 20:46:54 2007 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 29 Apr 2007 19:46:54 -0500 Subject: [Wtr-general] Missing IEDialog.dll? In-Reply-To: <4632627F.9050300@gmail.com> References: <4631C409.4030600@gmail.com> <463206DA.1050404@pettichord.com> <4632627F.9050300@gmail.com> Message-ID: <46353C7E.3040800@pettichord.com> Christopher Rasch wrote: > Bret Pettichord wrote: > >> Christopher Rasch wrote: >> >> >>> RuntimeError: LoadLibrary: >>> \usr\lib\ruby\gems\1.8\gems\watir-1.5.1.1164\watir\IE >>> Dialog\Release\IEDialog.dll >>> >> I don't understand this error message. But i'm guessing that this DLL >> might not be compatible with Cygwin. You also probably don't need it: it >> is only used by the modal dialog support. So you might just try >> commenting out the line that loads it and see what happens. >> >> Bret >> > Hi Bret, > > Thanks! I commented out the following lines: > > 156 : GetUnknown = Win32API.new(@@iedialog_file, 'GetUnknown', ['l', > 'p'], 'v') > 2789: GetUnknown.call(@hwnd, intPointer) > > I was able to get past that point. ( Although, one of my motivations > for using 1.5 rather 1.4.1 is better modal dialog support, so hopefully > it can be fixed at some point. ) > Well, then that is not really going to work for you. > If you would be so kind, what's your development environment? Do you > use cygwin? Which editor/IDE do you use? > I have cygwin installed on my older machines, so i can indeed test on it. Many years ago, i regularly tested Watir on cygwin and i think there is some cygwin-specific code in our test suite. But i haven't really used it in years. I mostly use Eclipse as my IDE, although i've also liked Scite and have recently been looking at Ruby in Steel. Of course, i mostly use Ruby for Windows, not Ruby under Cygwin. It seems to me that the problem you've seen may be specific to Ruby for Cygwin. If using Cygwin is important to you, then you'll need to track this down further. If you do find a solution, please pass it on. Bret From bret at pettichord.com Sun Apr 29 20:48:42 2007 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 29 Apr 2007 19:48:42 -0500 Subject: [Wtr-general] Watir Assertions In-Reply-To: <35363767.33961177754020818.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <35363767.33961177754020818.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <46353CEA.30703@pettichord.com> Naga Harish Kanegolla wrote: > Hi all, > Generally if i fill a form the values entered will go to the database and the data will be visible in the list automatically. So how can I do in watir whether the values are visible in the list ? How do i assert that? > It is much easier for us to answer questions like this if you can show us some sample html for the form you are dealing with. Bret From angrez at gmail.com Mon Apr 30 00:01:05 2007 From: angrez at gmail.com (Angrez Singh) Date: Mon, 30 Apr 2007 09:31:05 +0530 Subject: [Wtr-general] Do AutoIt3 scripts also work in Firewatir? In-Reply-To: References: Message-ID: Hi Jason, AutoIt3 is not supported by FireWatir. This is done so as to make Firewatir platform independent. Only 'alert' and 'confirm' javascript pop ups are supported as of now. We are looking into the alternatives/solutions were we can support other dialogs like Save File etc Regards, Angrez On 4/29/07, jhe wrote: > > Dear all, > > > > I use some AutoIt3 script together with watir script in test case. Do > these codes also work in firewatir? > > > > Thanks > > Jason > > > > _______________________________________________ > 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/20070430/da5e237f/attachment.html From shalinigupta2006 at gmail.com Mon Apr 30 01:30:35 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Mon, 30 Apr 2007 11:00:35 +0530 Subject: [Wtr-general] how to click on a image with this HTML code Message-ID: <7523f5800704292230s62f8ddf2vcaf4b145eda6c000@mail.gmail.com> Hi all, I have a problem in my project to click on a image. which has this HTML Code:-
  i have tried to click this as:- $ie.image(:src,"../Images/nav_research.png").click and $ie.image(:id,"research").click but both of this generate this error:- 1) Error: test_WEBV2_RR(TC_WEBV2_RR): Watir::Exception::UnknownObjectException: Unable to locate object, using src and ../Images/nav_research.png c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2009:in `click' r_n_d.rb:44:in `assert1' r_n_d.rb:31:in `start' r_n_d.rb:34:in `test_WEBV2_RR' please help me.. how can i click this.. its urgent thanks in advance Regards Shalini Gupta -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070430/dcb1c935/attachment.html From shalinigupta2006 at gmail.com Mon Apr 30 01:43:51 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Mon, 30 Apr 2007 11:13:51 +0530 Subject: [Wtr-general] HELP----Re: how to click on a image with this HTML code Message-ID: <7523f5800704292243uc5c6f60wef1789b8f1506b2f@mail.gmail.com> HELLO TO ALL, PLEASE HELP ITS VERY URGENT.. REGARDS SHALINI GUPTA On 4/30/07, SHALINI GUPTA wrote: > > Hi all, > > I have a problem in my project to click on a image. > which has this HTML Code:- > >
>   > > i have tried to click this as:- > $ie.image(:src,"../Images/nav_research.png").click > and > $ie.image(:id,"research").click > > but both of this generate this error:- > > 1) Error: > test_WEBV2_RR(TC_WEBV2_RR): > Watir::Exception::UnknownObjectException: Unable to locate object, using > src and ../Images/nav_research.png > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2009:in `click' > r_n_d.rb:44:in `assert1' > r_n_d.rb:31:in `start' > r_n_d.rb:34:in `test_WEBV2_RR' > > please help me.. > > how can i click this.. > its urgent > > thanks in advance > > Regards > Shalini Gupta > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070430/504d8a99/attachment.html From zeljko.filipin at gmail.com Mon Apr 30 04:08:34 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 30 Apr 2007 10:08:34 +0200 Subject: [Wtr-general] how click on image with div class & id In-Reply-To: References: Message-ID: Please post HTML of the image. In the meantime, try this. ie.image(:id, "research").click Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070430/4c9772db/attachment.html From zeljko.filipin at gmail.com Mon Apr 30 04:21:30 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 30 Apr 2007 10:21:30 +0200 Subject: [Wtr-general] how to click on a image with this HTML code In-Reply-To: <7523f5800704292230s62f8ddf2vcaf4b145eda6c000@mail.gmail.com> References: <7523f5800704292230s62f8ddf2vcaf4b145eda6c000@mail.gmail.com> Message-ID: On 4/30/07, SHALINI GUPTA wrote: > >
> Hi Shalini, You can not click that tag with ie.image because it is a div, not an image. Try this instead. ie.div(:id,"research").click Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070430/79585d08/attachment.html From zeljko.filipin at gmail.com Mon Apr 30 05:22:43 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 30 Apr 2007 11:22:43 +0200 Subject: [Wtr-general] Why ie.span(:name,"..").click no use? In-Reply-To: <28777351.681177874922309.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28777351.681177874922309.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 4/29/07, shqy wrote: > > Concatenate and print out the contents of all emails in your inbox. Hi shqy, When you log in, use this code to get some information about messages in inbox ie.frame(:name, "main").frame(:id, "v1").table(:id, "tb")[1][3].text # from ie.frame(:name, "main").frame(:id, "v1").table(:id, "tb")[1][5].text # subject and beginning of body ie.frame(:name, "main").frame(:id, "v1").table(:id, "tb")[1][7].text # sent time Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070430/39636034/attachment-0001.html From forum-watir-users at openqa.org Mon Apr 30 11:14:57 2007 From: forum-watir-users at openqa.org (Anna) Date: Mon, 30 Apr 2007 10:14:57 CDT Subject: [Wtr-general] Watir - Scrpting issues with Dynamic HTML Message-ID: <31448591.5671177946127715.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Helo, I am having an issue to click on the drop down menu from DHTML Menu. Please can you provide some help. This is what i am doing --> Steps 1) Open the Url with link. 2) pass the login info 3) From home selected the " Self" dynamic Html Menu - it is clicking correctly with the following code - this is an example website ie.link(:text,/"Self"/).fireEvent("onMouseOver") Self has 2 drop down menu items. Self line by customer Self line by Admin 4) Issue when i try to click on Self line by customer or Self line by Admin ie.Link(:text, /"Self line by customer"/).fire_event("onmouseover") Recieved this error Watir::Exception::UnknownObjectException: Unable to locate object, using text and (?-mix:Self line by customer) c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:2414:in `assert_exists' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:2643:in `enabled?' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:2418:in `assert_enabled' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:2613:in `fireEvent' Portal.rb:24:in `test_recorded' and also tried ie.div(:id, "Life Event Enrollment").fire_event("onmouseover") recieing the same rror. Please can you help me, Thanks, Anna From charley.baker at gmail.com Mon Apr 30 11:21:59 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 30 Apr 2007 09:21:59 -0600 Subject: [Wtr-general] HELP----Re: how to click on a image with this HTML code In-Reply-To: <7523f5800704292243uc5c6f60wef1789b8f1506b2f@mail.gmail.com> References: <7523f5800704292243uc5c6f60wef1789b8f1506b2f@mail.gmail.com> Message-ID: Try clicking on the div instead which is where the onclick event lives: ie.div(:id, 'Research').fire_event('onclick') -Charley On 4/29/07, SHALINI GUPTA wrote: > > HELLO TO ALL, > > PLEASE HELP ITS VERY URGENT.. > > REGARDS > SHALINI GUPTA > > On 4/30/07, SHALINI GUPTA < shalinigupta2006 at gmail.com> wrote: > > > > Hi all, > > > > I have a problem in my project to click on a image. > > which has this HTML Code:- > > > >
> >   > > > > i have tried to click this as:- > > $ie.image(:src,"../Images/nav_research.png").click > > and > > $ie.image(:id,"research").click > > > > but both of this generate this error:- > > > > 1) Error: > > test_WEBV2_RR(TC_WEBV2_RR): > > Watir::Exception::UnknownObjectException: Unable to locate object, using > > src and ../Images/nav_research.png > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2009:in `click' > > r_n_d.rb:44:in `assert1' > > r_n_d.rb:31:in `start' > > r_n_d.rb:34:in `test_WEBV2_RR' > > > > please help me.. > > > > how can i click this.. > > its urgent > > > > thanks in advance > > > > Regards > > Shalini Gupta > > > > > _______________________________________________ > 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/20070430/2d7d2ec8/attachment.html From paul.rogers at shaw.ca Mon Apr 30 11:24:32 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 30 Apr 2007 09:24:32 -0600 Subject: [Wtr-general] Watir - Scrpting issues with Dynamic HTML In-Reply-To: <31448591.5671177946127715.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <31448591.5671177946127715.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: we cant help at all without seeing the html you are trying to access. If its truly dynamic html then you wont see it in view source, you will however see it if you do ie.html in irb ----- Original Message ----- From: Anna Date: Monday, April 30, 2007 9:14 am Subject: [Wtr-general] Watir - Scrpting issues with Dynamic HTML > Helo, > > I am having an issue to click on the drop down menu from DHTML > Menu. Please can you provide some help. > > This is what i am doing --> > Steps > > 1) Open the Url with link. > 2) pass the login info > 3) From home selected the " Self" dynamic Html Menu - it is > clicking correctly with the following code - this is an example > website ie.link(:text,/"Self"/).fireEvent("onMouseOver") > Self has 2 drop down menu items. > Self line by customer > Self line by Admin > 4) Issue when i try to click on Self line by customer or Self > line by Admin > > ie.Link(:text, /"Self line by > customer"/).fire_event("onmouseover") > > Recieved this error > > Watir::Exception::UnknownObjectException: Unable to locate object, > using text and (?-mix:Self line by customer) > c:/ruby/lib/ruby/gems/1.8/gems/watir- > 1.5.1.1164/./watir.rb:2414:in `assert_exists' > c:/ruby/lib/ruby/gems/1.8/gems/watir- > 1.5.1.1164/./watir.rb:2643:in `enabled?' > c:/ruby/lib/ruby/gems/1.8/gems/watir- > 1.5.1.1164/./watir.rb:2418:in `assert_enabled' > c:/ruby/lib/ruby/gems/1.8/gems/watir- > 1.5.1.1164/./watir.rb:2613:in `fireEvent' > Portal.rb:24:in `test_recorded' > > and also tried > > ie.div(:id, "Life Event Enrollment").fire_event("onmouseover") > > recieing the same rror. > > Please can you help me, > > Thanks, > Anna > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Mon Apr 30 11:34:09 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 30 Apr 2007 09:34:09 -0600 Subject: [Wtr-general] ruby windows blog Message-ID: this site has lots of info aobiut automating excel etc http://rubyonwindows.blogspot.com/ From forum-watir-users at openqa.org Mon Apr 30 12:03:06 2007 From: forum-watir-users at openqa.org (Anna) Date: Mon, 30 Apr 2007 11:03:06 CDT Subject: [Wtr-general] Watir - Scrpting issues with Dynamic HTML In-Reply-To: Message-ID: <29215605.6251177949016654.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for the reply what you want me to provide so that i wil provide the info. please reply me back. Thansk, anna From charley.baker at gmail.com Mon Apr 30 12:12:04 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 30 Apr 2007 10:12:04 -0600 Subject: [Wtr-general] Cannot run example test case In-Reply-To: <37095361.33131177720180746.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <37095361.33131177720180746.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Are you getting anything if you run through irb? Open a command prompt type irb in irb type require 'watir' include Watir ie = IE.new Anything happen? -Charley On 4/27/07, Kui Zhang wrote: > > Hello, > > I just installed ruby 186-35 and Watir 1.4.1 on windows Xp. Following the > instruction to run example test case from the command line, IE browser is > not open, the cursor just blinking with nothing displayed in the command > window. > > Please help! > Kui > _______________________________________________ > 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/20070430/68a9f39c/attachment.html From forum-watir-users at openqa.org Mon Apr 30 12:57:59 2007 From: forum-watir-users at openqa.org (Anna) Date: Mon, 30 Apr 2007 11:57:59 CDT Subject: [Wtr-general] Watir - Scrpting issues with Dynamic HTML In-Reply-To: Message-ID: <26653912.6561177952309972.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Paul, Please can you direct me with this issue. Thanks, anna From bret at pettichord.com Mon Apr 30 13:03:00 2007 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 30 Apr 2007 12:03:00 -0500 Subject: [Wtr-general] Do AutoIt3 scripts also work in Firewatir? In-Reply-To: References: Message-ID: <46362144.7080102@pettichord.com> Angrez Singh wrote: > AutoIt3 is not supported by FireWatir. This is done so as to make > Firewatir platform independent. Only 'alert' and 'confirm' javascript > pop ups are supported as of now. We are looking into the > alternatives/solutions were we can support other dialogs like Save > File etc Of course, any user can choose to use AutoIt3 with Firefox. It will work (on windows). Bret From paul.rogers at shaw.ca Mon Apr 30 13:07:19 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 30 Apr 2007 11:07:19 -0600 Subject: [Wtr-general] Watir - Scrpting issues with Dynamic HTML In-Reply-To: <26653912.6561177952309972.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <26653912.6561177952309972.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: we'd need to see the html you are trying to access if we are to provide suggestions on what you need to try Paul ----- Original Message ----- From: Anna Date: Monday, April 30, 2007 10:57 am Subject: Re: [Wtr-general] Watir - Scrpting issues with Dynamic HTML > Paul, > > Please can you direct me with this issue. > > Thanks, > anna > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Mon Apr 30 13:10:52 2007 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 30 Apr 2007 12:10:52 -0500 Subject: [Wtr-general] Replies and Threads In-Reply-To: <7523f5800704292243uc5c6f60wef1789b8f1506b2f@mail.gmail.com> References: <7523f5800704292243uc5c6f60wef1789b8f1506b2f@mail.gmail.com> Message-ID: <4636231C.6080605@pettichord.com> SHALINI GUPTA wrote: > PLEASE HELP ITS VERY URGENT.. Shalini, I have noticed many posts from you. I am tending to ignore many of your pleas for a simple reason that you may not be aware of. I use a threaded mail reader to read the posts on this list (Thunderbird). For some reason, your posts are all coming across as new posts, and are not being threaded. Because they are not in a thread, i cannot easily tell whether they have already been responded to or not. I am letting you know this because i suspect that other members of this list are also using threaded email readers. With most email programs, if you reply to a message, it will mark the message as part of a thread. I can't say whether the problem with your emails is due to your email reader itself, or the way that you are using it. Bret From forum-watir-users at openqa.org Mon Apr 30 13:18:21 2007 From: forum-watir-users at openqa.org (Anna) Date: Mon, 30 Apr 2007 12:18:21 CDT Subject: [Wtr-general] Watir - Scrpting issues with Dynamic HTML In-Reply-To: Message-ID: <33970025.6671177953531800.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> paul, Example website is --> www.ceridian.com >From there we have DHTML menus available. you can pick any menu items. i hope this helps to direct me. Thanks, Anna From paul.rogers at shaw.ca Mon Apr 30 13:44:57 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 30 Apr 2007 11:44:57 -0600 Subject: [Wtr-general] Watir - Scrpting issues with Dynamic HTML In-Reply-To: <33970025.6671177953531800.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <33970025.6671177953531800.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: not really, I dont want to have to go through all the stuff on your web site. I'm happy to try and help, but I need to see the HTML you are trying to access, the code you are using, and any exceptions that occur Paul ----- Original Message ----- From: Anna Date: Monday, April 30, 2007 11:18 am Subject: Re: [Wtr-general] Watir - Scrpting issues with Dynamic HTML > paul, > > Example website is --> www.ceridian.com > >From there we have DHTML menus available. you can pick any menu > items. i hope this helps to direct me. > > Thanks, > > Anna > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From charley.baker at gmail.com Mon Apr 30 14:09:18 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 30 Apr 2007 12:09:18 -0600 Subject: [Wtr-general] Watir - Scrpting issues with Dynamic HTML In-Reply-To: References: <33970025.6671177953531800.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: The main dhtml menu is pretty straighforward using Watir 1.5.1: require 'watir' include Watir ie = IE.start('http://www.ceridian.com/') ie.table(:id, 'STM0_0__5___').fire_event('onmouseover') ie.cell(:id, 'STM0_5__1___MTD').click -Charley On 4/30/07, Paul Rogers wrote: > > not really, > > I dont want to have to go through all the stuff on your web site. > > I'm happy to try and help, but I need to see the HTML you are trying to > access, the code you are using, and any exceptions that occur > > Paul > > ----- Original Message ----- > From: Anna > Date: Monday, April 30, 2007 11:18 am > Subject: Re: [Wtr-general] Watir - Scrpting issues with Dynamic HTML > > > paul, > > > > Example website is --> www.ceridian.com > > >From there we have DHTML menus available. you can pick any menu > > items. i hope this helps to direct me. > > > > Thanks, > > > > Anna > > _______________________________________________ > > 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/20070430/c3ce9599/attachment.html From forum-watir-users at openqa.org Mon Apr 30 14:09:00 2007 From: forum-watir-users at openqa.org (Anna) Date: Mon, 30 Apr 2007 13:09:00 CDT Subject: [Wtr-general] Watir - Scrpting issues with Dynamic HTML In-Reply-To: Message-ID: <32383245.6781177956570591.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Paul, This is what watir recorder is returning when i record the menu item News menu. ie.goto('http://www.ceridian.com/corp/nav/1,2869,10923,00.html') --> when i playback. it is directly opening the page from the url. but i need to click on the menu item and open through the menu. ( how the real user does). This is what i used to click ie.Link(:text, /"News"/).fire_event("onmouseover") Recieved this error Watir::Exception::UnknownObjectException: Unable to locate object, using text and (?-mix:Self line by customer) c:/ruby/lib/ruby/gems/1.8/gems/watir- 1.5.1.1164/./watir.rb:2414:in `assert_exists' c:/ruby/lib/ruby/gems/1.8/gems/watir- 1.5.1.1164/./watir.rb:2643:in `enabled?' c:/ruby/lib/ruby/gems/1.8/gems/watir- 1.5.1.1164/./watir.rb:2418:in `assert_enabled' c:/ruby/lib/ruby/gems/1.8/gems/watir- 1.5.1.1164/./watir.rb:2613:in `fireEvent' Portal.rb:24:in `test_recorded' FYI --> Same issue i solved with Rtaional Robot Using Low level recording. Not always rely on this utility. Please hep me. Thanks, anna From forum-watir-users at openqa.org Mon Apr 30 14:33:19 2007 From: forum-watir-users at openqa.org (annapurna) Date: Mon, 30 Apr 2007 13:33:19 CDT Subject: [Wtr-general] Watir - Scrpting issues with Dynamic HTML In-Reply-To: Message-ID: <32239719.7161177958029084.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Charley, what is this mean --> 'STM0_0__5___ any keyword identification in watir. i am very new to this tool. please help me Thanks, anna From forum-watir-users at openqa.org Mon Apr 30 14:35:42 2007 From: forum-watir-users at openqa.org (shqy) Date: Mon, 30 Apr 2007 13:35:42 CDT Subject: [Wtr-general] Why ie.span(:name,"..").click no use? In-Reply-To: <28777351.681177874922309.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <34219950.7221177958172217.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> OH,I solved the problem,thanks a lot! From forum-watir-users at openqa.org Mon Apr 30 14:52:24 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Mon, 30 Apr 2007 13:52:24 CDT Subject: [Wtr-general] Cannot run example test case In-Reply-To: <37095361.33131177720180746.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <34679095.7281177959174897.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks Charley! I download Watir from another link and installed it. It is working now. Kui From forum-watir-users at openqa.org Mon Apr 30 15:11:17 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Mon, 30 Apr 2007 14:11:17 CDT Subject: [Wtr-general] Unable to locate object Message-ID: <30932306.7341177960307063.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello, I just started to write a test script below. When run the script, I always received error message: C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists': Unable to locate object. HTML source is attached. What did I missing here? Should I be able to use smokeId to identify the elements? Please help. Thanks! Kui require 'watir' test_site = 'http://xxxxx' ie = Watir::IE.new ie.goto(test_site) sleep(5) ie.text_field(:label, "Username").set("aa") ie.text_field(:text, "Password").set("bb") ie.button(:smokeId, "submit").click Source:       From forum-watir-users at openqa.org Mon Apr 30 15:40:06 2007 From: forum-watir-users at openqa.org (annapurna) Date: Mon, 30 Apr 2007 14:40:06 CDT Subject: [Wtr-general] Watir - Scrpting issues with Dynamic HTML In-Reply-To: <32239719.7161177958029084.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <28300766.8041177962036740.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Charley, where did you captured this info. 'STM0_0__5___ can you explain to how to do it. thanks, anna From charley.baker at gmail.com Mon Apr 30 15:49:42 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 30 Apr 2007 13:49:42 -0600 Subject: [Wtr-general] Watir - Scrpting issues with Dynamic HTML In-Reply-To: <28300766.8041177962036740.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32239719.7161177958029084.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <28300766.8041177962036740.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: This is the id I got off of that control in your menus using ie developer toolbar: http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en Watir works off of how and what. How would you like to access a dom element? What can you use to identify it? ie.div(:how, 'what').click In this case the how is :id and the what is the string. Clicked on the menu and refreshed the toolbar, find element by click and clicked on the open menu item. We should probably add examples like this to the User Guide. -Charley On 4/30/07, annapurna wrote: > > Charley, > > where did you captured this info. 'STM0_0__5___ > > can you explain to how to do it. > > thanks, > anna > _______________________________________________ > 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/20070430/89956c53/attachment.html From charley.baker at gmail.com Mon Apr 30 15:58:11 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 30 Apr 2007 13:58:11 -0600 Subject: [Wtr-general] Unable to locate object In-Reply-To: <30932306.7341177960307063.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30932306.7341177960307063.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: smokeid means nothing in standard dom. You can use :text to identify the control. Watir works off of standard html attributes and the DOM, this is some sort of custom attribute. This should work. ie.button(:text, 'Login').click -Charley On 4/30/07, Kui Zhang wrote: > > Hello, > > I just started to write a test script below. When run the script, I > always received error message: > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists': Unable to > locate object. HTML source is attached. > > What did I missing here? Should I be able to use smokeId to identify the > elements? Please help. > > Thanks! > Kui > > require 'watir' > > test_site = 'http://xxxxx' > > ie = Watir::IE.new > > ie.goto(test_site) > > sleep(5) > > ie.text_field(:label, "Username").set("aa") > ie.text_field(:text, "Password").set("bb") > > ie.button(:smokeId, "submit").click > > > Source: > smokeId="__msgs__">  class="login-input-label">Username type="text" name="1_2" id="1_2" smokeId="username" label="Username" value="" > onChange="if (EventHandlers.valueChanged(this)==false) return false;" > onKeyDown="DHTML.cancelBubbleIfNoAltKeyOrEnter();" contenteditable="true" > delayOnChange="false" class="txt" style="text-align: left" size="20" > helpText="__UseTitle__" onfocus="EventHandlers.onFocus()" onblur=" > EventHandlers.onBlur()"> >   class="login-input-label">Password value="" type="password" class="txt" smokeId="password" id="1_3" > helpText="__UseTitle__" delayOnChange="false" label="Password" onfocus=" > EventHandlers.onFocus()" onChange="if (EventHandlers.valueChanged(this)==false) > return false;" size="20" name="1_3" onblur="EventHandlers.onBlur > ()"> >   > _______________________________________________ > 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/20070430/d7abe515/attachment-0001.html From forum-watir-users at openqa.org Mon Apr 30 16:20:36 2007 From: forum-watir-users at openqa.org (annapurna) Date: Mon, 30 Apr 2007 15:20:36 CDT Subject: [Wtr-general] Watir - Scrpting issues with Dynamic HTML In-Reply-To: Message-ID: <30423358.8201177964466242.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you very much. i dd downloaded the IE-toolbar. just now i will run and see. Anna From charley.baker at gmail.com Mon Apr 30 16:28:02 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 30 Apr 2007 14:28:02 -0600 Subject: [Wtr-general] How to unzip the zip file using watir/ruby script In-Reply-To: References: Message-ID: There's rubyzip library on sourceforge.net which you might look into: http://sourceforge.net/projects/rubyzip -Charley On 4/28/07, jhe wrote: > > Dear all, > > > > I want to extract the content from the winzip file by water/ruby script, > which of the following command could achieve the goal, > > exec, syscall, system, or anything else? > > > > Thanks in advance. > > Jason > > > > _______________________________________________ > 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/20070430/cba76977/attachment.html From forum-watir-users at openqa.org Mon Apr 30 17:19:13 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Mon, 30 Apr 2007 16:19:13 CDT Subject: [Wtr-general] Unable to locate object In-Reply-To: <30932306.7341177960307063.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <38929463.8641177967983046.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks Charley for the quick response! I tried with your suggestion (ie.button(:text, ?Login?).click) and still received the same error message. Here is DOM for the login button. I also tried with the ie.form(:name, ?mainForm?).button(:text, ?Login?).click. Not working. Anything I can try? Really appreciate your help! Kui
From forum-watir-users at openqa.org Mon Apr 30 17:47:54 2007 From: forum-watir-users at openqa.org (annapurna) Date: Mon, 30 Apr 2007 16:47:54 CDT Subject: [Wtr-general] Watir - Scrpting issues with Dynamic HTML In-Reply-To: <32239719.7161177958029084.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <31073051.8701177969704442.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you very much Charley for you rhelp. This helps us a lot. Anna From charley.baker at gmail.com Mon Apr 30 18:18:38 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 30 Apr 2007 16:18:38 -0600 Subject: [Wtr-general] Unable to locate object In-Reply-To: <38929463.8641177967983046.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30932306.7341177960307063.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <38929463.8641177967983046.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Install the latest gem for Watir 1.5.1 and try it again if you can . Here's a link for how to do just that: http://wiki.openqa.org/display/WTR/Development+Builds Follow the instructions on the right pane To Install. -Charley On 4/30/07, Kui Zhang wrote: > > Thanks Charley for the quick response! > I tried with your suggestion (ie.button(:text, ?Login?).click) and still > received the same error message. > > Here is DOM for the login button. I also tried with the ie.form(:name, > ?mainForm?).button(:text, ?Login?).click. Not working. Anything I can try? > > Really appreciate your help! > Kui > > http-equiv="Content-Type" content="text/html; charset=utf-8"> > > SogouAutoLinkDoc>
method="post"> cellPadding="0" width="100%" border="0">
vAlign="top" width="100%" height="100%">
style="Z-INDEX: 10; LEFT: 0px; POSITION: absolute; TOP: 36px"> cellSpacing="0" cellPadding="0" width="100%">
class="login-table" cellSpacing="0" cellPadding="0" width="600" > align="center">
> _______________________________________________ > 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/20070430/b22287f9/attachment.html From forum-watir-users at openqa.org Mon Apr 30 19:28:29 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Mon, 30 Apr 2007 18:28:29 CDT Subject: [Wtr-general] Unable to locate object In-Reply-To: Message-ID: <32061209.9341177975739166.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Charley, Follow your instruction, installed the latest Watir gem. It works now! One question, if I installed the Watir gem, does this include autoit which I need to use in the testing? Or how to check if the autoit is installed with Watir? Thanks so much for your help. Kui From charley.baker at gmail.com Mon Apr 30 19:37:48 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 30 Apr 2007 17:37:48 -0600 Subject: [Wtr-general] Unable to locate object In-Reply-To: <32061209.9341177975739166.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32061209.9341177975739166.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Yep, we still include autoit. -c On 4/30/07, Kui Zhang wrote: > > Hi Charley, > > Follow your instruction, installed the latest Watir gem. It works now! > > One question, if I installed the Watir gem, does this include autoit which > I need to use in the testing? Or how to check if the autoit is installed > with Watir? > > Thanks so much for your help. > > Kui > _______________________________________________ > 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/20070430/d7a4af8e/attachment.html From forum-watir-users at openqa.org Mon Apr 30 20:21:35 2007 From: forum-watir-users at openqa.org (alan) Date: Mon, 30 Apr 2007 19:21:35 CDT Subject: [Wtr-general] manipulating dos prompt with watir Message-ID: <31000054.9721177978925633.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> In my watir script i would like to have it go to open a dos command window and start sqlplus, then run a simple query to see if a member exists, the flow would be something like: open cmd.exe log in as name at data09 pass the password somewhere around here do query select * from members where name = 'testername' if cmd contains(testername) puts 'yay' else puts 'drat' end is this easily done? so far after spending most of the day in google and trying some different ideas I still have nothing. suggestions? i'm new to sql and watir, but since i did make watir send results to and excel file I figure this must also be doable. From forum-watir-users at openqa.org Mon Apr 30 20:24:45 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Mon, 30 Apr 2007 19:24:45 CDT Subject: [Wtr-general] Unable to locate object In-Reply-To: <30932306.7341177960307063.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <38321972.9781177979115598.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Charley, I installed latest gem, the test case ran fine. Then, I restarted IntelliJ, now when run the test, IE browser is not open. It is the same in the irb command line window. Is there something I need to change? Thanks. Kui From christopher.mcmahon at gmail.com Mon Apr 30 21:37:47 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 30 Apr 2007 19:37:47 -0600 Subject: [Wtr-general] manipulating dos prompt with watir In-Reply-To: <31000054.9721177978925633.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <31000054.9721177978925633.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70704301837q714a4835n374e7f15d61cfda2@mail.gmail.com> Look up ruby "system" or "exec" commands. Also consider connecting to the DB directly with ODBC or DBI. -Chris On 4/30/07, alan wrote: > In my watir script i would like to have it go to open a dos command window and start sqlplus, then run a simple query to see if a member exists, the flow would be something like: > open cmd.exe > log in as name at data09 > pass the password somewhere around here > do query select * from members where name = 'testername' > if cmd contains(testername) > puts 'yay' > else > puts 'drat' > end > > is this easily done? so far after spending most of the day in google and trying some different ideas I still have nothing. suggestions? > i'm new to sql and watir, but since i did make watir send results to and excel file I figure this must also be doable. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Mon Apr 30 21:44:39 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 30 Apr 2007 19:44:39 -0600 Subject: [Wtr-general] manipulating dos prompt with watir In-Reply-To: <31000054.9721177978925633.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <31000054.9721177978925633.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: you dont need to use sqlplus - use the ruby dbi module ----- Original Message ----- From: alan Date: Monday, April 30, 2007 6:21 pm Subject: [Wtr-general] manipulating dos prompt with watir > In my watir script i would like to have it go to open a dos > command window and start sqlplus, then run a simple query to see > if a member exists, the flow would be something like: > open cmd.exe > log in as name at data09 > pass the password somewhere around here > do query select * from members where name = 'testername' > if cmd contains(testername) > puts 'yay' > else > puts 'drat' > end > > is this easily done? so far after spending most of the day in > google and trying some different ideas I still have nothing. > suggestions?i'm new to sql and watir, but since i did make watir > send results to and excel file I figure this must also be doable. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general >