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