From WKruse at multichoice.co.za Wed Nov 1 07:19:22 2006 From: WKruse at multichoice.co.za (Walter Kruse) Date: Wed, 1 Nov 2006 14:19:22 +0200 Subject: [Wtr-general] IE with no address bar Message-ID: Hi guys I apologise if this is documented somewhere - I've searched the mailing list, the guide and the unit tests. Our app opens a new, maximised, addressbar-less browser window upon login, where the whole application is used. What is the right way to attach to this window / browser instance ? Thanks in advance Walter Kruse Senior Test Analyst www.OBS-Consulting.com 082 660 7288 http://www.ou-ryperd.net ************************************************************************************************************************** Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and destroy the original message. ************************************************************************************************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061101/e6a685d3/attachment.html From herr.kreutzer at googlemail.com Wed Nov 1 08:13:28 2006 From: herr.kreutzer at googlemail.com (Christian Kreutzer) Date: Wed, 1 Nov 2006 14:13:28 +0100 Subject: [Wtr-general] IE with no address bar In-Reply-To: References: Message-ID: <81FF5248-F75D-47D8-82CC-EF393E4F8B70@googlemail.com> hi Walter, @ie = Watir::IE.attach(:title, /title-of-webpage-as-regexp-here/) should work just fine Christian Am 01.11.2006 um 13:19 schrieb Walter Kruse: > Hi guys > > I apologise if this is documented somewhere ? I?ve searched the > mailing list, the guide and the unit tests. > > > > Our app opens a new, maximised, addressbar-less browser window upon > login, where the whole application is used. What is the right way > to attach to this window / browser instance ? > > > > Thanks in advance > > > > Walter Kruse > > Senior Test Analyst > > www.OBS-Consulting.com > > 082 660 7288 > > http://www.ou-ryperd.net > > > > ********************************************************************** > *********************************************** > Everything in this e-mail and attachments relating to the official > business of MultiChoice Africa is proprietary to the company. Any > view or opinion expressed in this message may be the view of the > individual and should not automatically be ascribed to the > company. If you are not the intended recipient, you may not > peruse, use, disseminate, distribute or copy this message. If you > have received this message in error, please notify the sender > immediately by email, facsimile or telephone and destroy the > original message. > ********************************************************************** > *********************************************** > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From WKruse at multichoice.co.za Wed Nov 1 09:51:12 2006 From: WKruse at multichoice.co.za (Walter Kruse) Date: Wed, 1 Nov 2006 16:51:12 +0200 Subject: [Wtr-general] IE with no address bar In-Reply-To: <81FF5248-F75D-47D8-82CC-EF393E4F8B70@googlemail.com> Message-ID: Hi Christian I use: ie_new = ie.attach(:title, /MultiChoice Customer Care/) and I get: undefined method `attach' for # (NoMethodError) -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Christian Kreutzer Sent: 01 November 2006 03:13 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] IE with no address bar hi Walter, @ie = Watir::IE.attach(:title, /title-of-webpage-as-regexp-here/) should work just fine Christian Am 01.11.2006 um 13:19 schrieb Walter Kruse: > Hi guys > > I apologise if this is documented somewhere - I've searched the > mailing list, the guide and the unit tests. > > > > Our app opens a new, maximised, addressbar-less browser window upon > login, where the whole application is used. What is the right way > to attach to this window / browser instance ? > > > > Thanks in advance > > > > Walter Kruse > > Senior Test Analyst > > www.OBS-Consulting.com > > 082 660 7288 > > http://www.ou-ryperd.net > > > > ********************************************************************** > *********************************************** > Everything in this e-mail and attachments relating to the official > business of MultiChoice Africa is proprietary to the company. Any > view or opinion expressed in this message may be the view of the > individual and should not automatically be ascribed to the > company. If you are not the intended recipient, you may not > peruse, use, disseminate, distribute or copy this message. If you > have received this message in error, please notify the sender > immediately by email, facsimile or telephone and destroy the > original message. > ********************************************************************** > *********************************************** > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ************************************************************************************************************************** Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and destroy the original message. ************************************************************************************************************************** From mrussell at inpses.co.uk Wed Nov 1 12:00:02 2006 From: mrussell at inpses.co.uk (Max Russell) Date: Wed, 1 Nov 2006 17:00:02 -0000 Subject: [Wtr-general] Listener Message-ID: Where am I going wrong here? require 'test/unit' require 'watir' require 'observer' class Watir::IE def run_script(js) ie.Document.parentWindow.execScript(js) end end class Dragdiv include Observable def run ie.frame("main").run_script("document.blah = document.createEventObject(); document.blah.button = 1") ie.frame("main").run_script("document.getElementById('10439,10439').fire Event('onmousedown', document.blah)") ie.frame("main").run_script("document.blah = document.createEventObject(); document.blah.clientX = document.getElementById('search_results'); document.blah.clientY = document.getElementById('search_results')")#.offsetLeft .offsetTop ie.frame("main").run_script("document.getElementById('10439,10439').fire Event('onmousemove', document.blah)") ie.frame("main").run_script("document.getElementById('10439,10439').fire Event('onmouseup', document.blah)") changed notify_observers(TestWatir) end end class TestWatir < Test::Unit::TestCase #def initialize(dragdiv) # dragdiv.add_observer(self) #end def test_drag_and_drop ie = Watir::IE.start('http://) #ie.maximize ie.frame("main").text_field(:name, "username").set("") ie.frame("main").text_field(:name, "password").set("") ie.frame("main").select_list(:name, "ldapDir").select("") ie.frame("main").button(:name, "Login").click #expand the admin node ie.frame("left").link(:index, 35).click #click on the data management link ie.frame("left").link(:index, 54).click #Enter a search string into the search field. ie.frame("main").text_field(:id, "Search_box").set("B") #Click to search ie.frame("main").button(:id, "btn_search").click dragdiv = Dragdiv.new dragdiv.add_observer(self) dragdiv.run update end end I have been trying to set up an observer so that I can wait for the drag drop action to occur.... (Actually, maybe this should really be for the main ruby mailing list...) Max Russell test Analyst. InPS Tel: 01382 223900 Fax: 01382 204488 Visit our Web site at www.inps.co.uk The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of In Practice Systems Limited or any of its affiliates. If you are not the intended recipient please contact is.helpdesk at inps.co.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061101/09bdf756/attachment-0001.html From herr.kreutzer at googlemail.com Wed Nov 1 13:33:50 2006 From: herr.kreutzer at googlemail.com (Christian Kreutzer) Date: Wed, 1 Nov 2006 19:33:50 +0100 Subject: [Wtr-general] IE with no address bar In-Reply-To: References: Message-ID: <22A171CA-4560-4FEF-809E-C8BFCB5939FD@googlemail.com> Hi, it seems like you are trying to invoke the static method 'attach' on an instance of Watir::IE. try the following instead: ie_new = Watir::IE.attach(:title, /MultiChoice Customer Care/) Christian Am 01.11.2006 um 15:51 schrieb Walter Kruse: > Hi Christian > > I use: > ie_new = ie.attach(:title, /MultiChoice Customer Care/) > > and I get: > undefined method `attach' for # (NoMethodError) > > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Christian > Kreutzer > Sent: 01 November 2006 03:13 PM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] IE with no address bar > > hi Walter, > > @ie = Watir::IE.attach(:title, /title-of-webpage-as-regexp-here/) > should work just fine > > Christian > > Am 01.11.2006 um 13:19 schrieb Walter Kruse: > >> Hi guys >> >> I apologise if this is documented somewhere - I've searched the >> mailing list, the guide and the unit tests. >> >> >> >> Our app opens a new, maximised, addressbar-less browser window upon >> login, where the whole application is used. What is the right way >> to attach to this window / browser instance ? >> >> >> >> Thanks in advance >> >> >> >> Walter Kruse >> >> Senior Test Analyst >> >> www.OBS-Consulting.com >> >> 082 660 7288 >> >> http://www.ou-ryperd.net >> >> >> >> ********************************************************************* >> * > >> *********************************************** >> Everything in this e-mail and attachments relating to the official >> business of MultiChoice Africa is proprietary to the company. Any >> view or opinion expressed in this message may be the view of the >> individual and should not automatically be ascribed to the >> company. If you are not the intended recipient, you may not >> peruse, use, disseminate, distribute or copy this message. If you >> have received this message in error, please notify the sender >> immediately by email, facsimile or telephone and destroy the >> original message. >> ********************************************************************* >> * > >> *********************************************** >> _______________________________________________ >> Wtr-general mailing list >> Wtr-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > ********************************************************************** > **************************************************** > Everything in this e-mail and attachments relating to the official > business of MultiChoice Africa is proprietary to > the company. Any view or opinion expressed in this message may be > the view of the individual and should not automatically > be ascribed to the company. If you are not the intended recipient, > you may not peruse, use, disseminate, distribute or > copy this message. If you have received this message in error, > please notify the sender immediately by email, facsimile > or telephone and destroy the original message. > ********************************************************************** > **************************************************** > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From vikashkumar051 at yahoo.co.in Thu Nov 2 08:26:30 2006 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Thu, 2 Nov 2006 18:56:30 +0530 (IST) Subject: [Wtr-general] Problem in accessing table data Message-ID: <20061102132630.10799.qmail@web7815.mail.in.yahoo.com> I want to access the value stores in nested table. I am unable to do it, please send me the solution for this. I am using a table:
   
 
name vikash
roll 30
I want to store the value, name=vikash and roll=30 in a excel file, what should be the solution for this. Thanks in advance __________________________________________________________ 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/20061102/00abff15/attachment.html From forum-watir-users at openqa.org Thu Nov 2 16:46:17 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Thu, 02 Nov 2006 15:46:17 CST Subject: [Wtr-general] Recover from IE crash? Message-ID: <43534815.1162504007282.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I seem to have found a way of crashing IE during my testing (something I do makes it happen, though I have never done it in a manual way). Is there a way to recover from this? (IE, can I close the dialog that asks me to debug it?) Message was edited by: jlolis --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5069&messageID=14104#14104 From bret at pettichord.com Thu Nov 2 21:13:04 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 02 Nov 2006 20:13:04 -0600 Subject: [Wtr-general] Hacking Ruby Message-ID: <454AA5B0.4030004@pettichord.com> Here is a nice description of how to use Ruby to create a simplified dialect for Watir. http://substantiality.net/articles/2006/11/02/i-replaced-myself-with-a-small-ruby-script From christopher.mcmahon at gmail.com Thu Nov 2 23:21:04 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 2 Nov 2006 20:21:04 -0800 Subject: [Wtr-general] Hacking Ruby In-Reply-To: <454AA5B0.4030004@pettichord.com> References: <454AA5B0.4030004@pettichord.com> Message-ID: <72799cd70611022021t32a77b9fsfaac68ec3525ee3d@mail.gmail.com> Fun! I'm just starting to wrap my head around metaprogramming, which is what that example is doing. I think . :) On 11/2/06, Bret Pettichord wrote: > > Here is a nice description of how to use Ruby to create a simplified > dialect for Watir. > > > http://substantiality.net/articles/2006/11/02/i-replaced-myself-with-a-small-ruby-script > _______________________________________________ > 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/20061102/b72faa65/attachment.html From phlip2005 at gmail.com Fri Nov 3 00:58:20 2006 From: phlip2005 at gmail.com (Phlip) Date: Thu, 2 Nov 2006 21:58:20 -0800 Subject: [Wtr-general] screenshots References: <62685743.1162342490665.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <032201c6ff0d$12475400$81a1b04c@Marley> Egil Sorensen wrote: > You write that for your third option (using getHTML) that you won't get > the Internet Explorer's DOM in its exact visual state. If I were insanely pursuing that option, I would try to get things like the little floating
in GMail that points down to the name of the next thread author. That's just a goal; for now I'm only curious about grabbing whatever's easy! Here's some Q and A about your lines... > require 'jcode' Uh, Japanese? > file_name = "#{basename}_#{sprintf("%03d",no)}.html" # ex.: > watir_pagecapture_001.html Parenthetically, my test rig names each snapshot after the title of the test case. Next, I will convert this file into a PNG using a little program I wrote called snapshot.exe. So others will need the above code, but I will just nab a temporary HTML and give the PNG file the final name. > html = ie.document.body.parentelement.outerhtml Kewl. The outermost DOM thing, regardless what it thinks its type or name is! > html.sub!(//i,"\n\n") I worked-around that by sticking the BASE HREF at the front of the file, outside the . This will rely on (shocked gasp) browser forgiveness! But my snapshot.exe doesn't care... > html.sub!('', > '') Oookay. The only problem I can think of there is HTML is _already_ UTF-8 unless you specify otherwise, so either your browser dislikes redundancy, or something else is going on! In conclusion, thanks! I will replace the getHTML with that, to force a more accurate snapshot. -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! From aidy.lewis at googlemail.com Fri Nov 3 05:40:41 2006 From: aidy.lewis at googlemail.com (aidy lewis) Date: Fri, 3 Nov 2006 02:40:41 -0800 Subject: [Wtr-general] Hacking Ruby In-Reply-To: <72799cd70611022021t32a77b9fsfaac68ec3525ee3d@mail.gmail.com> References: <454AA5B0.4030004@pettichord.com> <72799cd70611022021t32a77b9fsfaac68ec3525ee3d@mail.gmail.com> Message-ID: <7ac2300c0611030240t1d551e8fp75d0e572151ffa05@mail.gmail.com> Bret, Chris are we saying as a community that we are aiming for dsl's with watir? and are we saying that this can only relate to one's own project? aidy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061103/97ead2c7/attachment.html From herr.kreutzer at googlemail.com Fri Nov 3 07:51:14 2006 From: herr.kreutzer at googlemail.com (Christian Kreutzer) Date: Fri, 3 Nov 2006 13:51:14 +0100 Subject: [Wtr-general] Hacking Ruby In-Reply-To: <7ac2300c0611030240t1d551e8fp75d0e572151ffa05@mail.gmail.com> References: <454AA5B0.4030004@pettichord.com> <72799cd70611022021t32a77b9fsfaac68ec3525ee3d@mail.gmail.com> <7ac2300c0611030240t1d551e8fp75d0e572151ffa05@mail.gmail.com> Message-ID: > are we saying as a community that we are aiming for dsl's with watir? and > are we saying that this can only relate to one's own project? in my opinion a DSL is not only related to specific project. a DSL for testing webapps has to deal with 3 domains: - the web domain (navigating the browser, clicking links,...) - the test domain (assertions/verifications and the test verdict) - the SUT domain <-- for me only this part can be related to a specific project. if you test standard software (sap, siebel, or some like that) it may not be limited to your own project only. Christian From forum-watir-users at openqa.org Fri Nov 3 08:17:52 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Fri, 03 Nov 2006 07:17:52 CST Subject: [Wtr-general] Hacking Ruby In-Reply-To: <454AA5B0.4030004@pettichord.com> Message-ID: <49206519.1162559902059.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> very cool! I have been wondering how to do something like this, and it makes so much sense now. thanks! --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5072&messageID=14118#14118 From mrussell at inpses.co.uk Fri Nov 3 09:15:44 2006 From: mrussell at inpses.co.uk (Max Russell) Date: Fri, 3 Nov 2006 14:15:44 -0000 Subject: [Wtr-general] Harness question Message-ID: I'm trying to get my harness to read in tests from a list... $LOAD_PATH << '..\Tests\\' class TestSuite < Test::Unit::TestCase testlist = File.open('testlist.txt') testlist.each_line{ |line| load line } what I find happens is that it fails to iterate through tests. How do I let the harness know it should execute a test, wait, then execute another? Max Russell test Analyst. InPS Tel: 01382 223900 Fax: 01382 204488 Visit our Web site at www.inps.co.uk The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of In Practice Systems Limited or any of its affiliates. If you are not the intended recipient please contact is.helpdesk at inps.co.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061103/aadbf0d2/attachment-0001.html From christopher.mcmahon at gmail.com Fri Nov 3 10:52:51 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 3 Nov 2006 07:52:51 -0800 Subject: [Wtr-general] Hacking Ruby In-Reply-To: <7ac2300c0611030240t1d551e8fp75d0e572151ffa05@mail.gmail.com> References: <454AA5B0.4030004@pettichord.com> <72799cd70611022021t32a77b9fsfaac68ec3525ee3d@mail.gmail.com> <7ac2300c0611030240t1d551e8fp75d0e572151ffa05@mail.gmail.com> Message-ID: <72799cd70611030752n1106f3n7597abcf2fb8e44a@mail.gmail.com> > are we saying as a community that we are aiming for dsl's with watir? and > are we saying that this can only relate to one's own project? > Not at all. The little example in the link just shows that this person understood what he needed to do in a certain way, and he could easily make that little bit of his own domain accessible, using Watir/Ruby to do it. It's actually much harder to do that in other languages: http://blogs.pragprog.com/cgi-bin/pragdave.cgi/Tech/UnsetGlue.html -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061103/d92c58ae/attachment.html From christopher.mcmahon at gmail.com Fri Nov 3 11:00:32 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 3 Nov 2006 08:00:32 -0800 Subject: [Wtr-general] Harness question In-Reply-To: References: Message-ID: <72799cd70611030800q270e17d3n254ed33ca6a519ca@mail.gmail.com> > I'm trying to get my harness to read in tests from a list? > > $LOAD_PATH << '..\Tests\\' > > class TestSuite < Test::Unit::TestCase > > testlist = File.open('testlist.txt') > > testlist.each_line{ |line| load line } > > what I find happens is that it fails to iterate through tests. How do I > let the harness know it should execute a test, wait, then execute another? > In a nutshell, this doesn't work because a TestSuite is an object that has some particular properties, not an array of lines from a file. If you really need a TestSuite object, I'll send you to the test/unit documentation. If you really just want to run each test file one after another, the canonical way is something like (assume all of the test files are in a single directory and start with the string "test"): topdir = File.join(File.dirname(__FILE__)) Dir.chdir topdir do tests = Dir["test*"] tests.each{|x| require x} end Dir[] creates an array of files that match the criteria specified in the the argument. Then you iterate over that list, require-ing each file. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061103/dcd0d46c/attachment.html From zeljko.filipin at gmail.com Fri Nov 3 11:01:54 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 3 Nov 2006 17:01:54 +0100 Subject: [Wtr-general] Problem in accessing table data In-Reply-To: <20061102132630.10799.qmail@web7815.mail.in.yahoo.com> References: <20061102132630.10799.qmail@web7815.mail.in.yahoo.com> Message-ID: You can get values from table like this. irb(main):008:0> ie.table(:index, 2)[1][1].text => "name" irb(main):009:0> ie.table(:index, 2)[1][2].text => "vikash" irb(main):010:0> ie.table(:index, 2)[2][1].text => "roll" irb(main):011:0> ie.table(:index, 2)[2][2].text => "30" For Excel, take a look at http://wiki.rubygarden.org/Ruby/page/show/ScriptingExcel. If simple solution would do it, you can just save file as csv, and Excel can read it. Zeljko -- http://zeljkofilipin.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061103/99c2ba0b/attachment.html From forum-watir-users at openqa.org Fri Nov 3 10:59:54 2006 From: forum-watir-users at openqa.org (Ralica Nacheva) Date: Fri, 03 Nov 2006 09:59:54 CST Subject: [Wtr-general] Test suites in Watir problem Message-ID: <53202453.1162570464139.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello, I am quite new to Ruby and Watir I started writing some test cases and I wanted to try to tie them into a test suite but unfortunately the example shown in http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/ doesn't work for me. My test suite is very simple - just for trying out. It has to execute two test cases - login and logout, but when I execute it I get the following errors: C:\watir-v1_4\myTests>ruby mybox_suite.rb c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_re quire': no such file to load -- unittests/setup (LoadError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re quire' from ./mybox_login1.rb:15 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re quire' from mybox_suite.rb:6 I'd like to get some explanation about how to write test cases, which can be run separately and tied into a test suite. I have been reading for couple of days articles and posts from blogs, forums, documentatin , etc., but I haven't found a solution. Here is the content of my test suite: require 'test/unit/testsuite' require 'mybox_login1' require 'mybox_logout1' class TS_MyTests def self.suite suite = Test::Unit::TestSuite.new suite << TC_MYBOX_Login.suite suite << TC_MYBOX_Logout.suite return suite end end And here is for example the login test: $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ require 'unittests/setup' require 'test/unit' require 'watir/WindowHelper' require 'watir' require "mysql" class TC_MYBOX_Login < Test::Unit::TestCase include Watir # set variables $host = '192.168.0.1' - this is a fake host I'm using another in the true test $user_login = 'test_demo' def test_login() # set variables user_pass = '123'; test_site = 'http://'+ $host # print some comments puts "## Beginning of test: 'Mybox Login'" puts " " puts "Step 1: go to the test site: " + test_site $ie.goto(test_site) puts "Step 2: enter '"+$user_login+"' in login field" $ie.text_field(:name, "login").set($user_login) puts "Step 3: enter '"+user_pass+"' in password field" $ie.text_field(:name, "password").set(user_pass) sleep 1 puts "Step 4: click the 'Login' button" $ie.button(:name, "login_button").click puts "Expected Result: " puts "Actual Result: Check that the 'Log Out' link appears on the results page" assert($ie.contains_text("Log Out")) end end When I comment the "require unittests/setup". Then I get: 1) Error: test_login(TC_MYBOX_Login): NoMethodError: undefined method `goto' for nil:NilClass ./mybox_login1.rb:39:in `test_login' 2) Error: test_logout(TC_MYBOX_Logout): NoMethodError: undefined method `goto' for nil:NilClass ./mybox_logout1.rb:51:in `test_logout' Thanx in advance :) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5078&messageID=14122#14122 From bret at pettichord.com Fri Nov 3 14:52:06 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 03 Nov 2006 13:52:06 -0600 Subject: [Wtr-general] Hacking Ruby In-Reply-To: <7ac2300c0611030240t1d551e8fp75d0e572151ffa05@mail.gmail.com> References: <454AA5B0.4030004@pettichord.com> <72799cd70611022021t32a77b9fsfaac68ec3525ee3d@mail.gmail.com> <7ac2300c0611030240t1d551e8fp75d0e572151ffa05@mail.gmail.com> Message-ID: <454B9DE6.7010309@pettichord.com> Some people have described Watir as a DSL for web application testing, so DSL's don't have to be project-specific. That comment also underscores a central design principle for Watir: Watir commands should be intuitive to testers. People who don't understand the DSL goal have sometimes suggested Watir extensions arguing that they are *useful*. But i have declined to accept them because they were not -- to my mind -- intuitive to testers. In my work at DataCert, i try to make our tests readable by testers (and developers) both by using and creating DSL's, and also be supporting data-driven tests using Spreadsheets. Bret From sikander at marlabs.com Sat Nov 4 00:59:42 2006 From: sikander at marlabs.com (sikander) Date: Sat, 4 Nov 2006 11:29:42 +0530 Subject: [Wtr-general] Is there any way to get all the scr's of images? Message-ID: <000f01c6ffd6$6bf9b910$6520a8c0@caseshare.com> Hi All! Is there any way to get all buttons, text boxes, images etc., of a page to display? For Example i want to see all id's or :src's of images of a web page. In that case i may write similar to following code to display all the images of the current page one by one check_Images=$ie.image(:src, /*.jpg/) pust check_Images. Please help me in this regard. Regards, Sikander -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061104/4719795e/attachment.html From paul.rogers at shaw.ca Sat Nov 4 10:52:15 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sat, 04 Nov 2006 08:52:15 -0700 Subject: [Wtr-general] Is there any way to get all the scr's of images? References: <000f01c6ffd6$6bf9b910$6520a8c0@caseshare.com> Message-ID: <05ca01c70029$3310d9f0$6400a8c0@laptop> probably easiest to use a reg exp for this youd have to create the reg exp with care, as there may be white space and different types of quotes, but this might do it ie.html.scan(/src\s*=\s*'(.*)?') that says, find src followed by either space or no space followed by equals followed by a single quote capture the text in the quote If you get it to ork correctly, please post it, as many people may find this useful Paul ----- Original Message ----- From: sikander To: wtr-general at rubyforge.org Sent: Friday, November 03, 2006 10:59 PM Subject: [Wtr-general] Is there any way to get all the scr's of images? Hi All! Is there any way to get all buttons, text boxes, images etc., of a page to display? For Example i want to see all id's or :src's of images of a web page. In that case i may write similar to following code to display all the images of the current page one by one check_Images=$ie.image(:src, /*.jpg/) pust check_Images. Please help me in this regard. Regards, Sikander ------------------------------------------------------------------------------ _______________________________________________ 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/20061104/4ee1abf7/attachment-0001.html From charley.baker at gmail.com Sat Nov 4 14:54:07 2006 From: charley.baker at gmail.com (Charley Baker) Date: Sat, 4 Nov 2006 12:54:07 -0700 Subject: [Wtr-general] Test suites in Watir problem In-Reply-To: <53202453.1162570464139.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <53202453.1162570464139.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: You need to comment or remove the unittests/setup line and assign $ie to a new instance of IE, something like this (this is a simple example, you might or might not want to restart ie after every test, but should at least give you some idea of setup/teardown methods): $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ #require 'unittests/setup' require 'test/unit' require 'watir/WindowHelper' require 'watir' require 'mysql' class TC_MYBOX_Login < Test::Unit::TestCase include Watir def setup # set variables and open site, this will run before every test case $host = '192.168.0.1' - this is a fake host I'm using another in the true test $user_login = 'test_demo' $ie = Watir::IE.start(test_site = 'http://'+ $host) end # this will run after every test case. def teardown $ie.close end def test_login ..... end more test methods, etc......... end -Charley On 11/3/06, Ralica Nacheva wrote: > Hello, I am quite new to Ruby and Watir I started writing some test cases and I wanted to try to tie them into a test suite but unfortunately the example shown in http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/ doesn't work for me. > My test suite is very simple - just for trying out. It has to execute two test cases - login and logout, but when I execute it I get the following errors: > > > C:\watir-v1_4\myTests>ruby mybox_suite.rb > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_re > quire': no such file to load -- unittests/setup (LoadError) > from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re > quire' > from ./mybox_login1.rb:15 > from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re > quire' > from mybox_suite.rb:6 > > > I'd like to get some explanation about how to write test cases, which can be run separately and tied into a test suite. I have been reading for couple of days articles and posts from blogs, forums, documentatin , etc., but I haven't found a solution. > > Here is the content of my test suite: > > require 'test/unit/testsuite' > require 'mybox_login1' > require 'mybox_logout1' > > > class TS_MyTests > def self.suite > suite = Test::Unit::TestSuite.new > suite << TC_MYBOX_Login.suite > suite << TC_MYBOX_Logout.suite > > return suite > end > end > > And here is for example the login test: > > $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ > require 'unittests/setup' > require 'test/unit' > require 'watir/WindowHelper' > require 'watir' > require "mysql" > > class TC_MYBOX_Login < Test::Unit::TestCase > include Watir > > > # set variables > $host = '192.168.0.1' - this is a fake host I'm using another in the true test > $user_login = 'test_demo' > > def test_login() > # set variables > user_pass = '123'; > test_site = 'http://'+ $host > > # print some comments > puts "## Beginning of test: 'Mybox Login'" > puts " " > > puts "Step 1: go to the test site: " + test_site > $ie.goto(test_site) > > puts "Step 2: enter '"+$user_login+"' in login field" > $ie.text_field(:name, "login").set($user_login) > > puts "Step 3: enter '"+user_pass+"' in password field" > $ie.text_field(:name, "password").set(user_pass) > > sleep 1 > > puts "Step 4: click the 'Login' button" > $ie.button(:name, "login_button").click > > puts "Expected Result: " > > puts "Actual Result: Check that the 'Log Out' link appears on the results page" > assert($ie.contains_text("Log Out")) > end > > end > > When I comment the "require unittests/setup". Then I get: > > 1) Error: > test_login(TC_MYBOX_Login): > NoMethodError: undefined method `goto' for nil:NilClass > ./mybox_login1.rb:39:in `test_login' > > 2) Error: > test_logout(TC_MYBOX_Logout): > NoMethodError: undefined method `goto' for nil:NilClass > ./mybox_logout1.rb:51:in `test_logout' > > Thanx in advance :) > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5078&messageID=14122#14122 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Sun Nov 5 19:01:54 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 05 Nov 2006 17:01:54 -0700 Subject: [Wtr-general] IE7 Message-ID: <065101c70136$c4db8110$6400a8c0@laptop> Here are the release notes for IE7 from http://msdn.microsoft.com/library/default.asp?url=/workshop/essentials/whatsnew/whatsnew_70_sdk.asp there is a new document status for xmlhttprequests ( ie ajax ) so it should be possible to check for this There are details on tabs, but I couldnt find any mention of how to change to a new tab from script Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061105/28d4cf70/attachment.html From luccasz at gmail.com Mon Nov 6 02:38:19 2006 From: luccasz at gmail.com (Luke) Date: Mon, 6 Nov 2006 08:38:19 +0100 Subject: [Wtr-general] same name of elements Message-ID: I have a few elements with the same name on the web, I can't catch them just by index, is it possible to catch them somehow? like element.(:name, ....). and then the index somehow? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061106/fce60b19/attachment.html From forum-watir-users at openqa.org Mon Nov 6 04:59:15 2006 From: forum-watir-users at openqa.org (Ralica Nacheva) Date: Mon, 06 Nov 2006 03:59:15 CST Subject: [Wtr-general] Test suites in Watir problem In-Reply-To: Message-ID: <52249242.1162807185181.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you very much! :) I just tried your advice and it works fine. Thanks for your help :) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5078&messageID=14165#14165 From areed at relocationcentral.com Mon Nov 6 10:27:18 2006 From: areed at relocationcentral.com (Adam Reed) Date: Mon, 6 Nov 2006 09:27:18 -0600 Subject: [Wtr-general] Is there any way to get all the scr's of images? Message-ID: <36B5DBA88E027F47812ED877C6A978D8034EA1@rc-mail.relocationcentral.com> I'd use a simple ie-do loop: ie = Watir::IE.new ie.set_fast_speed ie.goto "www.google.com" ie.images.each do |image| images = {'path' => image.src} images.each do | ite, image | puts "#{ite}:#{image}" end end This should output: path:http://www.google.com/images/logo.gif path:http://www.google.com/images/x2.gif Put a little "def Check_images" and add another "end" afterwards, and there's your function. Thanks, Adam ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of sikander Sent: Saturday, November 04, 2006 12:00 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Is there any way to get all the scr's of images? Hi All! Is there any way to get all buttons, text boxes, images etc., of a page to display? For Example i want to see all id's or :src's of images of a web page. In that case i may write similar to following code to display all the images of the current page one by one check_Images=$ie.image(:src, /*.jpg/) pust check_Images. Please help me in this regard. Regards, Sikander -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061106/86a72e16/attachment.html From forum-watir-users at openqa.org Mon Nov 6 11:19:07 2006 From: forum-watir-users at openqa.org (Ralica Nacheva) Date: Mon, 06 Nov 2006 10:19:07 CST Subject: [Wtr-general] invoking tests in right order In-Reply-To: Message-ID: <47781393.1162829977812.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi all, I'm quite new to Ruby and Watir. I'd like to ask you where exactly to copy/paste the patch? I'm using Watir - v1.4 - should i rewrite the file: C:\ruby\lib\ruby\1.8\test\unit\testcase.rb or the file: C:\ruby\src\ruby-1.8.4\lib\test\unit\testcase.rb or maybe any other file? Thanx in advance :) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3666&messageID=14184#14184 From forum-watir-users at openqa.org Mon Nov 6 12:33:45 2006 From: forum-watir-users at openqa.org (Nathan) Date: Mon, 06 Nov 2006 11:33:45 CST Subject: [Wtr-general] same name of elements In-Reply-To: Message-ID: <52990172.1162834455616.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> So if I understand what you're saying correctly, you mean to say for example that you have three links that all share the name property of "link" like this: Link number 1 Link number 2 Link number 3 and even though they all have the same name attribute, you cannot access them by your browser object in the links array, for example if I called this initially: ie = IE.start("www.mywebsite.com"), then tried to catch my links this way: link1 = ie.links[1] link2 = ie.links[2] link3 = ie.links[3] Is that what you're trying to say? Message was edited by: nathandelane --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5101&messageID=14187#14187 From bret at pettichord.com Mon Nov 6 12:42:09 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 06 Nov 2006 11:42:09 -0600 Subject: [Wtr-general] same name of elements In-Reply-To: References: Message-ID: <454F73F1.3040403@pettichord.com> Luke wrote: > I have a few elements with the same name on the web, I can't catch > them just by index, is it possible to catch them somehow? > like element.(:name, ....). and then the index somehow? In 1.5, this syntax works: ie.div(:name => 'foo', :index => 2).click This will find the second div with the name 'foo'. Not all elements yet have multiple attribute support. What are you looking for? Bret From bret at pettichord.com Mon Nov 6 12:44:40 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 06 Nov 2006 11:44:40 -0600 Subject: [Wtr-general] invoking tests in right order In-Reply-To: <47781393.1162829977812.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <47781393.1162829977812.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <454F7488.4050900@pettichord.com> Ralica Nacheva wrote: > Hi all, I'm quite new to Ruby and Watir. I'd like to ask you where exactly to copy/paste the patch? I'm using Watir - v1.4 - should i rewrite the file: C:\ruby\lib\ruby\1.8\test\unit\testcase.rb or the file: C:\ruby\src\ruby-1.8.4\lib\test\unit\testcase.rb or maybe any other file? > You want to use the watir/testcase.rb file contained in Watir 1.5. You can pull it out of 1.5 -- it has no dependencies. This creates a new class, Watir::TestCase. Your tests should be subclasses of this. (Instead of Test::Unit::TestCase) Bret From bret at pettichord.com Mon Nov 6 13:32:25 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 06 Nov 2006 12:32:25 -0600 Subject: [Wtr-general] Watir Test Automation Position in San Jose Message-ID: <454F7FB9.6090206@pettichord.com> Here is an interesting job posting I noticed. Bret *lead Test Automation Engineer * *LogLogic* is an established startup, funded by outstanding VCs, with a broad range of current customers and a growing market. We develop ultra-high-performance Log Management appliances on Linux platforms, which provide real-time log data aggregation, analysis, and retention for enterprise IT departments. We accelerate and support responses to data center security and performance events, while providing complete log data archives for compliance and legal protection. *This position is for a *lead test automation engineer *to drive developing a test automation process. The candidate will report to the Director of Quality Assurance. *If you are an outstanding team player looking for an exciting challenge, and you are experienced in testing of web-based enterprise class applications, we want to talk with you! *_Professional Qualifications_:* * 5 years experience designing, implementing, and testing large scale/complex/web based interface products in Windows or Unix/Linux based network applications. * Hands on experience with WATIR/RUBY and other scripting languages such as perl, expect, Shell, etc. * Experience with Windows XP, Windows 2000/2003 Server, Exchange 2000/2003, and MySQL is highly desirable. * UNIX/Linux shell scripting experience would also be a plus. * 3+ years in a leadership role of a test automation project. * Excellent verbal and written communication skills. * BS in Electrical Engineering, Computer Science, Mathematics, or MIS. * Self motivator. * Team player. * Proven track records http://hotjobs.yahoo.com/jobs/CA/San-Jose/Technology/J714749BX From forum-watir-users at openqa.org Mon Nov 6 14:25:18 2006 From: forum-watir-users at openqa.org (Nathan) Date: Mon, 06 Nov 2006 13:25:18 CST Subject: [Wtr-general] Recover from IE crash? In-Reply-To: <43534815.1162504007282.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <53451112.1162841149362.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Not sure if the IE Crash dialog is a child window of IE, but it's probable, and if it is, then you might be able to get it and control it. In my recent experience with our own website, we had one area that consistently caused IE to crash, but we thought it was our tool - commercial at the time. When we realized it was our web application, we turned on our logging and looked for any possible reason why our app would cause IE to crash, and it ended up being a line of CSS code that wasn't getting released. We took that out and everything works great now! You might want to check into that, before you start trying to handle IE Crash dialogs. cheers, Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5069&messageID=14194#14194 From forum-watir-users at openqa.org Mon Nov 6 14:41:54 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Mon, 06 Nov 2006 13:41:54 CST Subject: [Wtr-general] Recover from IE crash? In-Reply-To: <53451112.1162841149362.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <45664374.1162842144049.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for the input. I was seeing the crash as a problem to get around, as opposed to a problem to investigate :) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5069&messageID=14195#14195 From forum-watir-users at openqa.org Mon Nov 6 15:31:16 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Mon, 06 Nov 2006 14:31:16 CST Subject: [Wtr-general] QuickTest Pro vs Watir? Message-ID: <42626429.1162845106653.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Looking for some experience from people that have used both. We are currently looking into both of these applications, and I'm wondering if anyone has any experience (that they care to share on the subject). Cost alone isn't that big of an issue. So its a point that doesn't need to be stressed. I'm finding with QTP (quicktest pro) once you move out of the basic recorder (which is fine for laying out some ground work) and enter 'expert mode' you are more or less dealing with things the same way as Watir. Thanks in advance! --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5110&messageID=14197#14197 From luccasz at gmail.com Mon Nov 6 15:41:10 2006 From: luccasz at gmail.com (Luke) Date: Mon, 6 Nov 2006 21:41:10 +0100 Subject: [Wtr-general] same name of elements In-Reply-To: <454F73F1.3040403@pettichord.com> References: <454F73F1.3040403@pettichord.com> Message-ID: thanx a lot Bret, that's what I'm asking. I made mistake and mislead you guys, sorry. I'm looking for link by text not by name, but I suppose it doesn't matter and similar code will work ie.link(:text => 'linktext',:index => 2).click am I right? Luke -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061106/951c8ffb/attachment.html From paul.rogers at shaw.ca Mon Nov 6 15:41:54 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 06 Nov 2006 13:41:54 -0700 Subject: [Wtr-general] Recover from IE crash? References: <53451112.1162841149362.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <008501c701e3$ffd4ab40$6400a8c0@laptop> I use a library that draws a treeview in javascript. This has also caused IE to crash. I think it is something to do with dynamic tables Paul ----- Original Message ----- From: "Nathan" To: Sent: Monday, November 06, 2006 12:25 PM Subject: Re: [Wtr-general] Recover from IE crash? > Not sure if the IE Crash dialog is a child window of IE, but it's > probable, and if it is, then you might be able to get it and control it. > In my recent experience with our own website, we had one area that > consistently caused IE to crash, but we thought it was our tool - > commercial at the time. When we realized it was our web application, we > turned on our logging and looked for any possible reason why our app would > cause IE to crash, and it ended up being a line of CSS code that wasn't > getting released. We took that out and everything works great now! You > might want to check into that, before you start trying to handle IE Crash > dialogs. > > cheers, > > Nathan > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5069&messageID=14194#14194 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Mon Nov 6 18:00:48 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 06 Nov 2006 17:00:48 -0600 Subject: [Wtr-general] same name of elements In-Reply-To: References: <454F73F1.3040403@pettichord.com> Message-ID: <454FBEA0.9060700@pettichord.com> Luke wrote: > ie.link(:text => 'linktext',:index => 2).click > > am I right? Yes. From christopher.mcmahon at gmail.com Mon Nov 6 18:41:30 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 6 Nov 2006 15:41:30 -0800 Subject: [Wtr-general] QuickTest Pro vs Watir? In-Reply-To: <42626429.1162845106653.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <42626429.1162845106653.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70611061541l2cdac2f6la16d21c0c8092679@mail.gmail.com> On 11/6/06, John Lolis wrote: > > Looking for some experience from people that have used both. We are > currently looking into both of these applications, and I'm wondering if > anyone has any experience (that they care to share on the subject). I don't know if it was WinRunner or QTP, but one telling story from about 18 months ago: I was giving some training about testing to umm some people. Important people. These people had an application that ran in IE and was full of crazy ActiveX controls. I was going on about how cool Watir was, and one of the people in the session said "we have this one page where WinRunner just crashes. We can't figure out what's causing it." So we cranked up Watir. Not only did Watir not crash, but using Watir, we were able to identify the exact line that was causing the WinRunner crash. This particular line was so heinously non-standard that the Mercury tool couldn't even bear the sight of it and crashed. Watir just ignored it. No matter how we tried, we couldn't interact with this heinously non-standard widget. Of course, somewhere in the bowels of COM or DCOM or COM++ or OLE or something is the key to interacting with that particular widget, but it was only a one-day overview I was teaching, and we didn't pursue the problem any farther. Although I don't use Watir very much anymore, my favorite part has always been asking for new features. In fact, take some time to go through the mail list archives looking for all of the features that people have requested and received over the past couple of years. It's an impressive list. Try doing that with Mercury. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061106/b6b422cc/attachment.html From forum-watir-users at openqa.org Mon Nov 6 20:54:55 2006 From: forum-watir-users at openqa.org (Nathan) Date: Mon, 06 Nov 2006 19:54:55 CST Subject: [Wtr-general] QuickTest Pro vs Watir? In-Reply-To: <42626429.1162845106653.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <56435491.1162864720011.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am an experienced scripter in both Mercury QTP and Watir, and I'd have to say that they are very comparable in functionality. At this time niether QTP nor Watir have the ability to do a whole lot easily with Firefox or other browsers, and QTP will never support Safari or linux based systems, which is something that Watir is striving for. One thing I like about Watir is that I get native control of the computer I'm running on, because it uses Ruby. With QTP you are limited to the QTP Environment, which in and of itself isn't too bad. Both QTP and Watir take a similar approach to testing in IE, except that QTP has the ability to use the mouse cursor to perform actions, and Watir at this time does not. This mouse cursor type testing though, is not necessarily invaluable, and can easily be programmed in languages that readily support it, like Java with the Robot api in AWT. Even without knowing that, there are likely other open source test suites that can provide you with this functionality. You are correct is saying that once one moves out of the old (beginner level) recorder functionality of QTP, basically you have the same tools as in Watir. At this time my company uses both QTP and Watir, though we may easily one day completely switch over to Watir or similar tools. The reason behind that is that in our experience we have found the seemingly costly support that Mercury provides very unhelpful in our time of need, and by the time they get back to us generally we have found a way around our problem anyway. One disadvantage that Watir has at this time in comparison to QTP is its reporting mechanism. I have no experience with the Test Suite part of Watir yet, as we've been writing spiders and bots using Watir to test specific components of our website, but if you are using Ruby's built in Logger class to log information, then it is pretty much in raw format. I have thought of creating a program that parses that raw format and creates an HTML report based on it, and I have also thought of extending the Logger class to make my own format, as it hints to in the Ruby Core API documentation to do, but I haven't taken either path yet. So basically, both QTP and Watir do the same thing in the same way - don't let QTP fool you into thinking they can test IE better than any app around, because all they do is plug into the OLE server in IE. That's exactly what Watir does also. I don't know if this helps you any. Oh one more thing is that QTP gives you several options for scripting languages including VBScript and JavaScript, whereas Watir requires you to learn Ruby. But it really isn't very difficult (coming from a Jack - of - all - languages) to learn, and I think, as Ruby claims, it is a much cleaner language and has true OOP capability. If you'd like to know more about anything specific, respond to this, and maybe I can help out. thanks, Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5110&messageID=14212#14212 From bret at pettichord.com Tue Nov 7 01:40:49 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 7 Nov 2006 00:40:49 -0600 Subject: [Wtr-general] Why Open Source Test Tools? Message-ID: In her new/relocated blog, Elisabeth Hendrickson gives a convincing explanation for why open-source test tools are gaining in popularity. http://testobsessed.com/wordpress/?p=6 And then explains how to learn more about them. http://testobsessed.com/wordpress/?p=7 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061107/2b02f219/attachment-0001.html From herr.kreutzer at googlemail.com Tue Nov 7 03:29:56 2006 From: herr.kreutzer at googlemail.com (Christian Kreutzer) Date: Tue, 7 Nov 2006 09:29:56 +0100 Subject: [Wtr-general] QuickTest Pro vs Watir? In-Reply-To: <72799cd70611061541l2cdac2f6la16d21c0c8092679@mail.gmail.com> References: <42626429.1162845106653.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <72799cd70611061541l2cdac2f6la16d21c0c8092679@mail.gmail.com> Message-ID: excellent point. The way feature requests are handled, the ability to extend the functionality of watir yourself and no longer fighting with a test tool vendor's support are the main advantages of watir over mercury in my opinion. and after all you can play with the nice ruby language instead of VBScript ;) Christian On 11/7/06, Chris McMahon wrote: > > Although I don't use Watir very much anymore, my favorite part has always > been asking for new features. In fact, take some time to go through the > mail list archives looking for all of the features that people have > requested and received over the past couple of years. It's an impressive > list. Try doing that with Mercury. > From forum-watir-users at openqa.org Tue Nov 7 05:28:31 2006 From: forum-watir-users at openqa.org (Ralica Nacheva) Date: Tue, 07 Nov 2006 04:28:31 CST Subject: [Wtr-general] invoking tests in right order In-Reply-To: <454F7488.4050900@pettichord.com> Message-ID: <54235991.1162895341124.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you, I.ve tried this and it works with test cases, but how about when someone wants to use the test cases into a test suite and wants them to be exequted sequentially? For example if we have a couple of test cases that are subclasses of Watir::TestCase and we want them to be executed in a test suite like this: require 'test/unit/testsuite' require 'mybox_login' require 'mybox_create_article' require 'mybox_delete_article' require 'mybox_logout1' class TS_MyTests def self.suite suite = Test::Unit::TestSuite.new suite << TC_MYBOX_Login.suite suite << TC_MYBOX_Create_Article.suite suite << TC_MYBOX_Delete_Article.suite suite << TC_MYBOX_Logout.suite return suite end end Is this the right way to tie-up test cases into a test suite? Because now I get them executed alphabetically, no matter that in the test cases I use watir/testcase.rb and 'execute: sequentially'. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3666&messageID=14237#14237 From phlip2005 at gmail.com Tue Nov 7 06:29:41 2006 From: phlip2005 at gmail.com (Phlip) Date: Tue, 7 Nov 2006 03:29:41 -0800 Subject: [Wtr-general] invoking tests in right order In-Reply-To: <54235991.1162895341124.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <454F7488.4050900@pettichord.com> <54235991.1162895341124.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <860c114f0611070329h230660c7vbec938fd10ed5d06@mail.gmail.com> Ralica Nacheva wrote: > Thank you, I.ve tried this and it works with test cases, but how about when someone wants to use the test cases into a test suite and wants them to be exequted sequentially? If you run a Ruby program containing any classes derived from TestCase, they will automatically run all their test cases. You shouldn't need to run them in any order. Each test case should set up data, invoke a web browser, browse your site, assert, and shut down your browser. Google "Test Isolation" for lectures on why test cases should run in any order. Your cases should not, for example, drive your website into a given state, and then rely on that state in the next case. Doing this is a sign you have not characterized that state. I use Rails, which has a test fixtures system (which should be called "test resources"). It lets me declare records as text (YAML), and then load them into the database on command. So for a given website, I have a series of records in various conditions. One is a user who did not log in, the next one is logged in, the next one logged in and created one data record, etc. So my test cases can reach out to these records, each in their intermediate state, and push them to the next state. The tests can run in any order because the data refreshes between test cases. -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! From forum-watir-users at openqa.org Tue Nov 7 08:11:20 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Tue, 07 Nov 2006 07:11:20 CST Subject: [Wtr-general] QuickTest Pro vs Watir? In-Reply-To: <42626429.1162845106653.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <42852234.1162905110357.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for the great input. I have a more specific question though. How is the support of (well written) QTP steps down the road? Watir/Ruby scripts (if well designed) seem to be very easy to support. Is that also the case with QTP? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5110&messageID=14241#14241 From tester.paul at gmail.com Tue Nov 7 10:00:18 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 7 Nov 2006 10:00:18 -0500 Subject: [Wtr-general] invoking tests in right order In-Reply-To: <860c114f0611070329h230660c7vbec938fd10ed5d06@mail.gmail.com> References: <454F7488.4050900@pettichord.com> <54235991.1162895341124.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <860c114f0611070329h230660c7vbec938fd10ed5d06@mail.gmail.com> Message-ID: <37c405480611070700k6655197ekbff720950d313c07@mail.gmail.com> Umm.. I have something to add to this.. On 07/11/06, Phlip wrote: > > > You shouldn't need to run them in any order. Each test case should set > up data, invoke a web browser, browse your site, assert, and shut down > your browser. > > Google "Test Isolation" for lectures on why test cases should run in > any order. Your cases should not, for example, drive your website into > a given state, and then rely on that state in the next case. Doing > this is a sign you have not characterized that state. Bah! Lectures! You want to lecture me on how to test!? I see this style of testing (that you describe) as almost a complete waste of time (for me). I think that fundamentally we are hitting on a difference in approach between System Testing and Unit/Integration Testing. If my focus were on Unit/Integration Testing, I would likely agree with you. That is, you set up the tests, perform the required steps and checks and then tear them down to a known, good state. If you do that, why should you care what order you run them in? However, I am a System/Black-Box tester and during a particular test run, the system gets into fairly complex setups that would be rather stupid to close the web browser between each test. There is no *reset* between tests. Just as everyone's definition of what a "test" might be, so we should respect that the order in which the tests need to be executed may be different. The addition of the feature to specify an order to the test cases is a valuable one that acknowledges that Watir is not only a tool for unit/integration/developer testing. Paul C. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061107/e52c1a91/attachment.html From forum-watir-users at openqa.org Tue Nov 7 10:48:54 2006 From: forum-watir-users at openqa.org (Markus) Date: Tue, 07 Nov 2006 09:48:54 CST Subject: [Wtr-general] click_no_wait (again) Message-ID: <49238689.1162914601972.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, this has been discussed but the solutions don't work for me. The story: I want to test an application that uses JS-Alerts to communicate errors. I found a code snippet that should solve this, but instead I get always this exception: WIN32OLERuntimeError: hwnd OLE error code:80004005 in HRESULT error code:0x80020009 Ausnahmefehler aufgetreten. C:/Programme/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1121/./watir.rb:1514:in `method_missing' C:/Programme/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1121/./watir.rb:1514:in `hwnd' C:/Programme/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1121/./watir.rb:2205:in `attach_command' C:/Programme/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1121/./watir.rb:1222:in `eval_in_spawned_process' C:/Programme/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1121/./watir.rb:2440:in `click_no_wait' I debugged watir.rb to the method "hwnd" (around line 1510) and in there to the method call "@ie.hwnd" which (to me) causes the exception. Is it possible that this method is missing from win32ole.so? Any help would be highly appreciated! --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5137&messageID=14251#14251 From forum-watir-users at openqa.org Tue Nov 7 11:04:57 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Tue, 07 Nov 2006 10:04:57 CST Subject: [Wtr-general] click_no_wait (again) In-Reply-To: <49238689.1162914601972.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <64002405.1162915527031.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Post the code you are using that causes this, that might help :) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5137&messageID=14254#14254 From richard.conroy at gmail.com Tue Nov 7 11:14:50 2006 From: richard.conroy at gmail.com (Richard Conroy) Date: Tue, 7 Nov 2006 16:14:50 +0000 Subject: [Wtr-general] QuickTest Pro vs Watir? In-Reply-To: <42852234.1162905110357.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <42626429.1162845106653.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <42852234.1162905110357.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <511fa3a20611070814o7dadf232wbcf6b5ffe5a68c66@mail.gmail.com> On 11/7/06, John Lolis wrote: > Watir/Ruby scripts (if well designed) seem to be very easy to support. Is that also the case with QTP? Don't know about QTP, but I remember Winrunner was laughable. I would guess if you are using VBScript & JavaScript as your test script languages they would be inferior to support. They can't hold a candle Ruby/WATIR DSL. Strictly speaking if QTP is using the same mechanism as WATIR to control IE, it is on the right track - the two tools are using the correct testing approach and DOM level control of the browser makes for very robust tests. Don't forget the power that comes with being able to drop down into Ruby for more hardcore testing. As part of a recent test effort where we needed to automatically test event generation of a software product with a Web UI, we used WATIR/AutoIT to control a windows simulator that drove our product, then used WATIR to configure the app, and validate when its UI changed, and dropped down into Ruby when we needed to check that mails were sent. We used a locally installed test mail server and parsed the .eml files on the local machine. But we could also have used Ruby's POP3 or SMTP libraries to validate if the mails were present on an external mail server. We could have used the same principle for querying syslog server entries, validating SNMP traps and a pile of other stuff. The most amazing thing was that it all worked pretty well and the tests were very robust. Basically WATIR being written in Ruby is an advantage, as it gives you more test capability than either VBScript or JavaScript. Our testers were quite impressed with it, and though Ruby was quite different to what they were familiar with, the amount of Ruby that they need to know to use WATIR is very little indeed. WATIR negatives - testing of non-english Unicode pages could be tricky, its an area that a professional product like QTP could pull ahead (as I don't see how the hell you could SELL a product without multinational support). Also the reporting aspect. You are on your own when it comes to making test reports. You can use the Ruby log functionality or roll your own, but in reality you probably want something much better than that, something built-in with good HTML reports, or export into portable formats like CSV. Anyone who has used a good unit test coverage tool knows what I mean. Without the reports aspect, WATIR is biased towards developers rather than testers. From phlip2005 at gmail.com Tue Nov 7 11:34:18 2006 From: phlip2005 at gmail.com (Phlip) Date: Tue, 7 Nov 2006 08:34:18 -0800 Subject: [Wtr-general] invoking tests in right order References: <454F7488.4050900@pettichord.com><54235991.1162895341124.JavaMail.oqa-j2ee@openqa01.managed.contegix.com><860c114f0611070329h230660c7vbec938fd10ed5d06@mail.gmail.com> <37c405480611070700k6655197ekbff720950d313c07@mail.gmail.com> Message-ID: <029d01c7028a$946e2fa0$81a1b04c@Marley> Paul Carvalho wrote: > Bah! Lectures! You want to lecture me on how to test!? No, I wanted the fetched Google pages to lecture you. > If my focus were on Unit/Integration Testing, I would likely agree with > you. That is, you set up the tests, perform the required steps and checks > and then tear them down to a known, good state. If you do that, why > should > you care what order you run them in? However, I am a System/Black-Box > tester and during a particular test run, the system gets into fairly > complex > setups that would be rather stupid to close the web browser between each > test. There is no *reset* between tests. That is an example of poor design-for-testing. Regardless how complex a user may find a path from program load to some given state, tests should simply have a back-door to that state, such as test resources with fixed data tables. However, there are much more excessive examples of poor design-for-testing than just using GUI tests to test the back-end, so carry on! > Just as everyone's definition of what a "test" might be, so we should > respect that the order in which the tests need to be executed may be > different. The addition of the feature to specify an order to the test > cases is a valuable one that acknowledges that Watir is not only a tool > for > unit/integration/developer testing. Then prefix all the steps methods with step_, and call them all from one test case: def test_universe() step_bigBang() step_inflationPhase() step_condensatePhase() step_quasarIgnition() # etc end -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! From phlip2005 at gmail.com Tue Nov 7 11:37:11 2006 From: phlip2005 at gmail.com (Phlip) Date: Tue, 7 Nov 2006 08:37:11 -0800 Subject: [Wtr-general] Wiki -> RSpec -> Watir Message-ID: <029e01c7028a$fafcc380$81a1b04c@Marley> Rubies & Acceptance Testers: For those of you not doing acceptance tests yet, I have a very slick test rig to show off. I haven't demo-ized it yet, so please accept these diverse audiovisual displays as if they were a united whole! We start with MiniRubyWiki, at this demo: http://www.zeroplayer.com/cgi-bin/wiki?TestFlea Click on any of the green bars. Now imagine if the left graphic were a thumbnail of a screenshot of a web page. You could click on the thumbnail and get the complete screenshot. This would be a copy of the tested website, in its tested state, with its intermediate data. To drive that test, in the right panel I put RSpec and Watir. So the code to log into a website would look like this: input_text 'login', 'quentin' input_text 'password', 'test' click_button 'commit' @browser.should_contain('Logged in successfully') @browser.should_contain('greetings quentin') The point of RSpec is syntactic sugar, and I have not yet learned how much sweeter I can make that. So far, I have learned how to use it to make well-formed English sentences (modulo all the _() delimiter crap!). Writing acceptance tests with this system is just plain fun. Click one of the quill icons next to the green bars. Before or after I write a new feature, I find a similar test and clone it. (Cloning a test is a best-practice in Acceptance Test land, so long as you frequently merge things back into features!) Then I edit the new test to advance its behavior. The test cases all go into an XML file (_not_ a Wiki file!). At test time, Wiki calls a test runner to run one case in that file. The test runner without arguments runs all the cases in all the relevant XML files. It stitches together the RSpec environment, tests all the cases, and then changes each case's result_color to reflect its passing state. What feature should I add next? -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! From christopher.mcmahon at gmail.com Tue Nov 7 12:00:14 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 7 Nov 2006 09:00:14 -0800 Subject: [Wtr-general] spiderwatir! Message-ID: <72799cd70611070900q5abb127bjfa7f124a1bec48a4@mail.gmail.com> Here's the next FireWatir or SafariWatir, I think: http://www.mozilla.com/en-US/press/mozilla-2006-11-07.html -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061107/4515c02b/attachment.html From richard.conroy at gmail.com Tue Nov 7 12:02:33 2006 From: richard.conroy at gmail.com (Richard Conroy) Date: Tue, 7 Nov 2006 17:02:33 +0000 Subject: [Wtr-general] Why Open Source Test Tools? In-Reply-To: References: Message-ID: <511fa3a20611070902r289635a7n49f44b9d5178b464@mail.gmail.com> On 11/7/06, Bret Pettichord wrote: > In her new/relocated blog, Elisabeth Hendrickson gives a convincing > explanation for why open-source test tools are gaining in popularity. > > http://testobsessed.com/wordpress/?p=6 > > And then explains how to learn more about them. > > http://testobsessed.com/wordpress/?p=7 Great articles. Nothing that *we* didn't already know, but now I got links to articles that I can give to our QA guys. They are already sold on this WATIR thing, and I can just see them nodding their heads right through the paragraph on what was wrong with the whole vendor driven test automation. Good stuff indeed. From wsoula at pointserve.com Tue Nov 7 13:57:52 2006 From: wsoula at pointserve.com (Soula, William) Date: Tue, 7 Nov 2006 12:57:52 -0600 Subject: [Wtr-general] WATIR Extension Toolkit (WET) Message-ID: I discovered this toolkit for WATIR which appears like it can solve some of WATIR's problems like clicking modal dialogs and automatically logging. Has anyone used this toolkit before? Anyone have any ideas on if it is a good toolkit or not? Thanks, the link to WET is here http://www.wet.qantom.org/overview.html Will -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061107/d03fb33d/attachment.html From areed at relocationcentral.com Tue Nov 7 14:08:44 2006 From: areed at relocationcentral.com (Adam Reed) Date: Tue, 7 Nov 2006 13:08:44 -0600 Subject: [Wtr-general] WATIR Extension Toolkit (WET) Message-ID: <36B5DBA88E027F47812ED877C6A978D8034EAE@rc-mail.relocationcentral.com> Will, I used WET for a months (also for the modal dialogs). However, it was only compatible with Watir 1.4 if I recall correctly, and some of the other features of Watir 1.5 were more important to me, so I switched back. Since, I have had no problem using Watir to handle anything WET could handle, so it's staying. Thanks, Adam ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Soula, William Sent: Tuesday, November 07, 2006 12:58 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] WATIR Extension Toolkit (WET) I discovered this toolkit for WATIR which appears like it can solve some of WATIR's problems like clicking modal dialogs and automatically logging. Has anyone used this toolkit before? Anyone have any ideas on if it is a good toolkit or not? Thanks, the link to WET is here http://www.wet.qantom.org/overview.html Will -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061107/a561db99/attachment.html From raghu at qantom.com Tue Nov 7 14:35:44 2006 From: raghu at qantom.com (Raghu Venkataramana) Date: Wed, 08 Nov 2006 01:05:44 +0530 Subject: [Wtr-general] WATIR Extension Toolkit (WET) In-Reply-To: <36B5DBA88E027F47812ED877C6A978D8034EAE@rc-mail.relocationcentral.com> References: <36B5DBA88E027F47812ED877C6A978D8034EAE@rc-mail.relocationcentral.com> Message-ID: <4550E010.2050504@qantom.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061108/7aaf68a3/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: wet_email.jpg Type: image/jpeg Size: 1609 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20061108/7aaf68a3/attachment.jpg -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 2942 bytes Desc: S/MIME Cryptographic Signature Url : http://rubyforge.org/pipermail/wtr-general/attachments/20061108/7aaf68a3/attachment.bin From phlip2005 at gmail.com Tue Nov 7 14:40:02 2006 From: phlip2005 at gmail.com (Phlip) Date: Tue, 7 Nov 2006 11:40:02 -0800 Subject: [Wtr-general] WATIR Extension Toolkit (WET) References: <36B5DBA88E027F47812ED877C6A978D8034EAE@rc-mail.relocationcentral.com> Message-ID: <032001c702a4$8638f400$81a1b04c@Marley> Can you use WET's capture system to extrude scripts which you then run in Watir >1.4? -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! From lonny at titanez.net Tue Nov 7 14:28:06 2006 From: lonny at titanez.net (Lonny Eachus) Date: Tue, 07 Nov 2006 11:28:06 -0800 Subject: [Wtr-general] invoking tests in right order In-Reply-To: References: Message-ID: <4550DE46.900@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061107/39a42daf/attachment-0001.html From forum-watir-users at openqa.org Wed Nov 8 02:33:53 2006 From: forum-watir-users at openqa.org (Markus) Date: Wed, 08 Nov 2006 01:33:53 CST Subject: [Wtr-general] click_no_wait (again) In-Reply-To: <64002405.1162915527031.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <39626695.1162971336712.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> No magic here: ie = Watir::IE.start("http://internal.web.project") ie.text_field(:name, "txtUserName").set("myname") ie.text_field(:name, "txtPassword").set("mypass") ie.button(:value, "Anmelden").click ie.goto("http://internal.web.project/subpage") ie.text_field(:name, "txtKurzname").set("xyz") ie.button(:name, "btnSubmit").click ie.link(:text, "5002287156").click ie.button(:value, /eu/i).click ie.text_field(:name, "txt_Firma1").set("Irgendein Name") ie.button(:name, /btnSave/i).click_no_wait # <-- Exception thrown I followed every tutorial/sample I could find on the web. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5137&messageID=14285#14285 From raghu at qantom.com Wed Nov 8 03:28:38 2006 From: raghu at qantom.com (Raghu Venkataramana) Date: Wed, 08 Nov 2006 13:58:38 +0530 Subject: [Wtr-general] WATIR Extension Toolkit (WET) In-Reply-To: <032001c702a4$8638f400$81a1b04c@Marley> References: <36B5DBA88E027F47812ED877C6A978D8034EAE@rc-mail.relocationcentral.com> <032001c702a4$8638f400$81a1b04c@Marley> Message-ID: <45519536.7070601@qantom.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061108/84291b2b/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: wet_email.jpg Type: image/jpeg Size: 1609 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20061108/84291b2b/attachment.jpg -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 2942 bytes Desc: S/MIME Cryptographic Signature Url : http://rubyforge.org/pipermail/wtr-general/attachments/20061108/84291b2b/attachment.bin From forum-watir-users at openqa.org Wed Nov 8 05:00:21 2006 From: forum-watir-users at openqa.org (Markus) Date: Wed, 08 Nov 2006 04:00:21 CST Subject: [Wtr-general] click_no_wait (again) In-Reply-To: <39626695.1162971336712.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <41787581.1162980065955.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Found the solution :) IE is my standard browser, but I use Avant instead. When Avant is running (which it usually is), watir uses that instance. Unfortunately usage of Avant causes the exception. I closed it, startet IE 6, ran the example and it worked. Is there a way to tell watir to use a specific browser, like "run c:\system\ie.exe"? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5137&messageID=14290#14290 From herr.kreutzer at googlemail.com Wed Nov 8 06:58:53 2006 From: herr.kreutzer at googlemail.com (Christian Kreutzer) Date: Wed, 8 Nov 2006 12:58:53 +0100 Subject: [Wtr-general] spiderwatir! In-Reply-To: <72799cd70611070900q5abb127bjfa7f124a1bec48a4@mail.gmail.com> References: <72799cd70611070900q5abb127bjfa7f124a1bec48a4@mail.gmail.com> Message-ID: interesting! This could be the right technology for paul rogers RuMBA project. Christian On 11/7/06, Chris McMahon wrote: > > Here's the next FireWatir or SafariWatir, I think: > http://www.mozilla.com/en-US/press/mozilla-2006-11-07.html > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From sikander at marlabs.com Wed Nov 8 08:25:08 2006 From: sikander at marlabs.com (sikander) Date: Wed, 8 Nov 2006 18:55:08 +0530 Subject: [Wtr-general] Is there any way to get all the scr's of images? In-Reply-To: <36B5DBA88E027F47812ED877C6A978D8034EA1@rc-mail.relocationcentral.com> Message-ID: <00b901c70339$4fb6d5b0$6520a8c0@caseshare.com> Thanks, the following code works very well for images. How about buttons, drop down list boxes, text boxes. Thanks, Sikander _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Adam Reed Sent: Monday, November 06, 2006 8:57 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Is there any way to get all the scr's of images? I'd use a simple ie-do loop: ie = Watir::IE.new ie.set_fast_speed ie.goto "www.google.com" ie.images.each do |image| images = {'path' => image.src} images.each do | ite, image | puts "#{ite}:#{image}" end end This should output: path:http://www.google.com/images/logo.gif path:http://www.google.com/images/x2.gif Put a little "def Check_images" and add another "end" afterwards, and there's your function. Thanks, Adam _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of sikander Sent: Saturday, November 04, 2006 12:00 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Is there any way to get all the scr's of images? Hi All! Is there any way to get all buttons, text boxes, images etc., of a page to display? For Example i want to see all id's or :src's of images of a web page. In that case i may write similar to following code to display all the images of the current page one by one check_Images=$ie.image(:src, /*.jpg/) pust check_Images. Please help me in this regard. Regards, Sikander -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061108/327336aa/attachment.html From sikander at marlabs.com Wed Nov 8 08:29:27 2006 From: sikander at marlabs.com (sikander) Date: Wed, 8 Nov 2006 18:59:27 +0530 Subject: [Wtr-general] Is there any way to get all the scr's of images? In-Reply-To: <05ca01c70029$3310d9f0$6400a8c0@laptop> Message-ID: <00be01c70339$ea040660$6520a8c0@caseshare.com> Hi Paul, Its giving error for ie.html.scan(/src\s*=\s*'(.*)?') here. Please correct it. Thanks, _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Saturday, November 04, 2006 9:22 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Is there any way to get all the scr's of images? probably easiest to use a reg exp for this youd have to create the reg exp with care, as there may be white space and different types of quotes, but this might do it ie.html.scan(/src\s*=\s*'(.*)?') that says, find src followed by either space or no space followed by equals followed by a single quote capture the text in the quote If you get it to ork correctly, please post it, as many people may find this useful Paul ----- Original Message ----- From: sikander To: wtr-general at rubyforge.org Sent: Friday, November 03, 2006 10:59 PM Subject: [Wtr-general] Is there any way to get all the scr's of images? Hi All! Is there any way to get all buttons, text boxes, images etc., of a page to display? For Example i want to see all id's or :src's of images of a web page. In that case i may write similar to following code to display all the images of the current page one by one check_Images=$ie.image(:src, /*.jpg/) pust check_Images. Please help me in this regard. Regards, Sikander _____ _______________________________________________ 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/20061108/5816938b/attachment-0001.html From areed at relocationcentral.com Wed Nov 8 08:40:22 2006 From: areed at relocationcentral.com (Adam Reed) Date: Wed, 8 Nov 2006 07:40:22 -0600 Subject: [Wtr-general] Is there any way to get all the scr's of images? Message-ID: <36B5DBA88E027F47812ED877C6A978D8034EB3@rc-mail.relocationcentral.com> I wrote a script a while back that yanks all the elements on a page and puts them in a nicely formatted xml document. The only things I've had to change when sending examples has been to use the 'puts" command at the end rather than the xml inject, and remove the outer "XML.images do" loops that make sure they get written in correctly. I think these should help you figure out my logic since it can be used for all elements. Examples: Buttons: ie.buttons.each do |button| buttons = {'name' => button.name, 'text' => button.value} buttons.each do | it, button | puts "#{it}:#{button}" end Links: ie.links.each do |link| next if link.innerText.empty? #they get this extra line in case they don't have text urls = {'href' => link.href, 'name' => link.innerText} urls.each do | item, url | puts "#{item}:#{url}" end Thanks, Adam ________________________________ From: sikander [mailto:sikander at marlabs.com] Sent: Wednesday, November 08, 2006 7:25 AM To: wtr-general at rubyforge.org Cc: Adam Reed Subject: RE: [Wtr-general] Is there any way to get all the scr's of images? Thanks, the following code works very well for images. How about buttons, drop down list boxes, text boxes. Thanks, Sikander ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Adam Reed Sent: Monday, November 06, 2006 8:57 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Is there any way to get all the scr's of images? I'd use a simple ie-do loop: ie = Watir::IE.new ie.set_fast_speed ie.goto "www.google.com" ie.images.each do |image| images = {'path' => image.src} images.each do | ite, image | puts "#{ite}:#{image}" end end This should output: path:http://www.google.com/images/logo.gif path:http://www.google.com/images/x2.gif Put a little "def Check_images" and add another "end" afterwards, and there's your function. Thanks, Adam ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of sikander Sent: Saturday, November 04, 2006 12:00 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Is there any way to get all the scr's of images? Hi All! Is there any way to get all buttons, text boxes, images etc., of a page to display? For Example i want to see all id's or :src's of images of a web page. In that case i may write similar to following code to display all the images of the current page one by one check_Images=$ie.image(:src, /*.jpg/) pust check_Images. Please help me in this regard. Regards, Sikander -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061108/88730ad8/attachment.html From zeljko.filipin at gmail.com Wed Nov 8 08:47:31 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 8 Nov 2006 14:47:31 +0100 Subject: [Wtr-general] Watir tests as how-to documents Message-ID: You have a bunch of Watir tests, right? With every build of your application under test, you run them all. If a test fails, application should be fixed, or you test should be fixed. Wouldn't it be nice to make how-to documents from that tests? Time for an example. def login_as(username, password) ie.goto("my.app/login") ie.should_contain("please login") ie.text_field(:id, "username").set(username) ie.text_field(:id, "password").set(password) ie.button(:value, "login").click ie.should_contain("logged in as #{username}") end You run that test, and you get output like this: How to login? - go to page my.app/login - there should be text "please login" - enter username at username text field - enter password at password text field - click button login - there should be text "logged in as username" Has anybody done something like this? I am thinking of doing it, but If somebody has done it already, I would like to take a look. Zeljko -- http://zeljkofilipin.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061108/86ea0ef6/attachment.html From richard.conroy at gmail.com Wed Nov 8 08:57:30 2006 From: richard.conroy at gmail.com (Richard Conroy) Date: Wed, 8 Nov 2006 13:57:30 +0000 Subject: [Wtr-general] Watir tests as how-to documents In-Reply-To: References: Message-ID: <511fa3a20611080557y53d38c18k443588256d32923c@mail.gmail.com> On 11/8/06, ?eljko Filipin wrote: > You have a bunch of Watir tests, right? With every build of your application > under test, you run them all. If a test fails, application should be fixed, > or you test should be fixed. Wouldn't it be nice to make how-to documents > from that tests? I am assuming that you are doing this not for the purpose of explaining what the tests do (anyone who can't understand cleanly written WATIR doesn't need the tests explained to them). But you are talking about reverse storyboarding here right? Its got potential alright, especially if you could automatically annotate reports in such a fashion. It would be especially useful if you could extract context from a fail this way (parsing log messages). You might never get a perfect solution, but it could be reasonably deterministic for a respectable amount of non-trivial tests. Useful for training too. From zeljko.filipin at gmail.com Wed Nov 8 10:16:45 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 8 Nov 2006 16:16:45 +0100 Subject: [Wtr-general] Watir tests as how-to documents In-Reply-To: <511fa3a20611080557y53d38c18k443588256d32923c@mail.gmail.com> References: <511fa3a20611080557y53d38c18k443588256d32923c@mail.gmail.com> Message-ID: What I want to do is to generate how-to documents for users of application that I test. When user clicks how-to link (or help, or whatever), there should be list: - login - do something - do something else ... - logout Select login and you get: - go to 'my.app/login.aspx' - there should be text 'Please Login' - at text field Username enter your username - at text field Password enter your password - click button Login - url should be 'my.app/default.aspx' - there should be text 'logged in as [your username]' Zeljko -- http://zeljkofilipin.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061108/a5cfd4e4/attachment.html From christopher.mcmahon at gmail.com Wed Nov 8 10:39:13 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 8 Nov 2006 07:39:13 -0800 Subject: [Wtr-general] Watir tests as how-to documents In-Reply-To: References: Message-ID: <72799cd70611080739q4e041482udb57919e5eb1573d@mail.gmail.com> Check out Joe O'Brien's recent rSpec post: http://objo.com/2006/11/7/rspec-7-is-out That might get you part of the way. -Chris On 11/8/06, ?eljko Filipin wrote: > > You have a bunch of Watir tests, right? With every build of your > application under test, you run them all. If a test fails, application > should be fixed, or you test should be fixed. Wouldn't it be nice to make > how-to documents from that tests? > > Time for an example. > > def login_as(username, password) > ie.goto("my.app/login") > ie.should_contain("please login") > > ie.text_field(:id, "username").set(username) > ie.text_field(:id, "password").set(password) > ie.button(:value, "login").click > ie.should_contain("logged in as #{username}") > end > > You run that test, and you get output like this: > > How to login? > - go to page my.app/login > - there should be text "please login" > > - enter username at username text field > - enter password at password text field > - click button login > > - there should be text "logged in as username" > > Has anybody done something like this? I am thinking of doing it, but If > somebody has done it already, I would like to take a look. > > Zeljko > -- > http://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/20061108/b9e45fa3/attachment.html From bret at pettichord.com Wed Nov 8 10:53:12 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 08 Nov 2006 09:53:12 -0600 Subject: [Wtr-general] Watir tests as how-to documents In-Reply-To: References: Message-ID: <4551FD68.4000709@pettichord.com> ?eljko Filipin wrote: > Has anybody done something like this? I am thinking of doing it, but > If somebody has done it already, I would like to take a look. Systir included something along these lines. You should check it out. From forum-watir-users at openqa.org Wed Nov 8 10:54:19 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Wed, 08 Nov 2006 09:54:19 CST Subject: [Wtr-general] Watir tests as how-to documents In-Reply-To: Message-ID: <58467447.1163001289855.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I do this to a degree, but I consider it to be logging not documentation. I have 3 levels of logging (there are more, but thats besides the point) Section, Test and Details A section would be like "Administration" a test would "Create a New User" and details are "Clicked 'new user', 'Set user name 'Sam' '. When my program runs the output is in excel, and the different types are color coded. The 'details' are normally filtered out, its way too much information. [11:30am] - Administration (this is yellow background) [11:30am] - click new user (this is grey background) [11:30am] - set user name 'sam' (this is grey background) [11:31am] - Login PASS (or if something went wrong, login FAIL, or if it exploded UNKNOWN ERROR) (this is white background) Personally I do not want to generate a test document from my script. My script should be born from a document. Thats me though, it all depends on the situation. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5156&messageID=14301#14301 From forum-watir-users at openqa.org Wed Nov 8 11:51:54 2006 From: forum-watir-users at openqa.org (Bach Le) Date: Wed, 08 Nov 2006 10:51:54 CST Subject: [Wtr-general] spiderwatir! In-Reply-To: <72799cd70611070900q5abb127bjfa7f124a1bec48a4@mail.gmail.com> Message-ID: <36862123.1163004744466.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> This is very interesting news. Opens a whole new arena for functionality testing by allowing us to test even more rich web pages like those using flash, which if I'm not mistaken, is not possible with watir and difficult if not impossible with other technologies. -Bach --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5140&messageID=14309#14309 From paul.rogers at shaw.ca Wed Nov 8 13:06:30 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 08 Nov 2006 11:06:30 -0700 Subject: [Wtr-general] Watir tests as how-to documents In-Reply-To: References: Message-ID: rspec gets closest to doing this. THere is some command line option that you need to use. But I cant rememerb what it is -------------- next part -------------- You have a bunch of Watir tests, right? With every build of your application under test, you run them all. If a test fails, application should be fixed, or you test should be fixed. Wouldn't it be nice to make how-to documents from that tests? Time for an example. def login_as(username, password) ie.goto("my.app/login") ie.should_contain("please login") ie.text_field(:id, "username").set(username) ie.text_field(:id, "password").set(password) ie.button(:value, "login").click ie.should_contain("logged in as #{username}") end You run that test, and you get output like this: How to login? - go to page my.app/login - there should be text "please login" - enter username at username text field - enter password at password text field - click button login - there should be text "logged in as username" Has anybody done something like this? I am thinking of doing it, but If somebody has done it already, I would like to take a look. Zeljko -- http://zeljkofilipin.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061108/ffa3a03d/attachment.html -------------- next part -------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Wed Nov 8 13:10:37 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 08 Nov 2006 11:10:37 -0700 Subject: [Wtr-general] spiderwatir! In-Reply-To: References: <72799cd70611070900q5abb127bjfa7f124a1bec48a4@mail.gmail.com> Message-ID: I didnt read all that article, so maybe I missed something really important.. But isnt this just saying they are going to open source it? Since Im unlikely to read the source, I dont think it will be much help to me. Rumba has been working using flash, Ive sort of proved it can work but got no further. Paul ----- Original Message ----- From: Christian Kreutzer Date: Wednesday, November 8, 2006 4:58 am Subject: Re: [Wtr-general] spiderwatir! > interesting! > This could be the right technology for paul rogers RuMBA project. > > Christian > > On 11/7/06, Chris McMahon wrote: > > > > Here's the next FireWatir or SafariWatir, I think: > > http://www.mozilla.com/en-US/press/mozilla-2006-11-07.html > > > > _______________________________________________ > > 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 dara.lillis at kiodex.com Wed Nov 8 14:42:16 2006 From: dara.lillis at kiodex.com (Lillis, Dara) Date: Wed, 8 Nov 2006 11:42:16 -0800 Subject: [Wtr-general] modal dialogs in IE 7.0 In-Reply-To: Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E018A9268@ehost011-27.exch011.intermedia.net> [sorry for the long delay, I cleverly sent the last email just before going on vacation] I am using dialog rather than winClicker, but it was fairly obvious from your example what change I needed to make. line 32 of watir\dialog.rb OLD unless name_pattern =~ autoit.WinGetText("Microsoft Internet Explorer", "") NEW unless name_pattern =~ autoit.WinGetText("Windows Internet Explorer", "") My code works now. I would assume that to be correctly updated for IE 7.0 all instances of "Microsoft Internet Explorer" in dialog.rb (there are 4) should be updated to read "Windows Internet Explorer", but it works if you only change the one I mention above. Thanks, -Dara -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Thursday, October 26, 2006 10:02 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] modal dialogs in IE 7.0 Dara, I had the same problem, when I started using IE7 a few months ago, and I am pretty sure I know exactly what is wrong. MS changed the popups title bar text in IE7 from 'Microsoft Internet Explorer' to 'Windows Internet Explorer'. So in watir\WinCLicker.rb you will need to change lines 113 and 144: OLD: clickWindowsButton("Microsoft Internet Explorer" , button ) NEW: clickWindowsButton("Windows Internet Explorer" , button ) Hope this helps, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Lillis, Dara Sent: Thursday, October 26, 2006 12:48 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] modal dialogs in IE 7.0 I'm testing IE 7.0. I have run into one problem with modal dialogs. A test that runs fine in IE 6.0, clicking on a modal dialog, hangs in IE 7.0. Here's the offending code: browser.link(:text, 'DELETE').click_no_wait dialog = Watir::Dialog.new dialog.exists? dialog.button('ok').click browser.wait Sorry but I don't have html to post, the html is extremely complex and I can't figure out a simple example. This code works fine with IE 6.0, just hangs (no error message or anything) with IE 7.0 Anyone run into this, or got suggestions? Thanks, -Dara _______________________________________________ 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 herr.kreutzer at googlemail.com Wed Nov 8 14:28:15 2006 From: herr.kreutzer at googlemail.com (Christian Kreutzer) Date: Wed, 8 Nov 2006 20:28:15 +0100 Subject: [Wtr-general] spiderwatir! In-Reply-To: References: <72799cd70611070900q5abb127bjfa7f124a1bec48a4@mail.gmail.com> Message-ID: <42D6D213-2E14-4897-A65C-7FE227EF6D48@googlemail.com> They are going to merge that actionscript VM with the mozilla javascript engine. by reading that article i had the feeling that ideas like Rumba (controlling a browser via flash) or that tools like watiir or selenium have access to flash objects should be much easier to implement then. Christian Am 08.11.2006 um 19:10 schrieb Paul Rogers: > I didnt read all that article, so maybe I missed something really > important.. > > But isnt this just saying they are going to open source it? > > Since Im unlikely to read the source, I dont think it will be much > help to me. > > Rumba has been working using flash, Ive sort of proved it can work > but got no further. > > Paul > > ----- Original Message ----- > From: Christian Kreutzer > Date: Wednesday, November 8, 2006 4:58 am > Subject: Re: [Wtr-general] spiderwatir! > >> interesting! >> This could be the right technology for paul rogers RuMBA project. >> >> Christian >> >> On 11/7/06, Chris McMahon wrote: >>> >>> Here's the next FireWatir or SafariWatir, I think: >>> http://www.mozilla.com/en-US/press/mozilla-2006-11-07.html >>> >>> _______________________________________________ >>> Wtr-general mailing list >>> Wtr-general at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/wtr-general >>> >>> >> _______________________________________________ >> Wtr-general mailing list >> Wtr-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wtr-general >> > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Wed Nov 8 14:39:53 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 08 Nov 2006 13:39:53 -0600 Subject: [Wtr-general] click_no_wait (again) In-Reply-To: <41787581.1162980065955.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <41787581.1162980065955.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <45523289.4010803@pettichord.com> Markus wrote: > Found the solution :) > > IE is my standard browser, but I use Avant instead. When Avant is running (which it usually is), watir uses that instance. Unfortunately usage of Avant causes the exception. I closed it, startet IE 6, ran the example and it worked. > > Is there a way to tell watir to use a specific browser, like "run c:\system\ie.exe"? You can use "system" to start IE and then attach to it. Avant is a modified version of IE and that is why Watir thinks it is IE. Bret From Mark_Cain at RL.gov Wed Nov 8 15:37:37 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Wed, 8 Nov 2006 12:37:37 -0800 Subject: [Wtr-general] modal dialogs in IE 7.0 In-Reply-To: <35AF30C7B5EBFA4DBC854B5B9DF66B0E018A9268@ehost011-27.exch011.intermedia.net> Message-ID: I am pretty sure that is yes. --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Lillis, Dara Sent: Wednesday, November 08, 2006 11:42 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] modal dialogs in IE 7.0 [sorry for the long delay, I cleverly sent the last email just before going on vacation] I am using dialog rather than winClicker, but it was fairly obvious from your example what change I needed to make. line 32 of watir\dialog.rb OLD unless name_pattern =~ autoit.WinGetText("Microsoft Internet Explorer", "") NEW unless name_pattern =~ autoit.WinGetText("Windows Internet Explorer", "") My code works now. I would assume that to be correctly updated for IE 7.0 all instances of "Microsoft Internet Explorer" in dialog.rb (there are 4) should be updated to read "Windows Internet Explorer", but it works if you only change the one I mention above. Thanks, -Dara -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Thursday, October 26, 2006 10:02 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] modal dialogs in IE 7.0 Dara, I had the same problem, when I started using IE7 a few months ago, and I am pretty sure I know exactly what is wrong. MS changed the popups title bar text in IE7 from 'Microsoft Internet Explorer' to 'Windows Internet Explorer'. So in watir\WinCLicker.rb you will need to change lines 113 and 144: OLD: clickWindowsButton("Microsoft Internet Explorer" , button ) NEW: clickWindowsButton("Windows Internet Explorer" , button ) Hope this helps, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Lillis, Dara Sent: Thursday, October 26, 2006 12:48 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] modal dialogs in IE 7.0 I'm testing IE 7.0. I have run into one problem with modal dialogs. A test that runs fine in IE 6.0, clicking on a modal dialog, hangs in IE 7.0. Here's the offending code: browser.link(:text, 'DELETE').click_no_wait dialog = Watir::Dialog.new dialog.exists? dialog.button('ok').click browser.wait Sorry but I don't have html to post, the html is extremely complex and I can't figure out a simple example. This code works fine with IE 6.0, just hangs (no error message or anything) with IE 7.0 Anyone run into this, or got suggestions? Thanks, -Dara _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From charley.baker at gmail.com Wed Nov 8 16:08:37 2006 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 8 Nov 2006 14:08:37 -0700 Subject: [Wtr-general] modal dialogs in IE 7.0 In-Reply-To: <35AF30C7B5EBFA4DBC854B5B9DF66B0E018A9268@ehost011-27.exch011.intermedia.net> References: <35AF30C7B5EBFA4DBC854B5B9DF66B0E018A9268@ehost011-27.exch011.intermedia.net> Message-ID: Hi Dara, Could you make sure to add this to the defect list in Jira so that we can keep track of it? http://jira.openqa.org/browse/WTR Thanks, Charley On 11/8/06, Lillis, Dara wrote: > [sorry for the long delay, I cleverly sent the last email just before > going on vacation] > > I am using dialog rather than winClicker, but it was fairly obvious from > your example what change I needed to make. line 32 of watir\dialog.rb > > OLD > unless name_pattern =~ autoit.WinGetText("Microsoft Internet Explorer", > "") > > NEW > unless name_pattern =~ autoit.WinGetText("Windows Internet Explorer", > "") > > My code works now. I would assume that to be correctly updated for IE > 7.0 all instances of "Microsoft Internet Explorer" in dialog.rb (there > are 4) should be updated to read "Windows Internet Explorer", but it > works if you only change the one I mention above. > > Thanks, > > -Dara > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark > Sent: Thursday, October 26, 2006 10:02 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] modal dialogs in IE 7.0 > > Dara, I had the same problem, when I started using IE7 a few months ago, > and I am pretty sure I know exactly what is wrong. MS changed the > popups title bar text in IE7 from 'Microsoft Internet Explorer' to > 'Windows Internet Explorer'. So in watir\WinCLicker.rb you will need to > change lines 113 and 144: > > OLD: > clickWindowsButton("Microsoft Internet Explorer" , button ) > > NEW: > clickWindowsButton("Windows Internet Explorer" , button ) > > Hope this helps, > > --Mark > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Lillis, Dara > Sent: Thursday, October 26, 2006 12:48 AM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] modal dialogs in IE 7.0 > > I'm testing IE 7.0. I have run into one problem with modal dialogs. A > test that runs fine in IE 6.0, clicking on a modal dialog, hangs in IE > 7.0. > > Here's the offending code: > > browser.link(:text, 'DELETE').click_no_wait > dialog = Watir::Dialog.new > dialog.exists? > dialog.button('ok').click > browser.wait > > Sorry but I don't have html to post, the html is extremely complex and I > can't figure out a simple example. > > This code works fine with IE 6.0, just hangs (no error message or > anything) with IE 7.0 > > Anyone run into this, or got suggestions? > > Thanks, > > -Dara > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From dara.lillis at kiodex.com Wed Nov 8 16:18:28 2006 From: dara.lillis at kiodex.com (Lillis, Dara) Date: Wed, 8 Nov 2006 13:18:28 -0800 Subject: [Wtr-general] modal dialogs in IE 7.0 In-Reply-To: Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E018A929A@ehost011-27.exch011.intermedia.net> already done: http://jira.openqa.org/browse/WTR-115 -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Charley Baker Sent: Wednesday, November 08, 2006 4:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] modal dialogs in IE 7.0 Hi Dara, Could you make sure to add this to the defect list in Jira so that we can keep track of it? http://jira.openqa.org/browse/WTR Thanks, Charley On 11/8/06, Lillis, Dara wrote: > [sorry for the long delay, I cleverly sent the last email just before > going on vacation] > > I am using dialog rather than winClicker, but it was fairly obvious > from your example what change I needed to make. line 32 of > watir\dialog.rb > > OLD > unless name_pattern =~ autoit.WinGetText("Microsoft Internet > Explorer", > "") > > NEW > unless name_pattern =~ autoit.WinGetText("Windows Internet Explorer", > "") > > My code works now. I would assume that to be correctly updated for IE > 7.0 all instances of "Microsoft Internet Explorer" in dialog.rb (there > are 4) should be updated to read "Windows Internet Explorer", but it > works if you only change the one I mention above. > > Thanks, > > -Dara > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark > Sent: Thursday, October 26, 2006 10:02 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] modal dialogs in IE 7.0 > > Dara, I had the same problem, when I started using IE7 a few months > ago, and I am pretty sure I know exactly what is wrong. MS changed > the popups title bar text in IE7 from 'Microsoft Internet Explorer' to > 'Windows Internet Explorer'. So in watir\WinCLicker.rb you will need > to change lines 113 and 144: > > OLD: > clickWindowsButton("Microsoft Internet Explorer" , button ) > > NEW: > clickWindowsButton("Windows Internet Explorer" , button ) > > Hope this helps, > > --Mark > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Lillis, Dara > Sent: Thursday, October 26, 2006 12:48 AM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] modal dialogs in IE 7.0 > > I'm testing IE 7.0. I have run into one problem with modal dialogs. A > test that runs fine in IE 6.0, clicking on a modal dialog, hangs in IE > 7.0. > > Here's the offending code: > > browser.link(:text, 'DELETE').click_no_wait > dialog = Watir::Dialog.new > dialog.exists? > dialog.button('ok').click > browser.wait > > Sorry but I don't have html to post, the html is extremely complex and > I can't figure out a simple example. > > This code works fine with IE 6.0, just hangs (no error message or > anything) with IE 7.0 > > Anyone run into this, or got suggestions? > > Thanks, > > -Dara > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From forum-watir-users at openqa.org Thu Nov 9 10:30:14 2006 From: forum-watir-users at openqa.org (Nathan) Date: Thu, 09 Nov 2006 09:30:14 CST Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two hours - see details Message-ID: <43289313.1163086767555.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Good morning, I have created a very nice script that does a few specialized things in the way of testing our website using Watir. First of all it is not your typical test, as it is a Spider or Web Crawler specialized to crawl our website. It only touches links that contain our domain, that aren't associated with basic menu navigation (because the same menus are on every page) and those that don't belong to individual forms, such as submit buttons that are actually images that send data to ASPX web applications. Those are just some technical details, though they aren't really important. The Spider does no clicking, rather it goes to a page that was previously defined and gathers all of the links on that page to use later. The following explains briefly the recursive method used: 1. Go to home page 2. Gather all of the links on that page 3. Remove links that are associated with menus, images, forms, or that go outside of our website from the array 4. Go to each page in the array (using IE.goto) 5. Return to step two for each page This is a recursive method, so it only ever makes one array of all of the links in the long run. It's really quite amazing, simple, and intuitive. Besides the rules that are defined specifically for our website (step 3), one could use this same algorithm on pretty much any website to crawl it. Also one must define how many levels of links deep to recurse, otherwise it would potentially run forever, given perfect conditions. Now on to my problem. When I run my recursive script, I expect it to traverse every link within our rules to four levels by default. As the Spider goes through our website it collects a great number of links - level 1 = 1, level 2 = 27, level 3 = 475, level 4 = 2670. It does a great job of getting through everything until suddenly it gets to the 129th out of 2670 on level 4, then it throws the following exception and gives the following baffling information (baffling because it doesn't seem like it should do this, read through the stack trace and my comments afterward before you draw any conclusions please - this is completely consistent - happens in the same place every time, so I haven't ruled out a website issue, but please continue): c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1347:in `method_missing': unknown proper ty or method `document' (WIN32OLERuntimeError) HRESULT error code:0x800706ba The RPC server is unavailable. from c:/ruby/lib/ruby/site_ruby/1.8/wati r.rb:1347:in `document' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3648:in `length' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2088:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:620:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:620:in `images' from C:/Documents and Settings/nathanl/My Documents/Watir Tests/Spider/S pider.rb:91:in `blnCheckAllImages' from C:/Documents and Settings/nathanl/My Documents/Watir Tests/Spider/S pider.rb:234:in `recurseLinks' from C:/Documents and Settings/nathanl/My Documents/Watir Tests/Spider/S pider.rb:219:in `each' from C:/Documents and Settings/nathanl/My Documents/Watir Tests/Spider/S pider.rb:219:in `recurseLinks' from C:/Documents and Settings/nathanl/My Documents/Watir Tests/Spider/S pider.rb:286:in `recurseLinks' from C:/Documents and Settings/nathanl/My Documents/Watir Tests/Spider/S pider.rb:362 from c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' from C:/Documents and Settings/nathanl/My Documents/Watir Tests/Spider/S pider.rb:356 As you can see it appears as though the RPC server stopped, or became futily busy (I know futily isn't a word, but I think you can get my drift if you've ever seen a Borg episode of Star Trek). For my problems I found the following article in the forums (linked here http://www.mail-archive.com/wtr-general at rubyforge.org/msg05305.html): "...This can happen in the following scenario 1. create browser 2. close browser 3. create browser -- error sometimes happens here The problem lies in the way IE is structured and the way that Watir 1.4 interacts with it. Specifically, Watir creates a "client windows" that interacts with the "IE RPC Server". This is not a web server, but rather the IE process running on your computer. When the last client to this server is closed, the "server" will also start closing, but this happens asynchronously. [b]In your case, you are probably trying to get a new IE window, and it is trying to connect to the IE RPC server that is actually in the process of closing down. The simplest workaround is to reuse IE windows instead of opening and closing them.[/b] Another workaround is to leave IE window open at the beginning of your session (it can be invisible) and then when you open and close windows, the IE RPC Server will never shutdown, because there always will be one window connected to it..." Notice the part I highlighted in bold, that would be the logical problem/solution scenario, wouldn't it, but I ALWAYS reuse the same window, and never try to attach to another window or open a new window. I also have taken a screenshot of every page I've browsed to (378 pages so far). I am using Watir 1.4 (latest) and Ruby 1.8.5-21 I believe on Windows (of course) with Internet Explorer 6. PLEASE, please help me if you have a solution. I have thought to maybe put a begin...rescue...end block around some of my code to try and keep this from happening, but I'm not sure that would do any good. Oh also, I know pretty much that something WIERD is going on because my browser window is always closed at this point - when the error occurs, which is obviously the reason for the RPC Server problem. But WHY is it closing? I do not believe that you seeing my code would help any. One other hint I can give as to what I see is the following, which is a larger bit of my log near the end, showing what happened on the two pages before the script choked - also I love Watir, it's awesome! (Some notes, the '-----' signify when a new page is loaded and when one has been completely taken care of, i.e. links gathered, etc., and the '.....|' symbolize checking images to see if any are broken - I do that by checking whether the file size of the image is -1 or greater than 0, because if it's -1, then it's broken): I, [2006-11-08T18:01:08.425000 #5768] INFO -- : * Benchmark - http://www.stagin g.vehix.com/finance/calculators/LowInterestFinancing.aspx?radius=75&year=&condit ion=1: Seconds to browse to http://www.staging.vehix.com/finance/calculators/Low InterestFinancing.aspx?radius=75&year=&condition=1: (3.133000) seconds I, [2006-11-08T18:01:08.425000 #5768] INFO -- : * Current URL: http://www.stagi ng.vehix.com/finance/calculators/LowInterestFinancing.aspx?radius=75&year=&condi tion=1 I, [2006-11-08T18:01:08.425000 #5768] INFO -- : * Total number of images on thi s page = 37 ....................................| I, [2006-11-08T18:01:08.986000 #5768] INFO -- : * Last erroneous image (-1 if n one): -1 I, [2006-11-08T18:01:09.298000 #5768] INFO -- : * Stored screenshot: Browsed to Vehix.com - Calculators _ Low Interest Financing_1163034068 level 4 I, [2006-11-08T18:01:09.469000 #5768] INFO -- : * Added 11 links to strHrefArra y. I, [2006-11-08T18:01:09.469000 #5768] INFO -- : * Stored links for page 128/267 0 into objSubTempArray - gathered from level 3 ------------------------- I, [2006-11-08T18:01:12.010000 #5768] INFO -- : * Benchmark - http://www.stagin g.vehix.com/finance/calculators/RebateVsLowInterest.aspx?radius=75&year=&conditi on=1: Seconds to browse to http://www.staging.vehix.com/finance/calculators/Reba teVsLowInterest.aspx?radius=75&year=&condition=1: (2.541000) seconds I, [2006-11-08T18:01:12.010000 #5768] INFO -- : * Current URL: http://www.stagi ng.vehix.com/finance/calculators/RebateVsLowInterest.aspx?radius=75&year=&condit ion=1 I, [2006-11-08T18:01:12.010000 #5768] INFO -- : * Total number of images on thi s page = 37 ....................................| I, [2006-11-08T18:01:12.337000 #5768] INFO -- : * Last erroneous image (-1 if n one): -1 I, [2006-11-08T18:01:12.617000 #5768] INFO -- : * Stored screenshot: Browsed to Vehix.com - Calculators _ Rebate vs. Low Interest_1163034072 level 4 I, [2006-11-08T18:01:12.805000 #5768] INFO -- : * Added 11 links to strHrefArra y. I, [2006-11-08T18:01:12.805000 #5768] INFO -- : * Stored links for page 129/267 0 into objSubTempArray - gathered from level 3 ------------------------- W, [08-Nov-2006 18:01:18#5768] WARN -- : runtime error in wait I, [2006-11-08T18:01:18.353000 #5768] INFO -- : * Benchmark - http://www.stagin g.vehix.com/finance/creditReport.aspx?radius=75&year=&condition=1: Seconds to br owse to http://www.staging.vehix.com/finance/creditReport.aspx?radius=75&year=&c ondition=1: (5.548000) seconds c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1347:in `method_missing': unknown proper ty or method `document' (WIN32OLERuntimeError) HRESULT error code:0x800706ba The RPC server is unavailable. from c:/ruby/lib/ruby/site_ruby/1.8/wati r.rb:1347:in `document' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3648:in `length' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2088:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:620:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:620:in `images' from C:/Documents and Settings/nathanl/My Documents/Watir Tests/Spider/S pider.rb:91:in `blnCheckAllImages' from C:/Documents and Settings/nathanl/My Documents/Watir Tests/Spider/S pider.rb:234:in `recurseLinks' from C:/Documents and Settings/nathanl/My Documents/Watir Tests/Spider/S pider.rb:219:in `each' from C:/Documents and Settings/nathanl/My Documents/Watir Tests/Spider/S pider.rb:219:in `recurseLinks' from C:/Documents and Settings/nathanl/My Documents/Watir Tests/Spider/S pider.rb:286:in `recurseLinks' from C:/Documents and Settings/nathanl/My Documents/Watir Tests/Spider/S pider.rb:362 from c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' from C:/Documents and Settings/nathanl/My Documents/Watir Tests/Spider/S pider.rb:356 Thank you very much in advance. Nathan Lane --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5183&messageID=14370#14370 From forum-watir-users at openqa.org Thu Nov 9 10:43:34 2006 From: forum-watir-users at openqa.org (Parv) Date: Thu, 09 Nov 2006 09:43:34 CST Subject: [Wtr-general] detecting an item in drop down list Message-ID: <58369147.1163087044218.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello Everyone, Is there a way to detect an item in a drop down list? Thanks, Parv --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5184&messageID=14371#14371 From mrussell at inpses.co.uk Thu Nov 9 11:06:26 2006 From: mrussell at inpses.co.uk (Max Russell) Date: Thu, 9 Nov 2006 16:06:26 -0000 Subject: [Wtr-general] more suite questions Message-ID: I'm still working away on a suite, I've got something basic setup, but have been trying to get logging working. So I've got a harness which has this code class TestSuite < Test::Unit::TestCase def test_simple load 'simple.rb' end which as you can see, loads up simple and runs it. Simple, after a few actions, has an assert block like this... begin assert(ie.frame("main").contains_text("centralvision") ) logger.log("Passed. Found test string 'centralvision' ") logger.log_results("test_simple_login", "centralvision","centralvision", "TEST PASSED.") rescue => e logger.log("*FAILED*." + e.message + "\n" + e.backtrace.join("\n")) logger.log_results("test_simple_login", "centralvision","centralvision", "TEST FAILED.") end (You'll probably notice I'm, for now, using the format of the logger suggested in the Scripting101 docs.) Anyway - the asserts work fine, and I can see the correct results in the logs, but the harness returns Loaded suite simple Started Finished in 0.0 seconds. 0 tests, 0 assertions, 0 failures, 0 errors Which is presumably because no assertions were made in the harness? Isn't it possible to use this code block in the test being loaded in? Or should I be doing this differently? I've found the suite on openqa.org to be useful as an example, but am getting a bit stuck here. Max Russell test Analyst. InPS Tel: 01382 223900 Fax: 01382 204488 Visit our Web site at www.inps.co.uk The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of In Practice Systems Limited or any of its affiliates. If you are not the intended recipient please contact is.helpdesk at inps.co.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061109/fea335c6/attachment-0001.html From areed at relocationcentral.com Thu Nov 9 11:22:33 2006 From: areed at relocationcentral.com (Adam Reed) Date: Thu, 9 Nov 2006 10:22:33 -0600 Subject: [Wtr-general] Is there any way to get all the scr's of images? Message-ID: <36B5DBA88E027F47812ED877C6A978D8034EB8@rc-mail.relocationcentral.com> No prob -- also thought you might be interested in this. If you want to calculate and/or display the totals for elements, this is what I use: puts "#{$ie.links.length} urls" puts "#{$ie.images.length} images" puts "#{$ie.buttons.length} buttons" puts "#{$ie.text_fields.length} text fields" puts "#{$ie.ps.length} paragraphs" puts "#{$ie.spans.length} spans" puts "#{$ie.divs.length} divs" puts "#{$ie.radios.length} radio menus" puts "#{$ie.select_lists.length} list menus" puts "#{$ie.checkboxes.length} checkboxes" ________________________________ From: sikander [mailto:sikander at marlabs.com] Sent: Thursday, November 09, 2006 2:29 AM To: Adam Reed Subject: RE: [Wtr-general] Is there any way to get all the scr's of images? Thanks Adam, Sikander ________________________________ From: Adam Reed [mailto:areed at relocationcentral.com] Sent: Wednesday, November 08, 2006 7:10 PM To: wtr-general at rubyforge.org Cc: sikander at marlabs.com Subject: RE: [Wtr-general] Is there any way to get all the scr's of images? I wrote a script a while back that yanks all the elements on a page and puts them in a nicely formatted xml document. The only things I've had to change when sending examples has been to use the 'puts" command at the end rather than the xml inject, and remove the outer "XML.images do" loops that make sure they get written in correctly. I think these should help you figure out my logic since it can be used for all elements. Examples: Buttons: ie.buttons.each do |button| buttons = {'name' => button.name, 'text' => button.value} buttons.each do | it, button | puts "#{it}:#{button}" end Links: ie.links.each do |link| next if link.innerText.empty? #they get this extra line in case they don't have text urls = {'href' => link.href, 'name' => link.innerText} urls.each do | item, url | puts "#{item}:#{url}" end Thanks, Adam ________________________________ From: sikander [mailto:sikander at marlabs.com] Sent: Wednesday, November 08, 2006 7:25 AM To: wtr-general at rubyforge.org Cc: Adam Reed Subject: RE: [Wtr-general] Is there any way to get all the scr's of images? Thanks, the following code works very well for images. How about buttons, drop down list boxes, text boxes. Thanks, Sikander ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Adam Reed Sent: Monday, November 06, 2006 8:57 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Is there any way to get all the scr's of images? I'd use a simple ie-do loop: ie = Watir::IE.new ie.set_fast_speed ie.goto "www.google.com" ie.images.each do |image| images = {'path' => image.src} images.each do | ite, image | puts "#{ite}:#{image}" end end This should output: path:http://www.google.com/images/logo.gif path:http://www.google.com/images/x2.gif Put a little "def Check_images" and add another "end" afterwards, and there's your function. Thanks, Adam ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of sikander Sent: Saturday, November 04, 2006 12:00 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Is there any way to get all the scr's of images? Hi All! Is there any way to get all buttons, text boxes, images etc., of a page to display? For Example i want to see all id's or :src's of images of a web page. In that case i may write similar to following code to display all the images of the current page one by one check_Images=$ie.image(:src, /*.jpg/) pust check_Images. Please help me in this regard. Regards, Sikander -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061109/e7cb556f/attachment.html From wpreul at gmail.com Thu Nov 9 11:46:22 2006 From: wpreul at gmail.com (Wyatt Preul) Date: Thu, 9 Nov 2006 11:46:22 -0500 Subject: [Wtr-general] Watir Test Case Documents... Message-ID: I was curious if anyone has created any test case documents specific for performing Watir testing? If you have, what items did you include in your document? I particularly like the test case table that is used in the WET quickstart guide: http://wet.qantom.org/quickstart_tut.html, however, I am not impressed at all by WET, but that is another topic entirely. Here are some of the items that I think are important: Title Description Dependencies Watir Test Step - Actions Taken - Expectations Specified Open Issues -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061109/4bcccc6d/attachment.html From lonny at titanez.net Wed Nov 8 16:52:26 2006 From: lonny at titanez.net (Lonny Eachus) Date: Wed, 08 Nov 2006 13:52:26 -0800 Subject: [Wtr-general] modal dialogs in IE 7.0 In-Reply-To: References: Message-ID: <4552519A.3030109@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061108/b8f32bf3/attachment.html From lonny at titanez.net Wed Nov 8 11:42:18 2006 From: lonny at titanez.net (Lonny Eachus) Date: Wed, 08 Nov 2006 08:42:18 -0800 Subject: [Wtr-general] click_no_wait (again) In-Reply-To: References: Message-ID: <455208EA.7020905@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061108/dbb44fdf/attachment.html From bret at pettichord.com Thu Nov 9 12:40:44 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 09 Nov 2006 11:40:44 -0600 Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two hours - see details In-Reply-To: <43289313.1163086767555.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <43289313.1163086767555.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4553681C.2010902@pettichord.com> Thanks for your detailed report on how you are using Watir. I agree that the error you see happens because your IE window is closed. I don't know why it closed, either. You need to restructure your testing system so you can get more information about what is causing the window to close. And you need to be able to reproduce the error in less than 2 hours. Bret From mail at chriss-baumann.de Thu Nov 9 13:12:52 2006 From: mail at chriss-baumann.de (Christian Baumann) Date: Thu, 09 Nov 2006 19:12:52 +0100 Subject: [Wtr-general] Watir Test Case Documents... In-Reply-To: References: Message-ID: <45536FA4.1020408@chriss-baumann.de> Hello Wyatt, what?s about the items descriped in IEEE 829?! Regards, Christian Wyatt Preul schrieb: > I was curious if anyone has created any test case documents specific > for performing Watir testing? If you have, what items did you include > in your document? > I particularly like the test case table that is used in the WET > quickstart guide: http://wet.qantom.org/quickstart_tut.html, however, > I am not impressed at all by WET, but that is another topic entirely. > > Here are some of the items that I think are important: > > Title > Description > Dependencies > Watir Test Step > - Actions Taken > - Expectations Specified > Open Issues > > ------------------------------------------------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From mail at chriss-baumann.de Thu Nov 9 13:21:49 2006 From: mail at chriss-baumann.de (Christian Baumann) Date: Thu, 09 Nov 2006 19:21:49 +0100 Subject: [Wtr-general] detecting an item in drop down list In-Reply-To: <58369147.1163087044218.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <58369147.1163087044218.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <455371BD.8030802@chriss-baumann.de> Hi parv, just check the first result of a google-search for 'watir dropdown list': http://www.google.de/search?hs=cW0&hl=de&client=opera&rls=de&q=watir+dropdown+list&btnG=Suche&meta=lr%3D Regards, Christian Parv schrieb: > Hello Everyone, > > Is there a way to detect an item in a drop down list? > > Thanks, > Parv > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5184&messageID=14371#14371 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From bret at pettichord.com Thu Nov 9 14:30:34 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 09 Nov 2006 13:30:34 -0600 Subject: [Wtr-general] detecting an item in drop down list In-Reply-To: <58369147.1163087044218.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <58369147.1163087044218.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <455381DA.5050504@pettichord.com> Parv wrote: > Hello Everyone, > > Is there a way to detect an item in a drop down list? > Yes. Here is the info for Watir 1.4 http://wtr.rubyforge.org/rdoc/classes/Watir/SelectList.html In Watir 1.5, you can use the new SelectList#includes? and SelectList#selected?. E.g: assert(ie.select_list(:name, 'foo').includes? 'bar') From forum-watir-users at openqa.org Thu Nov 9 14:31:23 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Thu, 09 Nov 2006 13:31:23 CST Subject: [Wtr-general] detecting an item in drop down list In-Reply-To: <58369147.1163087044218.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <43046007.1163100714013.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> As with everything i type, I'm sure its not the best of way of doing it. Heres a quick way of getting it working until someone comes along and helps. select_list = $ie.select_list( :name , 'yourSelectListHere'). select_list.text.include? 'What you want to find' Message was edited by: jlolis --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5184&messageID=14390#14390 From forum-watir-users at openqa.org Thu Nov 9 15:04:31 2006 From: forum-watir-users at openqa.org (Nathan) Date: Thu, 09 Nov 2006 14:04:31 CST Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two In-Reply-To: <4553681C.2010902@pettichord.com> Message-ID: <47980452.1163102701477.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you for the compliment. I'm sorry that I didn't give enough detail. Can you or somebody else give me an idea of what else I might log/track in order to give you an idea of what might be going on or even me? At this point I'm not exactly sure what to do, because obviously my browser shuts down for some reason, which causes the wait method to suddenly stop, which causes an exception to be thrown. The stack trace is no more helpful than that, and I can see that, either to you or to me. I'm usually pretty much able to take care of myself, but not this time. Do you think that reopening my browser might help? Something else, sometimes I lose the attachment to the OLE object for IE, this is also only reproducible over a couple of hours. Is there some mechanism perhaps on the OLE side that might cause this, like a timeout that I can change or so? I most recently saw this error, where I lost the window, but it was still open, and when I verified it in my script by returning the HWND to the screen, it threw another exception stating that it could not find it. I just thought of something I might be able to try if my window is still open - perhaps I could try the iteration again by before the sub processes go, get the title of the window, then if I lose the window, try and reattach to it by its title...hmmm. What does anybody think? Thanks again Bret for your response. It at least got me thinking! Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5183&messageID=14392#14392 From phlip2005 at gmail.com Thu Nov 9 15:22:47 2006 From: phlip2005 at gmail.com (Phlip) Date: Thu, 9 Nov 2006 12:22:47 -0800 Subject: [Wtr-general] handle exhaustion References: <6dea3120611091204i1395047fi69809b589938ce83@mail.gmail.com> Message-ID: <00a001c7043c$d5dabea0$81a1b04c@Marley> > >Now how to get rid of all the IEs that pop up in a tested state during > >the run? > > $HIDE_IE=true I think this is what you are looking for. > > Brian Won't they still exist in memory? -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! From paul.rogers at shaw.ca Thu Nov 9 15:29:03 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 09 Nov 2006 13:29:03 -0700 Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two hours - see details References: <43289313.1163086767555.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <022901c7043d$b32c75a0$6400a8c0@laptop> can you access that link without going through your recursive script? Does it do anything special if done directly? ----- Original Message ----- From: "Nathan" To: Sent: Thursday, November 09, 2006 8:30 AM Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two hours - see details > Good morning, > > I have created a very nice script that does a few specialized things in > the way of testing our website using Watir. First of all it is not your > typical test, as it is a Spider or Web Crawler specialized to crawl our > website. It only touches links that contain our domain, that aren't > associated with basic menu navigation (because the same menus are on every > page) and those that don't belong to individual forms, such as submit > buttons that are actually images that send data to ASPX web applications. > Those are just some technical details, though they aren't really > important. The Spider does no clicking, rather it goes to a page that was > previously defined and gathers all of the links on that page to use later. > The following explains briefly the recursive method used: > > 1. Go to home page > 2. Gather all of the links on that page > 3. Remove links that are associated with menus, images, forms, or that go > outside of our website from the array > 4. Go to each page in the array (using IE.goto) > 5. Return to step two for each page > > This is a recursive method, so it only ever makes one array of all of the > links in the long run. It's really quite amazing, simple, and intuitive. > Besides the rules that are defined specifically for our website (step 3), > one could use this same algorithm on pretty much any website to crawl it. > Also one must define how many levels of links deep to recurse, otherwise > it would potentially run forever, given perfect conditions. Now on to my > problem. > > When I run my recursive script, I expect it to traverse every link within > our rules to four levels by default. As the Spider goes through our > website it collects a great number of links - level 1 = 1, level 2 = 27, > level 3 = 475, level 4 = 2670. It does a great job of getting through > everything until suddenly it gets to the 129th out of 2670 on level 4, > then it throws the following exception and gives the following baffling > information (baffling because it doesn't seem like it should do this, read > through the stack trace and my comments afterward before you draw any > conclusions please - this is completely consistent - happens in the same > place every time, so I haven't ruled out a website issue, but please > continue): > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1347:in `method_missing': unknown > proper > ty or method `document' (WIN32OLERuntimeError) > HRESULT error code:0x800706ba > The RPC server is unavailable. from > c:/ruby/lib/ruby/site_ruby/1.8/wati > r.rb:1347:in `document' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3648:in `length' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2088:in `initialize' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:620:in `new' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:620:in `images' > from C:/Documents and Settings/nathanl/My Documents/Watir > Tests/Spider/S > pider.rb:91:in `blnCheckAllImages' > from C:/Documents and Settings/nathanl/My Documents/Watir > Tests/Spider/S > pider.rb:234:in `recurseLinks' > from C:/Documents and Settings/nathanl/My Documents/Watir > Tests/Spider/S > pider.rb:219:in `each' > from C:/Documents and Settings/nathanl/My Documents/Watir > Tests/Spider/S > pider.rb:219:in `recurseLinks' > from C:/Documents and Settings/nathanl/My Documents/Watir > Tests/Spider/S > pider.rb:286:in `recurseLinks' > from C:/Documents and Settings/nathanl/My Documents/Watir > Tests/Spider/S > pider.rb:362 > from c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' > from C:/Documents and Settings/nathanl/My Documents/Watir > Tests/Spider/S > pider.rb:356 > > As you can see it appears as though the RPC server stopped, or became > futily busy (I know futily isn't a word, but I think you can get my drift > if you've ever seen a Borg episode of Star Trek). For my problems I found > the following article in the forums (linked here > http://www.mail-archive.com/wtr-general at rubyforge.org/msg05305.html): > > "...This can happen in the following scenario > > 1. create browser > 2. close browser > 3. create browser > -- error sometimes happens here > > The problem lies in the way IE is structured and the way that Watir 1.4 > interacts with it. Specifically, Watir creates a "client windows" that > interacts with the "IE RPC Server". This is not a web server, but rather > the IE process running on your computer. When the last client to this > server is closed, the "server" will also start closing, but this happens > asynchronously. [b]In your case, you are probably trying to get a new IE > window, and it is trying to connect to the IE RPC server that is actually > in the process of closing down. > > The simplest workaround is to reuse IE windows instead of opening and > closing them.[/b] Another workaround is to leave IE window open at the > beginning of your session (it can be invisible) and then when you open and > close windows, the IE RPC Server will never shutdown, because there always > will be one window connected to it..." > > Notice the part I highlighted in bold, that would be the logical > problem/solution scenario, wouldn't it, but I ALWAYS reuse the same > window, and never try to attach to another window or open a new window. I > also have taken a screenshot of every page I've browsed to (378 pages so > far). > > I am using Watir 1.4 (latest) and Ruby 1.8.5-21 I believe on Windows (of > course) with Internet Explorer 6. PLEASE, please help me if you have a > solution. I have thought to maybe put a begin...rescue...end block around > some of my code to try and keep this from happening, but I'm not sure that > would do any good. Oh also, I know pretty much that something WIERD is > going on because my browser window is always closed at this point - when > the error occurs, which is obviously the reason for the RPC Server > problem. But WHY is it closing? I do not believe that you seeing my code > would help any. One other hint I can give as to what I see is the > following, which is a larger bit of my log near the end, showing what > happened on the two pages before the script choked - also I love Watir, > it's awesome! (Some notes, the '-----' signify when a new page is loaded > and when one has been completely taken care of, i.e. links gathered, etc., > and the '.....|' symbolize checking images to see i > f any are broken - I do that by checking whether the file size of the > image is -1 or greater than 0, because if it's -1, then it's broken): > > I, [2006-11-08T18:01:08.425000 #5768] INFO -- : * Benchmark - > http://www.stagin > g.vehix.com/finance/calculators/LowInterestFinancing.aspx?radius=75&year=&condit > ion=1: Seconds to browse to > http://www.staging.vehix.com/finance/calculators/Low > InterestFinancing.aspx?radius=75&year=&condition=1: (3.133000) seconds > I, [2006-11-08T18:01:08.425000 #5768] INFO -- : * Current URL: > http://www.stagi > ng.vehix.com/finance/calculators/LowInterestFinancing.aspx?radius=75&year=&condi > tion=1 > I, [2006-11-08T18:01:08.425000 #5768] INFO -- : * Total number of images > on thi > s page = 37 > ....................................| > I, [2006-11-08T18:01:08.986000 #5768] INFO -- : * Last erroneous image > (-1 if n > one): -1 > I, [2006-11-08T18:01:09.298000 #5768] INFO -- : * Stored screenshot: > Browsed to > Vehix.com - Calculators _ Low Interest Financing_1163034068 level 4 > I, [2006-11-08T18:01:09.469000 #5768] INFO -- : * Added 11 links to > strHrefArra > y. > I, [2006-11-08T18:01:09.469000 #5768] INFO -- : * Stored links for page > 128/267 > 0 into objSubTempArray - gathered from level 3 > ------------------------- > I, [2006-11-08T18:01:12.010000 #5768] INFO -- : * Benchmark - > http://www.stagin > g.vehix.com/finance/calculators/RebateVsLowInterest.aspx?radius=75&year=&conditi > on=1: Seconds to browse to > http://www.staging.vehix.com/finance/calculators/Reba > teVsLowInterest.aspx?radius=75&year=&condition=1: (2.541000) seconds > I, [2006-11-08T18:01:12.010000 #5768] INFO -- : * Current URL: > http://www.stagi > ng.vehix.com/finance/calculators/RebateVsLowInterest.aspx?radius=75&year=&condit > ion=1 > I, [2006-11-08T18:01:12.010000 #5768] INFO -- : * Total number of images > on thi > s page = 37 > ....................................| > I, [2006-11-08T18:01:12.337000 #5768] INFO -- : * Last erroneous image > (-1 if n > one): -1 > I, [2006-11-08T18:01:12.617000 #5768] INFO -- : * Stored screenshot: > Browsed to > Vehix.com - Calculators _ Rebate vs. Low Interest_1163034072 level 4 > I, [2006-11-08T18:01:12.805000 #5768] INFO -- : * Added 11 links to > strHrefArra > y. > I, [2006-11-08T18:01:12.805000 #5768] INFO -- : * Stored links for page > 129/267 > 0 into objSubTempArray - gathered from level 3 > ------------------------- > W, [08-Nov-2006 18:01:18#5768] WARN -- : runtime error in wait > I, [2006-11-08T18:01:18.353000 #5768] INFO -- : * Benchmark - > http://www.stagin > g.vehix.com/finance/creditReport.aspx?radius=75&year=&condition=1: Seconds > to br > owse to > http://www.staging.vehix.com/finance/creditReport.aspx?radius=75&year=&c > ondition=1: (5.548000) seconds > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1347:in `method_missing': unknown > proper > ty or method `document' (WIN32OLERuntimeError) > HRESULT error code:0x800706ba > The RPC server is unavailable. from > c:/ruby/lib/ruby/site_ruby/1.8/wati > r.rb:1347:in `document' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3648:in `length' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2088:in `initialize' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:620:in `new' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:620:in `images' > from C:/Documents and Settings/nathanl/My Documents/Watir > Tests/Spider/S > pider.rb:91:in `blnCheckAllImages' > from C:/Documents and Settings/nathanl/My Documents/Watir > Tests/Spider/S > pider.rb:234:in `recurseLinks' > from C:/Documents and Settings/nathanl/My Documents/Watir > Tests/Spider/S > pider.rb:219:in `each' > from C:/Documents and Settings/nathanl/My Documents/Watir > Tests/Spider/S > pider.rb:219:in `recurseLinks' > from C:/Documents and Settings/nathanl/My Documents/Watir > Tests/Spider/S > pider.rb:286:in `recurseLinks' > from C:/Documents and Settings/nathanl/My Documents/Watir > Tests/Spider/S > pider.rb:362 > from c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' > from C:/Documents and Settings/nathanl/My Documents/Watir > Tests/Spider/S > pider.rb:356 > > Thank you very much in advance. > > Nathan Lane > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5183&messageID=14370#14370 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Thu Nov 9 15:36:57 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Thu, 09 Nov 2006 14:36:57 CST Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two In-Reply-To: <47980452.1163102701477.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <62580692.1163104647438.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> So if I'm reading this right you are saying you have collected 2670 links, but are exploring link 129 and the browser closes? The exploring is just a goto 'address' I assume. If my assumptions are correct, heres a couple questions. Questions, If you attempt to go straight to that link (hard code some data into your loop to force it to go straight there) does it happen? If you slip in a link before 129, which one does it crash on? Have you tried turning off taking screen shots, then see where it happens? If you attempt to 'goto' the link by hand, does the browser close? Hope a question stirs something in your head to get you back on the right track :) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5183&messageID=14395#14395 From paul.rogers at shaw.ca Thu Nov 9 16:06:44 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 09 Nov 2006 14:06:44 -0700 Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two References: <62580692.1163104647438.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <025101c70442$f6065030$6400a8c0@laptop> John Said: If you attempt to 'goto' the link by hand..... this is a good one what if its javascript ?, mail_to? we did a link checker once, and ran into all sorts of issues like those ----- Original Message ----- From: "John Lolis" To: Sent: Thursday, November 09, 2006 1:36 PM Subject: Re: [Wtr-general] WIN32OLERuntimeError - I get this error after two > So if I'm reading this right you are saying you have collected 2670 links, > but are exploring link 129 and the browser closes? The exploring is just > a goto 'address' I assume. If my assumptions are correct, heres a couple > questions. > > Questions, > If you attempt to go straight to that link (hard code some data into your > loop to force it to go straight there) does it happen? > > If you slip in a link before 129, which one does it crash on? > > Have you tried turning off taking screen shots, then see where it happens? > > If you attempt to 'goto' the link by hand, does the browser close? > > Hope a question stirs something in your head to get you back on the right > track :) > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5183&messageID=14395#14395 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Thu Nov 9 16:43:22 2006 From: forum-watir-users at openqa.org (Nathan) Date: Thu, 09 Nov 2006 15:43:22 CST Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two In-Reply-To: <022901c7043d$b32c75a0$6400a8c0@laptop> Message-ID: <44739823.1163108632471.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Good question Paul - yes I can access that link without going through my recursive script - that's the very nice thing about a web application like ASPX or PHP - it takes care of me even though I am "injecting" my data. Nothing special happens when I go there this way. Thanks for asking though. I really do appreciate your thought-provoking question. Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5183&messageID=14400#14400 From forum-watir-users at openqa.org Thu Nov 9 16:54:56 2006 From: forum-watir-users at openqa.org (Nathan) Date: Thu, 09 Nov 2006 15:54:56 CST Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two In-Reply-To: <62580692.1163104647438.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <54214688.1163109572489.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Jlolis - you have read correctly, thank you for taking the time to read my giant descriptive post. So in level three of my recursion I collected a total of 2670 unique links from our site - you can imagine then how big our site is - and I actually realized something that I don't know - according to my log, which has the "---" line right before the stack trace at the end, I could either be on link 129 or 130 - I don't log that until I'm done with the page. The number really shouldn't matter, but maybe it does. I will have to look into that for certain. And your second point is also correct. I thought I explained that, I do use IE.goto([i]strLinkHref[/i]) to get to each page. Now to answer your questions: [b]Q.[/b] "If you attempt to go straight to that link (hard code some data into your loop to force it to go straight there) does it happen?" [b]A.[/b] If I go straight to that link without my script, the page loads and everyone cheers. I'll need to try injecting it in my script - but first I need to find out what that link actually is, which I don't know yet. [b]Q.[/b] "If you slip in a link before 129, which one does it crash on?" [b]A.[/b] Once again, I'll need to figure out a way to do this first - might need to write some funny code or something, but I'll give it a try and let you know for sure - it'll be added to my important tasks. However I don't expect that it'll change where it crashes, though if it does, then I know that link might be suspicious! Thanks for making me think - a second pair of eyes is always necessary, even in QA development. [b]Q.[/b] "If you attempt to 'goto' the link by hand, does the browser close?" [b]A.[/b] This brings me to a point I don't know yet, whether I die on link 129 or link 130, because I don't know what link 130 is and my log says that it's actually probably 130 - I have made adjustments to my script to give me more info when it dies, so I hope I'll get something that can be more helpful in the long run. Thank you Jlolis, these questions have stirred my thoughts. And I'll get back to the forum when I know more. Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5183&messageID=14402#14402 From christopher.mcmahon at gmail.com Thu Nov 9 17:33:20 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 9 Nov 2006 14:33:20 -0800 Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two hours - see details In-Reply-To: <43289313.1163086767555.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <43289313.1163086767555.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70611091433q79ddf41rb4c97b0e2014f129@mail.gmail.com> > When I run my recursive script, I expect it to traverse every link within > our rules to four levels by default. As the Spider goes through our website > it collects a great number of links - level 1 = 1, level 2 = 27, level 3 = > 475, level 4 = 2670. It does a great job of getting through everything > until suddenly it gets to the 129th out of 2670 on level 4, then it throws > the following exception and gives the following baffling information > (baffling because it doesn't seem like it should do this, read through the > stack trace and my comments afterward before you draw any conclusions please > - this is completely consistent - happens in the same place every time, so I > haven't ruled out a website issue, but please continue): So it's still a complete mystery, but it's suggestive that a single IE process always disappears on exactly the 2800th link. I googled for "internet explorer" + 2800 but had no success. That's a lot of links, and a round number. I wonder if there's some protective mechanism in IE itself at work. Maybe you could farm out the work among scripts communicating with more IE processes? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061109/a2b72a7d/attachment.html From forum-watir-users at openqa.org Thu Nov 9 17:34:37 2006 From: forum-watir-users at openqa.org (Nathan) Date: Thu, 09 Nov 2006 16:34:37 CST Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two In-Reply-To: <025101c70442$f6065030$6400a8c0@laptop> Message-ID: <55391966.1163111834417.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Ah yes, I only explained this part of my algorithm briefly. I said that I filter out "...links that are associated with menus, images, forms, or that go outside of our website...", but neglected to mention my full algorithm I guess: Here's a list of links that I remove from my array(s) of links (I have a sub procedure that gets all of the links on a page, then deletes these ones, and gives me an array to return, then I return that and store it in the BIG array): Links that are deleted from my array by just not adding them in :) 1. if tempLink.src.empty? 2. if (tempLink.id.to_s)["menu"].nil? 3. if (tempLink.id.to_s)["breadcrumb"].nil? 4. if (tempLink.href.to_s)["javascript"].nil? 5. if not (tempLink.href.to_s).empty? 6. if (tempLink.href.to_s)["@"].nil? 7. if not (tempLink.href.to_s)["vehix"].nil? So a little explanation now. This is actually one long "if" statement and each of these are linked by and's. The first one makes sure that the link isn't attached to an image. Number 2 makes sure that in our case the class name doesn't tell us the link is in a menu - our classes (HTML) are very descriptive like this for the most part. Number 3 makes sure that the link isn't part of a breadcrumb (which is like a traceback of pages that are associated with each other, like in a menu hierarchy). Number 4 makes sure the link isn't a [b]javascript[/b] link. Number 5 makes sure the href of the link has some text in it. Number 6 makes sure that the link isn't a mailto, because those suck, especially when you are actually running something like Outlook or Thunderbird! And finally number 7 makes sure that the link contains our domain name, because all of the links I care about do. So there you have it. I realized a lot of the same things as you did :) Thanks for pointing those out though. I went through about a week to develop this. Now it's all up to my logging to tell me what's wrong. Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5183&messageID=14404#14404 From forum-watir-users at openqa.org Thu Nov 9 18:11:11 2006 From: forum-watir-users at openqa.org (Dave Munns) Date: Thu, 09 Nov 2006 17:11:11 CST Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two hours - see details In-Reply-To: <43289313.1163086767555.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <46416725.1163113902046.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Can you break up the test into smaller chunks? Say test1 checks one type of link and exits, Test2 checks another type of link and exits, .... Perhaps this workaround will get you more complete results, assuming it's a timing or space issue. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5183&messageID=14406#14406 From forum-watir-users at openqa.org Thu Nov 9 18:28:14 2006 From: forum-watir-users at openqa.org (Nathan) Date: Thu, 09 Nov 2006 17:28:14 CST Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two hours - see details In-Reply-To: <46416725.1163113902046.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <51616341.1163115059829.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for the idea Dave. I don't really believe that the link type is the problem, though it may be related. I don't want to test the links that I filter out on purpose because they either don't take me to a new page, or they take me to the same page multiple times because they are always in the same position on the page, like menu links for example. Our website rules state that if you go to exactly the same page multiple times, then it is treated as though you only went there once. That's okay with me, I just won't test links that do that to me. Our purpose in the spider is also to try and see as many unique pages as we possibly can on our website. And with each recursion it becomes more and more likely that we will accomplish this. The purpose of a web crawler, which this test is, is to crawl the entire web site by itself as well as possible. To do this a recursive method is implemented. In a way it is incidental that we are using Watir, though it isn't accidental - we chose this tool for a good reason. It works! So dividing the task up would defeat our original purposes. This is why we don't follow the test case format, in fact we don't utilize any of the the test suite/test case stuff included with Watir for this reason. We wanted to be as native as possible without reinventing the wheel. As far as JavaScript and the other links go, they don't do anything the a normal web crawler would want to do anyway, so we just throw them away. :) I hope that helps you understand a little about why we did what we did. Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5183&messageID=14409#14409 From ryhoward at telligent.com Thu Nov 9 19:12:20 2006 From: ryhoward at telligent.com (Ryan Howard (Intern)) Date: Thu, 9 Nov 2006 19:12:20 -0500 Subject: [Wtr-general] startClicker Message-ID: <8D2B87EFB35A4341B53B86D3DE6F4CD58F8AD9@mse1be1.mse1.mailstreet.com> I am trying to use the startClicker method to click on a popup box. The code is absolutely correct, however when the program runs and the popup appears, another command prompt appears and starts to cycle through a whole bunch of stuff I've never seen before. It's almost as if I went into my computer and clicked the actual file. I have also checked, and I am calling the method at the right time. Here is what I have. class TC_blogsFrontEnd < Test::Unit::TestCase def test_15_Blogs_DeleteBlog $ie = Watir::IE.new() $ie.goto('http://localhost/cs') $ie.link(:text, 'Control Panel').click $ie.link(:text, 'My Blogs').click $ie.goto('http://localhost/cs/ControlPanel/Blogs/postlist.aspx') startClicker('Cancel') $ie.link(:text, 'Delete').click if $ie.contains_text('Change Post title attempt') puts "Blogx15 Failed" else puts "Blogx15 Passed" end $ie.goto('http://localhost/cs/') end 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 end If yall have any ideas that would be great! :-) Thanks, -Ryan Howard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061109/ee818f72/attachment-0001.html From ryhoward at telligent.com Thu Nov 9 19:12:38 2006 From: ryhoward at telligent.com (Ryan Howard (Intern)) Date: Thu, 9 Nov 2006 19:12:38 -0500 Subject: [Wtr-general] File won't recognize "require watir/testcase" Message-ID: <8D2B87EFB35A4341B53B86D3DE6F4CD58F8ADA@mse1be1.mse1.mailstreet.com> I'm trying to run a test suite, but my "main" file gets interrupted by an error when trying to use "require watir/testcase", the compiler keeps giving me a "no such file to load" error, for the testcase example. I don't see how this should cause any trouble because the compiler recognizes the "watir/testUnitAddons" file. I have checked to see that the file is actually there, and it is. Here is my code. require 'watir' require 'test/unit' require 'test/unit/ui/console/testrunner' require 'watir/testUnitAddons' require 'watir/testcase' #topdir = File.dirname(__FILE__) #Dir.chdir topdir do # $all_tests = Dir["*Blogs.rb"] #end $all_tests.each {|x| begin timeout(1.0) do |timeout_length| require x end rescue Timeout::Error => e puts "Error Message: " + e end } And here is the error I keep getting. >ruby Automate.rb c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- runit/robserver (LoadError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from c:/ruby/lib/ruby/site_ruby/1.8/watir/testcase.rb:3 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from Automate.rb:6 >Exit code: 1 I'm using version 1.4.1 , Thanks, -Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061109/14acd345/attachment.html From zeljko.filipin at gmail.com Fri Nov 10 03:34:41 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 10 Nov 2006 09:34:41 +0100 Subject: [Wtr-general] Watir tests as how-to documents In-Reply-To: References: Message-ID: Thank you all. I will take a look at tools that you suggested. Zeljko -- http://zeljkofilipin.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061110/83ae322d/attachment.html From tester.paul at gmail.com Fri Nov 10 09:45:35 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Fri, 10 Nov 2006 09:45:35 -0500 Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two hours - see details In-Reply-To: <43289313.1163086767555.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <43289313.1163086767555.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <37c405480611100645rffb9dbfo5dca1618fb4c0a71@mail.gmail.com> Hello Nathan, thanks for all the details you included in your initial post. While I don't think I can add anything more to the programming/troubleshooting side of things than have already been offered, I haven't seen anyone yet ask what else is going on in the system. Do you have any other programs or services running in the background? (In particular any monitoring programs in the System Tray?) Have you tried collecting system performance metrics while you run your test? For example, using the Windows Perfmon tool, set up a new Counter Log to trace the CPU and Memory usage of the system and the iexplore process. Make sure to create a "Text File (Comma delimited)" Log file type so that you can bring the results into Excel and examine them after the test failure. Sysinternals also makes some nice tools that you can use for monitoring your system, including Process Explorer, Filemon, etc. If you can't solve the mystery with the information you have, look for more clues and information. All the best! Cheers. Paul C. On 09/11/06, Nathan wrote: > > > I am using Watir 1.4 (latest) and Ruby 1.8.5-21 I believe on Windows (of > course) with Internet Explorer 6. PLEASE, please help me if you have a > solution. I have thought to maybe put a begin...rescue...end block around > some of my code to try and keep this from happening, but I'm not sure that > would do any good. Oh also, I know pretty much that something WIERD is > going on because my browser window is always closed at this point - when the > error occurs, which is obviously the reason for the RPC Server problem. But > WHY is it closing? > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061110/24a276cb/attachment.html From Mark_Cain at RL.gov Fri Nov 10 12:51:21 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Fri, 10 Nov 2006 09:51:21 -0800 Subject: [Wtr-general] startClicker In-Reply-To: <8D2B87EFB35A4341B53B86D3DE6F4CD58F8AD9@mse1be1.mse1.mailstreet.com> Message-ID: What you're seeing is correct. What is happening with the command prompt window it is scrolling through all of the active windows objects on your machine trying to match the window title bar text. The clicker starts a new process (command prompt window) since a JS alert is modal otherwise the JS Alert would never get clicked. If the command prompt window bothers you could change the line in startClicker by adding a 'w' after ruby: c = "start rubyw #{shortName}\\watir\\clickJSDialog.rb #{button} #{waitTime} " Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Ryan Howard (Intern) Sent: Thursday, November 09, 2006 4:12 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] startClicker I am trying to use the startClicker method to click on a popup box. The code is absolutely correct, however when the program runs and the popup appears, another command prompt appears and starts to cycle through a whole bunch of stuff I've never seen before. It's almost as if I went into my computer and clicked the actual file. I have also checked, and I am calling the method at the right time. Here is what I have. class TC_blogsFrontEnd < Test::Unit::TestCase def test_15_Blogs_DeleteBlog $ie = Watir::IE.new() $ie.goto('http://localhost/cs') $ie.link(:text, 'Control Panel').click $ie.link(:text, 'My Blogs').click $ie.goto('http://localhost/cs/ControlPanel/Blogs/postlist.aspx') startClicker('Cancel') $ie.link(:text, 'Delete').click if $ie.contains_text('Change Post title attempt') puts "Blogx15 Failed" else puts "Blogx15 Passed" end $ie.goto('http://localhost/cs/') end 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 end If yall have any ideas that would be great! :-) Thanks, -Ryan Howard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061110/33f9d95a/attachment-0001.html From tester.paul at gmail.com Fri Nov 10 13:27:47 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Fri, 10 Nov 2006 13:27:47 -0500 Subject: [Wtr-general] startClicker In-Reply-To: References: <8D2B87EFB35A4341B53B86D3DE6F4CD58F8AD9@mse1be1.mse1.mailstreet.com> Message-ID: <37c405480611101027s5250945at4ce16419c17daa5e@mail.gmail.com> Ha! Thank you, Mark! You don't know it, but this just helped me solve a completely different problem that I was experiencing with a non-Watir Ruby script. The key was the "start". Every time I would run my Ruby script (using the "rubyw") from a batch file a command prompt window would still be left open just to annoy me. When I saw the "start" that you included below, it dawned on me that it was the batch file that was leaving the cmd window open not the Ruby interpreter. I added that DOS command to my batch file and now the cmd window closes when the ruby script runs. Sweet! Sigh. What a relief. Have a great weekend. Cheers! Paul C. On 10/11/06, Cain, Mark wrote: > > What you're seeing is correct. What is happening with the command prompt > window it is scrolling through all of the active windows objects on your > machine trying to match the window title bar text. The clicker starts a new > process (command prompt window) since a JS alert is modal otherwise the JS > Alert would never get clicked. If the command prompt window bothers you > could change the line in startClicker by adding a 'w' after ruby: > > > > c = "start rubyw #{shortName}\\watir\\clickJSDialog.rb #{button} > #{waitTime} " > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061110/ff738fb7/attachment.html From christopher.mcmahon at gmail.com Fri Nov 10 13:30:17 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 10 Nov 2006 10:30:17 -0800 Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two hours - see details In-Reply-To: <37c405480611100645rffb9dbfo5dca1618fb4c0a71@mail.gmail.com> References: <43289313.1163086767555.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <37c405480611100645rffb9dbfo5dca1618fb4c0a71@mail.gmail.com> Message-ID: <72799cd70611101030u4e96c6b9i276244429dbca70b@mail.gmail.com> > > Do you have any other programs or services running in the background? (In > particular any monitoring programs in the System Tray?) Have you tried > collecting system performance metrics while you run your test? So just for fun I did this: #################################3 require 'watir' include Watir @ie = IE.new @ie.set_fast_speed 1.upto 3000 do |num| @ie.goto("C:\\Documents and Settings\\cmcmahon\\Desktop\\3000\\buttons1.html") puts num @ie.button(:name, "b1").click end ########################################## where buttons1.html just goes to itself: and found some interesting things. First of all, there's a memory leak. Watch your ruby process in taskmanager and it's clear to see. It's not too egregious, but on a system with other demands on memory, could be a problem. The other thing is a little weirder. On my box at least, if I kill this process and re-start, the next ruby/watir process grabs as much memory as it had when I killed the previous process. I've never seen this behavior before and I can't explain it. At about 2700 clicks, the rate of clicking dropped dramatically, to maybe 2 or 3 clicks every 10 seconds, or even longer. It picked back up again, but at one point it was slow enough that a timeout could definitely have come into play. So I vote for a memory-leak problem or a timeout problem. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061110/4c43b8b7/attachment.html From paul.rogers at shaw.ca Sat Nov 11 16:05:13 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sat, 11 Nov 2006 14:05:13 -0700 Subject: [Wtr-general] detecting versions of browser and os Message-ID: <032301c705d5$14d58920$6400a8c0@laptop> I think, now that we have vista, ie7 etc, that the following would be useful: ie.browser_version => "IE7" ie.os => "XP" ie.os_language =>"en-us" etc as Im sure, many people like me now either need to test multiple browsers/os or at least need to know what it was tested on. I have most of the code, I just need to know if there are any comments on method names etc? Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061111/9e160974/attachment.html From gwest at inpses.co.uk Mon Nov 13 08:04:05 2006 From: gwest at inpses.co.uk (Garry West) Date: Mon, 13 Nov 2006 13:04:05 -0000 Subject: [Wtr-general] Using watir to control JavaScript popups Message-ID: I am new to watir and I am currently trying to automate some tests, however I am having difficulties automating a JavaScript popup. This popup asks the user to confirm that they would like to log off, it has two options which are "OK" and "Cancel". After reading some information from various web pages it would appear that this is a difficult thing to do... Any suggestions how to do this? Garry West Trainee Test Analyst InPS Visit our Web site at www.inps.co.uk The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of In Practice Systems Limited or any of its affiliates. If you are not the intended recipient please contact is.helpdesk at inps.co.uk P please don't print this e-mail unless you really need to. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061113/80a820b4/attachment.html From oblomov.consulting at googlemail.com Mon Nov 13 09:17:15 2006 From: oblomov.consulting at googlemail.com (George Hawthorne) Date: Mon, 13 Nov 2006 14:17:15 +0000 Subject: [Wtr-general] Using watir to control JavaScript popups In-Reply-To: References: Message-ID: On 13/11/06, Garry West wrote: > > I am new to watir and I am currently trying to automate some tests, however > I am having difficulties automating a JavaScript popup. This popup asks the > user to confirm that they would like to log off, it has two options which > are "OK" and "Cancel". > After reading some information from various web pages it would appear that > this is a difficult thing to do... > > Any suggestions how to do this? > > Garry West Hi Garry, Good to see another UK person using Watir (I'm in Brighton). Reliability used to be a problem but I'm now using Watir to test a web app that has loads of JavaScript pop-ups. The method described below is an unofficial add-on rather than a supported part of Watir but it works fine. Get the latest development version of Watir (1127 as of a few moments ago). Then use the following code... ++++++++++++++++ # The next line goes with the other require statements at the top of your script require 'watir/contrib/enabled_popup' ... # The next statement clicks the link or button that produces your pop-up - amend it as appropriate. ie.link(:text, "yourlink").click_no_wait # Now comes the code that handles the pop-up. No need to change it unless you want to click the 'Cancel' button rather than "OK" hwnd = ie.enabled_popup(5) # get a handle if one exists if (hwnd) # yes there is a popup w = WinClicker.new w.makeWindowActive(hwnd) # "OK" or whatever the name on the button is w.clickWindowsButton_hwnd(hwnd, "OK") end ++++++++++++++++ If you have problems post again or email me. George From Mark_Cain at RL.gov Mon Nov 13 09:52:14 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Mon, 13 Nov 2006 06:52:14 -0800 Subject: [Wtr-general] Using watir to control JavaScript popups In-Reply-To: Message-ID: Which version of Watir are you using? --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Garry West Sent: Monday, November 13, 2006 5:04 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Using watir to control JavaScript popups I am new to watir and I am currently trying to automate some tests, however I am having difficulties automating a JavaScript popup. This popup asks the user to confirm that they would like to log off, it has two options which are "OK" and "Cancel". After reading some information from various web pages it would appear that this is a difficult thing to do... Any suggestions how to do this? Garry West Trainee Test Analyst InPS Visit our Web site at www.inps.co.uk The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of In Practice Systems Limited or any of its affiliates. If you are not the intended recipient please contact is.helpdesk at inps.co.uk P please don't print this e-mail unless you really need to. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061113/2ce37568/attachment-0001.html From zeljko.filipin at gmail.com Mon Nov 13 10:23:23 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 13 Nov 2006 16:23:23 +0100 Subject: [Wtr-general] Watir tests as how-to documents In-Reply-To: References: Message-ID: At the end I decided to use Watir only. I took a closer look at application that I test and found out that there are labels for elements. I added this to the end of Watir::TextField#set what = @container.label(:for, @what).text puts "- at text field '#{what}' enter '[#{what}]'" and got - at text field 'Username' enter '[Username]' That is all I need. I added something similar to other methods. I have two questions. 1) Should I use @container or some other variable? It works. 2) How should I extract this? I do not want to modify watir.rb, because I would have to modify it every time I upgrade. At the moment I created new file howto.rb (at the end of e-mail). I require this file in my scripts. This is the only way I knew how to override Watir's methods. Is there a better way? Thanks, Zeljko -- http://zeljkofilipin.com/ #howto.rb module Watir class TextField < InputElement def set(setThis) assert_enabled assert_not_readonly highlight(:set) @o.scrollIntoView @o.focus @o.select @o.fireEvent("onSelect") @o.value = "" @o.fireEvent("onKeyPress") doKeyPress(setThis) highlight(:clear) @o.fireEvent("onChange") @o.fireEvent("onBlur") what = @container.label(:for, @what).text $howto.puts "+at text field '#{what}' enter '[#{what}]'" end end end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061113/cea6cd66/attachment.html From dara.lillis at kiodex.com Mon Nov 13 14:01:23 2006 From: dara.lillis at kiodex.com (Lillis, Dara) Date: Mon, 13 Nov 2006 11:01:23 -0800 Subject: [Wtr-general] Grouping Test Cases In-Reply-To: <72799cd70605240950n2dd76872q9115225c01e6aa2b@mail.gmail.com> Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E018A99FF@ehost011-27.exch011.intermedia.net> [resurrecting an old thread] the code Chris supplies below is useful in that I can use it to run all tests in a given directory. I've been struggling with how to package these tests into suites so I can produce output with Test::Unit::Reporter That is, I want to replace code like this with something more general: require 'test/unit/ui/console/testrunner' require 'test/unit/ui/reporter' require 'TC_TestCase' class TS_Suite def self.suite suite = Test::Unit::TestSuite.new('A Test Suite') suite << TC_TestCase.suite return suite end end Test::Unit::UI::Reporter.run(TS_Suite, 'C:/TestOutput/Sample') Any ideas? -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: Wednesday, May 24, 2006 12:51 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Grouping Test Cases On 5/24/06, Adrian Rutter wrote: > > Could anyone tell me how they are grouping test cases and running > suites within Watir? > #run_suite.rb topdir = File.join(File.dirname(__FILE__)) Dir.chdir topdir do tests = Dir["test*"] tests.each{|x| require x} end _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From dara.lillis at kiodex.com Mon Nov 13 16:12:23 2006 From: dara.lillis at kiodex.com (Lillis, Dara) Date: Mon, 13 Nov 2006 13:12:23 -0800 Subject: [Wtr-general] Grouping Test Cases Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E018A9AF5@ehost011-27.exch011.intermedia.net> I figured this out...after a colleague pointed me at Andy Sipe's blog: http://zbarzone.blogspot.com/2006/04/getting-xml-test-results-from-rails _06.html the relevant code I needed to add: require 'test/unit/collector/objectspace' #replace class def for the suite with one line suite = Test::Unit::Collector::ObjectSpace.new().collect() #generate the output Test::Unit::UI::Reporter.run(suite, 'C:/TestOutput/Sample') Thanks to Andy! -Dara -----Original Message----- From: Lillis, Dara Sent: Monday, November 13, 2006 2:01 PM To: 'wtr-general at rubyforge.org' Subject: RE: [Wtr-general] Grouping Test Cases [resurrecting an old thread] the code Chris supplies below is useful in that I can use it to run all tests in a given directory. I've been struggling with how to package these tests into suites so I can produce output with Test::Unit::Reporter That is, I want to replace code like this with something more general: require 'test/unit/ui/console/testrunner' require 'test/unit/ui/reporter' require 'TC_TestCase' class TS_Suite def self.suite suite = Test::Unit::TestSuite.new('A Test Suite') suite << TC_TestCase.suite return suite end end Test::Unit::UI::Reporter.run(TS_Suite, 'C:/TestOutput/Sample') Any ideas? -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: Wednesday, May 24, 2006 12:51 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Grouping Test Cases On 5/24/06, Adrian Rutter wrote: > > Could anyone tell me how they are grouping test cases and running > suites within Watir? > #run_suite.rb topdir = File.join(File.dirname(__FILE__)) Dir.chdir topdir do tests = Dir["test*"] tests.each{|x| require x} end _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From rob.mayhew at gmail.com Mon Nov 13 16:13:04 2006 From: rob.mayhew at gmail.com (Rob Mayhew) Date: Mon, 13 Nov 2006 14:13:04 -0700 Subject: [Wtr-general] Finding the size of IE Message-ID: Hello, I'm attempting to use watir to check for JavaScript memory leaks. But I can't find a way to check the memory usage of IE though watir. Is there any way to do this? Thanks. Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061113/762dfbeb/attachment.html From phlip2005 at gmail.com Mon Nov 13 16:44:41 2006 From: phlip2005 at gmail.com (Phlip) Date: Mon, 13 Nov 2006 13:44:41 -0800 Subject: [Wtr-general] Finding the size of IE In-Reply-To: References: Message-ID: <860c114f0611131344gd3c5e21l8b2ed4d880384d68@mail.gmail.com> Rob Mayhew wrote: > I'm attempting to use watir to check for JavaScript memory leaks. But I > can't find a way to check the memory usage of IE though watir. > > Is there any way to do this? That requires kernel-level programming. Win32 uses virtual memory. As IE runs, no matter what it does, its memory usage variable in your Task Manager's Process's tab will always go up; never down. That's because virtual memory has no need to truly free any allocated memory. If your program stops using that memory, then it will languish in your swapper file while IE uses memory pages that are (hopefully!) swapped into physical memory. Within each program's memory arena are heaps, managed by the system. (These contain the storage used by C language heap functions, malloc() and free(). Programs typically use heaps inside of heaps.) If you got a handle to the IE process, you could query its system heaps, and detect which ones were in-use and which are not. And this still would not directly detect a leak. Etc. etc. etc. You don't want to know what all the ActiveX (COM) does between IE, memory, and Javascript. The simplest way to test for leaks is leave a test case running all night in a loop, and see if it crashes. If I had Purify, I could try Purify -> Ruby -> IE -> JavaScript. Except all of those items probably leak like crazy (except Ruby, of course!), so you would not be able to tell the trees for the forest. -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! From forum-watir-users at openqa.org Mon Nov 13 19:59:53 2006 From: forum-watir-users at openqa.org (Nathan) Date: Mon, 13 Nov 2006 18:59:53 CST Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two hours - see details In-Reply-To: <37c405480611100645rffb9dbfo5dca1618fb4c0a71@mail.gmail.com> Message-ID: <51185643.1163466250402.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi bb_tester. You have a very good point. As of right now, the test is always running on my personal development machine, though we are already working on building a "spider/bot environment". This will minimize the possibility that another process is taking over or killing our process, but I haven't ruled out that possibility yet. Currently my Spider is a scheduled task, which runs every evening after I leave work. If I happen to know I'll be working later, then I reschedule the Spider to run at a different time. Because I am running it on my personal development machine, I try and close as many programs as I don't need before I leave for the day, including popup blockers, IM, Email, and various quick launchers I have running on my system. The only system tray programs I leave running are my antivirus, VPN, and sound controls. None of these systems "should" affect the way such a program as a Spider performs, but it may be possible. As of yet I haven't decided to collect perfomance stats. As I watch my little Spider program run I don't usually see anything out of the ordinary, except for example, when the page I am on contains several hundred images and I am checking each image. One page of ours contains over 1,000 separate images, and during the time it is checking those images there is much higher CPU usage (upwards of 100%). This doesn't really concern me though, because all I am doing is querying the RPC server (Internet Explorer) to find out each image's file size. I have seen IE use 100% CPU and 400,000 KB of Memory and not give me any trouble, though they may signify some kind of memory leak in our web application. I described this somewhat in another thread, where I mentioned our website having a problem at one time, where a certain section of our website would crash IE after a few clicks. This was caused by a line of CSS not being released by IE, and building up memory usage, which was a leak in our software (the ASPX web app we created) and not Internet Explorer. I am convinced, though clumsy it may be, that IE is very robust and can handle anything it's built for, so web app and web site developers need to be very careful to do things the "right" way. This may be the reason IE is closing on me. I plan now to run at least one test to include memory data from task manager - I have written an external, low-level screenshot program using C#.Net to take the place of the clumsier, less reliable method that Watir 1.4 uses - sending keystrokes and using Paint to save the file -, and it allows me to take a screenshot of either just my browser or the whole screen. For now I believe this will be sufficient. Thank you for your time bb_tester. Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5183&messageID=14535#14535 From forum-watir-users at openqa.org Mon Nov 13 20:17:40 2006 From: forum-watir-users at openqa.org (Nathan) Date: Mon, 13 Nov 2006 19:17:40 CST Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two hours - see details In-Reply-To: <72799cd70611101030u4e96c6b9i276244429dbca70b@mail.gmail.com> Message-ID: <38974279.1163467266072.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi cmcmahon, it looks like you've gone to a lot of work. I won't say it was for nothing. Thank you for trying things out that might help me. It appears that your conclusions are correct as far as your website goes. It may very well be that there is a memory leak because of the way you are doing things. It is possible that performing recursion as you have with javascript in a webpage can cause the browser not to let go of previously used memory, because "it doesn't know any better". This is a link to a thread that discusses this sort of phenomenon briefly: http://www.thescripts.com/forum/thread153454.html The other thing that you're doing is considered "unsafe" in the world of programming, and so it is not considered normal if a computer does this. Most operating systems are built to ensure that this doesn't happen, but I know that you can override that when compiling your kernel for Linux, for example, in order to minimze the amount of memory used by a single process. I suppose that tweaks also exist for Windows to do the same thing, though I haven't looked into it. In such a case, a process may be restarted in order to try and free up memory. As far as clicking a lot affecting performance, I'm not sure what to think about it. It does not seem likely that simply clicking would decrease performance as IE does not continuously withhold memory from the system, except when the web application is poorly programmed for handling memory, especially when using objects. For example when you leave a website, the memory IE retained for that website's cache is released and the objects it was saving are linked to by creating shortcuts in the cache space. This kind of perfomance problem would necessarily be caused by other programs running, or by some memory leak contained in the web site/ web application itself. Thank you again for the information. I am continuing to work through these issues. Interestingly, another error I see in the same place every time is that about half of my level two links come back as null. I think I know why, but I'm not sure yet. I have already formed precautionary blocks around that section of code in order to keep it from killing the Spider ultimately, but it shows up in the log I create consistently. Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5183&messageID=14536#14536 From niegq at nec-as.nec.com.cn Tue Nov 14 05:53:03 2006 From: niegq at nec-as.nec.com.cn (Nie Guoqiang) Date: Tue, 14 Nov 2006 18:53:03 +0800 Subject: [Wtr-general] how to access icon's button Message-ID: <20061114184922.1A17.NIEGQ@nec-as.nec.com.cn> Hello everyone I am newbie to watir, and encounter some problems during my web testing. The following is some html codes, my question is how can i access this icon-button. Appreciate for your answers,thank you. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
System Status:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++ GuoqiangNie From zeljko.filipin at gmail.com Tue Nov 14 06:31:36 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 14 Nov 2006 12:31:36 +0100 Subject: [Wtr-general] how to access icon's button In-Reply-To: <20061114184922.1A17.NIEGQ@nec-as.nec.com.cn> References: <20061114184922.1A17.NIEGQ@nec-as.nec.com.cn> Message-ID: On 11/14/06, Nie Guoqiang wrote: > > how can i access this icon-button. > Hi Nie, This will click logout image: ie.image(:src, /logout/).flash If this does not do what you need, let me know. ?eljko -- http://zeljkofilipin.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061114/bf4186f5/attachment.html From andy__s at hotmail.com Tue Nov 14 06:50:02 2006 From: andy__s at hotmail.com (Andy Sipe) Date: Tue, 14 Nov 2006 06:50:02 -0500 Subject: [Wtr-general] Grouping Test Cases Message-ID: You're welcome :)> Date: Mon, 13 Nov 2006 13:12:23 -0800> From: dara.lillis at kiodex.com> To: dara.lillis at kiodex.com; wtr-general at rubyforge.org> Subject: Re: [Wtr-general] Grouping Test Cases> > I figured this out...after a colleague pointed me at Andy Sipe's blog:> > http://zbarzone.blogspot.com/2006/04/getting-xml-test-results-from-rails> _06.html> > the relevant code I needed to add:> > require 'test/unit/collector/objectspace'> > #replace class def for the suite with one line> suite = Test::Unit::Collector::ObjectSpace.new().collect()> > #generate the output> Test::Unit::UI::Reporter.run(suite, 'C:/TestOutput/Sample')> > Thanks to Andy!> > -Dara> > -----Original Message-----> From: Lillis, Dara > Sent: Monday, November 13, 2006 2:01 PM> To: 'wtr-general at rubyforge.org'> Subject: RE: [Wtr-general] Grouping Test Cases> ..... -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061114/4cf43123/attachment.html From forum-watir-users at openqa.org Tue Nov 14 08:57:35 2006 From: forum-watir-users at openqa.org (Markus) Date: Tue, 14 Nov 2006 07:57:35 CST Subject: [Wtr-general] Running Watir from FoxPro 9 Message-ID: <41130036.1163512840881.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Has anybody tried to run a watir-script from an foxpro web application? I get this error: 1) Error: test_parm(Paramtest): RuntimeError: Fail: OLE initialize HRESULT error code:0x80070057 Falscher Parameter. C:/Programme/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1121/./watir.rb:1442:in `new' C:/Programme/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1121/./watir.rb:1442:in `create_browser_window' C:/Programme/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1121/./watir.rb:1347:in `initialize' C:/Programme/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1121/./watir.rb:1356:in `start' So this line causes the error: @ie = WIN32OLE.new('InternetExplorer.Application') The script is run with this command: lcScript = "C:\Programme\ruby\bin\rubyw.exe -CC:\goto\some\path\ C:\Programme\ruby\bin\fit.rb input.html output" RUN /N &lcScript Without the /N option nothing happens at all (not even a cryptic unhelpfull foxpro error message). The system is windows 2003 server, foxpro 9, ruby 1.8.4, watir 1.5.1.1121, fit 1.1. By the way, when I issue that command in a dos box it runs with no errors. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5247&messageID=14557#14557 From forum-watir-users at openqa.org Tue Nov 14 10:08:19 2006 From: forum-watir-users at openqa.org (Markus) Date: Tue, 14 Nov 2006 09:08:19 CST Subject: [Wtr-general] Running Watir from FoxPro 9 In-Reply-To: <41130036.1163512840881.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <58189836.1163516942945.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I forgot: the page from which the test script is invoked runs within web connection 4.30. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5247&messageID=14559#14559 From Mark_Cain at RL.gov Tue Nov 14 10:20:43 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Tue, 14 Nov 2006 07:20:43 -0800 Subject: [Wtr-general] Running Watir from FoxPro 9 In-Reply-To: <41130036.1163512840881.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Try require 'watir' ... @ie = Watir::IE.new Instead of @ie = WIN32OLE.new('InternetExplorer.Application') You could alternatively edit the setup.rb file to be for your tests anh just require it $ie and the logger are both initialized in that file. Also, take a look at the unittests for good usage examples. --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Markus Sent: Tuesday, November 14, 2006 5:58 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Running Watir from FoxPro 9 Has anybody tried to run a watir-script from an foxpro web application? I get this error: 1) Error: test_parm(Paramtest): RuntimeError: Fail: OLE initialize HRESULT error code:0x80070057 Falscher Parameter. C:/Programme/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1121/./watir.rb:144 2:in `new' C:/Programme/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1121/./watir.rb:144 2:in `create_browser_window' C:/Programme/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1121/./watir.rb:134 7:in `initialize' C:/Programme/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1121/./watir.rb:135 6:in `start' So this line causes the error: @ie = WIN32OLE.new('InternetExplorer.Application') The script is run with this command: lcScript = "C:\Programme\ruby\bin\rubyw.exe -CC:\goto\some\path\ C:\Programme\ruby\bin\fit.rb input.html output" RUN /N &lcScript Without the /N option nothing happens at all (not even a cryptic unhelpfull foxpro error message). The system is windows 2003 server, foxpro 9, ruby 1.8.4, watir 1.5.1.1121, fit 1.1. By the way, when I issue that command in a dos box it runs with no errors. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5247&messageID=14557#14557 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From arkie at compli.com Tue Nov 14 11:28:05 2006 From: arkie at compli.com (Alan Ark) Date: Tue, 14 Nov 2006 10:28:05 -0600 Subject: [Wtr-general] [Test] Ignore Message-ID: <7F2DAB1053EC4D47B821DA0A7BA5E3EB2FF1FB@mail-21ps.atlarge.net> Is this turned on? No messages for me to fall behind on since Friday _____ Alan Ark | Lead QA Engineer | Compl? | HYPERLINK "mailto:arkie at compli.com"arkie at compli.com | office: 503.294.2020 | fax: 503.294.1200 | HYPERLINK "http://www.compli.com/"www.compli.com -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.409 / Virus Database: 268.14.5/533 - Release Date: 11/13/2006 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061114/88860fb6/attachment.html From forum-watir-users at openqa.org Tue Nov 14 18:26:43 2006 From: forum-watir-users at openqa.org (Nathan) Date: Tue, 14 Nov 2006 17:26:43 CST Subject: [Wtr-general] WIN32OLERuntimeError - I get this error after two hours - In-Reply-To: <38974279.1163467266072.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <42338602.1163546989837.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hey everyone, thank you so much for your help through this. I think that I have resolved my problem. I'll tell you how it happened. So this morning I put a little extra debugging stuff into my Spider script, and realized that there was one point in my script where I was checking to see if an Array object was empty?, but sometimes this object wasn't returning as an Array, so I looked up reflection in the Ruby Pragmatic Programmer manual and found out how to determine the class of an object. I then implemented an if...end block that checked whether my object was an array (if object.class == Array...) and found out that I had about 200 null objects in my collection of arrays - that's a ton - which I think I mentioned in my previous post. Well I went back through my code and found out that I was making my collection too large. Here's where the problem was - order of operations (they kill me sometimes): collection = Array.new(otherCollection.length) collection = otherCollection collection.sort! collection.uniq! # This is where my issue was, sort of collection.each { ... So the order of operations problem was in the order I was doing things in this segment. Because I always knew that there were duplicates in my collection object, I always purged that object, but what I should have done, and changed to was this: otherCollection.sort! otherCollection.uniq! collection = Array.new(otherCollection.length) collection = otherCollection collection.each { ... Anyway, so I changed that around, and since then I haven't seen any problems - IE doesn't close, my arrays don't throw a bunch of null pointer exceptions at me, and my Spider actually completed its task. Coding problems are always the most elusive. Order of operations is necessary to understand in almost every coding situation. Even processors need to understand order of operations, otherwise things would be crazy jumbled up! Well thanks again for all of your help. I will call on you all again in the future. Even though none of you had the right solution, you still all got me thinking, and that's what I count on from other developers/testers! Thanks, Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5183&messageID=14601#14601 From forum-watir-users at openqa.org Tue Nov 14 18:54:56 2006 From: forum-watir-users at openqa.org (Prashant Bhatia) Date: Tue, 14 Nov 2006 17:54:56 CST Subject: [Wtr-general] Accessing links from the JavaScript page Message-ID: <39271216.1163548689669.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am pretty new to Watir & Ruby. So far I am able to figure out few things but am badly stuck at this issue. I have links on a page which are a part of javascript stored in .js files. Currently watir doesn't recognize it (atleast the way I am doing it). The workaround I have is to actually call the url which is supposed to be generated via that link. What is the correct way to click on the link that is stored in a js file. Here is the HTML for that page: [CODE] WPA::Wellness Plan Administration System [/b]
[/CODE] Sorry for the long code. Appreciate your help Prashant --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5259&messageID=14602#14602 From bret at pettichord.com Tue Nov 14 19:34:20 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 14 Nov 2006 18:34:20 -0600 Subject: [Wtr-general] Running Watir from FoxPro 9 In-Reply-To: <41130036.1163512840881.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <41130036.1163512840881.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <455A608C.2090902@pettichord.com> You might try starting up explorer using "system" and then attaching to the window. Bret Markus wrote: > Has anybody tried to run a watir-script from an foxpro web application? > > I get this error: > 1) Error: > test_parm(Paramtest): > RuntimeError: Fail: OLE initialize > HRESULT error code:0x80070057 > Falscher Parameter. > C:/Programme/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1121/./watir.rb:1442:in `new' > C:/Programme/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1121/./watir.rb:1442:in `create_browser_window' > C:/Programme/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1121/./watir.rb:1347:in `initialize' > C:/Programme/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1121/./watir.rb:1356:in `start' > > So this line causes the error: > @ie = WIN32OLE.new('InternetExplorer.Application') > > The script is run with this command: > lcScript = "C:\Programme\ruby\bin\rubyw.exe -CC:\goto\some\path\ C:\Programme\ruby\bin\fit.rb input.html output" > RUN /N &lcScript > > Without the /N option nothing happens at all (not even a cryptic unhelpfull foxpro error message). > > The system is windows 2003 server, foxpro 9, ruby 1.8.4, watir 1.5.1.1121, fit 1.1. > > By the way, when I issue that command in a dos box it runs with no errors. > From forum-watir-users at openqa.org Tue Nov 14 20:20:08 2006 From: forum-watir-users at openqa.org (Nathan) Date: Tue, 14 Nov 2006 19:20:08 CST Subject: [Wtr-general] Accessing links from the JavaScript page In-Reply-To: <39271216.1163548689669.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <63601147.1163553733906.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi pinkoobhatia. So to me it appears that you are missing a few things to let me know completely what's going on in your webpage, but let me guess about it. I looks like you have a flash object that contains a menu and it calls javascript functions? Or do you have javascript that somehow writes a link to your webpage? Is your link a normal link defined by ...? If your link is normal and NOT contained in your flash object, then Watir will enable you to click on it by some code similar to the following: require "watir" include Watir ie = IE.start("yourWebsiteURL") ie.link(:text, "textOnYourLink").click If your link contains no text, has no id, or name, or anything particularly identtifying, then I believe you can access it by its index via: ie.link(:index, 4) Where 4 is the number of the link on your webpage. If however your link is part of your flash object, then there's currently no hope unless you use a tool that will click on a specific location on your screen and that location is always the same. The reason there's currently no hope is that there is no tool in the world that will recognize objects within a flash object, like links. Maybe I missed something. Is there any more explanation you can give us? Thanks, Nathan - p.s. text styling must be turned of or something, because I pressed Enter several times and I see no white space :) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5259&messageID=14613#14613 From niegq at nec-as.nec.com.cn Wed Nov 15 05:24:10 2006 From: niegq at nec-as.nec.com.cn (Nie Guoqiang) Date: Wed, 15 Nov 2006 18:24:10 +0800 Subject: [Wtr-general] how to access icon's button In-Reply-To: References: <20061114184922.1A17.NIEGQ@nec-as.nec.com.cn> Message-ID: <20061115181730.1A3A.NIEGQ@nec-as.nec.com.cn> The codes doesnot work :( More tips: When I execute ie.show_frames(), I get "There is 6 frames". And when ie.show_images() is executed, message is "0". Thanks > On 11/14/06, Nie Guoqiang wrote: how can i access this icon-button. > > > > > Hi Nie, > > This will click logout image: > > ie.image(:src, /logout/).flash > > If this does not do what you need, let me know. > > ?eljko > -- > http://zeljkofilipin.com/ =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Nie Guoqiang NEC-CAS Software Department 1K/4SG Tel : 010-82334433-356 / 8-0086-22-356 Email : niegq at necas.nec.com.cn =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= From browne.daniel at gmail.com Wed Nov 15 06:09:48 2006 From: browne.daniel at gmail.com (Daniel Browne) Date: Wed, 15 Nov 2006 11:09:48 +0000 Subject: [Wtr-general] how to access icon's button In-Reply-To: <20061115181730.1A3A.NIEGQ@nec-as.nec.com.cn> References: <20061114184922.1A17.NIEGQ@nec-as.nec.com.cn> <20061115181730.1A3A.NIEGQ@nec-as.nec.com.cn> Message-ID: <79518aef0611150309x9226937xb3371e8e0e8fa2c3@mail.gmail.com> Your HTML snippet didn't show that there where any frames. Find the name of the frame that contains the image using e.g: ie.show_frames.some_frame.show_images If the image is listed for frame "show_frame" (frames will have different names for you) then you could use: ie.frame("some_frame").image(:src, /logout/).flash Cheers, Daniel. On 15/11/06, Nie Guoqiang wrote: > The codes doesnot work :( > > More tips: > When I execute ie.show_frames(), I get "There is 6 frames". > And when ie.show_images() is executed, message is "0". > > Thanks > > > > On 11/14/06, Nie Guoqiang wrote: how can i access this icon-button. > > > > > > > > > > Hi Nie, > > > > This will click logout image: > > > > ie.image(:src, /logout/).flash > > > > If this does not do what you need, let me know. > > > > ?eljko > > -- > > http://zeljkofilipin.com/ > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > Tel : 010-82334433-356 / 8-0086-22-356 > Email : niegq at necas.nec.com.cn > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From niegq at nec-as.nec.com.cn Wed Nov 15 06:30:42 2006 From: niegq at nec-as.nec.com.cn (Nie Guoqiang) Date: Wed, 15 Nov 2006 19:30:42 +0800 Subject: [Wtr-general] how to access icon's button In-Reply-To: <79518aef0611150309x9226937xb3371e8e0e8fa2c3@mail.gmail.com> References: <20061115181730.1A3A.NIEGQ@nec-as.nec.com.cn> <79518aef0611150309x9226937xb3371e8e0e8fa2c3@mail.gmail.com> Message-ID: <20061115192206.1A3C.NIEGQ@nec-as.nec.com.cn> Thanks for your reply! I tyied with ie.show_frames.frame("logo").show_images , but get such msg as "undefined method for 0..5:Range" BTW: how can i access one specified frame, eg. MENU? ie.frame("MENU") doesnot work. Frame codes is as below: ++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++ > Your HTML snippet didn't show that there where any frames. Find the > name of the frame that contains the image using e.g: > > ie.show_frames.some_frame.show_images > > If the image is listed for frame "show_frame" (frames will have > different names for you) then you could use: > > ie.frame("some_frame").image(:src, /logout/).flash > > Cheers, > Daniel. > > > > On 15/11/06, Nie Guoqiang wrote: > > The codes doesnot work :( > > > > More tips: > > When I execute ie.show_frames(), I get "There is 6 frames". > > And when ie.show_images() is executed, message is "0". > > > > Thanks > > > > > > > On 11/14/06, Nie Guoqiang wrote: how can i access this icon-button. > > > > > > > > > > > > > > > Hi Nie, > > > > > > This will click logout image: > > > > > > ie.image(:src, /logout/).flash > > > > > > If this does not do what you need, let me know. > > > > > > ?eljko > > > -- > > > http://zeljkofilipin.com/ > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > Email : niegq at necas.nec.com.cn > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > _______________________________________________ > > 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 =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Nie Guoqiang NEC-CAS Software Department 1K/4SG Tel : 010-82334433-356 / 8-0086-22-356 Email : niegq at necas.nec.com.cn =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= From browne.daniel at gmail.com Wed Nov 15 06:59:42 2006 From: browne.daniel at gmail.com (Daniel Browne) Date: Wed, 15 Nov 2006 11:59:42 +0000 Subject: [Wtr-general] how to access icon's button In-Reply-To: <20061115192206.1A3C.NIEGQ@nec-as.nec.com.cn> References: <20061115181730.1A3A.NIEGQ@nec-as.nec.com.cn> <79518aef0611150309x9226937xb3371e8e0e8fa2c3@mail.gmail.com> <20061115192206.1A3C.NIEGQ@nec-as.nec.com.cn> Message-ID: <79518aef0611150359n6773c06bp2e797a12842bd8cd@mail.gmail.com> 1. First of all do: ie.show_frames List will give you a list of frames. 2. Then for each of the frame names returned in step 1 do: ie.frame("").show_images This will give you lists of images in each frame (you have to replace with the actual name of a frame returned in step 1. If there are 5 frames returned in step 1, then you might have to do step 2 five times to find out which frame contains your image. 3. Once you know the name of the frame that contains the image (let's say it is called "frame5") do: ie.frame("frame5").image(:src, /logout/).flash Cheers, Daniel. On 15/11/06, Nie Guoqiang wrote: > Thanks for your reply! > > I tyied with ie.show_frames.frame("logo").show_images , but get such msg as "undefined method for 0..5:Range" > > BTW: how can i access one specified frame, eg. MENU? > ie.frame("MENU") doesnot work. > > Frame codes is as below: > ++++++++++++++++++++++++++++++++++ > > > > > > > > > > > > > > > > ++++++++++++++++++++++++++++++++++ > > > > Your HTML snippet didn't show that there where any frames. Find the > > name of the frame that contains the image using e.g: > > > > ie.show_frames.some_frame.show_images > > > > If the image is listed for frame "show_frame" (frames will have > > different names for you) then you could use: > > > > ie.frame("some_frame").image(:src, /logout/).flash > > > > Cheers, > > Daniel. > > > > > > > > On 15/11/06, Nie Guoqiang wrote: > > > The codes doesnot work :( > > > > > > More tips: > > > When I execute ie.show_frames(), I get "There is 6 frames". > > > And when ie.show_images() is executed, message is "0". > > > > > > Thanks > > > > > > > > > > On 11/14/06, Nie Guoqiang wrote: how can i access this icon-button. > > > > > > > > > > > > > > > > > > > > Hi Nie, > > > > > > > > This will click logout image: > > > > > > > > ie.image(:src, /logout/).flash > > > > > > > > If this does not do what you need, let me know. > > > > > > > > ?eljko > > > > -- > > > > http://zeljkofilipin.com/ > > > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > > Email : niegq at necas.nec.com.cn > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > > > _______________________________________________ > > > 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 > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > Tel : 010-82334433-356 / 8-0086-22-356 > Email : niegq at necas.nec.com.cn > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From forum-watir-users at openqa.org Wed Nov 15 09:45:55 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Wed, 15 Nov 2006 08:45:55 CST Subject: [Wtr-general] Find parent table index from a specific element within Message-ID: <56882113.1163601985547.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Lets say we have the following Table .TR ..TD ..TD ...SPAN text=findme ..TD ...Text Input Field The only element in this entire section that I can identify uniquely is the span. The span happens to be located within a table. That table also contains the text input field (my real goal). So is there a way to find out what the table index is that contains a span? To explain it another way, here is some fake code. table_index = $ie.frame('frame1').span(:text,'findme').get_parent_table_index() $ie.frame('frame1').table(:index,table_index)[1][3].text_field(:index, 1).set('i did it!') --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5270&messageID=14638#14638 From forum-watir-users at openqa.org Wed Nov 15 11:33:18 2006 From: forum-watir-users at openqa.org (Alan Ark) Date: Wed, 15 Nov 2006 10:33:18 CST Subject: [Wtr-general] Problems with the watir email list? Message-ID: <64931865.1163608487500.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi folks. I was just wondering if anyone else was getting the Watir list emails correctly? I double checked that I am subscribed to the watir list correctly (http://rubyforge.org/mailman/options/wtr-general), but have not recieved any emails since Friday 11/10th. My back-up plan is to just use the forums (like now). Any comments or ideas? Thanks -Alan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5274&messageID=14644#14644 From forum-watir-users at openqa.org Wed Nov 15 12:26:27 2006 From: forum-watir-users at openqa.org (Prashant Bhatia) Date: Wed, 15 Nov 2006 11:26:27 CST Subject: [Wtr-general] Accessing links from the JavaScript page In-Reply-To: <63601147.1163553733906.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <41417777.1163611685534.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks Nathan for the reply. I am not missing anything from the code I wrote. The flash is just to display an image in the center of the page and does not do anything apart from that. All the menu items on top of the page are actually stored in the menu_config.js script file. I have double check that. Snippet of the menu_config.js [CODE] // Menu tree //MenuX=new Array(Text to show, Link, background image (optional), number of sub elements, height, width); //For rollover images set "Text to show" to: "rollover:Image1.jpg:Image2.jpg" Menu1=new Array("Client Search","search.do","",0,22,139); Menu2=new Array("Reports","reports.do","",0,22,139); Menu3=new Array("Bank Transfer","banking.do","",0,22,139); [/CODE] and the menu_com.js file uploads the menus and do other stuff related to menus. So practically, calling the .js does the trick of creating a menu which acts as a link. Any funtion or method or anything in Watir that can handle this kind of javascripting on a page. Prashant --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5259&messageID=14651#14651 From gmcclure at tacoda.com Wed Nov 15 13:26:39 2006 From: gmcclure at tacoda.com (McClure, Gary) Date: Wed, 15 Nov 2006 11:26:39 -0700 Subject: [Wtr-general] Problems with the watir email list? In-Reply-To: <64931865.1163608487500.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: No problems for me. Spam Filter maybe? -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Alan Ark Sent: Wednesday, November 15, 2006 11:33 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Problems with the watir email list? Hi folks. I was just wondering if anyone else was getting the Watir list emails correctly? I double checked that I am subscribed to the watir list correctly (http://rubyforge.org/mailman/options/wtr-general), but have not recieved any emails since Friday 11/10th. My back-up plan is to just use the forums (like now). Any comments or ideas? Thanks -Alan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5274&messageID=14644#14644 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From Mark_Cain at RL.gov Wed Nov 15 13:46:57 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Wed, 15 Nov 2006 10:46:57 -0800 Subject: [Wtr-general] Problems with the watir email list? Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A3617@EX01-2.rl.gov> I have had some similar problems in the past. As it turned out the server IP the forum comes from was on the Spam Block list for the entire license class (if I said that right) any way, I had to have the cyber-security guy open up the spam filter to allow the specific IP for the forum. Problem solved...for me anyway. ;-) Hope this helps, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Alan Ark Sent: Wednesday, November 15, 2006 8:33 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Problems with the watir email list? Hi folks. I was just wondering if anyone else was getting the Watir list emails correctly? I double checked that I am subscribed to the watir list correctly (http://rubyforge.org/mailman/options/wtr-general), but have not recieved any emails since Friday 11/10th. My back-up plan is to just use the forums (like now). Any comments or ideas? Thanks -Alan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5274&messageID=14644#14644 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From wpreul at gmail.com Wed Nov 15 13:47:14 2006 From: wpreul at gmail.com (Wyatt Preul) Date: Wed, 15 Nov 2006 13:47:14 -0500 Subject: [Wtr-general] Bug in fileField SetComboBoxText Message-ID: I ran into an issue with the fileField.set method not setting the text I passed into it. I found that the issue was the call inside of winClicker.rbto the set_text method from the setComboBoxText method. The solution is to make your setComboBoxText method inside winClicker.rblook like the following: def setComboBoxText(hWnd , textToSet) send_message = @User32['SendMessage', 'ILISS'] r ,rs = send_message.call(hWnd , WM_SETTEXT ,'',textToSet) end this may also be true for the setTextBoxText method. Hopefully this will help those having issue with the fileField. Also, why is the value of the fileField not exposed? It seems that this would be a much more efficient way to assign a file path than to open a new dialog box, and find the appropriate file and open it. why not just do ie.fileField(:id, /someId/).value = 'myfile.ext' -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061115/7ef30527/attachment.html From charley.baker at gmail.com Wed Nov 15 14:51:36 2006 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 15 Nov 2006 12:51:36 -0700 Subject: [Wtr-general] detecting versions of browser and os In-Reply-To: <032301c705d5$14d58920$6400a8c0@laptop> References: <032301c705d5$14d58920$6400a8c0@laptop> Message-ID: Paul, I'm not currently testing with IE 7 but most likely will be soon, particularly since the upgrade is part of the system updates which means the user base will expand quickly. Can you add a JIRA task for this? While the browser version makes sense in context of the ie object, the os version and language don't. They'd make more sense to me in the context of the Watir module, possibly in their own class, Environment? Other thoughts? -Charley On 11/11/06, Paul Rogers wrote: > > > I think, now that we have vista, ie7 etc, that the following would be > useful: > > ie.browser_version => "IE7" > ie.os => "XP" > ie.os_language =>"en-us" > > etc > > as Im sure, many people like me now either need to test multiple browsers/os > or at least need to know what it was tested on. > > I have most of the code, I just need to know if there are any comments on > method names etc? > > Paul > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From forum-watir-users at openqa.org Wed Nov 15 15:11:34 2006 From: forum-watir-users at openqa.org (Nathan) Date: Wed, 15 Nov 2006 14:11:34 CST Subject: [Wtr-general] Accessing links from the JavaScript page In-Reply-To: <41417777.1163611685534.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <40660717.1163621853902.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hey pinkoobhatia, thanks for the clarification of the code - what I meant by "missing" was those two javascript files you included in your include tags. I kind of figured that your links were inside of those javascript files somewhere, but I couldn't see those, so I didn't know exactly where to begin with helping you possibly solve your problem. So one thing to try when you are viewing your page is the following: 1. Right click on your page and select View Source 2. Look for the links (<a href=...></a> tags) in the source code that results. Usually the page source will load up in Notepad or watever you have selected for it to load up in If you can see that your links show up there, then all you need to do is find some attribute, such as the id, name, or innertext, that is unique to each link, then you can use that in a statement link the following: ie.link(:someUniqueAttribute, "uniqueAttributeValue").click where :someUniqueAttribute is eqivalent to :id, :name, :innertext, or whatever you decide - the ':' is a necessary part of this value and it is not a string, so no quotes, but you probably already knew that. And where "uniqueAttributeValue" is the value of the attribute you picked. An example of link source code follows: <a href="#" id="newLink" class="blackLink" name="Link to nowhere">This is my link to nowhere</a> In the above link the following unique attributes and their values can be seen:
attribute             value
--------------------------------
  :href                 "#"
  :id                    "newLink"
  :class              "blackLink"
  :name              "Link to nowhere"
  :innertext          "This is my link to nowhere"
That said, looking at what you have given me to work with, I'm still unsure where your link is, or how to identify it myself. One problem with javascript generated stuff may be the following: If you are generating links or anything else on-the-fly every time that somebody triggers a specific event, then it's possible that you'll never see that object. With menus for example, if you redraw your menu completely and dynamically change the links in your menu, then you might not be able to see that link until you first fire a mouse over event and "mouseover" your menu, but if your menu already contains the links and all you do is change visibility of your menu, then you might still be able to click on them, but not if their :visible attribute is set to "hidden". To fire an event like mouseover on a menu you might do something like this, where the menu is an image: require "watir" include Watir # Create a new browser object $objWatirBrowser = IE.start("www.mystartpage.com") # Fire a mouseover event on my menu to activate it $objWatirBrowser.image(:id, "menu_Help").fireEvent("onMouseOver") # Now I can see my link, so click on it $objWatirBrowser.link(:innertext, "About Us").click Let me know if this has helped you at all. Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5259&messageID=14674#14674 From Mark_Cain at RL.gov Wed Nov 15 15:21:07 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Wed, 15 Nov 2006 12:21:07 -0800 Subject: [Wtr-general] Find parent table index from a specific element within Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A361A@EX01-2.rl.gov> If there is one I have never found it. What I have had to do was do a view source on the page. I then do f, enter ' Message-ID: <39758828.1163622724743.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> So if I understand correctly, you have a table that looks something like the following: [code]
... findme ...
[/code] And you want to located the text field and enter some value into it? Well you could do the following: Assuming that this text field is the first and only text field on the page, then some like this code would be able to access it and enter the value "I did it!" into that text field: ie.textField(:index, "0").set("I did it!") Does that make sense or am I way off? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5270&messageID=14675#14675 From paul.rogers at shaw.ca Wed Nov 15 15:33:27 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 15 Nov 2006 13:33:27 -0700 Subject: [Wtr-general] Find parent table index from a specific element within In-Reply-To: <56882113.1163601985547.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <56882113.1163601985547.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: myself and some others, I forget who, have discussed this. I had a need to do something like what you also need, and we came up with something like table ie.element_before( :table , :text_field , :id , "my_text_field") this would return the :table that is immediately before the :text_field wit :id "my text field" I never got as far as updating it to work with 1.5 though, so its not checked in :-( And it may be entirely different to what this is, as I'm going off memory I'll try and post it as it is tonight, but remind me if I dont do it in a day or 2 ;-) Paul ----- Original Message ----- From: John Lolis Date: Wednesday, November 15, 2006 7:45 am Subject: [Wtr-general] Find parent table index from a specific element within > Lets say we have the following > > Table > .TR > ..TD > ..TD > ...SPAN text=findme > ..TD > ...Text Input Field > > The only element in this entire section that I can identify > uniquely is the span. The span happens to be located within a > table. That table also contains the text input field (my real > goal). So is there a way to find out what the table index is that > contains a span? To explain it another way, here is some fake code. > > table_index = > $ie.frame('frame1').span(:text,'findme').get_parent_table_index()$ie.frame('frame1').table(:index,table_index)[1][3].text_field(:index, 1).set('i did it!') > ------------------------------------------------------------------- > -- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5270&messageID=14638#14638 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Wed Nov 15 15:58:11 2006 From: forum-watir-users at openqa.org (Prashant Bhatia) Date: Wed, 15 Nov 2006 14:58:11 CST Subject: [Wtr-general] Accessing links from the JavaScript page In-Reply-To: <40660717.1163621853902.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <23008298.1163624382578.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Nathan.. thats an awesome explanation.. thanks but unfortunately.. I am still stuck I don't have any since all my links are in the javascript file & they are loaded on load() I guess. So everything you click on a page, they will get loaded. I also tried the image method... but there is no image on the page. I get ("Unable to locate object, using index and 2"). I tried with Id as well.

Is there any way, watir can do this thing.. Get the text & click on the text. when I do $ie.text. .I get

=> "Client SearchReportsBank TransferProceduresChange PasswordAdvantageCheck RequestsBonus AwardsPredictive Dialer" Even though my text should be Client Serach Reports Bank.. etc

Thanks for helping me out.
Prashant --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5259&messageID=14676#14676 From forum-watir-users at openqa.org Wed Nov 15 16:22:58 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Wed, 15 Nov 2006 15:22:58 CST Subject: [Wtr-general] Find parent table index from a specific element within In-Reply-To: <39758828.1163622724743.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <47993873.1163625808686.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> That is actually a really nice simple solution, I have no idea why I didn't think of it. I decided to go with a simple parser. It looks for a certain table, finds a sub stable by index, finds the length then attempts to locate input fields within it. Thank you though, you got my brain thinking in a different direction. I'm still holding out hope that their is a way to find containing elements. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5270&messageID=14678#14678 From forum-watir-users at openqa.org Wed Nov 15 16:46:56 2006 From: forum-watir-users at openqa.org (Egil Sorensen) Date: Wed, 15 Nov 2006 15:46:56 CST Subject: [Wtr-general] Problems with the watir email list? In-Reply-To: <64931865.1163608487500.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <62403170.1163627246421.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I do see a problem, but of a different sort. I am getting the digest emails correctly. However, in the digests I see posts that I can't find on forums. E.g. in Wtr-general Digest, Vol 36, Issue 20, Message: 2 is a reply from Mark to this thread, but his reply is not to be found here on forums. I have seen the same earlier, where I was waiting for a reply to show up on forums before I replied, but the post never made it... Regards, ~~ Egil --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5274&messageID=14679#14679 From charley.baker at gmail.com Wed Nov 15 16:51:15 2006 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 15 Nov 2006 14:51:15 -0700 Subject: [Wtr-general] Find parent table index from a specific element within In-Reply-To: <47993873.1163625808686.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <39758828.1163622724743.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <47993873.1163625808686.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: You can use an approach similar to the Element#visible idea in the user contributions portion of the wiki site if you really need to. http://wiki.openqa.org/pages/viewpage.action?pageId=1119. The ole object is there and you can query it to get the parent if need be. Otherwise, using Watir 1.5.1.x you should be able to refer to your input field directly. -Charley On 11/15/06, John Lolis wrote: > That is actually a really nice simple solution, I have no idea why I didn't think of it. I decided to go with a simple parser. It looks for a certain table, finds a sub stable by index, finds the length then attempts to locate input fields within it. > > Thank you though, you got my brain thinking in a different direction. > > I'm still holding out hope that their is a way to find containing elements. > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5270&messageID=14678#14678 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Wed Nov 15 17:30:02 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 15 Nov 2006 16:30:02 -0600 Subject: [Wtr-general] Find parent table index from a specific element within In-Reply-To: <56882113.1163601985547.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <56882113.1163601985547.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <455B94EA.4050604@pettichord.com> John Lolis wrote: > Lets say we have the following > > Table > .TR > ..TD > ..TD > ...SPAN text=findme > ..TD > ...Text Input Field > > The only element in this entire section that I can identify uniquely is the span. The span happens to be located within a table. That table also contains the text input field (my real goal). So is there a way to find out what the table index is that contains a span? To explain it another way, here is some fake code. > > table_index = $ie.frame('frame1').span(:text,'findme').get_parent_table_index() > $ie.frame('frame1').table(:index,table_index)[1][3].text_field(:index, 1).set('i did it!') > This problem comes up repeatedly both on this forum and in my daily use of Watir. I believe that Watir needs to be extended to provide a solid, intuitive way to do this kind of thing. This has been discussed some on the wtr-development list. First of all, i should say that this specific problem has a little-known solution that is even in Watir 1.4. span = $ie.frame('frame1').span(:text, 'findme'). table = Table.create_from_element(span, span) table[1][3].text_field(:index, 1).set('i did it!') However, i have run into similar situations, where i needed to get a containing row instead of a table. There is not currently a TableRow.create_from_element method, and it is not clear that this would be the best API for this kind of thing. I would appreciate comments on how intuitive you find the following possible syntaxes. I also would appreciate hearing other suggestions. table = $ie.frame('frame1').table(:containing, span) table = span.parent.table(:index, 1) It also seems that we need to support the case where you want to know the containing element (say Div) of a particular class, so this is also something to consider. Some of these may be easier than others to implement, but right now i am trying to figure out what would be an intuitive Watir-like syntax for this kind of thing. Bret From Mark_Cain at RL.gov Wed Nov 15 17:49:19 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Wed, 15 Nov 2006 14:49:19 -0800 Subject: [Wtr-general] Find parent table index from a specific elementwithin Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A361B@EX01-2.rl.gov> It is 1-based ie.textField(:index, 1).set("I did it!") --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Nathan Sent: Wednesday, November 15, 2006 12:28 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Find parent table index from a specific elementwithin So if I understand correctly, you have a table that looks something like the following: [code]
... findme ...
[/code] And you want to located the text field and enter some value into it? Well you could do the following: Assuming that this text field is the first and only text field on the page, then some like this code would be able to access it and enter the value "I did it!" into that text field: ie.textField(:index, "0").set("I did it!") Does that make sense or am I way off? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5270&messageID=14675#14675 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From forum-watir-users at openqa.org Wed Nov 15 18:12:39 2006 From: forum-watir-users at openqa.org (Nathan) Date: Wed, 15 Nov 2006 17:12:39 CST Subject: [Wtr-general] Accessing links from the JavaScript page In-Reply-To: <23008298.1163624382578.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <49098051.1163632389680.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Okay, that's no good. Is your web page available online somewhere so that I might give it a go and try to do what you are trying to do? As far as the image method goes, if there isn't an image that represents your menu, then don't use the image, for example if your menu is a link, use link instead of image. Watir can only work with objects that are actually on your webpage - if no images, then Watir cannot see an image, which is what the message indicates. Watir can however do it! Because Watir uses the same technique as every other automated test tool for Internet Explorer, if Watir can't do it, then no other tool can, but I guarantee that Watir can do it. So the reason why you see "Client SearchReportsBank TransferProceduresChange PasswordAdvantageCheck RequestsBonus AwardsPredictive Dialer" INSTEAD of Client Search Reports Bank.. etc. with spaces in between each word is likely because in your webpage there aren't spaces after each word. If in your webpage you were to place a space after each word, probably in the form   then you would also see spaces between each word when you do $ie.text. Let's try something different. Open up a command line window (if you don't already know how, click on the Start button, click on Run, enter cmd, then click OK). From there type irb and press Enter. This brings you into the Ruby console. Now type the following, pressing enter after each line - case matters remember, and you should never see the word nil unless I tell you: require 'watir' include Watir $ie=IE.start([i]type the URL to your webpage here in quotation marks[/i]) $ie.show_links This will list all of the attributes of all of the links on your website. Try it out and let me know what you get. To exit the Ruby console type exit and press Enter. Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5259&messageID=14686#14686 From forum-watir-users at openqa.org Wed Nov 15 18:26:03 2006 From: forum-watir-users at openqa.org (Prashant Bhatia) Date: Wed, 15 Nov 2006 17:26:03 CST Subject: [Wtr-general] Accessing links from the JavaScript page In-Reply-To: <49098051.1163632389680.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <48217971.1163633193817.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hey Nathan, the result I get from $ie.show_links [br] irb(main):008:0> $ie.show_links index name id href text/src => nil [br] Somehow, I have made it work now. Even though the source code doesn't show any tags or divs, the links are actually showing as divs. I installed IE developers toolbar & using that, I found that those links are showing as a div & my developer said that the js file in within a div or something.. but bottom line.. using a div as[br] $ie.div(:index, 2).click[br] I am able to click on the link. The only problem is, if the developer change the order, I have to find the index number again. When I do [code] $ie.divs.each {|d| puts d.to_s puts " " } [/code] I get [CODE SNIPPET] type: Div id: name: value: disabled: style: text: Client Search [/CODE SNIPPET] since div only recognize id, name or index.. I can't use text so have to use :index in this case. Thanks for all the help Prashant --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5259&messageID=14688#14688 From forum-watir-users at openqa.org Wed Nov 15 18:30:55 2006 From: forum-watir-users at openqa.org (Prashant Bhatia) Date: Wed, 15 Nov 2006 17:30:55 CST Subject: [Wtr-general] Accessing links from the JavaScript page In-Reply-To: <39271216.1163548689669.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <43431504.1163633486662.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Even though the links are in javascript file, installing IE developer toolbar showed those links are divs & then using divs, able to click on the links --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5259&messageID=14689#14689 From niegq at nec-as.nec.com.cn Wed Nov 15 21:22:42 2006 From: niegq at nec-as.nec.com.cn (Nie Guoqiang) Date: Thu, 16 Nov 2006 10:22:42 +0800 Subject: [Wtr-general] how to access icon's button In-Reply-To: <79518aef0611150359n6773c06bp2e797a12842bd8cd@mail.gmail.com> References: <20061115192206.1A3C.NIEGQ@nec-as.nec.com.cn> <79518aef0611150359n6773c06bp2e797a12842bd8cd@mail.gmail.com> Message-ID: <20061116101942.1A42.NIEGQ@nec-as.nec.com.cn> I get only "there are 6 frames" when executing ie.show_frames. So I think it must be of the watir version that causes my problem. I am very sorry, and thanks to you all > 1. First of all do: > > ie.show_frames > > List will give you a list of frames. > > 2. Then for each of the frame names returned in step 1 do: > > ie.frame("").show_images > > This will give you lists of images in each frame (you have to replace > with the actual name of a frame returned in step > 1. If there are 5 frames returned in step 1, then you might have to > do step 2 five times to find out which frame contains your image. > > 3. Once you know the name of the frame that contains the image (let's > say it is called "frame5") do: > > ie.frame("frame5").image(:src, /logout/).flash > > Cheers, > Daniel. > > > On 15/11/06, Nie Guoqiang wrote: > > Thanks for your reply! > > > > I tyied with ie.show_frames.frame("logo").show_images , but get such msg as "undefined method for 0..5:Range" > > > > BTW: how can i access one specified frame, eg. MENU? > > ie.frame("MENU") doesnot work. > > > > Frame codes is as below: > > ++++++++++++++++++++++++++++++++++ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ++++++++++++++++++++++++++++++++++ > > > > > > > Your HTML snippet didn't show that there where any frames. Find the > > > name of the frame that contains the image using e.g: > > > > > > ie.show_frames.some_frame.show_images > > > > > > If the image is listed for frame "show_frame" (frames will have > > > different names for you) then you could use: > > > > > > ie.frame("some_frame").image(:src, /logout/).flash > > > > > > Cheers, > > > Daniel. > > > > > > > > > > > > On 15/11/06, Nie Guoqiang wrote: > > > > The codes doesnot work :( > > > > > > > > More tips: > > > > When I execute ie.show_frames(), I get "There is 6 frames". > > > > And when ie.show_images() is executed, message is "0". > > > > > > > > Thanks > > > > > > > > > > > > > On 11/14/06, Nie Guoqiang wrote: how can i access this icon-button. > > > > > > > > > > > > > > > > > > > > > > > > > Hi Nie, > > > > > > > > > > This will click logout image: > > > > > > > > > > ie.image(:src, /logout/).flash > > > > > > > > > > If this does not do what you need, let me know. > > > > > > > > > > ?eljko > > > > > -- > > > > > http://zeljkofilipin.com/ > > > > > > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > > > Email : niegq at necas.nec.com.cn > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > > > > > > _______________________________________________ > > > > 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 > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > Email : niegq at necas.nec.com.cn > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > _______________________________________________ > > 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 =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Nie Guoqiang NEC-CAS Software Department 1K/4SG Tel : 010-82334433-356 / 8-0086-22-356 Email : niegq at necas.nec.com.cn =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= From paul.rogers at shaw.ca Thu Nov 16 00:42:46 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 15 Nov 2006 22:42:46 -0700 Subject: [Wtr-general] detecting versions of browser and os References: <032301c705d5$14d58920$6400a8c0@laptop> Message-ID: <00e601c70942$0bbfd000$6400a8c0@laptop> the reason I had it on the ie object is that it comes fromthe user Agent, so it only applies to the ie object. I do think that some other approach might be more meaningful though, for example Watir::Utils::Environment::OS => "vista" Im sure there must be a win api call that gets this stuff, rather than using the userAgent Its in Jira, WTR-116 Paul ----- Original Message ----- From: "Charley Baker" To: Sent: Wednesday, November 15, 2006 12:51 PM Subject: Re: [Wtr-general] detecting versions of browser and os > Paul, > > I'm not currently testing with IE 7 but most likely will be soon, > particularly since the upgrade is part of the system updates which > means the user base will expand quickly. Can you add a JIRA task for > this? > > While the browser version makes sense in context of the ie object, > the os version and language don't. They'd make more sense to me in the > context of the Watir module, possibly in their own class, Environment? > Other thoughts? > > -Charley > > On 11/11/06, Paul Rogers wrote: >> >> >> I think, now that we have vista, ie7 etc, that the following would be >> useful: >> >> ie.browser_version => "IE7" >> ie.os => "XP" >> ie.os_language =>"en-us" >> >> etc >> >> as Im sure, many people like me now either need to test multiple >> browsers/os >> or at least need to know what it was tested on. >> >> I have most of the code, I just need to know if there are any comments on >> method names etc? >> >> Paul >> >> _______________________________________________ >> Wtr-general mailing list >> Wtr-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wtr-general >> >> > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From browne.daniel at gmail.com Thu Nov 16 04:14:18 2006 From: browne.daniel at gmail.com (Daniel Browne) Date: Thu, 16 Nov 2006 09:14:18 +0000 Subject: [Wtr-general] how to access icon's button In-Reply-To: <20061116101942.1A42.NIEGQ@nec-as.nec.com.cn> References: <20061115192206.1A3C.NIEGQ@nec-as.nec.com.cn> <79518aef0611150359n6773c06bp2e797a12842bd8cd@mail.gmail.com> <20061116101942.1A42.NIEGQ@nec-as.nec.com.cn> Message-ID: <79518aef0611160114i4c51af27w494bb7ee3f26d7ee@mail.gmail.com> What if you look at the HTML to determine the frame name? Cheers, Daniel. On 16/11/06, Nie Guoqiang wrote: > I get only "there are 6 frames" when executing ie.show_frames. > So I think it must be of the watir version that causes my problem. > I am very sorry, and thanks to you all > > > > 1. First of all do: > > > > ie.show_frames > > > > List will give you a list of frames. > > > > 2. Then for each of the frame names returned in step 1 do: > > > > ie.frame("").show_images > > > > This will give you lists of images in each frame (you have to replace > > with the actual name of a frame returned in step > > 1. If there are 5 frames returned in step 1, then you might have to > > do step 2 five times to find out which frame contains your image. > > > > 3. Once you know the name of the frame that contains the image (let's > > say it is called "frame5") do: > > > > ie.frame("frame5").image(:src, /logout/).flash > > > > Cheers, > > Daniel. > > > > > > On 15/11/06, Nie Guoqiang wrote: > > > Thanks for your reply! > > > > > > I tyied with ie.show_frames.frame("logo").show_images , but get such msg as "undefined method for 0..5:Range" > > > > > > BTW: how can i access one specified frame, eg. MENU? > > > ie.frame("MENU") doesnot work. > > > > > > Frame codes is as below: > > > ++++++++++++++++++++++++++++++++++ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ++++++++++++++++++++++++++++++++++ > > > > > > > > > > Your HTML snippet didn't show that there where any frames. Find the > > > > name of the frame that contains the image using e.g: > > > > > > > > ie.show_frames.some_frame.show_images > > > > > > > > If the image is listed for frame "show_frame" (frames will have > > > > different names for you) then you could use: > > > > > > > > ie.frame("some_frame").image(:src, /logout/).flash > > > > > > > > Cheers, > > > > Daniel. > > > > > > > > > > > > > > > > On 15/11/06, Nie Guoqiang wrote: > > > > > The codes doesnot work :( > > > > > > > > > > More tips: > > > > > When I execute ie.show_frames(), I get "There is 6 frames". > > > > > And when ie.show_images() is executed, message is "0". > > > > > > > > > > Thanks > > > > > > > > > > > > > > > > On 11/14/06, Nie Guoqiang wrote: how can i access this icon-button. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Hi Nie, > > > > > > > > > > > > This will click logout image: > > > > > > > > > > > > ie.image(:src, /logout/).flash > > > > > > > > > > > > If this does not do what you need, let me know. > > > > > > > > > > > > ?eljko > > > > > > -- > > > > > > http://zeljkofilipin.com/ > > > > > > > > > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > > > > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > > > > Email : niegq at necas.nec.com.cn > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > > > > > > > > > _______________________________________________ > > > > > 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 > > > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > > Email : niegq at necas.nec.com.cn > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > > > _______________________________________________ > > > 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 > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > Tel : 010-82334433-356 / 8-0086-22-356 > Email : niegq at necas.nec.com.cn > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From zeljko.filipin at gmail.com Thu Nov 16 04:23:23 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 16 Nov 2006 10:23:23 +0100 Subject: [Wtr-general] Bug in fileField SetComboBoxText In-Reply-To: References: Message-ID: Paul Rogers explained it before: "its a security thing in IE. It wont let you set a file fields value from script. Because you could have a file input in a hidden div, and have script enter the filename of some important file and then upload it without the user being aware of it." Zeljko -- http://zeljkofilipin.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061116/15fee33d/attachment.html From browne.daniel at gmail.com Thu Nov 16 04:24:19 2006 From: browne.daniel at gmail.com (Daniel Browne) Date: Thu, 16 Nov 2006 09:24:19 +0000 Subject: [Wtr-general] how to access icon's button In-Reply-To: <79518aef0611160114i4c51af27w494bb7ee3f26d7ee@mail.gmail.com> References: <20061115192206.1A3C.NIEGQ@nec-as.nec.com.cn> <79518aef0611150359n6773c06bp2e797a12842bd8cd@mail.gmail.com> <20061116101942.1A42.NIEGQ@nec-as.nec.com.cn> <79518aef0611160114i4c51af27w494bb7ee3f26d7ee@mail.gmail.com> Message-ID: <79518aef0611160124l6c2110b2ka5c1d84d35a7922c@mail.gmail.com> That's weird, I've experimented with a few different pages that contain frames and with some of them I get the same behaviour as you. With others it lists the frame names as expected. As I said, try looking at the HTML source for part that states: wrote: > What if you look at the HTML to determine the frame name? > > Cheers, > Daniel. > > On 16/11/06, Nie Guoqiang wrote: > > I get only "there are 6 frames" when executing ie.show_frames. > > So I think it must be of the watir version that causes my problem. > > I am very sorry, and thanks to you all > > > > > > > 1. First of all do: > > > > > > ie.show_frames > > > > > > List will give you a list of frames. > > > > > > 2. Then for each of the frame names returned in step 1 do: > > > > > > ie.frame("").show_images > > > > > > This will give you lists of images in each frame (you have to replace > > > with the actual name of a frame returned in step > > > 1. If there are 5 frames returned in step 1, then you might have to > > > do step 2 five times to find out which frame contains your image. > > > > > > 3. Once you know the name of the frame that contains the image (let's > > > say it is called "frame5") do: > > > > > > ie.frame("frame5").image(:src, /logout/).flash > > > > > > Cheers, > > > Daniel. > > > > > > > > > On 15/11/06, Nie Guoqiang wrote: > > > > Thanks for your reply! > > > > > > > > I tyied with ie.show_frames.frame("logo").show_images , but get such msg as "undefined method for 0..5:Range" > > > > > > > > BTW: how can i access one specified frame, eg. MENU? > > > > ie.frame("MENU") doesnot work. > > > > > > > > Frame codes is as below: > > > > ++++++++++++++++++++++++++++++++++ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ++++++++++++++++++++++++++++++++++ > > > > > > > > > > > > > Your HTML snippet didn't show that there where any frames. Find the > > > > > name of the frame that contains the image using e.g: > > > > > > > > > > ie.show_frames.some_frame.show_images > > > > > > > > > > If the image is listed for frame "show_frame" (frames will have > > > > > different names for you) then you could use: > > > > > > > > > > ie.frame("some_frame").image(:src, /logout/).flash > > > > > > > > > > Cheers, > > > > > Daniel. > > > > > > > > > > > > > > > > > > > > On 15/11/06, Nie Guoqiang wrote: > > > > > > The codes doesnot work :( > > > > > > > > > > > > More tips: > > > > > > When I execute ie.show_frames(), I get "There is 6 frames". > > > > > > And when ie.show_images() is executed, message is "0". > > > > > > > > > > > > Thanks > > > > > > > > > > > > > > > > > > > On 11/14/06, Nie Guoqiang wrote: how can i access this icon-button. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Hi Nie, > > > > > > > > > > > > > > This will click logout image: > > > > > > > > > > > > > > ie.image(:src, /logout/).flash > > > > > > > > > > > > > > If this does not do what you need, let me know. > > > > > > > > > > > > > > ?eljko > > > > > > > -- > > > > > > > http://zeljkofilipin.com/ > > > > > > > > > > > > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > > > > > > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > > > > > Email : niegq at necas.nec.com.cn > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > 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 > > > > > > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > > > Email : niegq at necas.nec.com.cn > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > > > > > > _______________________________________________ > > > > 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 > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > Email : niegq at necas.nec.com.cn > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > From vikashkumar051 at yahoo.co.in Thu Nov 16 05:12:19 2006 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Thu, 16 Nov 2006 15:42:19 +0530 (IST) Subject: [Wtr-general] problem in entering values in javascript input box Message-ID: <20061116101219.79572.qmail@web7811.mail.in.yahoo.com> I am clicking on an image using require 'watir' include Watir ie=Watir::IE.start("c:\test.htm") ie.image(:id,'3').click When the image is clicked it opens a javascript input box asking to enter some value, and click on either OK or Cancel button. I am unable to enter value in it also not able to click on either of the button, this stops my code, I have to enter value in the input box manually then click on either of the button. Please help me how to enter value in the javascript input box and then click on either of the button. Thanks __________________________________________________________ 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/20061116/8417a17b/attachment.html From niegq at nec-as.nec.com.cn Thu Nov 16 06:12:38 2006 From: niegq at nec-as.nec.com.cn (Nie Guoqiang) Date: Thu, 16 Nov 2006 19:12:38 +0800 Subject: [Wtr-general] how to access icon's button In-Reply-To: <79518aef0611160124l6c2110b2ka5c1d84d35a7922c@mail.gmail.com> References: <79518aef0611160114i4c51af27w494bb7ee3f26d7ee@mail.gmail.com> <79518aef0611160124l6c2110b2ka5c1d84d35a7922c@mail.gmail.com> Message-ID: <20061116191053.5E78.NIEGQ@nec-as.nec.com.cn> Hi Daniel I reinstall my Ruby and Watir. It's ok now. It's a version problem indeed. I am very appreciate your answers! > That's weird, I've experimented with a few different pages that > contain frames and with some of them I get the same behaviour as you. > With others it lists the frame names as expected. > > As I said, try looking at the HTML source for part that states: > > > and use the text that you have instead of "frame_name_here" to specify > the frame as described earlier in the mail thread. > > Cheers, > Daniel. > > On 16/11/06, Daniel Browne wrote: > > What if you look at the HTML to determine the frame name? > > > > Cheers, > > Daniel. > > > > On 16/11/06, Nie Guoqiang wrote: > > > I get only "there are 6 frames" when executing ie.show_frames. > > > So I think it must be of the watir version that causes my problem. > > > I am very sorry, and thanks to you all > > > > > > > > > > 1. First of all do: > > > > > > > > ie.show_frames > > > > > > > > List will give you a list of frames. > > > > > > > > 2. Then for each of the frame names returned in step 1 do: > > > > > > > > ie.frame("").show_images > > > > > > > > This will give you lists of images in each frame (you have to replace > > > > with the actual name of a frame returned in step > > > > 1. If there are 5 frames returned in step 1, then you might have to > > > > do step 2 five times to find out which frame contains your image. > > > > > > > > 3. Once you know the name of the frame that contains the image (let's > > > > say it is called "frame5") do: > > > > > > > > ie.frame("frame5").image(:src, /logout/).flash > > > > > > > > Cheers, > > > > Daniel. > > > > > > > > > > > > On 15/11/06, Nie Guoqiang wrote: > > > > > Thanks for your reply! > > > > > > > > > > I tyied with ie.show_frames.frame("logo").show_images , but get such msg as "undefined method for 0..5:Range" > > > > > > > > > > BTW: how can i access one specified frame, eg. MENU? > > > > > ie.frame("MENU") doesnot work. > > > > > > > > > > Frame codes is as below: > > > > > ++++++++++++++++++++++++++++++++++ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ++++++++++++++++++++++++++++++++++ > > > > > > > > > > > > > > > > Your HTML snippet didn't show that there where any frames. Find the > > > > > > name of the frame that contains the image using e.g: > > > > > > > > > > > > ie.show_frames.some_frame.show_images > > > > > > > > > > > > If the image is listed for frame "show_frame" (frames will have > > > > > > different names for you) then you could use: > > > > > > > > > > > > ie.frame("some_frame").image(:src, /logout/).flash > > > > > > > > > > > > Cheers, > > > > > > Daniel. > > > > > > > > > > > > > > > > > > > > > > > > On 15/11/06, Nie Guoqiang wrote: > > > > > > > The codes doesnot work :( > > > > > > > > > > > > > > More tips: > > > > > > > When I execute ie.show_frames(), I get "There is 6 frames". > > > > > > > And when ie.show_images() is executed, message is "0". > > > > > > > > > > > > > > Thanks > > > > > > > > > > > > > > > > > > > > > > On 11/14/06, Nie Guoqiang wrote: how can i access this icon-button. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Hi Nie, > > > > > > > > > > > > > > > > This will click logout image: > > > > > > > > > > > > > > > > ie.image(:src, /logout/).flash > > > > > > > > > > > > > > > > If this does not do what you need, let me know. > > > > > > > > > > > > > > > > ?eljko > > > > > > > > -- > > > > > > > > http://zeljkofilipin.com/ > > > > > > > > > > > > > > > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > > > > > > > > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > > > > > > Email : niegq at necas.nec.com.cn > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > 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 > > > > > > > > > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > > > > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > > > > Email : niegq at necas.nec.com.cn > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > > > > > > > > > _______________________________________________ > > > > > 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 > > > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > > Email : niegq at necas.nec.com.cn > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > > > _______________________________________________ > > > 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 =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Nie Guoqiang NEC-CAS Software Department 1K/4SG Tel : 010-82334433-356 / 8-0086-22-356 Email : niegq at necas.nec.com.cn =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= From browne.daniel at gmail.com Thu Nov 16 09:25:36 2006 From: browne.daniel at gmail.com (Daniel Browne) Date: Thu, 16 Nov 2006 14:25:36 +0000 Subject: [Wtr-general] how to access icon's button In-Reply-To: <20061116191053.5E78.NIEGQ@nec-as.nec.com.cn> References: <79518aef0611160114i4c51af27w494bb7ee3f26d7ee@mail.gmail.com> <79518aef0611160124l6c2110b2ka5c1d84d35a7922c@mail.gmail.com> <20061116191053.5E78.NIEGQ@nec-as.nec.com.cn> Message-ID: <79518aef0611160625x127735c1hb8af7013ecb63d0f@mail.gmail.com> No problem. Out of curiosity, what versions are you using? I'm using ruby 1.8.4 and Watir 1.4.1 Cheers, Daniel. On 16/11/06, Nie Guoqiang wrote: > Hi Daniel > > I reinstall my Ruby and Watir. > It's ok now. > It's a version problem indeed. > > I am very appreciate your answers! > > > That's weird, I've experimented with a few different pages that > > contain frames and with some of them I get the same behaviour as you. > > With others it lists the frame names as expected. > > > > As I said, try looking at the HTML source for part that states: > > > > > > > and use the text that you have instead of "frame_name_here" to specify > > the frame as described earlier in the mail thread. > > > > Cheers, > > Daniel. > > > > On 16/11/06, Daniel Browne wrote: > > > What if you look at the HTML to determine the frame name? > > > > > > Cheers, > > > Daniel. > > > > > > On 16/11/06, Nie Guoqiang wrote: > > > > I get only "there are 6 frames" when executing ie.show_frames. > > > > So I think it must be of the watir version that causes my problem. > > > > I am very sorry, and thanks to you all > > > > > > > > > > > > > 1. First of all do: > > > > > > > > > > ie.show_frames > > > > > > > > > > List will give you a list of frames. > > > > > > > > > > 2. Then for each of the frame names returned in step 1 do: > > > > > > > > > > ie.frame("").show_images > > > > > > > > > > This will give you lists of images in each frame (you have to replace > > > > > with the actual name of a frame returned in step > > > > > 1. If there are 5 frames returned in step 1, then you might have to > > > > > do step 2 five times to find out which frame contains your image. > > > > > > > > > > 3. Once you know the name of the frame that contains the image (let's > > > > > say it is called "frame5") do: > > > > > > > > > > ie.frame("frame5").image(:src, /logout/).flash > > > > > > > > > > Cheers, > > > > > Daniel. > > > > > > > > > > > > > > > On 15/11/06, Nie Guoqiang wrote: > > > > > > Thanks for your reply! > > > > > > > > > > > > I tyied with ie.show_frames.frame("logo").show_images , but get such msg as "undefined method for 0..5:Range" > > > > > > > > > > > > BTW: how can i access one specified frame, eg. MENU? > > > > > > ie.frame("MENU") doesnot work. > > > > > > > > > > > > Frame codes is as below: > > > > > > ++++++++++++++++++++++++++++++++++ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ++++++++++++++++++++++++++++++++++ > > > > > > > > > > > > > > > > > > > Your HTML snippet didn't show that there where any frames. Find the > > > > > > > name of the frame that contains the image using e.g: > > > > > > > > > > > > > > ie.show_frames.some_frame.show_images > > > > > > > > > > > > > > If the image is listed for frame "show_frame" (frames will have > > > > > > > different names for you) then you could use: > > > > > > > > > > > > > > ie.frame("some_frame").image(:src, /logout/).flash > > > > > > > > > > > > > > Cheers, > > > > > > > Daniel. > > > > > > > > > > > > > > > > > > > > > > > > > > > > On 15/11/06, Nie Guoqiang wrote: > > > > > > > > The codes doesnot work :( > > > > > > > > > > > > > > > > More tips: > > > > > > > > When I execute ie.show_frames(), I get "There is 6 frames". > > > > > > > > And when ie.show_images() is executed, message is "0". > > > > > > > > > > > > > > > > Thanks > > > > > > > > > > > > > > > > > > > > > > > > > On 11/14/06, Nie Guoqiang wrote: how can i access this icon-button. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Hi Nie, > > > > > > > > > > > > > > > > > > This will click logout image: > > > > > > > > > > > > > > > > > > ie.image(:src, /logout/).flash > > > > > > > > > > > > > > > > > > If this does not do what you need, let me know. > > > > > > > > > > > > > > > > > > ?eljko > > > > > > > > > -- > > > > > > > > > http://zeljkofilipin.com/ > > > > > > > > > > > > > > > > > > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > > > > > > > > > > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > > > > > > > Email : niegq at necas.nec.com.cn > > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > 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 > > > > > > > > > > > > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > > > > > > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > > > > > Email : niegq at necas.nec.com.cn > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > 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 > > > > > > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > > > Email : niegq at necas.nec.com.cn > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > > > > > > _______________________________________________ > > > > 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 > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > Tel : 010-82334433-356 / 8-0086-22-356 > Email : niegq at necas.nec.com.cn > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From Mark_Cain at RL.gov Thu Nov 16 11:01:45 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Thu, 16 Nov 2006 08:01:45 -0800 Subject: [Wtr-general] problem in entering values in javascript input box Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A361D@EX01-2.rl.gov> This works for putting text into an JS promt(input) box: require 'watir\contrib\enabled_popup' def startClicker( button , waitTime=9, user_input=nil) hwnd = $ie.enabled_popup(waitTime) # get a handle if one exists if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) w.setTextValueForFileNameField(hwnd, "#{user_input}") end sleep 3 # I put this in to see the text being input it is not necessary to work w.clickWindowsButton_hwnd(hwnd, "#{button}") # "OK" or whatever the name on the button is w=nil # this is just cleanup end end $ie=Watir::IE.start("c:\test.htm") $ie.image(:id,'3').click_no_wait startClicker("OK", 7, "User Input") Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of VIKASH KUMAR Sent: Thursday, November 16, 2006 2:12 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] problem in entering values in javascript input box I am clicking on an image using require 'watir' include Watir ie=Watir::IE.start("c:\test.htm") ie.image(:id,'3').click When the image is clicked it opens a javascript input box asking to enter some value, and click on either OK or Cancel button. I am unable to enter value in it also not able to click on either of the button, this stops my code, I have to enter value in the input box manually then click on either of the button. Please help me how to enter value in the javascript input box and then click on either of the button. Thanks ________________________________ Find out what India is talking about on - Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061116/7b15f1d5/attachment.html From forum-watir-users at openqa.org Thu Nov 16 15:03:16 2006 From: forum-watir-users at openqa.org (Prashant Bhatia) Date: Thu, 16 Nov 2006 14:03:16 CST Subject: [Wtr-general] Using logger generating error Message-ID: <64785705.1163707522104.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I created Logger.rb file which has [b][CODE][/b] require 'watir' include Watir $logger = Logger.new('C:\WebTest\MentorAppTestScripts\logger.log', 5, 1024000) $logger.level = Logger::ERROR [b][/CODE][/b] Now, I am trying to using this log file in another .rb. [b][CODE SNIPPET][/b] require 'watir' require 'Logger' include Watir username = 'watirplayer' password = 'watirplayer' puts "## Start MentorApp SQA" $ie = IE.new $ie.clear_url_list $ie.goto("http://mentorapp") if not $ie.button(:value, 'Login').exists? $logger.info("Successfull Login") puts "Successfull Login" else $logger.error("Did not log in") puts "Not able to Login" end [b][/CODE SNIPPET][/b] but I get this error message: [b][ERROR MSG][/b] >ruby LogintoMentorApp.rb In LoginToMentorApp file ## Start MentorApp SQA ## Entering username, password c:/webtest/ruby/lib/ruby/1.8/Logger.rb:179: warning: already initialized constant ProgName c:/webtest/ruby/lib/ruby/1.8/Logger.rb:186: warning: already initialized constant DEBUG c:/webtest/ruby/lib/ruby/1.8/Logger.rb:187: warning: already initialized constant INFO c:/webtest/ruby/lib/ruby/1.8/Logger.rb:188: warning: already initialized constant WARN c:/webtest/ruby/lib/ruby/1.8/Logger.rb:189: warning: already initialized constant ERROR c:/webtest/ruby/lib/ruby/1.8/Logger.rb:190: warning: already initialized constant FATAL c:/webtest/ruby/lib/ruby/1.8/Logger.rb:191: warning: already initialized constant UNKNOWN c:/webtest/ruby/lib/ruby/1.8/Logger.rb:422: warning: already initialized constant SEV_LABEL c:/webtest/ruby/lib/ruby/1.8/Logger.rb:436: warning: already initialized constant Format c:/webtest/ruby/lib/ruby/1.8/Logger.rb:553: warning: already initialized constant SiD LogintoMentorApp.rb:41: undefined method `info' for nil:NilClass (NoMethodError) >Exit code: 1 [b][/ERROR MSG][/b] What am I doing wrong? Thanks Prashant --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5304&messageID=14750#14750 From forum-watir-users at openqa.org Thu Nov 16 15:35:28 2006 From: forum-watir-users at openqa.org (Nathan) Date: Thu, 16 Nov 2006 14:35:28 CST Subject: [Wtr-general] Accessing links from the JavaScript page In-Reply-To: <43431504.1163633486662.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <40946844.1163709599553.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Prashant, that's great news that you made it work. Here's something to remember: You can send a click event to any object, even if it isn't defined as a link typically is defined. So for example you could do any of the following and it would be legitimate: ie.link(:id, "homeLink").click ie.image(:alt, "some image").click ie.div(:class, "menu").click ie.span(:innertext, "My name is Nathan").click ...and so on. Now as far as the possibility of your developer changing the order of the divs, he or she should be giving the divs unique identifiers, such as an html id or a name. Good programming suggests this and it makes sense. Then let's say you have a div containing a help menu, and it gets moved to be the second out of three menus, then that div should have the unique name of "help_menu" or something like that, then when its position does change, it is still named "help_menu". Your developer can do this like so: <div name="help_menu">[i]Content or link text here[/i]</div> Also, this little method you did: $ie.divs.each {|d| puts d.to_s puts " " } is a handy little method that is part of Watir, but it doesn't show all of the attributes by far that you can use. Try this, and you will get a listing of all of the attributes and methods that are available for a div, and you can do this on any element type: $ie.divs.methods.each {|m| puts m } This will list all of the attributes (properties) and methods available for a div object. The to_s method that has been written into Watir, simply only defines type, id, name, value, disabled, style, and text. Some other examples directly from the output of the above code are: methods: instance_of? click == send fire_event Attributes/properties: class id type display text value ...and there are so many more. You can even get collections of objects that are inside of divs. For example let's say a div contains several images, then you could do the following to get all of the images: imagesArray = ie.divs[0].images Then imagesArray would be an array of all of the images contained in the first div on the web page. Also to clarify, in Ruby arrays may be either one-based or zero-based. By default arrays are zero-based, meaning that the first element in an array is element 0 (zero), but the creators of Watir have decided to make the arrays that they return all one-based, so if you access an array that they have created, then 1 is the first element. Here's an example of the difference: Using Watir stuff: ie.div(:index, "1").click Using Native Ruby stuff: ie.divs[0].click Both of the above lines of code click on the first div in the web page. Don't forget about your developer needing to give names to each of the divs. It's good development practice, and it makes testing that much easier. It's part of developing pro-actively. Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5259&messageID=14752#14752 From forum-watir-users at openqa.org Thu Nov 16 16:09:11 2006 From: forum-watir-users at openqa.org (Nathan) Date: Thu, 16 Nov 2006 15:09:11 CST Subject: [Wtr-general] Using logger generating error In-Reply-To: <64785705.1163707522104.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <52957101.1163711388692.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hey Prashant, I'm not exactly sure why your seeing those errors specifically. I tried a couple of things to see if I could find out what was going on. First I copied your code into two separate files. I copied require 'watir' include Watir $logger = Logger.new('C:\WebTest\MentorAppTestScripts\logger.log', 5, 1024000) $logger.level = Logger::ERROR into a file named Logger.rb. And I copied require 'watir' require 'Logger' include Watir username = 'watirplayer' password = 'watirplayer' puts "## Start MentorApp SQA" $ie = IE.new $ie.clear_url_list $ie.goto("http://mentorapp") if not $ie.button(:value, 'Login').exists? $logger.info("Successfull Login") puts "Successfull Login" else $logger.error("Did not log in") puts "Not able to Login" end into a file named Another.rb (just because I couldn't think of another name). Both of these files were in the same directory. Then I ran them on the command line. IE launched, then I got these error messages, which are similar to yours: c:/ruby/lib/ruby/1.8/Logger.rb:172: warning: already initialized constant VERSION c:/ruby/lib/ruby/1.8/Logger.rb:174: warning: already initialized constant ProgName c:/ruby/lib/ruby/1.8/Logger.rb:181: warning: already initialized constant DEBUG c:/ruby/lib/ruby/1.8/Logger.rb:182: warning: already initialized constant INFO c:/ruby/lib/ruby/1.8/Logger.rb:183: warning: already initialized constant WARN c:/ruby/lib/ruby/1.8/Logger.rb:184: warning: already initialized constant ERROR c:/ruby/lib/ruby/1.8/Logger.rb:185: warning: already initialized constant FATAL c:/ruby/lib/ruby/1.8/Logger.rb:186: warning: already initialized constant UNKNOWN c:/ruby/lib/ruby/1.8/Logger.rb:424: warning: already initialized constant SEV_LABEL c:/ruby/lib/ruby/1.8/Logger.rb:436: warning: already initialized constant Format c:/ruby/lib/ruby/1.8/Logger.rb:537: warning: already initialized constant SiD And then I tried the following, and inlined Logger.rb like so: require 'watir' [b]require 'watir' include Watir $logger = Logger.new('C:\WebTest\MentorAppTestScripts\logger.log', 5, 1024000) $logger.level = Logger::ERROR [/b]include Watir username = 'watirplayer' password = 'watirplayer' puts "## Start MentorApp SQA" $ie = IE.new $ie.clear_url_list $ie.goto("http://mentorapp") if not $ie.button(:value, 'Login').exists? $logger.info("Successfull Login") puts "Successfull Login" else $logger.error("Did not log in") puts "Not able to Login" end where the bold code is the inlined Logger.rb, and then I ran it (Another.rb) and got zero errors. So I can only conclude one possibility as to what the problem might be. 1. Because the file where you initialized your $logger object was named Logger.rb, maybe there was confusion to Ruby, because the file for Logger in Ruby is called logger.rb So try renaming your Logger.rb file to something like MentorAppLogger.rb. I tried this and I didn't see any errors. Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5304&messageID=14753#14753 From forum-watir-users at openqa.org Thu Nov 16 16:17:31 2006 From: forum-watir-users at openqa.org (Prashant Bhatia) Date: Thu, 16 Nov 2006 15:17:31 CST Subject: [Wtr-general] Using logger generating error In-Reply-To: <52957101.1163711388692.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <43443998.1163711907031.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Dude, Has anyone told you so far that you are awesome & genious at the same time. That exactly (same file name) was the problem and now it is solved. Thanks dude Prashant --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5304&messageID=14754#14754 From charley.baker at gmail.com Thu Nov 16 19:09:31 2006 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 16 Nov 2006 17:09:31 -0700 Subject: [Wtr-general] detecting versions of browser and os In-Reply-To: <00e601c70942$0bbfd000$6400a8c0@laptop> References: <032301c705d5$14d58920$6400a8c0@laptop> <00e601c70942$0bbfd000$6400a8c0@laptop> Message-ID: Using the Windows api, I came up with this quick hack which may or may not have much merit :) : require "Win32API" GetVersionEx = Win32API.new("kernel32", "GetVersionEx", 'P', 'L') def system_version osversioninfo = [ 148, # size of this struct (IN) 0, # major version (OUT) 0, # minor version (OUT) 0, # build (OUT) 0, # platform (OUT) "\0" * 128 # additional info (OUT) ].pack('LLLLLa128') GetVersionEx.call(osversioninfo) osver = osversioninfo.unpack('LLLLLZ128') major_minor_rev = osver[1].to_s + '.' + osver[2].to_s case major_minor_rev when '6.0' : return "Longhorn/Vista" + ' ' + osver[5] when '5.2' : return "Windows Server 2003" + ' ' + osver[5] when '5.1' : return "Windows XP" + ' ' + osver[5] when '5.0' : return "Win2k" + ' ' + osver[5] when '4.90' : return "Windows Me" + ' ' + osver[5] when '4.10' : return "Windows 98" + ' ' + osver[5] when '4.0' : if osver[4] == 2 return "Windows 95" + ' ' + osver[5] else return "Windows NT 4.0" + ' ' + osver[5] end else return "Unknown OS" end end puts system_version Longhorn and Vista appear to share the same version numbers, otherwise that's the general idea. -Charley On 11/15/06, Paul Rogers wrote: > the reason I had it on the ie object is that it comes fromthe user Agent, so > it only applies to the ie object. I do think that some other approach might > be more meaningful though, for example > > Watir::Utils::Environment::OS => "vista" > > Im sure there must be a win api call that gets this stuff, rather than using > the userAgent > > Its in Jira, WTR-116 > > Paul > > ----- Original Message ----- > From: "Charley Baker" > To: > Sent: Wednesday, November 15, 2006 12:51 PM > Subject: Re: [Wtr-general] detecting versions of browser and os > > > > Paul, > > > > I'm not currently testing with IE 7 but most likely will be soon, > > particularly since the upgrade is part of the system updates which > > means the user base will expand quickly. Can you add a JIRA task for > > this? > > > > While the browser version makes sense in context of the ie object, > > the os version and language don't. They'd make more sense to me in the > > context of the Watir module, possibly in their own class, Environment? > > Other thoughts? > > > > -Charley > > > > On 11/11/06, Paul Rogers wrote: > >> > >> > >> I think, now that we have vista, ie7 etc, that the following would be > >> useful: > >> > >> ie.browser_version => "IE7" > >> ie.os => "XP" > >> ie.os_language =>"en-us" > >> > >> etc > >> > >> as Im sure, many people like me now either need to test multiple > >> browsers/os > >> or at least need to know what it was tested on. > >> > >> I have most of the code, I just need to know if there are any comments on > >> method names etc? > >> > >> Paul > >> > >> _______________________________________________ > >> Wtr-general mailing list > >> Wtr-general at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/wtr-general > >> > >> > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From niegq at nec-as.nec.com.cn Thu Nov 16 21:39:38 2006 From: niegq at nec-as.nec.com.cn (Nie Guoqiang) Date: Fri, 17 Nov 2006 10:39:38 +0800 Subject: [Wtr-general] how to access icon's button In-Reply-To: <79518aef0611160625x127735c1hb8af7013ecb63d0f@mail.gmail.com> References: <20061116191053.5E78.NIEGQ@nec-as.nec.com.cn> <79518aef0611160625x127735c1hb8af7013ecb63d0f@mail.gmail.com> Message-ID: <20061117103321.5E7B.NIEGQ@nec-as.nec.com.cn> I use the same version with you. But I have changed the function of wait() in watir.rb. So it's my fault:) > No problem. Out of curiosity, what versions are you using? I'm using > ruby 1.8.4 and Watir 1.4.1 > > Cheers, > Daniel. > > > > On 16/11/06, Nie Guoqiang wrote: > > Hi Daniel > > > > I reinstall my Ruby and Watir. > > It's ok now. > > It's a version problem indeed. > > > > I am very appreciate your answers! > > > > > That's weird, I've experimented with a few different pages that > > > contain frames and with some of them I get the same behaviour as you. > > > With others it lists the frame names as expected. > > > > > > As I said, try looking at the HTML source for part that states: > > > > > > > > > > > and use the text that you have instead of "frame_name_here" to specify > > > the frame as described earlier in the mail thread. > > > > > > Cheers, > > > Daniel. > > > > > > On 16/11/06, Daniel Browne wrote: > > > > What if you look at the HTML to determine the frame name? > > > > > > > > Cheers, > > > > Daniel. > > > > > > > > On 16/11/06, Nie Guoqiang wrote: > > > > > I get only "there are 6 frames" when executing ie.show_frames. > > > > > So I think it must be of the watir version that causes my problem. > > > > > I am very sorry, and thanks to you all > > > > > > > > > > > > > > > > 1. First of all do: > > > > > > > > > > > > ie.show_frames > > > > > > > > > > > > List will give you a list of frames. > > > > > > > > > > > > 2. Then for each of the frame names returned in step 1 do: > > > > > > > > > > > > ie.frame("").show_images > > > > > > > > > > > > This will give you lists of images in each frame (you have to replace > > > > > > with the actual name of a frame returned in step > > > > > > 1. If there are 5 frames returned in step 1, then you might have to > > > > > > do step 2 five times to find out which frame contains your image. > > > > > > > > > > > > 3. Once you know the name of the frame that contains the image (let's > > > > > > say it is called "frame5") do: > > > > > > > > > > > > ie.frame("frame5").image(:src, /logout/).flash > > > > > > > > > > > > Cheers, > > > > > > Daniel. > > > > > > > > > > > > > > > > > > On 15/11/06, Nie Guoqiang wrote: > > > > > > > Thanks for your reply! > > > > > > > > > > > > > > I tyied with ie.show_frames.frame("logo").show_images , but get such msg as "undefined method for 0..5:Range" > > > > > > > > > > > > > > BTW: how can i access one specified frame, eg. MENU? > > > > > > > ie.frame("MENU") doesnot work. > > > > > > > > > > > > > > Frame codes is as below: > > > > > > > ++++++++++++++++++++++++++++++++++ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ++++++++++++++++++++++++++++++++++ > > > > > > > > > > > > > > > > > > > > > > Your HTML snippet didn't show that there where any frames. Find the > > > > > > > > name of the frame that contains the image using e.g: > > > > > > > > > > > > > > > > ie.show_frames.some_frame.show_images > > > > > > > > > > > > > > > > If the image is listed for frame "show_frame" (frames will have > > > > > > > > different names for you) then you could use: > > > > > > > > > > > > > > > > ie.frame("some_frame").image(:src, /logout/).flash > > > > > > > > > > > > > > > > Cheers, > > > > > > > > Daniel. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On 15/11/06, Nie Guoqiang wrote: > > > > > > > > > The codes doesnot work :( > > > > > > > > > > > > > > > > > > More tips: > > > > > > > > > When I execute ie.show_frames(), I get "There is 6 frames". > > > > > > > > > And when ie.show_images() is executed, message is "0". > > > > > > > > > > > > > > > > > > Thanks > > > > > > > > > > > > > > > > > > > > > > > > > > > > On 11/14/06, Nie Guoqiang wrote: how can i access this icon-button. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Hi Nie, > > > > > > > > > > > > > > > > > > > > This will click logout image: > > > > > > > > > > > > > > > > > > > > ie.image(:src, /logout/).flash > > > > > > > > > > > > > > > > > > > > If this does not do what you need, let me know. > > > > > > > > > > > > > > > > > > > > ?eljko > > > > > > > > > > -- > > > > > > > > > > http://zeljkofilipin.com/ > > > > > > > > > > > > > > > > > > > > > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > > > > > > > > > > > > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > > > > > > > > Email : niegq at necas.nec.com.cn > > > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > 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 > > > > > > > > > > > > > > > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > > > > > > > > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > > > > > > Email : niegq at necas.nec.com.cn > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > 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 > > > > > > > > > > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > > > > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > > > > Email : niegq at necas.nec.com.cn > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > > > > > > > > > > _______________________________________________ > > > > > 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 > > > > > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > Nie Guoqiang NEC-CAS Software Department 1K/4SG > > > > Tel : 010-82334433-356 / 8-0086-22-356 > > Email : niegq at necas.nec.com.cn > > =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= > > > > > > _______________________________________________ > > 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 =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Nie Guoqiang NEC-CAS Software Department 1K/4SG Tel : 010-82334433-356 / 8-0086-22-356 Email : niegq at necas.nec.com.cn =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= From vikashkumar051 at yahoo.co.in Fri Nov 17 07:43:22 2006 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Fri, 17 Nov 2006 18:13:22 +0530 (IST) Subject: [Wtr-general] problem in accessing JS input box Message-ID: <20061117124322.80096.qmail@web7808.mail.in.yahoo.com> I am using the following code for accessing JS input box, but it gives error message undefined method `click_no_wait' for # (NoMethodError), below is the code, please help me out. require 'watir\contrib\enabled_popup' def startClicker( button , waitTime=9, user_input=nil) hwnd = $ie.enabled_popup(waitTime) # get a handle if one exists if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) w.setTextValueForFileNameField(hwnd, "#{user_input}") end sleep 3 # I put this in to see the text being input it is not necessary to work w.clickWindowsButton_hwnd(hwnd, "#{button}") # "OK" or whatever the name on the button is w=nil # this is just cleanup end end $ie=Watir::IE.start("c:\test.htm") $ie.image(:index,'4').click_no_wait startClicker("OK", 7, "User Input") Thanks __________________________________________________________ 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/20061117/d1f2243d/attachment-0001.html From charley.baker at gmail.com Fri Nov 17 11:00:42 2006 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 17 Nov 2006 09:00:42 -0700 Subject: [Wtr-general] Using logger generating error In-Reply-To: <64785705.1163707522104.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <64785705.1163707522104.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Prashant, You've named your logging file the same name as Ruby's standard logger - logger.rb. So when you're doing your require 'Logger', the ruby standard logger.rb is getting picked up, not your own logger, since it's first in ruby's load path. Rename Logger.rb to something else, mylogger.rb or whatever and then use that in your require. You also don't need the require and include for watir in your logging file unless you plan on using watir in it, you can replace that with require 'logger' to require Ruby's logger. mylog.rb: require 'logger' $logger = Logger.new('C:\WebTest\MentorAppTestScripts\logger.log', 5, 1024000) $logger.level = Logger::ERROR test_file.rb require 'mylog' require 'watir' include Watir .......... $logger.error("Did not log in") .......... -Charley On 11/16/06, Prashant Bhatia wrote: > I created Logger.rb file which has > [b][CODE][/b] > require 'watir' > include Watir > $logger = Logger.new('C:\WebTest\MentorAppTestScripts\logger.log', 5, 1024000) > $logger.level = Logger::ERROR > [b][/CODE][/b] > > Now, I am trying to using this log file in another .rb. > [b][CODE SNIPPET][/b] > require 'watir' > require 'Logger' > include Watir > > username = 'watirplayer' > password = 'watirplayer' > > puts "## Start MentorApp SQA" > $ie = IE.new > $ie.clear_url_list > $ie.goto("http://mentorapp") > > if not $ie.button(:value, 'Login').exists? > $logger.info("Successfull Login") > puts "Successfull Login" > else > $logger.error("Did not log in") > puts "Not able to Login" > end > [b][/CODE SNIPPET][/b] > > but I get this error message: > > [b][ERROR MSG][/b] > >ruby LogintoMentorApp.rb > In LoginToMentorApp file > ## Start MentorApp SQA > ## Entering username, password > c:/webtest/ruby/lib/ruby/1.8/Logger.rb:179: warning: already initialized constant ProgName > c:/webtest/ruby/lib/ruby/1.8/Logger.rb:186: warning: already initialized constant DEBUG > c:/webtest/ruby/lib/ruby/1.8/Logger.rb:187: warning: already initialized constant INFO > c:/webtest/ruby/lib/ruby/1.8/Logger.rb:188: warning: already initialized constant WARN > c:/webtest/ruby/lib/ruby/1.8/Logger.rb:189: warning: already initialized constant ERROR > c:/webtest/ruby/lib/ruby/1.8/Logger.rb:190: warning: already initialized constant FATAL > c:/webtest/ruby/lib/ruby/1.8/Logger.rb:191: warning: already initialized constant UNKNOWN > c:/webtest/ruby/lib/ruby/1.8/Logger.rb:422: warning: already initialized constant SEV_LABEL > c:/webtest/ruby/lib/ruby/1.8/Logger.rb:436: warning: already initialized constant Format > c:/webtest/ruby/lib/ruby/1.8/Logger.rb:553: warning: already initialized constant SiD > LogintoMentorApp.rb:41: undefined method `info' for nil:NilClass (NoMethodError) > >Exit code: 1 > [b][/ERROR MSG][/b] > > What am I doing wrong? > Thanks > Prashant > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5304&messageID=14750#14750 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From vikashkumar051 at yahoo.co.in Sat Nov 18 02:43:33 2006 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Sat, 18 Nov 2006 13:13:33 +0530 (IST) Subject: [Wtr-general] Exception error in using click_no_wait Message-ID: <20061118074333.92593.qmail@web7805.mail.in.yahoo.com> While using the following code for accessing JS input box, it gives error message undefined method `click_no_wait' for # (NoMethodError), below is the code, please help me out. require 'watir\contrib\enabled_popup' def startClicker( button , waitTime=9, user_input=nil) hwnd = $ie.enabled_popup(waitTime) # get a handle if one exists if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) w.setTextValueForFileNameField(hwnd, "#{user_input}") end sleep 3 # I put this in to see the text being input it is not necessary to work w.clickWindowsButton_hwnd(hwnd, "#{button}") # "OK" or whatever the name on the button is w=nil # this is just cleanup end end $ie=Watir::IE.start("c:\test.htm") $ie.image(:index,'4').click_no_wait startClicker("OK", 7, "User Input") Thanks __________________________________________________________ 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/20061118/1bb64d85/attachment.html From ajitesh.srinetra at gmail.com Sat Nov 18 07:06:40 2006 From: ajitesh.srinetra at gmail.com (Ajitesh Srinetra) Date: Sat, 18 Nov 2006 17:36:40 +0530 Subject: [Wtr-general] ignoring specific columns of a table for assertion Message-ID: <4f6da15b0611180406w6fbcabffjcb78481bf1471f57@mail.gmail.com> Hi all I have just started using watir but i am getting one problem in assertions. The problem is in my web client I have to validate one table's contents. i am using this script assert_equal(["Username", "+919812005761", "Mon Sep 18 00:00:20 IST 2006"], (@ie.table(:id, 'show_ds')).column_values(2)) where show_ds is the table name Now the problem is the third column " Mon Sep 18 00:00:20 IST 2006 " changes every day(is the timestamp) .Now is there any method so that watir can ignore this columns assertion, like For Ex: assert_equal(["Username", "+919812005761", nil], (@ie.table(:id, 'show_ds')).column_values(2)) One more thing splitting the assertion in different rows will not help me here as the testcase will be very lengthy Please help me out of this Bye Ajitesh -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061118/7d1386e0/attachment.html From lonny at titanez.net Thu Nov 16 15:05:52 2006 From: lonny at titanez.net (Lonny Eachus) Date: Thu, 16 Nov 2006 12:05:52 -0800 Subject: [Wtr-general] Find parent table index from a specific element within In-Reply-To: References: Message-ID: <455CC4A0.1070201@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061116/e73e67ba/attachment-0001.html From bret at pettichord.com Sun Nov 19 17:22:05 2006 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 19 Nov 2006 16:22:05 -0600 Subject: [Wtr-general] Exception error in using click_no_wait In-Reply-To: <20061118074333.92593.qmail@web7805.mail.in.yahoo.com> References: <20061118074333.92593.qmail@web7805.mail.in.yahoo.com> Message-ID: <4560D90D.2050408@pettichord.com> What version of Watir are you using? VIKASH KUMAR wrote: > > While using the following code for accessing JS input box, it > gives error message > > *undefined method `click_no_wait' for # > (NoMethodError),* below is the code, please help me out. > From vikashkumar051 at yahoo.co.in Sun Nov 19 22:10:40 2006 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Mon, 20 Nov 2006 08:40:40 +0530 (IST) Subject: [Wtr-general] How to access JS input box Message-ID: <20061120031040.39658.qmail@web7806.mail.in.yahoo.com> Please tell me how to access javascript input box __________________________________________________________ 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/20061120/3d9d6cb1/attachment.html From Mark_Cain at RL.gov Mon Nov 20 09:47:56 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Mon, 20 Nov 2006 06:47:56 -0800 Subject: [Wtr-general] problem in accessing JS input box Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A361F@EX01-2.rl.gov> What version on Watir are you using? If it is not 1.5.x then you will need to get it at-get the latest: http://wiki.openqa.org/display/WTR/Development+Builds There will be a tweak you will need to make (this is fixed in branch). In the 'watir/contrib/enabled_popup.rb' add 'include Win32' just below PageContainer like this: module Watir module PageContainer include Win32 Then try it again... --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of VIKASH KUMAR Sent: Friday, November 17, 2006 4:43 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] problem in accessing JS input box I am using the following code for accessing JS input box, but it gives error message undefined method `click_no_wait' for # (NoMethodError), below is the code, please help me out. require 'watir\contrib\enabled_popup' def startClicker( button , waitTime=9, user_input=nil) hwnd = $ie.enabled_popup(waitTime) # get a handle if one exists if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) w.setTextValueForFileNameField(hwnd, "#{user_input}") end sleep 3 # I put this in to see the text being input it is not necessary to work w.clickWindowsButton_hwnd(hwnd, "#{button}") # "OK" or whatever the name on the button is w=nil # this is just cleanup end end $ie=Watir::IE.start("c:\test.htm") $ie.image(:index,'4').click_no_wait startClicker("OK", 7, "User Input") Thanks ________________________________ Find out what India is talking about on - Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061120/d892a597/attachment.html From charley.baker at gmail.com Mon Nov 20 10:49:01 2006 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 20 Nov 2006 08:49:01 -0700 Subject: [Wtr-general] ignoring specific columns of a table for assertion In-Reply-To: <4f6da15b0611180406w6fbcabffjcb78481bf1471f57@mail.gmail.com> References: <4f6da15b0611180406w6fbcabffjcb78481bf1471f57@mail.gmail.com> Message-ID: Hi Ajitesh, The return from column_values is simply an array, so you can grab specific values if you want: assert_equal(["Username", "+919812005761"],(@ie.table(:id, 'show_ds')).column_values(2)[0,1]) -Charley On 11/18/06, Ajitesh Srinetra wrote: > Hi all > I have just started using watir but i am getting one problem in assertions. > The problem is in my web client I have to validate one table's contents. > i am using this script > > assert_equal(["Username", "+919812005761", "Mon Sep 18 00:00:20 IST 2006"], > (@ie.table(:id, 'show_ds')).column_values(2)) > > where show_ds is the table name > > Now the problem is the third column " Mon Sep 18 00:00:20 IST 2006 " changes > every day(is the timestamp) .Now is there any method so that watir can > ignore this columns assertion, like For Ex: > assert_equal(["Username", "+919812005761", nil], (@ie.table(:id, > 'show_ds')).column_values(2)) > > One more thing splitting the assertion in different rows will not help me > here as the testcase will be very lengthy > > Please help me out of this > > Bye Ajitesh > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From Mark_Cain at RL.gov Mon Nov 20 10:54:52 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Mon, 20 Nov 2006 07:54:52 -0800 Subject: [Wtr-general] How to access JS input box Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A3620@EX01-2.rl.gov> What version of Watir are you using? --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of VIKASH KUMAR Sent: Sunday, November 19, 2006 7:11 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] How to access JS input box Please tell me how to access javascript input box ________________________________ Find out what India is talking about on - Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061120/8f2331b8/attachment.html From irinaz1983 at gmail.com Mon Nov 20 11:43:05 2006 From: irinaz1983 at gmail.com (Irina) Date: Mon, 20 Nov 2006 18:43:05 +0200 Subject: [Wtr-general] Test suite running terminated Message-ID: <219143890.20061120184305@gmail.com> Hello everybody, I write functional tests using Watir. And all the metods of one test set are run perfectly. Though I needed to add @ie.logger.level = Logger::ERROR to get rid of trace like W, [20-Nov-2006 18:21:10#3280] WARN -- : frame error in waitdocument OLE error code:80070005 in Access is denied. As I've seen in the net that it can be ignored. The problem is that I can't run the entire test suite (I'm using eclipse IDE with Ruby plugin). After one test set has run I receive the message ruby_test.rb(1)[Test::Unit]Ruby W:\ruby\bin\ruby.exe : W:\eclipse\plugins\org.rubypeople.rdt.testunit_0.8.0.604272100PRD\ruby\RemoteTestRunner.rb If anybody has any ideas how to help this, I'll really appreciate if you share them. Thanks in advance. -- Best regards, Irina mailto:IrinaZ1983 at gmail.com From vikashkumar051 at yahoo.co.in Tue Nov 21 07:33:22 2006 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Tue, 21 Nov 2006 18:03:22 +0530 (IST) Subject: [Wtr-general] problem in accessing javascript input box using watir Message-ID: <20061121123323.79000.qmail@web7801.mail.in.yahoo.com> I am using watir version 1.5.1.1100. I have also added - In the 'watir/contrib/enabled_popup.rb' added 'include Win32' just below PageContainer like this: module Watir module PageContainer include Win32 Then I am using the following code for accessing JS input box, but it gives error message c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1100/./watir/winClicker.rb:416:in `setTextBoxText': undefined local variable or method `hwnd' for # (NameError) from ./Test.rb:15:in `startClicker' Below is the code, please help me out. require 'watir' include Watir require 'watir\contrib\enabled_popup' require 'Test' ie=Watir::IE.start("c:\test.htm") ie.image(:index,'4').click_no_wait testObj = Test.new testObj.startClicker(ie, $hwnd, $hWnd, "OK", 7, "User Input") ####################################################### In Test.rb, I am using the following code: class Test def initialize end def startClicker( ie, hwnd, hWnd, button , waitTime, user_input) hwnd = ie.enabled_popup(waitTime) # get a handle if one exists if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) w.setTextBoxText(hwnd, user_input) end sleep 3 # I put this in to see the text being input it is not necessary to work w.clickWindowsButton_hwnd(hwnd, "#{button}") # "OK" or whatever the name on the button is w=nil # this is just cleanup end end end I also checked the file winClicker.rb, there I saw the following code for accessing setTextBoxText method, this is the line def setTextBoxText(hWnd , textToSet) set_text(hwnd, textToSet) end Here, it is taking argument as hWnd and then passing it to set_text method as hwnd (See the spelling difference hWnd and hwnd). Then again set_text method is using the following code: def set_text(hWnd, textToSet) send_message = @User32['SendMessage', 'ILISS'] r ,rs = send_message.call(hWnd , WM_SETTEXT ,'',textToSet) end private :set_text Please tell me how to enter value in the javascript input box, and to remove the following error message: c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1100/./watir/winClicker.rb:416:in `setTextBoxText': undefined local variable or method `hwnd' for # (NameError) from ./Test.rb:15:in `startClicker' Thanks 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/20061121/50678fee/attachment.html From satti_mg at yahoo.com Tue Nov 21 08:09:35 2006 From: satti_mg at yahoo.com (sathya shankar) Date: Tue, 21 Nov 2006 05:09:35 -0800 (PST) Subject: [Wtr-general] WET at FOSS Message-ID: <981948.10961.qm@web31714.mail.mud.yahoo.com> Hi All, WET has been selected as a talk at FOSS.in conference in Bangalore. Raghu Venkataramana will be talking about WET on 26th November 2006 at 11:00 am. Interested guys can join and can have talk about the related topics after the conf. And few other guys are talking about ruby too :-) For further information about foss /registrations : http://foss.in Hope to meet you all at FOSS Sathya Shankar -- Regards, Sathya Shankar M G Sr. Test Engineer Qantom Software Private Limited 72/1B, 2nd Floor, K.H. Plaza, Kanakapura Road, Bangalore-78 Phone : 26655216-Xtn-<123>, Telefax : 26799269 ____________________________________________________________________________________ Sponsored Link $200,000 mortgage for $660/ mo - 30/15 yr fixed, reduce debt - http://yahoo.ratemarketplace.com From Mark_Cain at RL.gov Tue Nov 21 09:42:08 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Tue, 21 Nov 2006 06:42:08 -0800 Subject: [Wtr-general] problem in accessing javascript input box using watir Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A3626@EX01-2.rl.gov> Try replacing this in startClicker: w.setTextBoxText(hwnd, user_input) With w.setTextValueForFileNameField(hwnd, "#{user_input}") Just because it says the name of the method doesn't specifically say 'TextBox' it does work for input boxes. Try it. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of VIKASH KUMAR Sent: Tuesday, November 21, 2006 4:33 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] problem in accessing javascript input box using watir I am using watir version 1.5.1.1100. I have also added - In the 'watir/contrib/enabled_popup.rb' added 'include Win32' just below PageContainer like this: module Watir module PageContainer include Win32 Then I am using the following code for accessing JS input box, but it gives error message c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1100/./watir/winClicker.rb:41 6:in `setTextBoxText': undefined local variable or method `hwnd' for # (NameError) from ./Test.rb:15:in `startClicker' Below is the code, please help me out. require 'watir' include Watir require 'watir\contrib\enabled_popup' require 'Test' ie=Watir::IE.start("c:\test.htm") ie.image(:index,'4').click_no_wait testObj = Test.new testObj.startClicker(ie, $hwnd, $hWnd, "OK", 7, "User Input") ####################################################### In Test.rb, I am using the following code: class Test def initialize end def startClicker( ie, hwnd, hWnd, button , waitTime, user_input) hwnd = ie.enabled_popup(waitTime) # get a handle if one exists if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) w.setTextBoxText(hwnd, user_input) end sleep 3 # I put this in to see the text being input it is not necessary to work w.clickWindowsButton_hwnd(hwnd, "#{button}") # "OK" or whatever the name on the button is w=nil # this is just cleanup end end end I also checked the file winClicker.rb, there I saw the following code for accessing setTextBoxText method, this is the line def setTextBoxText(hWnd , textToSet) set_text(hwnd, textToSet) end Here, it is taking argument as hWnd and then passing it to set_text method as hwnd (See the spelling difference hWnd and hwnd). Then again set_text method is using the following code: def set_text(hWnd, textToSet) send_message = @User32['SendMessage', 'ILISS'] r ,rs = send_message.call(hWnd , WM_SETTEXT ,'',textToSet) end private :set_text Please tell me how to enter value in the javascript input box, and to remove the following error message: c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1100/./watir/winClicker.rb:41 6:in `setTextBoxText': undefined local variable or method `hwnd' for # (NameError) from ./Test.rb:15:in `startClicker' Thanks Vikash ________________________________ Find out what India is talking about on - Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061121/dc06cb64/attachment-0001.html From forum-watir-users at openqa.org Tue Nov 21 16:30:22 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Tue, 21 Nov 2006 15:30:22 CST Subject: [Wtr-general] [OT] Running scripts on machines without ruby Message-ID: <56586650.1164144653500.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Looking for general input. Is there any way to run a ruby script on a machine without first installing ruby? (ie, could i just include the binaries need to run it?) Having some trouble finding info on google :) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5390&messageID=15015#15015 From christopher.mcmahon at gmail.com Tue Nov 21 17:06:24 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 21 Nov 2006 14:06:24 -0800 Subject: [Wtr-general] [OT] Running scripts on machines without ruby In-Reply-To: <56586650.1164144653500.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <56586650.1164144653500.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70611211406w164aa79bw62930e9e225a325b@mail.gmail.com> http://www.erikveen.dds.nl/rubyscript2exe/index.html I hear good things about it. On 11/21/06, John Lolis wrote: > > Looking for general input. > > Is there any way to run a ruby script on a machine without first > installing ruby? (ie, could i just include the binaries need to run it?) > > Having some trouble finding info on google :) > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5390&messageID=15015#15015 > _______________________________________________ > 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/20061121/8f42c230/attachment.html From dou_yifan at yahoo.com Tue Nov 21 21:53:56 2006 From: dou_yifan at yahoo.com (Dou Yifan) Date: Wed, 22 Nov 2006 10:53:56 +0800 (CST) Subject: [Wtr-general] about command window Message-ID: <304663.27003.qm@web56307.mail.re3.yahoo.com> I don't know whether it's suitable to ask this question here. Watir is good tool for web testing, but during testing, usually there are a lot more things to do other than operating the web browser. It may be telnet to another machine to execute some commands, or just exec some command on the local machine. Some person mentioned about application map(http://www.mail-archive.com/wtr-general at rubyforge.org/msg03439.html), and that's exactly what I want the test to be. the test table will look something like this test, win object Action Arg #header T, googlewin, SearchField, set, "PickAxe" T, googlewin, SearchButon, click T, cmdwin, cmdwin execCmd "net user newUser /add" For operations on the IE browser, it's easy to implement this kind of testing, since there is already a class Watir::IE in the Watir lib, but for the command window, I don't know whether there is a class that can represent this, or how to implement such a class. --------------------------------- Do You Yahoo!? ????G?????????????????? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061122/f4101486/attachment.html From zeljko.filipin at gmail.com Wed Nov 22 07:12:27 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 22 Nov 2006 13:12:27 +0100 Subject: [Wtr-general] ie.minimize broken in watir-1.5.1.1127 Message-ID: I have just installed watir-1.5.1.1127.gem and it crashes when I use ie.minimize. I do not have autoit installed. Does watir require it now? Should I log this to jira? Steps to reproduce: C:\Documents and Settings\limited>ruby -v ruby 1.8.5 (2006-08-25) [i386-mswin32] C:\Documents and Settings\limited>irb irb(main):001:0> require 'watir' => true irb(main):002:0> Watir::IE::VERSION => "1.5.1.1127" irb(main):003:0> ie = Watir::IE.start("http://www.google.com/") => # irb(main):004:0> ie.minimize WIN32OLERuntimeError: Failed to create WIN32OLE object from `AutoItX3.Control' HRESULT error code:0x8007007e The specified module could not be found. from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/./watir.rb:4356:in `initialize' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/./watir.rb:4356:in `new' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/./watir.rb:4356:in `autoit' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/./watir.rb:1644:in `autoit' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/./watir.rb:1641:in `set_window_state' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/./watir.rb:1622:in `minimize' from (irb):4 Zeljko -- zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061122/89aca23f/attachment.html From christopher.mcmahon at gmail.com Wed Nov 22 10:58:08 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 22 Nov 2006 07:58:08 -0800 Subject: [Wtr-general] about command window In-Reply-To: <304663.27003.qm@web56307.mail.re3.yahoo.com> References: <304663.27003.qm@web56307.mail.re3.yahoo.com> Message-ID: <72799cd70611220758x102ce19bp784b0d1e0b7c4b50@mail.gmail.com> That's one of the advantages of using a real programming language like Ruby. You can go along using Watir, but when it's time to telnet, you can use Ruby's 'net/telnet' library, too: http://www.ruby-doc.org/stdlib/libdoc/net/telnet/rdoc/index.html Likewise database connections, SOAP clients, etc., Ruby has all sorts of useful libraries. -Chris On 11/21/06, Dou Yifan wrote: > > I don't know whether it's suitable to ask this question here. > Watir is good tool for web testing, but during testing, usually there are > a lot more things to do other than operating the web browser. It may be > telnet to another machine to execute some commands, or just exec some > command on the local machine. > > Some person mentioned about application map( > http://www.mail-archive.com/wtr-general at rubyforge.org/msg03439.html), and > that's exactly what I want the test to be. > > the test table will look something like this > > test, win object Action > Arg #header > > T, googlewin, SearchField, set, "PickAxe" > T, googlewin, SearchButon, click > T, cmdwin, cmdwin execCmd "net user newUser /add" > > For operations on the IE browser, it's easy to implement this kind of > testing, since there is already a class Watir::IE in the Watir lib, but for > the command window, I don't know whether there is a class that can represent > this, or how to implement such a class. > > ------------------------------ > Do You Yahoo!? > ????G?????????????????? > > > _______________________________________________ > 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/20061122/39acb4f6/attachment.html From charley.baker at gmail.com Wed Nov 22 10:58:47 2006 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 22 Nov 2006 08:58:47 -0700 Subject: [Wtr-general] about command window In-Reply-To: <304663.27003.qm@web56307.mail.re3.yahoo.com> References: <304663.27003.qm@web56307.mail.re3.yahoo.com> Message-ID: Dou, There are a lot of libraries for Ruby that you can use along with the Watir libraries for other pieces of your testing. If you're looking for telnet for example you might want to take a look at Ruby's builtin net/telnet documentation: http://www.ruby-doc.org/stdlib/libdoc/net/telnet/rdoc/index.html Running system commands locally can be done with system or exec. Take a look at the docs, run ri at the command prompt: ri Kernel#system -Charley On 11/21/06, Dou Yifan wrote: > I don't know whether it's suitable to ask this question here. > Watir is good tool for web testing, but during testing, usually there are a > lot more things to do other than operating the web browser. It may be telnet > to another machine to execute some commands, or just exec some command on > the local machine. > > Some person mentioned about application > map(http://www.mail-archive.com/wtr-general at rubyforge.org/msg03439.html), > and that's exactly what I want the test to be. > > the test table will look something like this > > test, win object Action Arg > #header > > T, googlewin, SearchField, set, "PickAxe" > T, googlewin, SearchButon, click > T, cmdwin, cmdwin execCmd "net user newUser /add" > > For operations on the IE browser, it's easy to implement this kind of > testing, since there is already a class Watir::IE in the Watir lib, but for > the command window, I don't know whether there is a class that can represent > this, or how to implement such a class. > > ________________________________ > Do You Yahoo!? > ????G?????????????????? > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From forum-watir-users at openqa.org Wed Nov 22 16:31:16 2006 From: forum-watir-users at openqa.org (Howard) Date: Wed, 22 Nov 2006 15:31:16 CST Subject: [Wtr-general] [Wtr-General] Problem with set_text and dialog boxes Message-ID: <63545887.1164231120535.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I have spent several days debugging to locate a problem with the file open dialog box that is presented by an html "file" type. I am getting a valid handle to the control on the file open dialog, but, when winClicker attempts to (ultimately) use set_text, the text is not put into the combo box text on the dialog box, and the message is never acknowledged, leaving the Open File dialog sitting there. The code is as follows: adoc = $ie.frame("main").image(:src, "https://alinea.inmar.com/alinea/images/adddocument.gif") sleep 2 adoc.click_no_wait sleep 2 modal = $ie.modal_dialog assert_not_nil modal $path = "C\:\\LogTest.txt" puts "starting autoit" $autoit = WIN32OLE.new("AutoItX3.Control") sleep 1 ffld = modal.fileField(:name, "selectDoc") ffld.set($path) success = $autoit.WinWait("Choose file", "", 10) if success == 0 puts "Failed to find Choose file" end $autoit.WinActivate("Choose file") $autoit.Send("{TAB 3}{ENTER}") modal.text_field(:name, "Subject").set("Test Subject") modal.select_list(:id,"LB1").set("hward") modal.select_list(:id,"LB1").fire_event("onDblClick") modal.button(:value, "Add Document").click sleep 2 modal = $ie.modal_dialog modal.button(:value, "Close").click The error message about not finding "Choose file" occurs frequently and the autoit code appears to do nothing. The fields in the modal dialog under the File Open will work as long as a file name is manually entered. I was able, one time, to get autoit to push something into the File Name field, but I have not been able to get it to work again. Is there a way to get this process to complete? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5403&messageID=15064#15064 From Mark_Cain at RL.gov Wed Nov 22 17:15:47 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Wed, 22 Nov 2006 14:15:47 -0800 Subject: [Wtr-general] [Wtr-General] Problem with set_text and dialog boxes Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A3636@EX01-2.rl.gov> If you are using 1.5.1070 or newer (if not you can get it here http://wiki.openqa.org/display/WTR/Development+Builds) you can use: require 'watir/contrib/enabled_popup' $path = "C\:\\watir_bonus\\working\\MyDoc.txt" def startClicker( button , waitTime=9, user_input=nil) hwnd = $ie.enabled_popup(waitTime) # get a handle if one exists if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) w.setTextValueForFileNameField(hwnd, "#{user_input}") end sleep 3 # I put this in to see the text being input it is not necessary to work w.clickWindowsButton_hwnd(hwnd, "#{button}") # "OK" or whatever the name on the button is w=nil # this is just cleanup end end adoc = $ie.frame("main").image(:src, "https://alinea.inmar.com/alinea/images/adddocument.gif") sleep 2 adoc.click_no_wait startClicker( '&Open', 9, $path) You may need to tweak this to work in your situation. I tested this and it works. --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Howard Sent: Wednesday, November 22, 2006 1:31 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] [Wtr-General] Problem with set_text and dialog boxes I have spent several days debugging to locate a problem with the file open dialog box that is presented by an html "file" type. I am getting a valid handle to the control on the file open dialog, but, when winClicker attempts to (ultimately) use set_text, the text is not put into the combo box text on the dialog box, and the message is never acknowledged, leaving the Open File dialog sitting there. The code is as follows: adoc = $ie.frame("main").image(:src, "https://alinea.inmar.com/alinea/images/adddocument.gif") sleep 2 adoc.click_no_wait sleep 2 modal = $ie.modal_dialog assert_not_nil modal $path = "C\:\\LogTest.txt" puts "starting autoit" $autoit = WIN32OLE.new("AutoItX3.Control") sleep 1 ffld = modal.fileField(:name, "selectDoc") ffld.set($path) success = $autoit.WinWait("Choose file", "", 10) if success == 0 puts "Failed to find Choose file" end $autoit.WinActivate("Choose file") $autoit.Send("{TAB 3}{ENTER}") modal.text_field(:name, "Subject").set("Test Subject") modal.select_list(:id,"LB1").set("hward") modal.select_list(:id,"LB1").fire_event("onDblClick") modal.button(:value, "Add Document").click sleep 2 modal = $ie.modal_dialog modal.button(:value, "Close").click The error message about not finding "Choose file" occurs frequently and the autoit code appears to do nothing. The fields in the modal dialog under the File Open will work as long as a file name is manually entered. I was able, one time, to get autoit to push something into the File Name field, but I have not been able to get it to work again. Is there a way to get this process to complete? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5403&messageID=15064#15064 _______________________________________________ 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/20061122/5b1a6397/attachment.html From christopher.mcmahon at gmail.com Wed Nov 22 19:36:07 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 22 Nov 2006 16:36:07 -0800 Subject: [Wtr-general] OT(ish): SafariWatir update Message-ID: <72799cd70611221636t1ad9165cy3d011daf98e33909@mail.gmail.com> Mr. Hoover and company are at it again: http://redsquirrel.com/cgi-bin/dave/2006/11/22#safari.watir.0.2.0 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061122/08ea9b06/attachment.html From michael.a.bolton at gmail.com Wed Nov 22 20:57:42 2006 From: michael.a.bolton at gmail.com (Michael Bolton) Date: Wed, 22 Nov 2006 20:57:42 -0500 Subject: [Wtr-general] [OT] Running scripts on machines without ruby In-Reply-To: <72799cd70611211406w164aa79bw62930e9e225a325b@mail.gmail.com> Message-ID: <008901c70ea2$ca956e30$6801a8c0@Koko> I've tried it. It's a little porky if you're compiling something small, but the size of the executable didn't matter much when I used it and it might not matter to you either. Performance similarly wasn't an issue, so I don't know about that either. But I will say this: it sure does the job nicely without hassle. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: November 21, 2006 5:06 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] [OT] Running scripts on machines without ruby http://www.erikveen.dds.nl/rubyscript2exe/index.html I hear good things about it. On 11/21/06, John Lolis wrote: Looking for general input. Is there any way to run a ruby script on a machine without first installing ruby? (ie, could i just include the binaries need to run it?) Having some trouble finding info on google :) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5390 &messageID=15015#15015 _______________________________________________ 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/20061122/3a0afde3/attachment-0001.html From gwest at inpses.co.uk Thu Nov 23 11:35:26 2006 From: gwest at inpses.co.uk (Garry West) Date: Thu, 23 Nov 2006 16:35:26 -0000 Subject: [Wtr-general] Table has no unique attributes Message-ID: I am quite new to watir and I am currently trying to automate some tests, however I am having difficulties clicking on a link within a cell in a table. I have done this before however this table has no name or id, Infact the only thing I have to identify the table is a class. I am assuming that I am not the first person to encounter this issue and I'm hoping that someone knows how to get around this problem. Anyone got any ideas?? Regards Garry West Trainee Test Analyst InPS Tel: 01382 564313 Visit our Web site at www.inps.co.uk The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of In Practice Systems Limited or any of its affiliates. If you are not the intended recipient please contact is.helpdesk at inps.co.uk P please don't print this e-mail unless you really need to. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061123/cadf6e9b/attachment.html From angrez at gmail.com Fri Nov 24 00:45:36 2006 From: angrez at gmail.com (Angrez Singh) Date: Fri, 24 Nov 2006 11:15:36 +0530 Subject: [Wtr-general] Table has no unique attributes In-Reply-To: References: Message-ID: Hi, I think you can select the element using class attribute. Else you can use xpath for selecting the element using any attribute that uniquely identifies that element on the page. This all is available in watir releases greater than 1.4.1. Regards, Angrez On 11/23/06, Garry West wrote: > > I am quite new to watir and I am currently trying to automate some tests, > however I am having difficulties clicking on a link within a cell in a > table. I have done this before however this table has no name or id,Infactthe only thing I have to identify the table is a class. I am assuming that I > am not the first person to encounter this issue and I'm hoping that someone > knows how to get around this problem. > > > > Anyone got any ideas?? > > > > Regards > > > > *Garry West* > > *Trainee Test Analyst* > > *InPS* > > * * > > *Tel: 01382 564313* > > ** > > * * > > *Visit our Web site at www.inps.co.uk* > > * * > > *The information in this internet email is confidential and is intended > solely for the addressee. Access, copying or re-use of information in it by > anyone else is not authorised. Any views or opinions presented are solely > those of the author and do not necessarily represent those of In Practice > Systems Limited or any of its affiliates. If you are not the intended > recipient please contact is.helpdesk at inps.co.uk* > > > > P please don't print this e-mail unless you really need to. > > > > _______________________________________________ > 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/20061124/6b1dbbde/attachment.html From forum-watir-users at openqa.org Fri Nov 24 05:00:57 2006 From: forum-watir-users at openqa.org (san) Date: Fri, 24 Nov 2006 04:00:57 CST Subject: [Wtr-general] Javascript Problem.... Message-ID: <37185796.1164362487682.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, This Is Sanju From India, I'm Brand New To "Watir". I'm Trying To Log In On www.calcuttatelephones.com. I Can Input Data In User ID & Passward By ie.text_field(:name, "userid1").set("My User name") ie.text_field(:name, "userpass").set("My Password") But Can't Click On "[b]Login[/b] Button" using "Watir"... As Its Bound In Javascript. Help Please... --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5425&messageID=15113#15113 From zeljko.filipin at gmail.com Fri Nov 24 05:41:02 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 24 Nov 2006 11:41:02 +0100 Subject: [Wtr-general] Javascript Problem.... In-Reply-To: <37185796.1164362487682.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <37185796.1164362487682.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 11/24/06, san wrote: > > Hi, This Is Sanju From India, I'm Brand New To "Watir". Welcome! :) But Can't Click On "[b]Login[/b] Button" > Login button is actually an image. I successfully clicked it with ie.image(:src, /button_login/).click And got page that said "You are not authorised to view the page". Let me know if this does not work for you. Zeljko -- zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061124/0653dcb8/attachment.html From forum-watir-users at openqa.org Fri Nov 24 06:05:15 2006 From: forum-watir-users at openqa.org (George) Date: Fri, 24 Nov 2006 05:05:15 CST Subject: [Wtr-general] Javascript Problem.... In-Reply-To: <37185796.1164362487682.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <52728046.1164366345156.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Sanju, This should work... ie.image(:src, /login/).click George --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5425&messageID=15119#15119 From forum-watir-users at openqa.org Fri Nov 24 06:14:35 2006 From: forum-watir-users at openqa.org (san) Date: Fri, 24 Nov 2006 05:14:35 CST Subject: [Wtr-general] Javascript Problem.... In-Reply-To: <52728046.1164366345156.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <37753023.1164366905172.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Yes It Worked.... Thanks Georg. But I Want To Know Was It A Regular Expression Match? As Far As I Know It Was Just A Image With that Name. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5425&messageID=15120#15120 From forum-watir-users at openqa.org Fri Nov 24 06:33:07 2006 From: forum-watir-users at openqa.org (san) Date: Fri, 24 Nov 2006 05:33:07 CST Subject: [Wtr-general] Javascript Problem.... In-Reply-To: <37185796.1164362487682.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <38175276.1164368017466.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> @ Zeljko : That Also Worked... Thanks For The Help.... --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5425&messageID=15122#15122 From forum-watir-users at openqa.org Fri Nov 24 06:37:47 2006 From: forum-watir-users at openqa.org (san) Date: Fri, 24 Nov 2006 05:37:47 CST Subject: [Wtr-general] Javascript Problem.... In-Reply-To: Message-ID: <53835617.1164368297603.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> & Is There Any Way To Directly Go To The Page After Logged In... I Don't Want To See The 1st page & The Data That Are Entered.... Will It Save A Little Bit Of Time....? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5425&messageID=15123#15123 From forum-watir-users at openqa.org Fri Nov 24 06:43:40 2006 From: forum-watir-users at openqa.org (George) Date: Fri, 24 Nov 2006 05:43:40 CST Subject: [Wtr-general] Javascript Problem.... In-Reply-To: <37753023.1164366905172.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <46450597.1164368730037.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> >> But I Want To Know Was It A Regular Expression Match? Yes it was. George --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5425&messageID=15124#15124 From zeljko.filipin at gmail.com Fri Nov 24 07:59:50 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 24 Nov 2006 13:59:50 +0100 Subject: [Wtr-general] Javascript Problem.... In-Reply-To: <53835617.1164368297603.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <53835617.1164368297603.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 11/24/06, san wrote: > > & Is There Any Way To Directly Go To The Page After Logged In... I Don't > Want To See The 1st page & The Data That Are Entered.... Will It Save A > Little Bit Of Time....? > You want to change the page that opens after you log in? That can not be done by watir. But your developer can do that. If you want to go to a specific page and you do not want to waste time clicking links, you can use this ie.goto("http://www.calcuttatelephones.com/mypage/") Zeljko -- zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061124/92ea857f/attachment.html From matt.makins at studylink.com Fri Nov 24 07:52:11 2006 From: matt.makins at studylink.com (Matt Makins) Date: Fri, 24 Nov 2006 12:52:11 -0000 Subject: [Wtr-general] Javascript Problem.... In-Reply-To: <53835617.1164368297603.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <200611241246.FJV18302@C2bthomr06.btconnect.com> Once you are logged in use ie.goto('http://example.com/example.html') to go directly to another page. this will only work if you are authorized to view this page. Cheers, Matt -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of san Sent: 24 November 2006 11:38 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Javascript Problem.... & Is There Any Way To Directly Go To The Page After Logged In... I Don't Want To See The 1st page & The Data That Are Entered.... Will It Save A Little Bit Of Time....? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5425&messageID=15123#15123 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From forum-watir-users at openqa.org Fri Nov 24 19:09:00 2006 From: forum-watir-users at openqa.org (Prashant Bhatia) Date: Fri, 24 Nov 2006 18:09:00 CST Subject: [Wtr-general] How to click on a link in a table Message-ID: <47996725.1164413477081.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am having some trouble finding a best way to click on a click which is in a table [TABLE SNAPSHOT] [b]| |1. |Basic Skills (link)| | Review (link)| | |2. |Pet Handling (link)| | Review (link)|[/b] [/TABLE SNAPSHOT] In the above table, Basic Skills, Review, Pet handling and Review are links. I am able to click on Basic Skills & Pet Handling link by [CODE SNAPSHOT] [b] totalCategory = $ie.tables[3].row_count for i in (1..totalCategory) clickCategory = $ie.tables[3][\i][3].text $ie.link(:text, clickCategory).click[/b] [/CODE SNAPSHOT] But if I try to click on the review with the similar logic, it always click on review in the row 1 since it will find the first text "Review" & click it. I tried to get the link of the text which is in row i cell 5 but again, i text always return Review thus getting the same link. Can anyone help in this. Thanks Prashant --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5434&messageID=15143#15143 From forum-watir-users at openqa.org Sat Nov 25 01:28:55 2006 From: forum-watir-users at openqa.org (san) Date: Sat, 25 Nov 2006 00:28:55 CST Subject: [Wtr-general] Javascript Problem.... In-Reply-To: Message-ID: <44826901.1164436165629.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> @ Zeljko : Yes, But I Wanted The Whole Process... i.e opening The 1st Page, Entering My Given Data, Then Logging In... In The Background.i.e When IE Will Open The Page,I'll Be Already Logged In... --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5425&messageID=15146#15146 From mail at chriss-baumann.de Sat Nov 25 05:53:25 2006 From: mail at chriss-baumann.de (Christian Baumann) Date: Sat, 25 Nov 2006 11:53:25 +0100 Subject: [Wtr-general] How to click on a link in a table In-Reply-To: <47996725.1164413477081.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <47996725.1164413477081.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <456820A5.7050501@chriss-baumann.de> Hi Prashant, try to click the link by identifying it by its href, like described here: http://www.mail-archive.com/wtr-general at rubyforge.org/msg05639.html Regards, Christian Prashant Bhatia schrieb: > I am having some trouble finding a best way to click on a click which is in a table > > [TABLE SNAPSHOT] > [b]| |1. |Basic Skills (link)| | Review (link)| > | |2. |Pet Handling (link)| | Review (link)|[/b] > [/TABLE SNAPSHOT] > > In the above table, Basic Skills, Review, Pet handling and Review are links. > I am able to click on Basic Skills & Pet Handling link by > > [CODE SNAPSHOT] > [b] totalCategory = $ie.tables[3].row_count > for i in (1..totalCategory) > clickCategory = $ie.tables[3][\i][3].text > $ie.link(:text, clickCategory).click[/b] > [/CODE SNAPSHOT] > > But if I try to click on the review with the similar logic, it always click on review in the row 1 since it will find the first text "Review" & click it. > > I tried to get the link of the text which is in row i cell 5 but again, i text always return Review thus getting the same link. > > Can anyone help in this. > > Thanks > Prashant > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5434&messageID=15143#15143 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From forum-watir-users at openqa.org Sat Nov 25 12:43:15 2006 From: forum-watir-users at openqa.org (Allen Zhou) Date: Sat, 25 Nov 2006 11:43:15 CST Subject: [Wtr-general] A special `method_missing': document (WIN32OLERuntimeError) Message-ID: <49206910.1164476625446.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi there, I have a question really confused me these days, it is a simple script but returns WIN32OLERuntimeError. I was writing an automatic script using Watir to help me manage and sell my items in eBay site. The following is the source code. require 'Watir' include Watir ie=IE.new ie.set_fast_speed ie.goto('https://signin.ebay.com/ws/eBayISAPI.dll?SignIn') ie.text_field(:name, 'userid').set('allentest2006') ie.text_field(:name, 'pass').set('testallen') ie.button(:value,'Sign In Securely >').click After clicking, I got the following errors. c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:2566:in `method_missing': document (WIN32OLERuntimeError) OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:2566:in `document' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:1188:in `check_for_http_error' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:218 from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:216:in `upto' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:216 from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:1711:in `call' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:1711:in `run_error_checks' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:1710:in `each' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:1710:in `run_error_checks' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:1699:in `wait' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:2419:in `click' I found that, once I access to the MyeBay page (http://my.ebay.com/ws/eBayISAPI.dll?MyeBay), I would get these errors. So anyone could help me to explain it? Or it is a bug of Watir? BTW, I pushed my Watir back to 1.4.1, it only returned a Warning about 'Access is denied', why 1.5 not? And is there anybody know why this exception happens? Thanks in advance! --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5436&messageID=15147#15147 From paul.rogers at shaw.ca Sat Nov 25 15:06:42 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sat, 25 Nov 2006 13:06:42 -0700 Subject: [Wtr-general] A special `method_missing': document(WIN32OLERuntimeError) References: <49206910.1164476625446.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <003901c710cd$3a1a7120$6400a8c0@laptop> the access is denied message usually appears when there is a frame( or iframe) that is in a different domain. Its a security thing in the browser. If your script is working, I wouldnt worry about it. Paul ----- Original Message ----- From: "Allen Zhou" To: Sent: Saturday, November 25, 2006 10:43 AM Subject: [Wtr-general] A special `method_missing': document(WIN32OLERuntimeError) > Hi there, > > I have a question really confused me these days, it is a simple script but > returns WIN32OLERuntimeError. > I was writing an automatic script using Watir to help me manage and sell > my items in eBay site. > The following is the source code. > > require 'Watir' > include Watir > ie=IE.new > ie.set_fast_speed > ie.goto('https://signin.ebay.com/ws/eBayISAPI.dll?SignIn') > ie.text_field(:name, 'userid').set('allentest2006') > ie.text_field(:name, 'pass').set('testallen') > ie.button(:value,'Sign In Securely >').click > > After clicking, I got the following errors. > > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:2566:in > `method_missing': document (WIN32OLERuntimeError) > OLE error code:80070005 in > Access is denied. > > > HRESULT error code:0x80020009 > Exception occurred. from > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:2566:in > `document' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:1188:in > `check_for_http_error' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:218 > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:216:in > `upto' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:216 > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:1711:in > `call' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:1711:in > `run_error_checks' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:1710:in > `each' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:1710:in > `run_error_checks' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:1699:in > `wait' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1095/./Watir.rb:2419:in > `click' > > I found that, once I access to the MyeBay page > (http://my.ebay.com/ws/eBayISAPI.dll?MyeBay), I would get these errors. > > So anyone could help me to explain it? Or it is a bug of Watir? > BTW, I pushed my Watir back to 1.4.1, it only returned a Warning about > 'Access is denied', why 1.5 not? And is there anybody know why this > exception happens? > > Thanks in advance! > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5436&messageID=15147#15147 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Sat Nov 25 23:10:52 2006 From: forum-watir-users at openqa.org (Allen Zhou) Date: Sat, 25 Nov 2006 22:10:52 CST Subject: [Wtr-general] A special `method_missing': In-Reply-To: <003901c710cd$3a1a7120$6400a8c0@laptop> Message-ID: <46634106.1164514282023.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> So what shall I do? Use 'begin..rescue..end' to ignore this exception? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5436&messageID=15150#15150 From forum-watir-users at openqa.org Sun Nov 26 10:55:26 2006 From: forum-watir-users at openqa.org (Allen Zhou) Date: Sun, 26 Nov 2006 09:55:26 CST Subject: [Wtr-general] A special `method_missing': In-Reply-To: <46634106.1164514282023.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <58378456.1164556556795.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hasn't anyone tried my script and give me some advices? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5436&messageID=15158#15158 From gmaralina at beingpresent.org Sun Nov 26 19:38:15 2006 From: gmaralina at beingpresent.org (Galina Maralina) Date: Sun, 26 Nov 2006 16:38:15 -0800 Subject: [Wtr-general] activeElement error. Message-ID: <00a101c711bc$537db6a0$3700a8c0@dbrblackcompaq> Hello, I encountered a difference between Watir behavior and manual clicking on the link that is a problem for automated testing of the hole application. Here is my button/link/image, clicking on it opens a popup window:
When I try to open a popup window for the first time after the page loaded, I can do it manually, but Water does not open it, though no error is reported by Watir itself. There is an error in Javascript on the page that says: Member not found. If I open this popup manually first time, then I can use Watir to continue working with the page and it will open this same popup. When our developers tried to debug the error, they saw, that it is connected to using an activeElement in Javascript, they thought that, may be, Watir does not support some of it's methods. Here is the code that tested it: function activeElementGeneralizor(focusedElement){//TODO release this 'hack'! //test alert("activeElementGeneralizor("+focusedElement+")");//test var message = "originally supported"; // if(!document.activeElement){ try{ alert("activeElement:"+document.activeElement.toString()); document.activeElement=focusedElement;//TSU44 11192006: This may be the code that Watia can not execute... }catch(e){ alert("activeElement error:"+e.description); t alert("activeElement:"+document.activeElement.toString()); // Document.prototype.activeElement = new HTMLElement; // document.activeElement = focusedElement; } message = "modified"; // } //test alert(document.activeElement+"("+message+")"); } When running manually, the alert would point to url; when tested with Watir alert was activeElement:[object] and activeElement error: Member not found. I do need to open this popup in order to run tests, so if you know, what can be done, please, help me. Thank you, Galina Maralina. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061126/aa8bd0e8/attachment-0001.html From faught at tejasconsulting.com Sun Nov 26 23:49:41 2006 From: faught at tejasconsulting.com (Danny R. Faught) Date: Sun, 26 Nov 2006 22:49:41 -0600 Subject: [Wtr-general] Finding the size of IE In-Reply-To: References: Message-ID: <456A6E65.8000900@tejasconsulting.com> > I'm attempting to use watir to check for JavaScript memory leaks. But I > can't find a way to check the memory usage of IE though watir. Maybe what you really mean is that you need a way to check the memory usage of an instance of IE using Ruby? This is probably outside the scope of Watir. See if you can find an API in Ruby for the underlying Windows calls that you need to query the memory usage of a process. Maybe the "Win32 Utils". -- Danny R. Faught Tejas Software Consulting http://tejasconsulting.com/ From zeljko.filipin at gmail.com Mon Nov 27 03:53:40 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 27 Nov 2006 09:53:40 +0100 Subject: [Wtr-general] Javascript Problem.... In-Reply-To: <44826901.1164436165629.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <44826901.1164436165629.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 11/25/06, san wrote: > > @ Zeljko : Yes, But I Wanted The Whole Process... i.e opening The 1st > Page, Entering My Given Data, Then Logging In... In The Background.i.eWhen IE Will Open The Page,I'll Be Already Logged In... Sanju, I do not understand what you want to do. Can you explain it further? Zeljko -- zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/3f35a7b1/attachment.html From zeljko.filipin at gmail.com Mon Nov 27 04:01:38 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 27 Nov 2006 10:01:38 +0100 Subject: [Wtr-general] A special `method_missing': In-Reply-To: <46634106.1164514282023.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <003901c710cd$3a1a7120$6400a8c0@laptop> <46634106.1164514282023.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 11/26/06, Allen Zhou wrote: > > So what shall I do? > Use 'begin..rescue..end' to ignore this exception? If your script works and that exception just bugs you, rescuing it sounds like a good idea. Zeljko -- zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/244e53ee/attachment.html From zeljko.filipin at gmail.com Mon Nov 27 04:04:31 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 27 Nov 2006 10:04:31 +0100 Subject: [Wtr-general] activeElement error. In-Reply-To: <00a101c711bc$537db6a0$3700a8c0@dbrblackcompaq> References: <00a101c711bc$537db6a0$3700a8c0@dbrblackcompaq> Message-ID: Could you send the code that you use to click that link? Zeljko -- zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/3102970d/attachment.html From forum-watir-users at openqa.org Mon Nov 27 05:21:28 2006 From: forum-watir-users at openqa.org (san) Date: Mon, 27 Nov 2006 04:21:28 CST Subject: [Wtr-general] Can Watir Download ".html" Pages...? Message-ID: <49227452.1164622918659.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Look At This Code Please... [i]ie = Watir::IE.new ie.goto('http://www.something.com') ie.text_field(:name, "userid1").set(".....") ie.text_field(:name, "userpass").set(".....") ie.image(:src, /login/).click[/i] Now Obviously After The Click A Page Opens. My Question Is, Is It Possible To Save The Page As .html Or Is It Possible To Get All The Links In That Page Including Its Own url Using Watir & Save As An Array? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5451&messageID=15186#15186 From zeljko.filipin at gmail.com Mon Nov 27 05:39:53 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 27 Nov 2006 11:39:53 +0100 Subject: [Wtr-general] Can Watir Download ".html" Pages...? In-Reply-To: <49227452.1164622918659.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <49227452.1164622918659.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 11/27/06, san wrote: > > Is It Possible To Save The Page As .html ie.html will show you html of the page: Or Is It Possible To Get All The Links In That Page ie.links is array of all links at that page Including Its Own url ie.url will give you url of page -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/c391ac50/attachment.html From zeljko.filipin at gmail.com Mon Nov 27 05:56:30 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 27 Nov 2006 11:56:30 +0100 Subject: [Wtr-general] Is there a way to make file_field.set faster? Message-ID: Is there a way to make file_field.set faster? I have noticed that this is the slowest part of my tests. It takes about 10 seconds to set file field. I have read that it can not be set directly because that would be security issue, but I wonder what I could do to make it faster. I upload extremely small files (a few bytes), but I have to do it frequently, and every time it takes about 10 seconds just to set file field. Any help would be appreciated. Thanks. -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/7b429acb/attachment.html From sikander at marlabs.com Mon Nov 27 05:55:19 2006 From: sikander at marlabs.com (sikander) Date: Mon, 27 Nov 2006 16:25:19 +0530 Subject: [Wtr-general] Parameterization Message-ID: <005701c71212$87f5e960$6520a8c0@caseshare.com> Hi All! Here is the my code, for which i need parameterization require 'watir' require 'win32ole' include Watir test_site = 'http://www.google.com' ie = IE.new ie.goto(test_site) #Search 1 ie.text_field(:name, "q").set("pickaxe") ie.button(:name, "btnG").click #Search 2 ie.text_field(:name, "q").clear ie.text_field(:name, "q").set("Ruby") ie.button(:name, "btnG").click #Search 3 ie.text_field(:name, "q").clear ie.text_field(:name, "q").set("Watir") ie.button(:name, "btnG").click #Search 4 ie.text_field(:name, "q").clear ie.text_field(:name, "q").set("Watir and Ruby") ie.button(:name, "btnG").click I want to write all the searches which i want to execute in a Excel sheet (1st worksheet) and want to execute these searches one by one by passing it from the Excel sheet. I was trying with the following code but could not able to continue.. excel = WIN32OLE::new('excel.Application') workbook = excel.Workbooks.Open('c:\examples\spreadsheet.xls') worksheet = workbook.Worksheets(1) worksheet.Select excel['Visible'] = true worksheet.Range('a1')['Value'] data = worksheet.Range('a1:a16')['Value'] ------------------- Please help me in this regard Thanks Sikander -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/e488388f/attachment.html From zeljko.filipin at gmail.com Mon Nov 27 06:26:04 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 27 Nov 2006 12:26:04 +0100 Subject: [Wtr-general] Parameterization In-Reply-To: <005701c71212$87f5e960$6520a8c0@caseshare.com> References: <005701c71212$87f5e960$6520a8c0@caseshare.com> Message-ID: I do not know how to use Excel, but this is how you could simplify your code (tested). searches = ["pickaxe", "Ruby", "Watir", "Watir and Ruby"] searches.each do |search| ie.text_field(:name, "q").set(search) ie.button(:name, "btnG").click end -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/5cf5e5df/attachment-0001.html From forum-watir-users at openqa.org Mon Nov 27 06:46:41 2006 From: forum-watir-users at openqa.org (san) Date: Mon, 27 Nov 2006 05:46:41 CST Subject: [Wtr-general] Can Watir Download ".html" Pages...? In-Reply-To: Message-ID: <57032660.1164628031210.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks [b]Zeljko[/b] But How Can I Save All These Links In An Array Of Strings? Will It Work? webs = ie.links webs.each do |web| puts web end Can You Tell Me From Where Can I Get All These Watir Functions...? Is There Any Good Quality Tutorial? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5451&messageID=15191#15191 From zeljko.filipin at gmail.com Mon Nov 27 07:11:02 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 27 Nov 2006 13:11:02 +0100 Subject: [Wtr-general] Can Watir Download ".html" Pages...? In-Reply-To: <57032660.1164628031210.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <57032660.1164628031210.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 11/27/06, san wrote: > > > Will It Work? > webs = ie.links > webs.each do |web| > puts web > end Try it and you will see if it works. :) Can You Tell Me From Where Can I Get All These Watir Functions...? > > Is There Any Good Quality Tutorial? http://www.openqa.org/watir/watir_user_guide.html http://en.wikipedia.org/wiki/Watir http://wtr.rubyforge.org/rdoc/index.html http://www.openqa.org/watir/ http://wtr.rubyforge.org/ -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/95938886/attachment.html From forum-watir-users at openqa.org Mon Nov 27 07:33:47 2006 From: forum-watir-users at openqa.org (san) Date: Mon, 27 Nov 2006 06:33:47 CST Subject: [Wtr-general] Can Watir Download ".html" Pages...? In-Reply-To: Message-ID: <38024582.1164630857856.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> lol lol :) Ya It Worked... But I can't Open The Links Again by webs = ie.links webs.each do |web| ie.goto(web) # This Line Produces Error... I Also Tried web.to_s output.puts(ie.html) # output is a .html file to be opened in w mode end In Fact I Wanna Save All The Linked html Pages in my HDD. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5451&messageID=15195#15195 From zeljko.filipin at gmail.com Mon Nov 27 08:23:37 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 27 Nov 2006 14:23:37 +0100 Subject: [Wtr-general] Can Watir Download ".html" Pages...? In-Reply-To: <38024582.1164630857856.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <38024582.1164630857856.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 11/27/06, san wrote: > > Ya It Worked... But I can't Open The Links Again by > > webs = ie.links > webs.each do |web| > ie.goto(web) # This Line Produces Error... I Also Tried > web.to_s > output.puts(ie.html) # output is a .html file to be opened in w mode > end If you posted your error I could say more. In any case this will open all links in separate windows ie.links.each {|link| Watir::IE.start(link.href)} In Fact I Wanna Save All The Linked html Pages in my HDD. Saving pages with ie.html would not save pictures. You should use some other tool to do it. -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/07666209/attachment.html From jackeichan at gmail.com Mon Nov 27 08:49:31 2006 From: jackeichan at gmail.com (jackei) Date: Mon, 27 Nov 2006 21:49:31 +0800 Subject: [Wtr-general] Parameterization In-Reply-To: References: <005701c71212$87f5e960$6520a8c0@caseshare.com> Message-ID: <4751ea460611270549i6346d2c2q4f540e0d468ab899@mail.gmail.com> I suggest that you can use CSV or XML rather than Excel, because the Watir's script won't execute if your machines haven't installed Excel. On 11/27/06, ?eljko Filipin wrote: > > I do not know how to use Excel, but this is how you could simplify your > code (tested). > > searches = ["pickaxe", "Ruby", "Watir", "Watir and Ruby"] > searches.each do |search| > ie.text_field(:name, "q").set(search) > ie.button(:name, "btnG").click > end > -- > Zeljko Filipin > zeljkofilipin.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -- Please give me a reply if you recevied the mail. Thanks. Best Regards Jackei.Chan (Software Testing Consultant) jackeichan at gmail.com Chinese Blog: http://jackei.cnblogs.com/ English Blog: http://www.testingreflections.com/blog/3424 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/92c79b54/attachment.html From sikander at marlabs.com Mon Nov 27 09:47:16 2006 From: sikander at marlabs.com (sikander) Date: Mon, 27 Nov 2006 20:17:16 +0530 Subject: [Wtr-general] Parameterization In-Reply-To: <4751ea460611270549i6346d2c2q4f540e0d468ab899@mail.gmail.com> Message-ID: <00aa01c71232$ef6c5eb0$6520a8c0@caseshare.com> could u expalin me how to do that in detail? _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of jackei Sent: Monday, November 27, 2006 7:20 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Parameterization I suggest that you can use CSV or XML rather than Excel, because the Watir's script won't execute if your machines haven't installed Excel. On 11/27/06, ?eljko Filipin wrote: I do not know how to use Excel, but this is how you could simplify your code (tested). searches = [ "pickaxe", "Ruby", "Watir" , "Watir and Ruby"] searches.each do |search| ie.text_field(:name, "q").set(search) ie.button(:name, "btnG").click end -- Zeljko Filipin zeljkofilipin.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -- Please give me a reply if you recevied the mail. Thanks. Best Regards Jackei.Chan (Software Testing Consultant) jackeichan at gmail.com Chinese Blog: http://jackei.cnblogs.com/ English Blog: http://www.testingreflections.com/blog/3424 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/1cc968d6/attachment.html From wpreul at gmail.com Mon Nov 27 09:52:18 2006 From: wpreul at gmail.com (Wyatt Preul) Date: Mon, 27 Nov 2006 09:52:18 -0500 Subject: [Wtr-general] WATIR Bug on Vista Message-ID: Whenever I try to run a WATIR script on Vista I encounter the following error, only after a new IE window appears. I believe that it is failing when trying to navigate to a page. Also, I am running the development gem 1.5.1.1100 as you can see in the error message. Started c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1100/./watir.rb:1550: [BUG] Segmentation fault ruby 1.8.5 (2006-08-25) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/638cc346/attachment.html From Mark_Cain at RL.gov Mon Nov 27 09:55:10 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Mon, 27 Nov 2006 06:55:10 -0800 Subject: [Wtr-general] Table has no unique attributes Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A3637@EX01-2.rl.gov> You could also just use table index. If you do a view source on the page, then do a f. Beginning at the top of the page, put ' wrote: I am quite new to watir and I am currently trying to automate some tests, however I am having difficulties clicking on a link within a cell in a table. I have done this before however this table has no name or id, Infact the only thing I have to identify the table is a class. I am assuming that I am not the first person to encounter this issue and I'm hoping that someone knows how to get around this problem. Anyone got any ideas?? Regards Garry West Trainee Test Analyst InPS Tel: 01382 564313 Visit our Web site at www.inps.co.uk The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of In Practice Systems Limited or any of its affiliates. If you are not the intended recipient please contact is.helpdesk at inps.co.uk P please don't print this e-mail unless you really need to. _______________________________________________ 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/20061127/b71d0297/attachment-0001.html From Mark_Cain at RL.gov Mon Nov 27 10:26:13 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Mon, 27 Nov 2006 07:26:13 -0800 Subject: [Wtr-general] Is there a way to make file_field.set faster? Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A3638@EX01-2.rl.gov> Zeljko, this works for me and it is much faster because it uses the handle of the object. require 'watir/contrib/enabled_popup' $path = "C\:\\watir_bonus\\working\\MyDoc.txt" def startClicker( button , waitTime=5, user_input=nil) hwnd = $ie.enabled_popup(waitTime) # get a handle if one exists if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) w.setTextValueForFileNameField(hwnd, "#{user_input}") end sleep 3 # I put this in to see the text being input it is not necessary to work w.clickWindowsButton_hwnd(hwnd, "#{button}") # "OK" or whatever the name on the button is w=nil # this is just cleanup end end # this is whatever invokes the file field dialog adoc = $ie.frame("main").image(:src, "https://alinea.inmar.com/alinea/images/adddocument.gif") adoc.click_no_wait # call the clicker startClicker( '&Open', 9, $path) --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of ?eljko Filipin Sent: Monday, November 27, 2006 2:57 AM To: Watir Subject: [Wtr-general] Is there a way to make file_field.set faster? Is there a way to make file_field.set faster? I have noticed that this is the slowest part of my tests. It takes about 10 seconds to set file field. I have read that it can not be set directly because that would be security issue, but I wonder what I could do to make it faster. I upload extremely small files (a few bytes), but I have to do it frequently, and every time it takes about 10 seconds just to set file field. Any help would be appreciated. Thanks. -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/137809cb/attachment.html From forum-watir-users at openqa.org Mon Nov 27 11:55:13 2006 From: forum-watir-users at openqa.org (san) Date: Mon, 27 Nov 2006 10:55:13 CST Subject: [Wtr-general] Can Watir Download ".html" Pages...? In-Reply-To: Message-ID: <50531452.1164646543252.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> It Says That It Needs An Absolute Path In ie.goto(), It Cant Recognize The Array Elements Named [i]web[/i] Here.... And Can You Tell Me Any Other Way To Save .html Pages Intact..... --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5451&messageID=15202#15202 From charley.baker at gmail.com Mon Nov 27 11:59:51 2006 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 27 Nov 2006 09:59:51 -0700 Subject: [Wtr-general] ie.minimize broken in watir-1.5.1.1127 In-Reply-To: References: Message-ID: Zeljko, I just ran through the same steps you list below and didn't have a problem. The use of autoit for controlling the window state of ie hasn't changed for quite some time and should be installed as part of your install. Is it working with previous gems on the same machine? -Charley On 11/22/06, ?eljko Filipin wrote: > I have just installed watir-1.5.1.1127.gem and it crashes when I use > ie.minimize. I do not have autoit installed. Does watir require it now? > Should I log this to jira? > > Steps to reproduce: > > C:\Documents and Settings\limited>ruby -v > ruby 1.8.5 (2006-08-25) [i386-mswin32] > C:\Documents and Settings\limited>irb > irb(main):001:0> require 'watir' > => true > irb(main):002:0> Watir::IE::VERSION > => "1.5.1.1127" > irb(main):003:0> ie = Watir::IE.start("http://www.google.com/") > => # > irb(main):004:0> ie.minimize > WIN32OLERuntimeError: Failed to create WIN32OLE object from > `AutoItX3.Control' > HRESULT error code:0x8007007e > The specified module could not be found. > from C:/ruby/lib/ruby/gems/1.8/gems/watir- > 1.5.1.1127/./watir.rb:4356:in `initialize' > from > C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/./watir.rb:4356:in > `new' > from > C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/./watir.rb:4356:in > `autoit' > from > C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/./watir.rb:1644:in > `autoit' > from > C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/./watir.rb:1641:in > `set_window_state' > from C:/ruby/lib/ruby/gems/1.8/gems/watir- > 1.5.1.1127/./watir.rb:1622:in `minimize' > from (irb):4 > > > Zeljko > -- > zeljkofilipin.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From paul.rogers at shaw.ca Mon Nov 27 12:01:43 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 27 Nov 2006 10:01:43 -0700 Subject: [Wtr-general] Is there a way to make file_field.set faster? In-Reply-To: <4440693B7CFF2440ABC2E0BE480DABA10A3638@EX01-2.rl.gov> References: <4440693B7CFF2440ABC2E0BE480DABA10A3638@EX01-2.rl.gov> Message-ID: you might also try setting focus to the filename field , and then using autoit to set the filename. -------------- next part -------------- Zeljko, this works for me and it is much faster because it uses the handle of the object. require 'watir/contrib/enabled_popup' $path = "C\:\\watir_bonus\\working\\MyDoc.txt" def startClicker( button , waitTime=5, user_input=nil) hwnd = $ie.enabled_popup(waitTime) # get a handle if one exists if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) w.setTextValueForFileNameField(hwnd, "#{user_input}") end sleep 3 # I put this in to see the text being input it is not necessary to work w.clickWindowsButton_hwnd(hwnd, "#{button}") # "OK" or whatever the name on the button is w=nil # this is just cleanup end end # this is whatever invokes the file field dialog adoc = $ie.frame("main").image(:src, "https://alinea.inmar.com/alinea/images/adddocument.gif") adoc.click_no_wait # call the clicker startClicker( '&Open', 9, $path) --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of ?eljko Filipin Sent: Monday, November 27, 2006 2:57 AM To: Watir Subject: [Wtr-general] Is there a way to make file_field.set faster? Is there a way to make file_field.set faster? I have noticed that this is the slowest part of my tests. It takes about 10 seconds to set file field. I have read that it can not be set directly because that would be security issue, but I wonder what I could do to make it faster. I upload extremely small files (a few bytes), but I have to do it frequently, and every time it takes about 10 seconds just to set file field. Any help would be appreciated. Thanks. -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/818a78db/attachment-0001.html -------------- next part -------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From forum-watir-users at openqa.org Mon Nov 27 14:05:08 2006 From: forum-watir-users at openqa.org (Egil Sorensen) Date: Mon, 27 Nov 2006 13:05:08 CST Subject: [Wtr-general] Can Watir Download ".html" Pages...? In-Reply-To: <50531452.1164646543252.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <49567724.1164654338322.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> > And Can You Tell Me Any Other Way To Save .html Pages Intact..... Take a look at http://forums.openqa.org/message.jspa?messageID=14044#14044 There is some code that can be used to save the page as rendered. (I believe that ei.html only will give you the page as downloaded.) ~~ Egil --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5451&messageID=15209#15209 From mail at chriss-baumann.de Mon Nov 27 14:39:05 2006 From: mail at chriss-baumann.de (Christian Baumann) Date: Mon, 27 Nov 2006 20:39:05 +0100 Subject: [Wtr-general] Parameterization In-Reply-To: <00aa01c71232$ef6c5eb0$6520a8c0@caseshare.com> References: <00aa01c71232$ef6c5eb0$6520a8c0@caseshare.com> Message-ID: <456B3ED9.2020601@chriss-baumann.de> http://www.ruby-doc.org/core/ ?! sikander schrieb: > could u expalin me how to do that in detail? > > ------------------------------------------------------------------------ > *From:* wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] *On Behalf Of *jackei > *Sent:* Monday, November 27, 2006 7:20 PM > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] Parameterization > > I suggest that you can use CSV or XML rather than Excel, because the > Watir's script won't execute if your machines haven't installed Excel. > > > > > On 11/27/06, *?eljko Filipin* > wrote: > > I do not know how to use Excel, but this is how you could simplify > your code (tested). > > searches = [ "pickaxe", "Ruby", "Watir" , "Watir and Ruby"] > searches.each do |search| > ie.text_field(:name, "q").set(search) > ie.button(:name, "btnG").click > end > -- > Zeljko Filipin > zeljkofilipin.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > -- > Please give me a reply if you recevied the mail. Thanks. > > Best Regards > > Jackei.Chan (Software Testing Consultant) > jackeichan at gmail.com > Chinese Blog: http://jackei.cnblogs.com/ > English Blog: http://www.testingreflections.com/blog/3424 > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20061127/0dc997ec/attachment.html From zeljko.filipin at gmail.com Mon Nov 27 14:56:20 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 27 Nov 2006 20:56:20 +0100 Subject: [Wtr-general] Parameterization In-Reply-To: <00aa01c71232$ef6c5eb0$6520a8c0@caseshare.com> References: <4751ea460611270549i6346d2c2q4f540e0d468ab899@mail.gmail.com> <00aa01c71232$ef6c5eb0$6520a8c0@caseshare.com> Message-ID: On 11/27/06, sikander wrote: > > could u expalin me how to do that in detail? > ------------------------------ > *From:* jackei** > I suggest that you can use CSV or XML > I suggest that you use yaml (http://yaml4r.sourceforge.net/cookbook/). I use it. -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/eeb6e07d/attachment.html From charley.baker at gmail.com Mon Nov 27 16:08:36 2006 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 27 Nov 2006 14:08:36 -0700 Subject: [Wtr-general] WATIR Bug on Vista In-Reply-To: References: Message-ID: I don't have access to a Vista system and haven't tried running scripts on it. What scripts are you trying to run and where is the error? Does this happen if you simply open irb and do something like this: irb> require 'watir' irb> include Watir irb> ie = IE.start('http://www.google.com') Or is there something further going on? I'd guess this doesn't really have much to do with Vista, but I've been mistaken before. More information might help track this down. -Charley On 11/27/06, Wyatt Preul wrote: > Whenever I try to run a WATIR script on Vista I encounter the following > error, only after a new IE window appears. I believe that it is failing > when trying to navigate to a page. Also, I am running the development gem > 1.5.1.1100 as you can see in the error message. > > > > Started > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1100/./watir.rb:1550: > [BUG] Segmentation fault > ruby 1.8.5 (2006-08-25) [i386-mswin32] > > > This application has requested the Runtime to terminate it in an unusual > way. > Please contact the application's support team for more information. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From michael.a.bolton at gmail.com Mon Nov 27 16:42:26 2006 From: michael.a.bolton at gmail.com (Michael Bolton) Date: Mon, 27 Nov 2006 16:42:26 -0500 Subject: [Wtr-general] Can Watir Download ".html" Pages...? In-Reply-To: <50531452.1164646543252.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <019b01c7126d$0b5dcb60$0c01060a@Koko> I think you're looking for wget; Google it. ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of san Sent: November 27, 2006 11:55 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Can Watir Download ".html" Pages...? It Says That It Needs An Absolute Path In ie.goto(), It Cant Recognize The Array Elements Named [i]web[/i] Here.... And Can You Tell Me Any Other Way To Save .html Pages Intact..... --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5451&messageID=15202#15202 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Mon Nov 27 16:46:44 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 27 Nov 2006 15:46:44 -0600 Subject: [Wtr-general] WATIR Bug on Vista In-Reply-To: References: Message-ID: <456B5CC4.30004@pettichord.com> To me this looks like a known problem with Watir and Ruby 1.8.5, and unrelated to Vista. I suggest you try Ruby 1.8.2. http://jira.openqa.org/browse/WTR-86 Please let us know if this fixes your problem. Bret Wyatt Preul wrote: > Whenever I try to run a WATIR script on Vista I encounter the > following error, only after a new IE window appears. I believe that > it is failing when trying to navigate to a page. Also, I am running > the development gem 1.5.1.1100 as you can see in the error message. > > > Started > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1100/./watir.rb:1550: [BUG] > Segmentation fault > ruby 1.8.5 (2006-08-25) [i386-mswin32] > > > This application has requested the Runtime to terminate it in an > unusual way. > Please contact the application's support team for more information. > > ------------------------------------------------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From gmaralina at beingpresent.org Mon Nov 27 17:02:52 2006 From: gmaralina at beingpresent.org (Galina Maralina) Date: Mon, 27 Nov 2006 14:02:52 -0800 Subject: [Wtr-general] activeElement error. In-Reply-To: <00a101c711bc$537db6a0$3700a8c0@dbrblackcompaq> Message-ID: <012c01c7126f$c8e10b50$3700a8c0@dbrblackcompaq> Any of the following works to click on the link: $ie.image(:id, "popupImage1").click $ie.image(:src, /button_arrows_round/).click $ie.link(:id, "ID_OPEN_POPUP1").click The result is the same, right button is flashed when used with .flash and they all open the right window - BUT! Second time, after you open it manually at least once. I even tried fireEvent(onClick) - same thing. Galina. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Galina Maralina Sent: Sunday, November 26, 2006 4:38 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] activeElement error. Hello, I encountered a difference between Watir behavior and manual clicking on the link that is a problem for automated testing of the hole application. Here is my button/link/image, clicking on it opens a popup window: When I try to open a popup window for the first time after the page loaded, I can do it manually, but Water does not open it, though no error is reported by Watir itself. There is an error in Javascript on the page that says: Member not found. If I open this popup manually first time, then I can use Watir to continue working with the page and it will open this same popup. When our developers tried to debug the error, they saw, that it is connected to using an activeElement in Javascript, they thought that, may be, Watir does not support some of it's methods. Here is the code that tested it: function activeElementGeneralizor(focusedElement){//TODO release this 'hack'! //test alert("activeElementGeneralizor("+focusedElement+")");//test var message = "originally supported"; // if(!document.activeElement){ try{ alert("activeElement:"+document.activeElement.toString()); document.activeElement=focusedElement;//TSU44 11192006: This may be the code that Watia can not execute... }catch(e){ alert("activeElement error:"+e.description); t alert("activeElement:"+document.activeElement.toString()); // Document.prototype.activeElement = new HTMLElement; // document.activeElement = focusedElement; } message = "modified"; // } //test alert(document.activeElement+"("+message+")"); } When running manually, the alert would point to url; when tested with Watir alert was activeElement:[object] and activeElement error: Member not found. I do need to open this popup in order to run tests, so if you know, what can be done, please, help me. Thank you, Galina Maralina. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/7d3fb3c4/attachment-0001.html From faught at tejasconsulting.com Mon Nov 27 17:49:13 2006 From: faught at tejasconsulting.com (Danny R. Faught) Date: Mon, 27 Nov 2006 16:49:13 -0600 Subject: [Wtr-general] how to tell when IE is *really* done In-Reply-To: Message-ID: <53HgYOX8.1164667753.6786120.dfaught@granville.textdrive.com> I'm having trouble getting a script to tell me accurately when a page has finished rendering. I'm running Watir 1.4.1 with Ruby 1.8.5 on Windows XP Pro SP2. I'm clicking a link that opens a new browser window, then I attach to the window. The attach returns before the contents of the window are rendered. There is a lot of javascript processing going on to do the rendering - I'm guessing that IE is saying it's done when the code and data are all downloaded, even though Javascript is still executing. Adding extra calls to the wait method doesn't help - IE insists that it's no longer busy, according to ie.busy. The rendering can take 30 seconds or more. Can anyone suggest a way to determine when the page has been completely rendered? Or when Javascript code is not currently executing? The best idea I've had so far, which isn't a very good idea, is to use a heuristic to watch for some element of the page to appear in the document. In my case, this would require traversing a quagmire of nested frames to find the content. -Danny From bret at pettichord.com Mon Nov 27 18:41:40 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 27 Nov 2006 17:41:40 -0600 Subject: [Wtr-general] how to tell when IE is *really* done In-Reply-To: <53HgYOX8.1164667753.6786120.dfaught@granville.textdrive.com> References: <53HgYOX8.1164667753.6786120.dfaught@granville.textdrive.com> Message-ID: <456B77B4.9050106@pettichord.com> I this that this patch might fix this problem: http://jira.openqa.org/browse/WTR-107 I believe that a correct wait procedure needs to check every frame. Bret Danny R. Faught wrote: > I'm having trouble getting a script to tell me accurately when a page > has finished rendering. I'm running Watir 1.4.1 with Ruby 1.8.5 on > Windows XP Pro SP2. > > I'm clicking a link that opens a new browser window, then I attach to > the window. The attach returns before the contents of the window are > rendered. There is a lot of javascript processing going on to do the > rendering - I'm guessing that IE is saying it's done when the code and > data are all downloaded, even though Javascript is still executing. > Adding extra calls to the wait method doesn't help - IE insists that > it's no longer busy, according to ie.busy. The rendering can take 30 > seconds or more. > > Can anyone suggest a way to determine when the page has been completely > rendered? Or when Javascript code is not currently executing? > > The best idea I've had so far, which isn't a very good idea, is to use > a heuristic to watch for some element of the page to appear in the > document. In my case, this would require traversing a quagmire of nested > frames to find the content. > From wpreul at gmail.com Mon Nov 27 18:51:08 2006 From: wpreul at gmail.com (Wyatt Preul) Date: Mon, 27 Nov 2006 18:51:08 -0500 Subject: [Wtr-general] WATIR Bug on Vista Message-ID: The fix was found at http://jira.openqa.org/browse/WTR-86 The solution is to copy win32ole.so from C:\ruby\lib\ruby\1.8\i386-mswin32 to C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.1.1100\watir\win32ole -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/7521df5c/attachment.html From forum-watir-users at openqa.org Mon Nov 27 19:00:33 2006 From: forum-watir-users at openqa.org (Scott) Date: Mon, 27 Nov 2006 18:00:33 CST Subject: [Wtr-general] How do I write to simple file instead of screen? Message-ID: <42954529.1164672063699.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am new to Watir, and am trying to build a small demo for management. Can someone give me a quick example on replacing 'puts' with the command that writes instead to a file? My DOS window closes immediately upon completion of running a script and I can't see the results. Also, it there a 'pause' command or something similar? I tried using the example on wikipedia.com for writing to an excel sheet, but it never opened an excel sheet or wrote anything to it. Thanks, Stacaz --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5462&messageID=15228#15228 From forum-watir-users at openqa.org Mon Nov 27 19:28:19 2006 From: forum-watir-users at openqa.org (Scott) Date: Mon, 27 Nov 2006 18:28:19 CST Subject: [Wtr-general] How do I write to simple file instead of screen? In-Reply-To: <42954529.1164672063699.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <45829797.1164673729153.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Here is what I have so far. It opens the Excel sheet, but doesn't write anything to it. require 'watir' # the watir controller require 'win32ole' # set a variable test_site = 'http://www.google.com' result1 = 'Default' # open the IE browser ie = Watir::IE.new # print some comments puts "## Beginning of test: Google search" puts " " puts "Step 1: go to the test site: " + test_site ie.goto(test_site) puts " Action: entered " + test_site + " in the address bar." puts "Step 2: enter 'sitewire' in the search text field" ie.text_field(:name, "q").set("sitewire") # q is the name of the search field puts " Action: entered sitewire in the search field" puts "Step 3: click the 'Google Search' button" ie.button(:name, "btnG").click # "btnG" is the name of the Search button puts " Action: clicked the Google Search button." puts "Expected Result: " puts " - a Google page with results should be shown. 'Programming Ruby' should be high on the list." puts "Actual Result: Check that the 'Programming Ruby' link appears on the results page " if ie.contains_text("Accelera") puts "Test Passed. Found the test string: 'Programming Ruby'. Actual Results match Expected Results." result1 = "PASS Test" else puts "Test Failed! Could not find: 'Programming Ruby'" result1 = "FAIL TEST" end puts " " puts "## End of test: Google search" # -end of simple Google search test #open spreadsheet excel = WIN32OLE.new("excel.application") excel.visible = true # in case you want to see what happens workbook = excel.workbooks.add #Log results excel.worksheet.range("a1").value = "Test Results for Sitewire" excel.worksheet.range("b1").value = result1 # # Etcetera...assume the above happens 4 times, for 4 screens... # #Format workbook columns #worksheet.range("b1:b4").Interior['ColorIndex'] = 36 #pale yellow excel.worksheet.columns("b:b").AutoFit #close the workbook excel.workbook.saveas('c:\watir\examples\spreadsheet99TEST.xls') excel.workbook.close excel.Quit Stacaz --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5462&messageID=15230#15230 From lauren at protopc.com Mon Nov 27 19:57:30 2006 From: lauren at protopc.com (lauren at protopc.com) Date: Mon, 27 Nov 2006 17:57:30 -0700 Subject: [Wtr-general] How do I write to simple file instead of screen? Message-ID: <20061127175730.f9a12746e143709d2bc165e5bb585f65.38d728185e.wbe@email.secureserver.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061127/16d02548/attachment.html From forum-watir-users at openqa.org Mon Nov 27 20:32:53 2006 From: forum-watir-users at openqa.org (Allen Zhou) Date: Mon, 27 Nov 2006 19:32:53 CST Subject: [Wtr-general] A special `method_missing': In-Reply-To: Message-ID: <53142117.1164677603902.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Sorry for spam. I just found out the same issue as me, it is a defect of Watir. More details please refer the following thread. http://www.mail-archive.com/wtr-general at rubyforge.org/msg05037.html Thanks. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5436&messageID=15232#15232 From zeljko.filipin at gmail.com Tue Nov 28 03:34:14 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 28 Nov 2006 09:34:14 +0100 Subject: [Wtr-general] activeElement error. In-Reply-To: <012c01c7126f$c8e10b50$3700a8c0@dbrblackcompaq> References: <00a101c711bc$537db6a0$3700a8c0@dbrblackcompaq> <012c01c7126f$c8e10b50$3700a8c0@dbrblackcompaq> Message-ID: This does not work? $ie.link(:id, "ID_OPEN_POPUP1").fire_event("onclick") -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061128/54f9d0cd/attachment.html From zeljko.filipin at gmail.com Tue Nov 28 04:05:06 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 28 Nov 2006 10:05:06 +0100 Subject: [Wtr-general] How do I write to simple file instead of screen? In-Reply-To: <20061127175730.f9a12746e143709d2bc165e5bb585f65.38d728185e.wbe@email.secureserver.net> References: <20061127175730.f9a12746e143709d2bc165e5bb585f65.38d728185e.wbe@email.secureserver.net> Message-ID: You can redirect output of your script to file really easy. Go to command prompt, and write test.rb > test.txt That will execute your test.rb script and write output to test.txt file. A little bit complicated is writing to file from ruby. file = File.open("test.txt", "w") file.puts "some text" file.close More information: http://www.rubycentral.com/book/tut_io.html http://www.ruby-doc.org/core/classes/File.html There is even ruby logger: http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc/ -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061128/6e1dcad2/attachment.html From forum-watir-users at openqa.org Tue Nov 28 06:08:32 2006 From: forum-watir-users at openqa.org (san) Date: Tue, 28 Nov 2006 05:08:32 CST Subject: [Wtr-general] Can't Determine The Error... Message-ID: <49604515.1164712148223.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Look At This Simple code.... [i]require 'watir' ie = Watir::IE.new ie.goto('http://pro.edgar-online.com')[/i] It Throws Exception In The Goto Line As : [i]W, [28-Nov-2006 16:24:40#1068] WARN -- : frame error in waitdocument OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1405:in `method_missing' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1405:in `wait' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1404:in `upto' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1404:in `wait' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1254:in `goto' Edgar1.rb:5[/i] I Cant Determine The Problem... Help... :) & Also I Can't Tell The Program To Wait Till A Page Is Loaded Fully By The Command [i]ie.wait( noSleep = false )[/i] Can You Please Give Me Any Way To Stop Execution Of The Program Till The Page Loades Completely. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5476&messageID=15263#15263 From Mark_Cain at RL.gov Tue Nov 28 10:08:25 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Tue, 28 Nov 2006 07:08:25 -0800 Subject: [Wtr-general] Can't Determine The Error... Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A363F@EX01-2.rl.gov> This has been answered many times. "The access is denied message usually appears when there is a frame ( or iframe) that is in a different domain. It's a security thing in the browser. If your script is working, I wouldnt worry about it." Many have endeavored to put these kinds of errors and stuff in the FAQ; you might want to check it out on the website. --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of san Sent: Tuesday, November 28, 2006 3:09 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Can't Determine The Error... Look At This Simple code.... [i]require 'watir' ie = Watir::IE.new ie.goto('http://pro.edgar-online.com')[/i] It Throws Exception In The Goto Line As : [i]W, [28-Nov-2006 16:24:40#1068] WARN -- : frame error in waitdocument OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1405:in `method_missing' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1405:in `wait' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1404:in `upto' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1404:in `wait' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1254:in `goto' Edgar1.rb:5[/i] I Cant Determine The Problem... Help... :) & Also I Can't Tell The Program To Wait Till A Page Is Loaded Fully By The Command [i]ie.wait( noSleep = false )[/i] Can You Please Give Me Any Way To Stop Execution Of The Program Till The Page Loades Completely. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5476&messageID=15263#15263 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From forum-watir-users at openqa.org Tue Nov 28 10:09:40 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Tue, 28 Nov 2006 09:09:40 CST Subject: [Wtr-general] Can't Determine The Error... In-Reply-To: <49604515.1164712148223.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <47133140.1164726610551.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I assume this is the standard 'access is denied' error. http://wiki.openqa.org/display/WTR/FAQ Look for the 'access is denied' section, it should help. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5476&messageID=15274#15274 From faught at tejasconsulting.com Tue Nov 28 14:42:15 2006 From: faught at tejasconsulting.com (Danny R. Faught) Date: Tue, 28 Nov 2006 13:42:15 -0600 Subject: [Wtr-general] how to tell when IE is *really* done In-Reply-To: Message-ID: >From: Bret Pettichord >I this that this patch might fix this problem: > >http://jira.openqa.org/browse/WTR-107 > >I believe that a correct wait procedure needs to check every frame. Thanks for the pointer. I've upgraded to 1.5.1.1127 to pick up this change. It doesn't quite fix the problem, though. The new wait code doesn't recursively descend into the frames - it only gets the direct children of the main page. The patch below makes it recursive, and gives me the correct behavior for my app. *** watir.rb.bak Tue Nov 28 13:30:15 2006 --- watir.rb Tue Nov 28 13:36:37 2006 *************** *** 1676,1681 **** --- 1676,1700 ---- # include Watir::Utils + def frame_wait(object, s) + if object.document.frames.length > 0 + begin + 0.upto object.document.frames.length-1 do |i| + until object.document.frames[i.to_s].document.readyState == "complete" + sleep 0.2; s.spin + end + url = object.document.frames[i.to_s].document.url + @url_list << url unless url_list.include?(url) + frame_wait(object.document.frames[i.to_s], s) + end + rescue WIN32OLERuntimeError + end + else + url = @ie.document.url + @url_list << url unless @url_list.include?(url) + end + end + # Block execution until the page has loaded. def wait(no_sleep=false) @down_load_time = 0.0 *************** *** 1709,1729 **** sleep 0.2; s.spin end ! if @ie.document.frames.length > 0 ! begin ! 0.upto @ie.document.frames.length-1 do |i| ! until @ie.document.frames[i.to_s].document.readyState == "complete" ! sleep 0.2; s.spin ! end ! url = @ie.document.frames[i.to_s].document.url ! @url_list << url unless url_list.include?(url) ! end ! rescue WIN32OLERuntimeError ! end ! else ! url = @ie.document.url ! @url_list << url unless @url_list.include?(url) ! end @down_load_time = Time.now - start_load_time run_error_checks print "\b" if @enable_spinner --- 1728,1734 ---- sleep 0.2; s.spin end ! frame_wait(ie, s) @down_load_time = Time.now - start_load_time run_error_checks print "\b" if @enable_spinner From faught at tejasconsulting.com Tue Nov 28 16:15:40 2006 From: faught at tejasconsulting.com (Danny R. Faught) Date: Tue, 28 Nov 2006 15:15:40 -0600 Subject: [Wtr-general] [OT] Running scripts on machines without ruby Message-ID: > http://www.erikveen.dds.nl/rubyscript2exe/index.html > I hear good things about it. I just tried it, and was impressed that it worked when I ran the executible on the same system where I built it. That's something that I haven't been able to get the open source Perl compiler to do. But when I copied it from an XP Pro SP2 box to an XP Embedded SP0 box, it ran for a few moments and then died with a segmentation fault. On repeated attempts, it died intermittently in two different places in watir.rb. I guess it's too much of a stretch to expect to run it on a different flavor of Windows. -Danny From forum-watir-users at openqa.org Tue Nov 28 16:24:45 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Tue, 28 Nov 2006 15:24:45 CST Subject: [Wtr-general] how to tell when IE is *really* done In-Reply-To: Message-ID: <45913228.1164749115198.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> maybe a silly question, how do we apply the above patch? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5487&messageID=15295#15295 From forum-watir-users at openqa.org Tue Nov 28 16:53:47 2006 From: forum-watir-users at openqa.org (Dave Munns) Date: Tue, 28 Nov 2006 15:53:47 CST Subject: [Wtr-general] Simulate CNTRL-LEFT CLICK Message-ID: <42913869.1164750868797.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I have the following html and I want to navigate to Best Practices - Operating System and CNTL-LEFT CLICK. 1) How do I reference that value? 2) How can a CNTRL-LEFT CLICK be simulated? irb> ie.frame('fraDataZone').form(:index,2).html => "\r\n

Okay, sorry, I jumped the gun on rubyscript2exe. I managed to get a full Ruby 1.8.5 install on my XP Embedded box, and I'm getting intermittent segmentation faults with that too. So rubyscript2exe is just faithfully producing the same bug that's in Ruby itself. Is anyone else using Ruby on Windows XP Embedded? I'm testing on a MaxTerm thin client. -Danny From forum-watir-users at openqa.org Tue Nov 28 22:19:02 2006 From: forum-watir-users at openqa.org (Vince) Date: Tue, 28 Nov 2006 21:19:02 CST Subject: [Wtr-general] screenshots In-Reply-To: <62685743.1162342490665.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <63128257.1164770767861.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> egil, I've been putting recent "downtime" between my primary tasks to polish up my homegrown testing app, and the state of the page at the time of errors is pretty key. My original idea was to leave the bad page up and refresh the IE object to a new instance for the continuation of the test suite, but that was sloppy at the very least, and fell far short of the greater goals of the app... Anyway, getting off topic. Some comments on the code: 1) right after you require Watir, you have [i]KCODE = 'UTF8' require 'jcode' [/i] I've commented this out and looked around, but have no idea what it's for... can you enlighten me? 2) For the file naming, you've got yourself set up for an infinite loop given enough of those files being written. I use numeric incrementation in my files in a few places, and have tended towards this snippet: [i]filenumber = "000" file_name = "#{basename}_#{filenumber}" while File.exists?(file_name) filenumber.succ! file_name = "#{basename}_#{filenumber}" end[/i] This way, if you run over the numeric character field you've given yourself, the field just gets bigger. In places where the actual text of the file name is less important to me, I increment the entire string rather than just the number. It makes for some funky looking file names, but like I said, they aren't important to me in those places. 3) I'm not sure how, but the pages that result from this code are actually cleaner looking than those resulting from a manual copy/paste of the "view source". Bravo. Other than that, I've hijacked this code in it's entirety and am cannibalizing it into my own. I've separated the file writing functionality from the page capturing functionality - On an error, I catch (rescue) the exception and pass the exception type, exception text, call stack, and offending pages code to an error logging class (which then constructs a simple html error log and viewer for later review and investigation) and re-raise the error exactly as it was received for the sake of the testrunner. My only other question would be if you able to point me in the direction of some decent documentation for getHTML - my searches have been rather fruitless thus far. I played with screen_capture, but at the end of the day an image just doesn't cut it (app errors handled in the product I am testing display with the error messages hidden, and require a knowing javascript event to view), and if my devs turn out a particularly bad build, I'd much rather have a few thousand html files than images any day. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=4907&messageID=15308#15308 From forum-watir-users at openqa.org Wed Nov 29 08:49:03 2006 From: forum-watir-users at openqa.org (san) Date: Wed, 29 Nov 2006 07:49:03 CST Subject: [Wtr-general] Can't Control JavaScript PopUp Window.... Message-ID: <38904846.1164808173911.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Basically When I Click On A Link A PopUp Appears With Some New Links... I Want To Click On One Of Them... But... The Very Third Line Of... [i]require 'rubygems' require 'watir' require 'watir/contrib/enabled_popup' [/i] ....Throws Error [i]c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- watir/contrib/enabled_popup (LoadError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' [/i] & Then... [i]hwnd = ie.enabled_popup(timeout=5) if (hwnd)[/i] Obviously Throwing Error.. Help Please... --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5505&messageID=15325#15325 From zeljko.filipin at gmail.com Wed Nov 29 09:34:43 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 29 Nov 2006 15:34:43 +0100 Subject: [Wtr-general] ie.minimize broken in watir-1.5.1.1127 In-Reply-To: References: Message-ID: On 11/27/06, Charley Baker wrote: > > I just ran through the same steps you list below and didn't have a > problem. The use of autoit for controlling the window state of ie > hasn't changed for quite some time and should be installed as part of > your install. Is it working with previous gems on the same machine? Charley, As far as I know, I do not have autoit installed (unless watir installed it silently). 1.5.1.1081 works perfectly. I can reproduce that error message with 1.5.1.1100 and 1.5.1.1127 every time. It gets interesting if I install multiple versions of watir (gem installations only). If 1081 is installed with 1100 or 1127, ie.minimizeworks. If only 1100 or 1127 are installed, I get that error message. I ran core_tests.rb and for mentioned versions and only 1127 ends with message about errors and failures: "193 tests, 1032 assertions, 5 failures, 9 errors" (I can send you all of output if it helps). By the way, I have ie6 and xp pro sp2. -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061129/f3fe3ce0/attachment.html From forum-watir-users at openqa.org Wed Nov 29 09:49:39 2006 From: forum-watir-users at openqa.org (vijay) Date: Wed, 29 Nov 2006 08:49:39 CST Subject: [Wtr-general] Can't Control JavaScript PopUp Window.... In-Reply-To: <38904846.1164808173911.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <59161833.1164811809837.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Sandeb, I also used to get that error in the 'enabled_popup' line but it does not seem to come after the previous version of 'watir gem' (1.5.1.1100) was uninstalled and the latest version (1.5.1.1127) was installed. Try that. It may work for you also. You may install the latest version of watir gem from the link given below: http://wiki.openqa.org/display/WTR/Development+Builds The piece of code that is currently being used to handle popups (simple function - just clicks the 'Ok' button of the popup window) in our script is (got from one of the forums): # should use 'click_no_wait' in the below statement and not 'click' ie.frame("Toolbar").link(:text,"Log out").click_no_wait hwnd = ie.enabled_popup(5) # get a handle if one exists if (hwnd) # yes there is a popup w = WinClicker.new w.makeWindowActive(hwnd) w.clickWindowsButton_hwnd(hwnd, "OK") end along with the statement, require 'watir/contrib/enabled_popup' , at the begining of the script. Hope, the reply was useful. Vijay. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5505&messageID=15330#15330 From Mark_Cain at RL.gov Wed Nov 29 09:56:46 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Wed, 29 Nov 2006 06:56:46 -0800 Subject: [Wtr-general] Can't Control JavaScript PopUp Window.... Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A3640@EX01-2.rl.gov> What version of Watir are you using? --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of san Sent: Wednesday, November 29, 2006 5:49 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Can't Control JavaScript PopUp Window.... Basically When I Click On A Link A PopUp Appears With Some New Links... I Want To Click On One Of Them... But... The Very Third Line Of... [i]require 'rubygems' require 'watir' require 'watir/contrib/enabled_popup' [/i] ....Throws Error [i]c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- watir/contrib/enabled_popup (LoadError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' [/i] & Then... [i]hwnd = ie.enabled_popup(timeout=5) if (hwnd)[/i] Obviously Throwing Error.. Help Please... --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5505&messageID=15325#15325 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From forum-watir-users at openqa.org Wed Nov 29 10:12:37 2006 From: forum-watir-users at openqa.org (vijay) Date: Wed, 29 Nov 2006 09:12:37 CST Subject: [Wtr-general] "abnormal program termination" error message while playing back a script Message-ID: <37412612.1164813187509.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi people, My name is Vijay. I am new to Watir. Occasionally, while playing back the script, which does a simple operation in our application, the script hangs with an error message, "abnormal program termination", in its window (where the command, 'puts', will write its output). As said above, this is not always. Several times, the script plays back till the end. Also, occasionally, I do get a "Program Error" in a small window saying that "Ruby.exe has had some problems. You may need to restart the program" with an 'OK' button at the bottom. At those times, I just re-run the script and the script runs fine. I am using 'Ruby 185-21' and 'Watir gem', 1.5.1.1127. Is there a problem with the installation? I have, a few times, uninstalled and re-installed 'Ruby' and 'Watir gem'. Previously, I was using 1.5.1.1100 and this error had not occured even once. I uninstalled 1.5.1.1100 and installed 1.5.1.1127 because 1.5.1.1100 was not allowing the script to handle pop-up windows. It was throwing an error in the statement, require 'watir/contrib/enabled_popup', while trying to handle pop-ups. Thanks, in Advance, Vijay. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5509&messageID=15336#15336 From forum-watir-users at openqa.org Wed Nov 29 10:29:28 2006 From: forum-watir-users at openqa.org (vijay) Date: Wed, 29 Nov 2006 09:29:28 CST Subject: [Wtr-general] list of "watir" commands Message-ID: <55866145.1164814198384.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi people, I have got a small doubt. Is there some place where one can find the list of commands that are available in Watir. When I went through this forum searching for some issue, I found a lot of new commands like clickWindowsButton, clickWindowsButton_hwnd, ie.enabled_popup(5) etc. If there a repository for all these available commands, then it would be greatly helpful. Thanks, in Advance, Vijay. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5512&messageID=15340#15340 From zeljko.filipin at gmail.com Wed Nov 29 10:38:26 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 29 Nov 2006 16:38:26 +0100 Subject: [Wtr-general] list of "watir" commands In-Reply-To: <55866145.1164814198384.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <55866145.1164814198384.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 11/29/06, vijay wrote: > > Is there some place where one can find the list of commands that are > available in Watir. > http://wtr.rubyforge.org/rdoc/index.html But I think it is for 1.4.1. -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061129/009ac4b0/attachment.html From forum-watir-users at openqa.org Wed Nov 29 11:01:51 2006 From: forum-watir-users at openqa.org (Howard) Date: Wed, 29 Nov 2006 10:01:51 CST Subject: [Wtr-general] [Wtr-General] Problem with set_text and dialog boxes In-Reply-To: <63545887.1164231120535.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <50115905.1164816142038.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I HAVE FOUND AN ANSWER! I changed the watir.rb to not use set_text. Instead, I moved the code from set_text to the two places that called it (set-combobox-text for one.) It now works every time. Debug showed it never actually called the set-text. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5403&messageID=15344#15344 From zeljko.filipin at gmail.com Wed Nov 29 11:05:31 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 29 Nov 2006 17:05:31 +0100 Subject: [Wtr-general] Is there a way to make file_field.set faster? In-Reply-To: References: <4440693B7CFF2440ABC2E0BE480DABA10A3638@EX01-2.rl.gov> Message-ID: Mark, Thanks a lot. startClicker works double faster than file_field.set. Paul, I will try autoit tomorrow, and see if it is even faster. -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061129/d5b3690d/attachment.html From gmaralina at beingpresent.org Wed Nov 29 12:47:06 2006 From: gmaralina at beingpresent.org (Galina Maralina) Date: Wed, 29 Nov 2006 09:47:06 -0800 Subject: [Wtr-general] activeElement error. In-Reply-To: Message-ID: <01e001c713de$664cb8c0$3700a8c0@dbrblackcompaq> No, same result: it opens popup ONLY after it was opened and closed manually at least once. Galina. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of ?eljko Filipin Sent: Tuesday, November 28, 2006 12:34 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] activeElement error. This does not work? $ie.link(:id, "ID_OPEN_POPUP1").fire_event("onclick") -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061129/df9ad316/attachment.html From charley.baker at gmail.com Wed Nov 29 13:44:20 2006 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 29 Nov 2006 11:44:20 -0700 Subject: [Wtr-general] "abnormal program termination" error message while playing back a script In-Reply-To: <37412612.1164813187509.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <37412612.1164813187509.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: This is a known issue with Watir and Ruby 185, this will work with Ruby 182, the Jira issue is here: http://jira.openqa.org/browse/WTR-86 -Charley On 11/29/06, vijay wrote: > Hi people, > > My name is Vijay. I am new to Watir. Occasionally, while playing back the script, which does a simple operation in our application, the script hangs with an error message, "abnormal program termination", in its window (where the command, 'puts', will write its output). As said above, this is not always. Several times, the script plays back till the end. > > Also, occasionally, I do get a "Program Error" in a small window saying that "Ruby.exe has had some problems. You may need to restart the program" with an 'OK' button at the bottom. At those times, I just re-run the script and the script runs fine. I am using 'Ruby 185-21' and 'Watir gem', 1.5.1.1127. > > Is there a problem with the installation? I have, a few times, uninstalled and re-installed 'Ruby' and 'Watir gem'. Previously, I was using 1.5.1.1100 and this error had not occured even once. I uninstalled 1.5.1.1100 and installed 1.5.1.1127 because 1.5.1.1100 was not allowing the script to handle pop-up windows. It was throwing an error in the statement, require 'watir/contrib/enabled_popup', while trying to handle pop-ups. > > Thanks, in Advance, > Vijay. > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5509&messageID=15336#15336 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From charley.baker at gmail.com Wed Nov 29 16:12:09 2006 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 29 Nov 2006 14:12:09 -0700 Subject: [Wtr-general] ie.minimize broken in watir-1.5.1.1127 In-Reply-To: References: Message-ID: The errors from core_tests.rb should be fixed now. The latest xpath test was getting in the way causing spurious errors. I've looked over the changes and don't see anything inherently that would cause this problem. I can't reproduce it personally and I'm stumped. Let me know if you come up with any additional information. I'll keep poking around. -Charley On 11/29/06, ?eljko Filipin wrote: > On 11/27/06, Charley Baker wrote: > > > I just ran through the same steps you list below and didn't have a > > problem. The use of autoit for controlling the window state of ie > > hasn't changed for quite some time and should be installed as part of > > your install. Is it working with previous gems on the same machine? > > Charley, > > As far as I know, I do not have autoit installed (unless watir installed it > silently). 1.5.1.1081 works perfectly. I can reproduce that error message > with 1.5.1.1100 and 1.5.1.1127 every time. > > It gets interesting if I install multiple versions of watir (gem > installations only). If 1081 is installed with 1100 or 1127, ie.minimize > works. If only 1100 or 1127 are installed, I get that error message. > > I ran core_tests.rb and for mentioned versions and only 1127 ends with > message about errors and failures: "193 tests, 1032 assertions, 5 failures, > 9 errors" (I can send you all of output if it helps). > > By the way, I have ie6 and xp pro sp2. > -- > Zeljko Filipin > zeljkofilipin.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From forum-watir-users at openqa.org Wed Nov 29 18:10:09 2006 From: forum-watir-users at openqa.org (Dave Munns) Date: Wed, 29 Nov 2006 17:10:09 CST Subject: [Wtr-general] setting text field in table Message-ID: <37526354.1164841855850.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> This problem seems to defy conventional solutions. Does someone have a solution ? The html: irb> ie.frame('fraDataZone').table(:index,1).table(:index,1)[1].html => "\r\nStart Date\r\n" The screen has a lable, Start Date, followed by a text field. I have tried accessing the text field by :name and :id, and irb just whines: irb> ie.frame('fraDataZone').table(:index,1).table(:index,1)[1].text_field(:name,'Start Date').set('11/11/2005 12:00:00PM') irb> ie.frame('fraDataZone').table(:index,1).table(:index,1)[1][2].text_field(:name,'Start Date').set('11/11/2005 12:00:00PM') Watir::Exception::UnknownObjectException: Unable to locate object, using name and Start Date --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5520&messageID=15373#15373 From paul.rogers at shaw.ca Wed Nov 29 18:41:43 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 29 Nov 2006 16:41:43 -0700 Subject: [Wtr-general] setting text field in table In-Reply-To: <37526354.1164841855850.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <37526354.1164841855850.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: the text field doesnt have a name, or id try using index ie.frame('fraDataZone').text_field(:index,1).set('11/11/2005 12:00:00PM') ----- Original Message ----- From: Dave Munns Date: Wednesday, November 29, 2006 4:10 pm Subject: [Wtr-general] setting text field in table > This problem seems to defy conventional solutions. Does someone > have a solution ? > > The html: > > irb> ie.frame('fraDataZone').table(:index,1).table(:index,1)[1].html > > => "\r\n Management\"> udefParmName=\"StartDate\">Start Date\r\n value=\"11/22/2006 2:53:28 PM\">" > > The screen has a lable, Start Date, followed by a text field. > > I have tried accessing the text field by :name and :id, and irb > just whines: > > irb> > ie.frame('fraDataZone').table(:index,1).table(:index,1)[1].text_field(:name,'Start Date').set('11/11/2005 12:00:00PM') > > irb> > ie.frame('fraDataZone').table(:index,1).table(:index,1)[1][2].text_field(:name,'Start Date').set('11/11/2005 12:00:00PM') > > Watir::Exception::UnknownObjectException: Unable to locate object, > using name and Start Date > ------------------------------------------------------------------- > -- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5520&messageID=15373#15373 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From zeljko.filipin at gmail.com Thu Nov 30 05:15:10 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 30 Nov 2006 11:15:10 +0100 Subject: [Wtr-general] Is there a way to make file_field.set faster? In-Reply-To: References: <4440693B7CFF2440ABC2E0BE480DABA10A3638@EX01-2.rl.gov> Message-ID: On 11/29/06, ?eljko Filipin wrote: > > startClicker works double faster than file_field.set. Iit is now even faster (for three seconds) after I removed line with "sleep 3" (when I noticed that comment says that it can be removed). file_field.set needed approximately 10,6 seconds to set file field, startClicker 4,4, and when I removed "sleep 3", it is down to 1,4. That saved me approximately 9 seconds for each file upload (and I do it a lot). Just wanted to say thanks. (I wonder if autoit is even faster?) -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061130/ed71e83f/attachment.html From forum-watir-users at openqa.org Thu Nov 30 12:30:13 2006 From: forum-watir-users at openqa.org (usha) Date: Thu, 30 Nov 2006 11:30:13 CST Subject: [Wtr-general] how to verify inside loop of ie.link Message-ID: <40713566.1164907896950.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, Started Watir last week. Great open source tool. How can I use if inside a ie.link loop i.e., I am looking for n specific links within the page. like below - which results in error! item_search="blah.com" ie.links.each do |l| ans=ie.link(:url,/#{item_search}/).exists? if ans then ctr=ctr+1 end end Thanks --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5543&messageID=15415#15415 From forum-watir-users at openqa.org Thu Nov 30 13:16:45 2006 From: forum-watir-users at openqa.org (usha) Date: Thu, 30 Nov 2006 12:16:45 CST Subject: [Wtr-general] looking for span class Message-ID: <53153414.1164910651079.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> how can I verify if "Blah Links" exists and how many of them. tried ie.span, ie.link - response was false though exists. Thanks in advance --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5545&messageID=15418#15418 From forum-watir-users at openqa.org Thu Nov 30 13:21:44 2006 From: forum-watir-users at openqa.org (Nathan) Date: Thu, 30 Nov 2006 12:21:44 CST Subject: [Wtr-general] how to verify inside loop of ie.link In-Reply-To: <40713566.1164907896950.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <59482583.1164911084801.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> try this I think: item_search = "blah.com" ie.links.each {   |l| tempLink = l   # This line looks for the substring in item_search in the url of tempLink.   # It says, "If [b]not[/b] (item_search is [b]not[/b] part of the string)" - double negative=positive in -   # this case. So really it says, "If item_search [b]is[/b] part of the string"   if not tempLink.url[item_search].nil?     ctr = ctr + 1   end } --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5543&messageID=15420#15420 From forum-watir-users at openqa.org Thu Nov 30 13:28:33 2006 From: forum-watir-users at openqa.org (Vince) Date: Thu, 30 Nov 2006 12:28:33 CST Subject: [Wtr-general] how to verify inside loop of ie.link In-Reply-To: <40713566.1164907896950.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <47817014.1164911499797.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> usha, Where to start... Semantics, but you need to give ctr a starting value, otherwise you're adding 1 to nil, which isn't going to fly. Look at your if statement - it is looking at ie.link().exists? for each link on the page. This is going to result in a zero if the link does not appear, and a count of all links on the page if the link appears once or more since a single instance of the link is going to mean that no matter how many times you look at the page, you're always going to find it again - Not the count I believe you're looking for. Let's try this: item_search=/blah.com/ ctr = 0 ie.links.each do |l| ans=l.href =~ item_search if ans ctr = ctr+1 end end --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5543&messageID=15421#15421 From forum-watir-users at openqa.org Thu Nov 30 13:39:04 2006 From: forum-watir-users at openqa.org (Vince) Date: Thu, 30 Nov 2006 12:39:04 CST Subject: [Wtr-general] looking for span class In-Reply-To: <53153414.1164910651079.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <49807613.1164912006839.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> usha,

This is your second (well, first of 2 to be specific) thread asking essentially the same thing. Hopefully my post in the other thread here was helpful, though this post does shed some light on a new angle of your question: ie.links will not expose every link on the page, only those accessible from the top level object ie. If you want to count links down through frames and the like, some more work is going to be required to recursively drill down through the levels, counting on the way.

Now, just as some general advice, try to be more descriptive with what you are trying to do, as well as how you are trying to do it. Had I not responded to your previous question, I would have been at a complete loss for what you were looking for here.

--------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5545&messageID=15422#15422 From forum-watir-users at openqa.org Thu Nov 30 14:20:38 2006 From: forum-watir-users at openqa.org (usha) Date: Thu, 30 Nov 2006 13:20:38 CST Subject: [Wtr-general] looking for span class In-Reply-To: <49807613.1164912006839.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <36869661.1164914483674.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks to you my previous issue is resolved. This one I think is different 'cause 'Blah Links' is not a link but text (of span class)displayed on the page. I'm trying to see if this text exists and how many times it occured in the page. tried these & seeing false ie.span(:id, /list/) . ie.span(:index,2) ie.span(:title , "Blah Links") Thanks --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5545&messageID=15427#15427 From forum-watir-users at openqa.org Thu Nov 30 14:21:45 2006 From: forum-watir-users at openqa.org (usha) Date: Thu, 30 Nov 2006 13:21:45 CST Subject: [Wtr-general] how to verify inside loop of ie.link In-Reply-To: <47817014.1164911499797.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <47527469.1164914535923.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you. It works! --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5543&messageID=15428#15428 From forum-watir-users at openqa.org Thu Nov 30 14:46:42 2006 From: forum-watir-users at openqa.org (Vince) Date: Thu, 30 Nov 2006 13:46:42 CST Subject: [Wtr-general] looking for span class In-Reply-To: <36869661.1164914483674.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <63304797.1164916100290.JavaMail.oqa-j2ee@openqa01.managed.contegix.com>

Are you trying to find text, or spans?

If you're looking for text, then:

search_term = /Blah Links/ ctr = ie.text =~ search_term

=~ returns a count of the times the regex matched, so it's perfect for finding instances...

If you're looking for the number of spans containing a string, then :

ctr = 0
search_term = /Blah Links/
ie.spans.each |s| do
if s.text =~ search_term
ctr = ctr + 1v end
end

It's going to take some getting used to, but you should really try to fish through the documentation for Watir here to get a better feel for what you have available.

--------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5545&messageID=15429#15429 From forum-watir-users at openqa.org Thu Nov 30 14:50:37 2006 From: forum-watir-users at openqa.org (Nathan) Date: Thu, 30 Nov 2006 13:50:37 CST Subject: [Wtr-general] I want to use Watir to test Firefox and Safari Message-ID: <51009756.1164916267478.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I am an experienced developer/tester and have been using Watir for a couple of months now. I have read a lot about Selenium also, and have noted that people are concerned about the need to install Selenium on the server, because it has to be served from the same location as the web page being tested. Well I share this concern, but not because it might be difficult, or because of some other experience reason, rather because it is not good practice, nor will we ever install third party tools on our production servers. This causes a problem with using selenium for my company, and that is that our production environment is generally more stable and better than our dev or qa environments. So what to do? I've read about FireWatir, but have not been able to find much on it. I'd prefer not to rebuild Firefox with that COM-like plugin because that makes it so that I'm not using exactly the same firefox as the rest of the world, and could produce different results than the real world sees, I also am unable to find the plugin for firefox as a separate program plugin. So I guess I can't test firefox or safari with watir. Does anybody know of a way to accomplish what I wish with JUST Watir? Please help, thanks. Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5549&messageID=15431#15431 From forum-watir-users at openqa.org Thu Nov 30 15:04:54 2006 From: forum-watir-users at openqa.org (Vince) Date: Thu, 30 Nov 2006 14:04:54 CST Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: <51009756.1164916267478.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <51758640.1164917124071.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Nathan, Some support for non-IE browsers built into Watir is on a lot of people's todo list, but at least for now you're going to have to look outside of Watir for a solution here. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5549&messageID=15435#15435 From faught at tejasconsulting.com Thu Nov 30 16:26:20 2006 From: faught at tejasconsulting.com (Danny Faught) Date: Thu, 30 Nov 2006 14:26:20 -0700 Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: <51009756.1164916267478.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <51009756.1164916267478.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <456F4C7C.50901@tejasconsulting.com> Nathan wrote: > So I guess I can't test firefox or safari with watir. Does anybody know of a way to accomplish what I wish with JUST Watir? Since you've rejected the port of Watir that works with Firefox, it looks like the answer is that you can't do what you want with Watir. I'm not familiar with FireWatir. Are you thinking that Firefox might have an API that can be accessed without installing a plugin? Using automation always has the potential to perturb the results. You have to assess what the risk of this happening is, and how much you're willing to pay to mitigate that risk. For example, you could choose to use a GUI automation tool to automate Firefox. That's a pretty expensive alternative, IMHO, that probably exceeds the risk exposure of installing a plugin in most contexts. -Danny From forum-watir-users at openqa.org Thu Nov 30 17:00:10 2006 From: forum-watir-users at openqa.org (usha) Date: Thu, 30 Nov 2006 16:00:10 CST Subject: [Wtr-general] looking for span class In-Reply-To: <63304797.1164916100290.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <47575149.1164924054301.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> absolutely! with minor typos corrected : ctr = 0 search_term = /Blah Links/ ie.spans.each do |s| if s.text =~ search_term ctr = ctr + 1 end end Thank you --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5545&messageID=15442#15442 From herr.kreutzer at googlemail.com Thu Nov 30 17:37:07 2006 From: herr.kreutzer at googlemail.com (Christian Kreutzer) Date: Thu, 30 Nov 2006 23:37:07 +0100 Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: <51009756.1164916267478.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <51009756.1164916267478.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: you should give selenium-rc (remote control) a try. there's no need for Installing components on the system under test and it can be scripted in ruby, python, perl, java and c#. it does handle cross browser testing pretty well... Christian On 11/30/06, Nathan wrote: > Hi, I am an experienced developer/tester and have been using Watir for a couple of months now. I have read a lot about Selenium also, and have noted that people are concerned about the need to install Selenium on the server, because it has to be served from the same location as the web page being tested. Well I share this concern, but not because it might be difficult, or because of some other experience reason, rather because it is not good practice, nor will we ever install third party tools on our production servers. This causes a problem with using selenium for my company, and that is that our production environment is generally more stable and better than our dev or qa environments. So what to do? I've read about FireWatir, but have not been able to find much on it. I'd prefer not to rebuild Firefox with that COM-like plugin because that makes it so that I'm not using exactly the same firefox as the rest of the world, and could produce different results than the real wor > ld sees, I also am unable to find the plugin for firefox as a separate program plugin. So I guess I can't test firefox or safari with watir. Does anybody know of a way to accomplish what I wish with JUST Watir? Please help, thanks. > > Nathan > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5549&messageID=15431#15431 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From billagee at gmail.com Thu Nov 30 19:23:52 2006 From: billagee at gmail.com (Bill Agee) Date: Thu, 30 Nov 2006 16:23:52 -0800 Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: <51009756.1164916267478.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <51009756.1164916267478.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <73e7817e0611301623g26dd529ayda37b3b2d0212cc1@mail.gmail.com> As for trying out FireWatir, you can get a prebuilt copy of the JSSh extension (as well as the most recent installation instructions and code) at the google code site: http://firewatir.googlecode.com/svn/trunk/Installation/ If you use that, you shouldn't need to rebuild firefox. I think you can also use the same Watir install for both vanilla IE testing as well as FireWatir, but this involves manually replacing a few watir files with development versions (IIRC). It does take a few extra minutes to set up and get used to using, but FireWatir does work. That said, I haven't been able to make serious use of it yet because of the slow execution speed.
Blah Links: What's This?