Re: [Wtr-general] Passing data between scirpts?

2005-08-29 Thread Ian Phillips
Hi.

Thanks for the suggestions.  I have only just started with WATiR so
still feeling my way into it.  OO is a bit of a new thing for me and I
need to get some thing up and running quickly to demostrate the
benefit of automation.

I have started with a driver script to call my test scripts.  In the
driver script I have set up the environment variables (servers, port
number) for all the called scripts to use.

Where is the usual place for Watir people to store test and envionrment data?

Thank for the help.

Ian

On 8/26/05, Jeff Wood [EMAIL PROTECTED] wrote:
 There is usually a clean way to build something into an object instead
 of simply blasting things to a global variable.
 
 If all of your tests are within a single TestCase object, then you can
 easily use instance variables for that class ( @blah ) and then all of
 the methods within that instance object will have access.
 
 Beyond that, if you have multiple separate TestCase objects then you
 either need to use something like a global ( even if that global is
 simply an object to hold your real globals ... still not the
 recommended solution ... globals are almost always sloppy ) or maybe
 serialize your values out to environment variables or a properties
 file and have each class load it... ( Think YAML! )
 
 Those are the options I would use... Hope that helps.


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Key / value pairs.

2005-08-29 Thread Atilla Ozgur
I think this question answered before. You can search archives. But I
added this to wiki FAQ. I also give wiki text here.

Q. What I'd like to do, is to have a configuration file (eg.
config.txt), which would have a number of key/value pairs, such as
UserName=user, which would be read by a test script to, for example,
log into a page.

A.  You can use ruby file for this. i.e
$user_name = 'atilla'
$last_name = 'ozgur'

save this as initialValues.rb

then in your script you can require initialValues.rb classes and
variables is ready for your use. Do not forget that these are global
variables. Maybe a class and class variables would be more suitable
for this. They will be more encapsulated in that way.

class initialValues
  @@user_name = 'atilla'
  @@last_name = 'ozgur'

end

Note: A variable prefixed with two at signs is a class variable,
accessible within both instance and class methods of the class.

Then you can use them as.

initialValues.user_name
initialValues.last_name

this way, related values will have their place.

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


RE: [Wtr-general] how to determine if checkbox is disabled

2005-08-29 Thread Jan.Montano



Thanks! I know it will raise an exception somehow.

  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]On Behalf Of saud 
  azizSent: Monday, August 29, 2005 1:17 PMTo: 
  wtr-general@rubyforge.orgSubject: Re: [Wtr-general] how to 
  determine if checkbox is disabled
  set() 
  
  This method sets the radio list item or check box.   Raises UnknownObjectException  if its unable to locate an object
ObjectDisabledException  if the object is disabled
  http://wtr.rubyforge.org/rdoc/classes/Watir/RadioCheckCommon.html#M000109
  
  
  
  On 8/28/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: 
  
  even 
if setting a disabled checkbox?-Original Message-From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]]On 
Behalf Of Zeljko FilipinSent: Friday, August 26, 2005 4:43 PMTo: wtr-general@rubyforge.orgSubject: 
Re: [Wtr-general] how to determine if checkbox is 
disabledie.checkbox(:id, "check_box_id").disabledwill 
return false if not disabled, true if disabled (works also for other 
page elements that can be disabled).Checking already checked check 
box does not raise error, just checksit again (also unchecking already 
unchecked check box - just unchecksit again).Zeljko 
2005/8/26, [EMAIL PROTECTED] [EMAIL PROTECTED]: 
What's the best approach to know if a checkbox is disabled or not?  
I could try to set it then just catch the error. but is there a method or 
something? I'm using this site for reference http://wtr.rubyforge.org/rdoc/classes/Watir/ 
 but it seems this is outdated. Is there any 
other link just like the one above? Thanks in advance. 
___ Wtr-general mailing 
list  Wtr-general@rubyforge.org 
http://rubyforge.org/mailman/listinfo/wtr-general___ 
Wtr-general mailing listWtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general 
___Wtr-general 
mailing listWtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general-- "..man is a human being, not because of his physical 
  powers for physically the camel is his superior; not because of his size for 
  the elephant is larger; not because of his courage for the lion is more 
  courageous; not because of his appetite for the ox has the greater; not 
  because of coitus for the least of the birds is more virile than he, but 
  rather by virtue of his noble aims and ideals. [As a matter of fact] he was 
  only created to know." (Al- Ghazali; The book of Knowledge, Section 1) 

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Chris Ellis is out of the office.

2005-08-29 Thread Chris_Ellis




This email is to be read subject to the disclaimer below.

I will be out of the office starting  29/08/2005 and will not return until
05/09/2005.

I will respond to your message when I return. If you have any questions
regarding TI please direct them to Jim Edwards or Amy Holden, Otherwise
I'll answer you when I return


NOTICE - This communication contains information which is confidential and
the copyright of Ernst  Young or a third party.

If you are not the intended recipient of this communication please delete
and destroy all copies and telephone Ernst  Young on 1800 655 717
immediately. If you are the intended recipient of this communication you
should not copy, disclose  or distribute this communication without the
authority of Ernst  Young.

Any views expressed in this Communication are those of the individual
sender, except where the sender specifically states them to be the views of
Ernst  Young.

Except as required at law, Ernst  Young does not represent, warrant and/or
guarantee that the integrity of this communication has been maintained nor
that the communication is free of errors, virus, interception or
interference.

Liability limited by a scheme approved under Professional Standards
Legislation.



If this communication is a commercial electronic message (as defined in
the Spam Act 2003) and you do not wish to receive communications such as
this, please forward this communication to [EMAIL PROTECTED]


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] re:re:more queries

2005-08-29 Thread Nishita Acharya



hello Kingsley Hendrickse,
 
thank you for sending me the program (datahandler.rb)regarding reading frm a csv 
file.It's working fine for me now.
Thanks a lot.

Regards,Nishita AcharyaBangalore.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Undefined method getObject when attempting to do a set on a text field.

2005-08-29 Thread Stephanie Mayfield
I apologize in advance if this question has already been asked.  I'm
new to the list and the hunting and pecking in the archives didn't
turn up an answer.  (Aside: is there a search engine on the archives?)

My problem is I'm getting an error when attempting to do a very simple
assignment to a text field.

require 'WET'
include WET

ie=Browser.new()
ie.goto http://URL here
ie.show_all_objects

puts username object exists:  + ie.TextField(name:=username).to_s
ie.TextField(name:=username).set('first.last')


My output confirms that the username field does in fact exist on the page:

username object exists: WebEdit(name:=username)

But then I get this exception: 


D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3205:in `locate': undefined
method `getObject' for nil:NilClass (NoMethodError)
from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'
from D:/ruby/lib/ruby/site_ruby/1.8/qantom/webobjects/WebEdit.rb:59:in 
`set'
from D:/ruby/myRuby/AdminTest/simple.rb:9

I'm not sure if this is a WET issue or a Watir issue.  What I'm running on is: 
-   Win XP
-   Watir v1.4
-   WET v0.5.1 (for water v1.4, doesn't include the optional component)

Watir by itself access the website just fine, however I have
JavaScript pop-ups so I'm attempting to use WET to access those.

The URL and username do not contain any extended characters.

Assistance is greatly appreciated!

-- 
Steph
Homepage: www.maesah.ca

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Undefined method getObject when attempting to do a set on a text field.

2005-08-29 Thread Raghu Venkataramana

Hi Stephanie,

Are you using a released version of Watir 1.4 or something off the SCM 
repository?


I was trying to locate the source of the problem from your stack trace:

from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'

and in the version(s) of Watir1.4 that I have, I could not find neither
assert_exists method in line number 1766 nor 'set' method at 3368. If you 
are using a version from the SCM could you tell me the exact revision number
so that I could check the same version out here and try it. 


Thanks
Raghu




Stephanie Mayfield wrote:


I apologize in advance if this question has already been asked.  I'm
new to the list and the hunting and pecking in the archives didn't
turn up an answer.  (Aside: is there a search engine on the archives?)

My problem is I'm getting an error when attempting to do a very simple
assignment to a text field.

require 'WET'
include WET

ie=Browser.new()
ie.goto http://URL here
ie.show_all_objects

puts username object exists:  + ie.TextField(name:=username).to_s
ie.TextField(name:=username).set('first.last')


My output confirms that the username field does in fact exist on the page:

username object exists: WebEdit(name:=username)

But then I get this exception: 



D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3205:in `locate': undefined
method `getObject' for nil:NilClass (NoMethodError)
from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'
from D:/ruby/lib/ruby/site_ruby/1.8/qantom/webobjects/WebEdit.rb:59:in 
`set'
from D:/ruby/myRuby/AdminTest/simple.rb:9

I'm not sure if this is a WET issue or a Watir issue.  What I'm running on is: 
-	Win XP

-   Watir v1.4
-   WET v0.5.1 (for water v1.4, doesn't include the optional component)

Watir by itself access the website just fine, however I have
JavaScript pop-ups so I'm attempting to use WET to access those.

The URL and username do not contain any extended characters.

Assistance is greatly appreciated!

 




--
Qantom Software

http://www.qantom.com
Ph : 26799269 Xtn. 125
sip : [EMAIL PROTECTED]
--

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Undefined method getObject when attempting to do a set on a text field.

2005-08-29 Thread Stephanie Mayfield
Raghu,

I installed 1.4 originally then I overwrote that installation via the
gem.  The gem is listed as 1.4.1.
Thanks for looking into this!

Steph


On 8/29/05, Raghu Venkataramana [EMAIL PROTECTED] wrote:
 Hi Stephanie,
 
 Are you using a released version of Watir 1.4 or something off the SCM
 repository?
 
 I was trying to locate the source of the problem from your stack trace:
 
 from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
 from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'
 
 and in the version(s) of Watir1.4 that I have, I could not find neither
 assert_exists method in line number 1766 nor 'set' method at 3368. If you
 are using a version from the SCM could you tell me the exact revision number
 so that I could check the same version out here and try it.
 
 Thanks
 Raghu
 
 
 
 
 Stephanie Mayfield wrote:
 
 I apologize in advance if this question has already been asked.  I'm
 new to the list and the hunting and pecking in the archives didn't
 turn up an answer.  (Aside: is there a search engine on the archives?)
 
 My problem is I'm getting an error when attempting to do a very simple
 assignment to a text field.
 
 require 'WET'
 include WET
 
 ie=Browser.new()
 ie.goto http://URL here
 ie.show_all_objects
 
 puts username object exists:  + ie.TextField(name:=username).to_s
 ie.TextField(name:=username).set('first.last')
 
 
 My output confirms that the username field does in fact exist on the page:
 
 username object exists: WebEdit(name:=username)
 
 But then I get this exception:
 
 
 D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3205:in `locate': undefined
 method `getObject' for nil:NilClass (NoMethodError)
from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'
from 
  D:/ruby/lib/ruby/site_ruby/1.8/qantom/webobjects/WebEdit.rb:59:in `set'
from D:/ruby/myRuby/AdminTest/simple.rb:9
 
 I'm not sure if this is a WET issue or a Watir issue.  What I'm running on 
 is:
 -  Win XP
 -  Watir v1.4
 -  WET v0.5.1 (for water v1.4, doesn't include the optional component)
 
 Watir by itself access the website just fine, however I have
 JavaScript pop-ups so I'm attempting to use WET to access those.
 
 The URL and username do not contain any extended characters.
 
 Assistance is greatly appreciated!
 
 
 
 
 
 --
 Qantom Software
 
 http://www.qantom.com
 Ph : 26799269 Xtn. 125
 sip : [EMAIL PROTECTED]
 --
 
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general
 


-- 
Steph
Homepage: www.maesah.ca

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Clicking OK in MS Explorer Popup window

2005-08-29 Thread Ian Phillips
Hi.

I am deleting an item in my application and I have a 'Microsoft
Internet Explorer' popup window with Ok and Cancel.

I am unable to click the OK button.  This is what I have tried so far:
1.
ie = Watir::IE.attach(:title, /Microsoft Internet Explorer/)
ie.button(:value, OK).click

2. 
require 'watir\winClicker.rb'
w.clickWindowsButton(Microsoft Internet Explorer , OK )

But neither work.  Where am I going wrong?

Thanks 

Ian

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Undefined method getObject when attempting to do a set on a text field.

2005-08-29 Thread Raghu Venkataramana

Hi Stephanie,

This is getting intersting. I just did a gem install of watir myself, 
but still

couldn't find the method 'locate' as shown by:

D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3205:in 
`locate': undefined


However I got the latest version HEAD version from cvs
repository and that version _does_ have the locate method
that is giving you the trouble. I took a quick look at that 
code and unfortunately wet's current version wont work 
with that implementation. For the current version of WET 
you need to make sure that you use the version that got 
installed off from the gem and not the CVS version. 

Your best bet may be to simply copy the Watir.rb from 
d:\ruby\lib\ruby\gems\1.8\gems\watir-1.4.1.rb to 
D:/ruby/lib/ruby/site_ruby/1.8/watir.rb 


Thanks
Raghu





Stephanie Mayfield wrote:


Raghu,

I installed 1.4 originally then I overwrote that installation via the
gem.  The gem is listed as 1.4.1.
Thanks for looking into this!

Steph


On 8/29/05, Raghu Venkataramana [EMAIL PROTECTED] wrote:
 


Hi Stephanie,

Are you using a released version of Watir 1.4 or something off the SCM
repository?

I was trying to locate the source of the problem from your stack trace:

   from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
   from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'

and in the version(s) of Watir1.4 that I have, I could not find neither
assert_exists method in line number 1766 nor 'set' method at 3368. If you
are using a version from the SCM could you tell me the exact revision number
so that I could check the same version out here and try it.

Thanks
Raghu




Stephanie Mayfield wrote:

   


I apologize in advance if this question has already been asked.  I'm
new to the list and the hunting and pecking in the archives didn't
turn up an answer.  (Aside: is there a search engine on the archives?)

My problem is I'm getting an error when attempting to do a very simple
assignment to a text field.

require 'WET'
include WET

ie=Browser.new()
ie.goto http://URL here
ie.show_all_objects

puts username object exists:  + ie.TextField(name:=username).to_s
ie.TextField(name:=username).set('first.last')


My output confirms that the username field does in fact exist on the page:

username object exists: WebEdit(name:=username)

But then I get this exception:


D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3205:in `locate': undefined
method `getObject' for nil:NilClass (NoMethodError)
 from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
 from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'
 from D:/ruby/lib/ruby/site_ruby/1.8/qantom/webobjects/WebEdit.rb:59:in 
`set'
 from D:/ruby/myRuby/AdminTest/simple.rb:9

I'm not sure if this is a WET issue or a Watir issue.  What I'm running on is:
-  Win XP
-  Watir v1.4
-  WET v0.5.1 (for water v1.4, doesn't include the optional component)

Watir by itself access the website just fine, however I have
JavaScript pop-ups so I'm attempting to use WET to access those.

The URL and username do not contain any extended characters.

Assistance is greatly appreciated!



 


--
Qantom Software

http://www.qantom.com
Ph : 26799269 Xtn. 125
sip : [EMAIL PROTECTED]
--

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

   




 




--
Qantom Software

http://www.qantom.com
Ph : 26799269 Xtn. 125
sip : [EMAIL PROTECTED]
--

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Undefined method getObject when attempting to do a set on a text field.

2005-08-29 Thread Stephanie Mayfield
Raghu,

My simple case works!  But I had to replace all the .rb files from the
gem, not just the watir one. I have no idea how I got the CVS version
of Watir installed.  Thanks so much for the help!

Steph



On 8/29/05, Raghu Venkataramana [EMAIL PROTECTED] wrote:
 Hi Stephanie,
 
 This is getting intersting. I just did a gem install of watir myself,
 but still
 couldn't find the method 'locate' as shown by:
 
 D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3205:in
 `locate': undefined
 
 However I got the latest version HEAD version from cvs
 repository and that version _does_ have the locate method
 that is giving you the trouble. I took a quick look at that
 code and unfortunately wet's current version wont work
 with that implementation. For the current version of WET
 you need to make sure that you use the version that got
 installed off from the gem and not the CVS version.
 
 Your best bet may be to simply copy the Watir.rb from
 d:\ruby\lib\ruby\gems\1.8\gems\watir-1.4.1.rb to
 D:/ruby/lib/ruby/site_ruby/1.8/watir.rb
 
 Thanks
 Raghu
 
 
 
 
 
 Stephanie Mayfield wrote:
 
 Raghu,
 
 I installed 1.4 originally then I overwrote that installation via the
 gem.  The gem is listed as 1.4.1.
 Thanks for looking into this!
 
 Steph
 
 
 On 8/29/05, Raghu Venkataramana [EMAIL PROTECTED] wrote:
 
 
 Hi Stephanie,
 
 Are you using a released version of Watir 1.4 or something off the SCM
 repository?
 
 I was trying to locate the source of the problem from your stack trace:
 
 from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
 from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'
 
 and in the version(s) of Watir1.4 that I have, I could not find neither
 assert_exists method in line number 1766 nor 'set' method at 3368. If you
 are using a version from the SCM could you tell me the exact revision number
 so that I could check the same version out here and try it.
 
 Thanks
 Raghu
 
 
 
 
 Stephanie Mayfield wrote:
 
 
 
 I apologize in advance if this question has already been asked.  I'm
 new to the list and the hunting and pecking in the archives didn't
 turn up an answer.  (Aside: is there a search engine on the archives?)
 
 My problem is I'm getting an error when attempting to do a very simple
 assignment to a text field.
 
 require 'WET'
 include WET
 
 ie=Browser.new()
 ie.goto http://URL here
 ie.show_all_objects
 
 puts username object exists:  + ie.TextField(name:=username).to_s
 ie.TextField(name:=username).set('first.last')
 
 
 My output confirms that the username field does in fact exist on the page:
 
 username object exists: WebEdit(name:=username)
 
 But then I get this exception:
 
 
 D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3205:in `locate': undefined
 method `getObject' for nil:NilClass (NoMethodError)
   from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
   from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'
   from 
  D:/ruby/lib/ruby/site_ruby/1.8/qantom/webobjects/WebEdit.rb:59:in `set'
   from D:/ruby/myRuby/AdminTest/simple.rb:9
 
 I'm not sure if this is a WET issue or a Watir issue.  What I'm running on 
 is:
 -  Win XP
 -  Watir v1.4
 -  WET v0.5.1 (for water v1.4, doesn't include the optional component)
 
 Watir by itself access the website just fine, however I have
 JavaScript pop-ups so I'm attempting to use WET to access those.
 
 The URL and username do not contain any extended characters.
 
 Assistance is greatly appreciated!
 
 
 
 
 
 --
 Qantom Software
 
 http://www.qantom.com
 Ph : 26799269 Xtn. 125
 sip : [EMAIL PROTECTED]
 --
 
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general
 
 
 
 
 
 
 
 
 
 --
 Qantom Software
 
 http://www.qantom.com
 Ph : 26799269 Xtn. 125
 sip : [EMAIL PROTECTED]
 --
 
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general
 


-- 
Steph
Homepage: www.maesah.ca

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Consolidate scripts into a master test plan

2005-08-29 Thread Torres, Ben (HQP)
Hi,

I've been writing a test script for each individual test case.  How do I
consolidate all my test scripts into a master test script so all I would
need to execute is the master test script?  Will I need to make each
testcase a function?

Thanks,
Ben


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Consolidate scripts into a master test plan

2005-08-29 Thread Jeff Wood
There are a number of ways you can do it.

You should use the Ruby Test::Unit framework.

From there, you can either wrap each of your existing test scripts
with a function and have one test case object that contains all of
them

Or you can build a separate class to wrap each of your scripts and
then build a TestSuite object to call all of those ...

Either one works, it really depends on the size of your scripts and
how much of the functionality of those tests is duplicated, because
wrapping multiple of those in the same TestCase object would then
allow you to break out that functionality and therefore not repeat
yourself.

Hope that made sense... Ask if you need more detail.

j.

On 8/29/05, Torres, Ben (HQP) [EMAIL PROTECTED] wrote:
 Hi,
 
 I've been writing a test script for each individual test case.  How do I
 consolidate all my test scripts into a master test script so all I would
 need to execute is the master test script?  Will I need to make each
 testcase a function?
 
 Thanks,
 Ben
 
 
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general
 


-- 
So long, and thanks for all the fish

Jeff Wood

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Key / value pairs.

2005-08-29 Thread Jeff Wood
That's one way to do it ... Another is to use YAML which has a pretty
heavy following with the Ruby community in general...

So, the following would do the same ... 

You can simply use a hash to store things... Here's a quick script to
load up a sample

--SCRIPT--
require 'yaml'

config = Hash.new
config[username] = joe
config[password] = pass
config[foo] = bar
config[baz] = 5
config[zoo] = [ 1, 2, 3, 4, 5 ]

File.open( config.yaml, w ) { |file| file  config.to_yaml }
--SCRIPT--

Then in your normal script you can get to this as simply as: 

--SCRIPT--

require 'yaml'

config = YAML.load( File.new( 'config.yaml' ) )

config.each_pair { |key,value| puts #{ key } -- #{ value } }
--SCRIPT--

It's that easy ... YAML is pretty cool.

Hope that helps.

j.

On 8/29/05, Kingsley [EMAIL PROTECTED] wrote:
  
  
 
 Hi 
 
   
 
 You might find this useful: 
 
   
 
 class MissingConfigurationFile  ArgumentError ; end 
 
   
 
 class MyConfig 
 
   
 
 MyConfig = Struct.new(MyConfig, :property, :value) 
 
   
 
 def initialize(config_file) 
 
 begin 
 
 @config = File.readlines(config_file) 
 
 rescue 
 
 raise MissingConfigurationFile, Can't find config file 
 
 end 
 
 end 
 
   
 
 def parse_config_file 
 
 rem_array = [] 
 
 prop_array = [] 
 
 @config.each do |line| 
 
 if line.match(/^#/) 
 
 rem_array  line 
 
 else 
 
 unless line.match(/^\n$/) then prop_array  line.chomp end 
 
 end 
 
 end 
 
 return prop_array - rem_array 
 
 end 
 
   
 
 def properties 
 
 config_hash = {} 
 
 parse_config_file.each do |data| 
 
 split = data.split(=) 
 
 property = split[0].gsub(/\s*/, ) 
 
 value = split[1].gsub(/$\s*/, ).gsub(/^\s*/, ) 
 
 config_hash.store(property,MyConfig.new(property, value)) 
 
 end 
 
 return config_hash 
 
 end 
 
 
 
 end 
 
   
 
 myConfig = MyConfig.new(config.txt).properties 
 
 config_option_name = myConfig['OPTION_NAME].property 
 
 config_option_value = myConfig['OPTION_NAME'].value 
 
   
 
 config.txt 
 
   
 
 # Lines with a # are ignored 
 
 OPTION_NAME = put some value here 
 
 OPTION_2 = more options 
 
   
 
 Hope it's useful 
 
   
 
 Thanks 
 
   
 
 Kingsley 
 
   
 
 -Original Message-
  From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of
 [EMAIL PROTECTED]
  Sent: 29 August 2005 06:40
  To: wtr-general@rubyforge.org
  Subject: [Wtr-general] Key / value pairs. 
 
   
 
 This email is to be read subject to the disclaimer below.
  
  
  Hello all, 
  
  I'm new to Watirr (and Ruby), so forgive me if the question is rather
 simplistic... 
  
  What I'd like to do, is to have a configuration file (eg. config.txt),
 which would have a number of key/value pairs, such as UserName=user, which
 would be read by a test script to, for example, log into a page. Hence, what
 I need, is a method to read each line in a given file; strip off the
 comments (if exist; denoted by #); find the pair based on the key (ie.
 UserName) and get the value (ie. user) and store it in a variable. 
  
  Any help would be greatly appreciated. 
  
  Regards 
  
  Leon 
  
  
  NOTICE - This communication contains information which is confidential and
 the copyright of Ernst  Young or a third party. 
  
  If you are not the intended recipient of this communication please delete
 and destroy all copies and telephone Ernst  Young on 1800 655 717
 immediately. If you are the intended recipient of this communication you
 should not copy, disclose or distribute this communication without the
 authority of Ernst  Young.
  
  Any views expressed in this Communication are those of the individual
 sender, except where the sender specifically states them to be the views of
 Ernst  Young.
  
  Except as required at law, Ernst  Young does not represent, warrant and/or
 guarantee that the integrity of this communication has been maintained nor
 that the communication is free of errors, virus, interception or
 interference.
  
  Liability limited by a scheme approved under Professional Standards
 Legislation.
  
  
  
  If this communication is a commercial electronic message (as defined in
 the Spam Act 2003) and you do not wish to receive communications such as
 this, please forward this communication to [EMAIL PROTECTED] 
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general
 
 
 


-- 
So long, and thanks for all the fish

Jeff Wood

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Undefined method getObject when attempting to do a set on a text field.

2005-08-29 Thread Bret Pettichord
I'm pretty sure than none of the Watir releases included the 'locate' 
method -- that is only in head.


When we created the 1.4.1 release, we were careful to only include minor 
fixes and updates that we were pretty sure would not break WET (for 1.4).


It may be worth noting that the regular installers (either the old 1.4 and 
earlier or the new 1.4.1 one-click installer) install watir into a 
different location than the gem. I do not know what happens if watir is 
installed both ways. I suspect that one would overrule the other, but i 
don't know which.


The best bet is to uninstall one version of Watir before installing a new 
version. Both of the installers for 1.4.1 have uninstall options. (Prior to 
that we didn't.)


Bret

At 10:45 AM 8/29/2005, Raghu Venkataramana wrote:

Hi Stephanie,

This is getting intersting. I just did a gem install of watir myself, but 
still

couldn't find the method 'locate' as shown by:

D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3205:in `locate': undefined

However I got the latest version HEAD version from cvs
repository and that version _does_ have the locate method
that is giving you the trouble. I took a quick look at that code and 
unfortunately wet's current version wont work with that implementation. 
For the current version of WET you need to make sure that you use the 
version that got installed off from the gem and not the CVS version.
Your best bet may be to simply copy the Watir.rb from 
d:\ruby\lib\ruby\gems\1.8\gems\watir-1.4.1.rb to 
D:/ruby/lib/ruby/site_ruby/1.8/watir.rb

Thanks
Raghu





Stephanie Mayfield wrote:


Raghu,

I installed 1.4 originally then I overwrote that installation via the
gem.  The gem is listed as 1.4.1.
Thanks for looking into this!

Steph


On 8/29/05, Raghu Venkataramana [EMAIL PROTECTED] wrote:



Hi Stephanie,

Are you using a released version of Watir 1.4 or something off the SCM
repository?

I was trying to locate the source of the problem from your stack trace:

   from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
   from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'

and in the version(s) of Watir1.4 that I have, I could not find neither
assert_exists method in line number 1766 nor 'set' method at 3368. If you
are using a version from the SCM could you tell me the exact revision number
so that I could check the same version out here and try it.

Thanks
Raghu




Stephanie Mayfield wrote:




I apologize in advance if this question has already been asked.  I'm
new to the list and the hunting and pecking in the archives didn't
turn up an answer.  (Aside: is there a search engine on the archives?)

My problem is I'm getting an error when attempting to do a very simple
assignment to a text field.

require 'WET'
include WET

ie=Browser.new()
ie.goto http://URL here
ie.show_all_objects

puts username object exists:  + ie.TextField(name:=username).to_s
ie.TextField(name:=username).set('first.last')


My output confirms that the username field does in fact exist on the page:

username object exists: WebEdit(name:=username)

But then I get this exception:


D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3205:in `locate': undefined
method `getObject' for nil:NilClass (NoMethodError)
 from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
 from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'
 from 
D:/ruby/lib/ruby/site_ruby/1.8/qantom/webobjects/WebEdit.rb:59:in `set'

 from D:/ruby/myRuby/AdminTest/simple.rb:9

I'm not sure if this is a WET issue or a Watir issue.  What I'm running 
on is:

-  Win XP
-  Watir v1.4
-  WET v0.5.1 (for water v1.4, doesn't include the optional component)

Watir by itself access the website just fine, however I have
JavaScript pop-ups so I'm attempting to use WET to access those.

The URL and username do not contain any extended characters.

Assistance is greatly appreciated!





--
Qantom Software

http://www.qantom.com
Ph : 26799269 Xtn. 125
sip : [EMAIL PROTECTED]
--

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general









--
Qantom Software

http://www.qantom.com
Ph : 26799269 Xtn. 125
sip : [EMAIL PROTECTED]
--

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


_
 Bret Pettichord
 www.pettichord.com

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Re: [ wtr-Feature Requests-1371 ] methods for visible/hidden

2005-08-29 Thread Bret Pettichord

Ron made this helpful comment to a recent feature request:


Comment By: Ron Evans (greatbignoise)
Date: 2005-08-26 19:19

Message:
Try adding this code to the ObjectActions class:

# This method checks to see if a control is visible or not
#   raises: UnknownObjectException  if the object is not found
def visible?
object_exist_check
return false if @o.style.visibility == hidden
return true
end


You can then use an assert like the following:
assert(@ie.text_field(:id, Text2).visible?)


I just wanted to point out that one of the great things about Ruby is that 
you can implement suggestions like this without actually changing watir.rb. 
Thus:


  class ObjectActions
def visible?
object_exist_check
return false if @o.style.visibility == hidden
return true
end
  end


You can load this code and add the feature right away. You don't have to 
patch watir.rb or wait for us to include it in a release. (If you look in 
watir.rb, you'll see that we actually add methods to the String and Regexp 
classes ourselves.)


This is one of the few features of Ruby that put it way ahead of what you 
can do in Python. The technical description of this feature is 'classes are 
always open.' (Actually you *can* freeze classes in Ruby, but i've never 
seen it done.)


(Also note that the ObjectActions class was renamed as Elements in 1.4)

Bret


_
 Bret Pettichord
 www.pettichord.com

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] unittest failures in head

2005-08-29 Thread Bret Pettichord

At 09:38 PM 8/26/2005, Paul Rogers wrote:
The first time I ran ( all_tests.rb), somethig went wrong about the time 
the screen capture tests ran - IE closed and every test after that failed.


This also happens to me.


Second time I got this:

  1) Error:
test_table_from_element(TC_Tables):
NoMethodError: undefined method `parentElement' for nil:NilClass
c:/watir_cvs/watir/unittests/../watir.rb:2290:in `create_from_element'
c:/watir_cvs/watir/unittests/../unittests/table_test.rb:175:in 
`test_table_from_element'


192 tests, 1081 assertions, 0 failures, 1 errors


Fixed in head.



_
 Bret Pettichord
 www.pettichord.com

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Help : new to Watir

2005-08-29 Thread Bret Pettichord
You can run watir with the -b switch to make it faster. We are also working 
on other methods to improve performance.


But 200 sessions is a lot for watir. Most boxes cannot support that many 
instances of IE, whether you are using watir or just creating IE sessions 
manually.


So i agree with Jeff.

At 03:14 PM 8/26/2005, Jeff Wood wrote:

It sounds like you are doing load testing which is not what I think
WATiR is intended for.

WATiR is meant for functional/procedural testing.

If you are simply wanting to load/perf-test large quantities of
simultaneous sessions on the system ... That would possibly be better
suited for simple HTTP calls directly... ( like using uri-open or wget
and/or curl )

That's my $0.02 ... YMMV

j.

On 8/26/05, Murtaza Lokhandwala [EMAIL PROTECTED] wrote:
 Hi Everybody,

 I started using WATIR to write my first web
 application test script two ago.

 -- The web page I am testing has approximately 6 input
 boxes and 7 drop down boxes for each record. And I am
 displaying 10 records per page. To view more user have
 to use 'Next ' or ' Previous' buttons.

 I started with hard coded values to have a feel of
 WATIR. The script is working but I was planning to use
 it to load the web server / database by creating 200
 sessions. And each session creating 1 form having
 approx 50 transactions.

 Using the script I created couple of forms but each
 form is taking approximately 12-14 min for 20
 transactions.

 I am attaching the script for the review. Please help
 me me in making the script more efficient. Because the
 test case I am handling needs 200 such sessions.

 Thank you very much.

 Murtaza



 __
 Yahoo! Mail for Mobile
 Take Yahoo! Mail with you! Check email on your mobile phone.
 http://mobile.yahoo.com/learn/mail

 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general






--
So long, and thanks for all the fish

Jeff Wood

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


_
 Bret Pettichord
 www.pettichord.com

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] [ wtr-Stories-2338 ] rdoc on website needs update

2005-08-29 Thread noreply
Stories item #2338, was opened at 2005-08-30 00:24
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detailatid=1999aid=2338group_id=104

Category: Website
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Bret Pettichord  (bret)
Assigned to: Nobody (None)
Summary: rdoc on website needs update

Initial Comment:
I'm using this site for reference http://wtr.rubyforge.org/rdoc/classes/Watir/
but it seems this is outdated.

-- Is currently at 1.2. Should be 1.4.1.

--

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detailatid=1999aid=2338group_id=104
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Any intellisense IDE for Ruby? Also WatirMaker rocks..

2005-08-29 Thread Bret Pettichord

At 12:12 AM 8/25/2005, saud aziz wrote:
For now i want to know if there is any IDE for Ruby that provides 
intellisense? Ecllipse plug-in maybe anyone...?


No.


_
 Bret Pettichord
 www.pettichord.com

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general