[Wtr-general] Best way to log Watir output?

2006-07-19 Thread Adam Reed
What is the best way to create a log file, or otherwise manipulate Watir
test output?

I am looking a building a framework for testing, and it would be nice to
output test results to a webpage, flat file, or even to a dashboard
results window.  I would want to include variables used (eg,
username/password for a login script, this seems straightforward), but
most importantly assertion results, test date and time, etc.

Thanks,
Adam 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Tuesday, July 18, 2006 9:37 PM
To: wtr-general@rubyforge.org
Subject: Wtr-general Digest, Vol 32, Issue 26

Send Wtr-general mailing list submissions to
wtr-general@rubyforge.org

To subscribe or unsubscribe via the World Wide Web, visit
http://rubyforge.org/mailman/listinfo/wtr-general
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]

You can reach the person managing the list at
[EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific than
Re: Contents of Wtr-general digest...


Today's Topics:

   1. Re: Install problem? (Simo, Ben)
   2. problem with nested frames (Xavier Noria)
   3. for loop syntax?? (mi)
   4. Page Loading Problem (David Solis)


--

Message: 1
Date: Tue, 18 Jul 2006 13:34:18 -0600
From: Simo, Ben [EMAIL PROTECTED]
Subject: Re: [Wtr-general] Install problem?
To: wtr-general@rubyforge.org
Message-ID:

[EMAIL PROTECTED]
Content-Type: text/plain; charset=iso-8859-1

I just reinstalled WATIR using the GEM file instead of the one-step
install.  Now it works.  Thank you.
 
 
Ben

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Cain, Mark
Sent: Tuesday, July 18, 2006 1:30 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Install problem?



I just remembered, one of the last times I installed ruby (either rc 3
or final I can't remember which) blew away ALL of my path information.
You might check to make sure ruby/bin and ruby/lib are in your path
environment variable.

 

--Mark

 


  _  


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Simo, Ben
Sent: Tuesday, July 18, 2006 12:21 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Install problem?

 

Mark,

 

Thanks, but that didn't seem to fix the problem.  I am having the same
problem on two different Windows XP PCs (one SP1, the other SP2). 

 

Ben

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Cain, Mark
Sent: Tuesday, July 18, 2006 8:14 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Install problem?

I have always had to install rubygems for a new ruby install.

 

Get the gem here:

http://rubyforge.org/projects/rubygems/

 

Download it somewhere.  Open a command prompt and navigate to where you
downloaded it.  Type gem install rubygems*.gem

 

This fix the same problem for me on a new install.

 

Hope this helps,

 

--Mark

 


  _  


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Simo, Ben
Sent: Monday, July 17, 2006 3:45 PM
To: Wtr-general@rubyforge.org
Subject: [Wtr-general] Install problem?

 

Hello, 

I have just installed Ruby and WATIR on a Windows XP box. 

When I try to run the unit tests, I get an error stating that
gem_original_require is missing. 

 

C:\watir\unittestsall_tests.rb
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- watir (LoadError)

from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require' 
from C:/watir/unittests/../unittests/setup.rb:4 
from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require' 
from C:/watir/unittests/all_tests.rb:4 

 

I'm not sure if it matters: when I installed WATIR from the .exe
package, I got errors about not being able to write to c:\watir until I
manually created the directory.  I manually created the c:\watir
directory and then installed to it.

Any ideas why I can't run the all_tests.rb script? 

Thank you, 

Ben Simo 

 


  _  


The information contained in this message is intended only for the
recipient, and may be a confidential attorney-client communication or
may otherwise be privileged and confidential and protected from
disclosure. If the reader of this message is not the intended recipient,
or an employee or agent responsible for delivering this message to the
intended recipient, please be aware that any dissemination or copying of
this communication is strictly prohibited. If you have received this
communication in error, please immediately notify us by replying to the
message and deleting it from your computer. 


  _  


-- next part --
An HTML attachment was scrubbed...
URL:

Re: [Wtr-general] selecting multiple values from on list and passing itto other list

2006-07-19 Thread Cain, Mark








You could do something like this:



 dbList = $ie.select_list( :name, 'assigned').getAllContents

 

 for dbl in dbList

 $ie.selectBox( :name, 'assigned').select(#{dbl})


end



Hope this helps,







--Mark















From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of VIKASH KUMAR
Sent: Tuesday, July 18, 2006 10:52
PM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] selecting
multiple values from on list and passing itto other list







Sir,











I am
facing a problem in selecting multiple values from a list and passing it over
to another list box with any button click, it should do it automatically.











for
example the list is as given below:











select
id=assigned name=assigned size=8
multiple=multiple class=addList
alloptions=availableGroups alt=permissions

option
value=viewUserSecurityviewUserSecurity/option
option
value=viewUserviewUser/option
option
value=viewTransactionInboxviewTransactionInbox/option
 option
value=viewTradeCancelviewTradeCancel/option





/select

















and
the other list as :











select
id=availableSystem name=availableSystem
size=8 multiple=multiple







/select

















Please send me a
solution for selecting multiple values from list assigned and
passing it over to list availableSystem, without any button click
event.











Thanks
in advance.











Vikash
Kumar



 







Find
out what India is talking
about on Yahoo!
Answers India.
Send FREE SMS from New Yahoo! Messenger to Mobile: Download NOW!






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

Re: [Wtr-general] for loop syntax??

2006-07-19 Thread Charley Baker
Your loop is 0-9 which is 10, your arrays are only 9 items long. You've overshot it by one. for x in 0..8 do...-CharleyOn 7/19/06, 
Cain, Mark [EMAIL PROTECTED] wrote:You will need to these:
require 'test/unit'require 'test/unit/ui/console/testrunner'require 'watir/testUnitAddons'require 'watir/testcase'I usually add the setup.rb from the unittest directory instead becausethese requires are already in it.
--Mark-Original Message-From: [EMAIL PROTECTED][mailto:[EMAIL PROTECTED]
] On Behalf Of miSent: Tuesday, July 18, 2006 4:23 PMTo: wtr-general@rubyforge.orgSubject: [Wtr-general] for loop syntax??Hi all,I'm using a for loop to access arrays to fillall the text fields in my
forms.For some reason, i'm getting the following error at the end ofthe for loop execution???c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists': Unableto locate object, using name and
(Watir::Exception::UnknownObjectException)from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3382:in `set'from c:/ruby/lib/ruby/site_ruby/1.8/watir/watir_simple.rb:402:in`fill_text_field'from SmokeTest.rb
:25from SmokeTest.rb:24Thanks in advance!my code require 'watir' # the watir controller\ require 'watir/watir_simple' include Watir include Watir::Simple
 Simple1 = Simpletest_site = 'http://dev01.pheedo.com'pubInfoTextFields =['user', 'email', 'password', 'repass', 'url','ssn', 'payment_address', 'payment_city', 'payment_zip']
pubInfo =['pubUserName', '[EMAIL PROTECTED]', '1', '1','http://www.test.com', '1234', '123 st', 'some city', '97035']#[user name, emaildAdd, passwd1, passwd2, yourSite, TaxID, StreetAdd,
CityName, State, ZipCode]Simple1.new_browser_at(test_site)Simple1.click_link_with_text(Sign up now)#same asSimple::click_link_with_text(Sign up now) #click on Publisher's sign up page
 Simple1.click_link_with_url(test_site+/register.phdo?mode=publish)#Enter all the required fieldsx=0for x in 0..9 doSimple1.fill_text_field(pubInfoTextFields[x], pubInfo[x])puts pubInfoTextFields = +pubInfoTextFields[x]+ pubInfo =
+pubInfo[x]end___Wtr-general mailing listWtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general___Wtr-general mailing listWtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Page Loading Problem

2006-07-19 Thread Charley Baker
You can turn off image loading in the ie options dialog under advanced. I'm not aware of any other way to set Watir not to wait for ready state from the browser. -CharleyOn 7/18/06, 
David Solis [EMAIL PROTECTED] wrote:
I have a problem with a site taking too long to load. I'm hoping somebody can point in the right direction.   The test environment in which my script runs takes a long time to load images. The following statement waits for the page to be loaded:
$ie.text_field(:name, username).set(casino_user) Is there a way that I can force this statement to start running without waiting for the page to completely load?
  class LoginCasino  def initialize(casino_user, casino_password, casino_url, casino_submit_key, cgc_submit_key)  $ie = Watir::IE.start(casino_url) if $ie.contains_text(Username:)
 $ie.goto($casino_url+/security/logoff.do) end  $ie.text_field(:name,
 username).set(casino_user) $ie.text_field(:name, password).set(casino_password) if (($casino_url=~/wpt/) || ($casino_url=~/msn/) || ($casino_url=~/vgfo/))  $ie.button(:value, casino_submit_key).click
 elsif (($casino_url=~/cqa/) || ($casino_url=~/cdev/)) $ie.button(:value, cgc_submit_key).click end  #$ie.image(:src, submit_key).click() end   def logout (casino_url)
 if (($casino_url=~/wpt/) || ($casino_url=~/msn/) || ($casino_url=~/vgfo/)) $ie.goto($casino_url+/security/logoff.do) elsif (($casino_url=~/cqa/) ||
 ($casino_url=~/cdev/)) $ie.link(:text, Log Out).click end end  def shutdown $ie.close sleep 1 endend  
___Wtr-general mailing listWtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Best way to log Watir output?

2006-07-19 Thread Charley Baker
Adam,  If you want to create a log file look at logger which is a Ruby library, Watir makes use of it in WatirLogger. Otherwise if you're looking for a junit type of test run dashboard and you're using Test::Unit, take a look at Test Unit Reporter: 
http://rubyforge.org/frs/?group_id=319It can dump out reports in either html or xml. -CharleyOn 7/19/06, 
Adam Reed [EMAIL PROTECTED] wrote:
What is the best way to create a log file, or otherwise manipulate Watirtest output?I am looking a building a framework for testing, and it would be nice tooutput test results to a webpage, flat file, or even to a dashboard
results window.I would want to include variables used (eg,username/password for a login script, this seems straightforward), butmost importantly assertion results, test date and time, etc.
Thanks,Adam
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Best way to log Watir output?

2006-07-19 Thread Michael Bolton
Ruby's Logger object?  What do you mean by best?

---Michael B.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Adam Reed
Sent: July 19, 2006 9:51 AM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Best way to log Watir output?

What is the best way to create a log file, or otherwise manipulate Watir
test output?

I am looking a building a framework for testing, and it would be nice to
output test results to a webpage, flat file, or even to a dashboard
results window.  I would want to include variables used (eg,
username/password for a login script, this seems straightforward), but
most importantly assertion results, test date and time, etc.

Thanks,
Adam 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Tuesday, July 18, 2006 9:37 PM
To: wtr-general@rubyforge.org
Subject: Wtr-general Digest, Vol 32, Issue 26

Send Wtr-general mailing list submissions to
wtr-general@rubyforge.org

To subscribe or unsubscribe via the World Wide Web, visit
http://rubyforge.org/mailman/listinfo/wtr-general
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]

You can reach the person managing the list at
[EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific than
Re: Contents of Wtr-general digest...


Today's Topics:

   1. Re: Install problem? (Simo, Ben)
   2. problem with nested frames (Xavier Noria)
   3. for loop syntax?? (mi)
   4. Page Loading Problem (David Solis)


--

Message: 1
Date: Tue, 18 Jul 2006 13:34:18 -0600
From: Simo, Ben [EMAIL PROTECTED]
Subject: Re: [Wtr-general] Install problem?
To: wtr-general@rubyforge.org
Message-ID:

[EMAIL PROTECTED]
Content-Type: text/plain; charset=iso-8859-1

I just reinstalled WATIR using the GEM file instead of the one-step
install.  Now it works.  Thank you.
 
 
Ben

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Cain, Mark
Sent: Tuesday, July 18, 2006 1:30 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Install problem?



I just remembered, one of the last times I installed ruby (either rc 3
or final I can't remember which) blew away ALL of my path information.
You might check to make sure ruby/bin and ruby/lib are in your path
environment variable.

 

--Mark

 


  _  


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Simo, Ben
Sent: Tuesday, July 18, 2006 12:21 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Install problem?

 

Mark,

 

Thanks, but that didn't seem to fix the problem.  I am having the same
problem on two different Windows XP PCs (one SP1, the other SP2). 

 

Ben

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Cain, Mark
Sent: Tuesday, July 18, 2006 8:14 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Install problem?

I have always had to install rubygems for a new ruby install.

 

Get the gem here:

http://rubyforge.org/projects/rubygems/

 

Download it somewhere.  Open a command prompt and navigate to where you
downloaded it.  Type gem install rubygems*.gem

 

This fix the same problem for me on a new install.

 

Hope this helps,

 

--Mark

 


  _  


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Simo, Ben
Sent: Monday, July 17, 2006 3:45 PM
To: Wtr-general@rubyforge.org
Subject: [Wtr-general] Install problem?

 

Hello, 

I have just installed Ruby and WATIR on a Windows XP box. 

When I try to run the unit tests, I get an error stating that
gem_original_require is missing. 

 

C:\watir\unittestsall_tests.rb
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- watir (LoadError)

from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require' 
from C:/watir/unittests/../unittests/setup.rb:4 
from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require' 
from C:/watir/unittests/all_tests.rb:4 

 

I'm not sure if it matters: when I installed WATIR from the .exe
package, I got errors about not being able to write to c:\watir until I
manually created the directory.  I manually created the c:\watir
directory and then installed to it.

Any ideas why I can't run the all_tests.rb script? 

Thank you, 

Ben Simo 

 


  _  


The information contained in this message is intended only for the
recipient, and may be a confidential attorney-client communication or
may otherwise be privileged and confidential and protected from
disclosure. If the reader of this message is not the intended recipient,
or an employee or agent responsible for delivering this message to the
intended recipient, please be aware that any dissemination or copying of
this communication is strictly prohibited. If you have 

Re: [Wtr-general] Best way to log Watir output?

2006-07-19 Thread Adam Reed
 To: wtr-general@rubyforge.org
 Subject: [Wtr-general] for loop syntax??

 Hi all,

 I'm using a for loop to access arrays to fill  all the text fields in 
 my

 forms.  For some reason, i'm getting the following error at the end of

 the for loop execution???
 c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists': 
 Unable to locate object, using name and
 (Watir::Exception::UnknownObjectException)
 from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3382:in `set'
 from c:/ruby/lib/ruby/site_ruby/1.8/watir/watir_simple.rb:402:in
 `fill_text_field'
 from SmokeTest.rb:25
 from SmokeTest.rb:24


 Thanks in advance!

 my code

 require 'watir'   # the watir controller\
 require 'watir/watir_simple'
 include Watir
 include Watir::Simple

 Simple1 = Simple

 test_site = 'http://dev01.pheedo.com'
 pubInfoTextFields =  ['user', 'email', 'password', 'repass', 'url', 
 'ssn', 'payment_address', 'payment_city', 'payment_zip'] pubInfo =  
 ['pubUserName', '[EMAIL PROTECTED]', '1', '1', 'http://www.test.com', 
 '1234', '123 st', 'some city', '97035'] #[user name, emaildAdd, 
 passwd1, passwd2, yourSite, TaxID, StreetAdd, CityName, State, 
 ZipCode]

 Simple1.new_browser_at(test_site)
 Simple1.click_link_with_text(Sign up now)  #same as 
 Simple::click_link_with_text(Sign up now)

 #click on Publisher's sign up page
 Simple1.click_link_with_url(test_site+/register.phdo?mode=publish)

 #Enter all the required fields
 x=0
 for x in 0..9 do
   Simple1.fill_text_field(pubInfoTextFields[x], pubInfo[x])
   puts pubInfoTextFields = +pubInfoTextFields[x]+   pubInfo =
 +pubInfo[x]
 end

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

-- next part --
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/wtr-general/attachments/20060719/0a9c6244
/attachment-0001.html 

--

Message: 3
Date: Wed, 19 Jul 2006 08:58:34 -0600
From: Charley Baker [EMAIL PROTECTED]
Subject: Re: [Wtr-general] Page Loading Problem
To: wtr-general@rubyforge.org
Message-ID:
[EMAIL PROTECTED]
Content-Type: text/plain; charset=iso-8859-1

You can turn off image loading in the ie options dialog under advanced.
I'm not aware of any other way to set Watir not to wait for ready state
from the browser.

-Charley

On 7/18/06, David Solis [EMAIL PROTECTED] wrote:

 I have a problem with a site taking too long to load.  I'm hoping 
 somebody can point in the right direction.
 The test environment in which my script runs takes a long time to load

 images. The following statement waits for the page to be loaded:

 $ie.text_field(:name, username).set(casino_user)

 Is there a way that I can force this statement to start running 
 without waiting for the page to completely load?

 class LoginCasino
   def initialize(casino_user, casino_password, casino_url, 
 casino_submit_key, cgc_submit_key)
   $ie = Watir::IE.start(casino_url)
   if $ie.contains_text(Username:)
 $ie.goto($casino_url+/security/logoff.do)
   end
   $ie.text_field(:name, username).set(casino_user)
   $ie.text_field(:name, password).set(casino_password)
 if (($casino_url=~/wpt/) || ($casino_url=~/msn/) ||
 ($casino_url=~/vgfo/))
   $ie.button(:value, casino_submit_key).click
 elsif (($casino_url=~/cqa/) || ($casino_url=~/cdev/))
   $ie.button(:value, cgc_submit_key).click
 end

  #$ie.image(:src, submit_key).click()
   end
   def logout (casino_url)
 if (($casino_url=~/wpt/) || ($casino_url=~/msn/) ||
 ($casino_url=~/vgfo/))
   $ie.goto($casino_url+/security/logoff.do)
 elsif (($casino_url=~/cqa/) || ($casino_url=~/cdev/))
   $ie.link(:text, Log Out).click
 end
   end

   def shutdown
$ie.close
sleep 1
   end
 end


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


-- next part --
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/wtr-general/attachments/20060719/431ca445
/attachment-0001.html 

--

Message: 4
Date: Wed, 19 Jul 2006 09:04:29 -0600
From: Charley Baker [EMAIL PROTECTED]
Subject: Re: [Wtr-general] Best way to log Watir output?
To: wtr-general@rubyforge.org
Message-ID:
[EMAIL PROTECTED]
Content-Type: text/plain; charset=iso-8859-1

Adam,

  If you want to create a log file look at logger which is a Ruby
library, Watir makes use of it in WatirLogger. Otherwise if you're
looking for a junit type of test run dashboard and you're using
Test::Unit, take a look at Test Unit Reporter:
http://rubyforge.org/frs/?group_id=319
It can dump out reports in either html or xml

Re: [Wtr-general] for loop syntax??

2006-07-19 Thread mi
ahhh, That was it!!!  I'm just NOT used to start an iteration 
form 0:-(  THANKS a million

Charley Baker wrote:
 Your loop is 0-9 which is 10, your arrays are only 9 items long. 
 You've overshot it by one.

 for x in 0..8 do
 ...

 -Charley

 On 7/19/06, * Cain, Mark* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
 wrote:

 You will need to these:

 require 'test/unit'
 require 'test/unit/ui/console/testrunner'
 require 'watir/testUnitAddons'
 require 'watir/testcase'

 I usually add the setup.rb from the unittest directory instead because
 these requires are already in it.

 --Mark

 -Original Message-
 From: [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]] On Behalf Of mi
 Sent: Tuesday, July 18, 2006 4:23 PM
 To: wtr-general@rubyforge.org mailto:wtr-general@rubyforge.org
 Subject: [Wtr-general] for loop syntax??

 Hi all,

 I'm using a for loop to access arrays to fill  all the text fields
 in my

 forms.  For some reason, i'm getting the following error at the end of
 the for loop execution???
 c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists':
 Unable
 to locate object, using name and
 (Watir::Exception::UnknownObjectException)
 from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3382:in `set'
 from c:/ruby/lib/ruby/site_ruby/1.8/watir/watir_simple.rb:402:in
 `fill_text_field'
 from SmokeTest.rb :25
 from SmokeTest.rb:24


 Thanks in advance!

 my code

 require 'watir'   # the watir controller\
 require 'watir/watir_simple'
 include Watir
 include Watir::Simple

 Simple1 = Simple

 test_site = 'http://dev01.pheedo.com'
 pubInfoTextFields =  ['user', 'email', 'password', 'repass', 'url',
 'ssn', 'payment_address', 'payment_city', 'payment_zip']
 pubInfo =  ['pubUserName', '[EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]', '1', '1',
 'http://www.test.com', '1234', '123 st', 'some city', '97035']
 #[user name, emaildAdd, passwd1, passwd2, yourSite, TaxID, StreetAdd,
 CityName, State, ZipCode]

 Simple1.new_browser_at(test_site)
 Simple1.click_link_with_text(Sign up now)  #same as
 Simple::click_link_with_text(Sign up now)

 #click on Publisher's sign up page
 Simple1.click_link_with_url(test_site+/register.phdo?mode=publish)

 #Enter all the required fields
 x=0
 for x in 0..9 do
   Simple1.fill_text_field(pubInfoTextFields[x], pubInfo[x])
   puts pubInfoTextFields = +pubInfoTextFields[x]+   pubInfo =
 +pubInfo[x]
 end

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


 

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


Re: [Wtr-general] for loop syntax??

2006-07-19 Thread Chris McMahon
On 7/19/06, mi [EMAIL PROTECTED] wrote:
 ahhh, That was it!!!  I'm just NOT used to start an iteration
 form 0:-(  THANKS a million

Ruby folks don't generally use for loops:


1.upto 9 do |x|
  puts x
  end

ruby loop.rb
1
2
3
4
5
6
7
8
9
Exit code: 0
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] for loop syntax??

2006-07-19 Thread Paul Carvalho
Ruby rocks! My fav is: 9.times{|x|putsx}It doesn't get any clearer for me than just telling it how many times I want it to loop without worrying about extra syntax that I'm likely to get wrong.. ;)
On 19/07/06, Chris McMahon [EMAIL PROTECTED] wrote:
On 7/19/06, mi [EMAIL PROTECTED] wrote: ahhh, That was it!!!I'm just NOT used to start an iteration form 0:-(THANKS a millionRuby folks don't generally use for loops:
1.upto 9 do |x|puts xendruby loop.rb123456789Exit code: 0
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] for loop syntax??

2006-07-19 Thread Rand Thacker
Let's not forget the each_index method, then the size of the array no longer matters:pubInfoTextFields.each_index {|x| Simple1.fill_text_field(pubInfoTextFields[x], pubInfo[x])  puts pubInfoTextFields = +pubInfoTextFields[x]+  pubInfo = +pubInfo[x]
}On 7/19/06, Paul Carvalho [EMAIL PROTECTED] wrote:
Ruby rocks! My fav is: 9.times{|x|putsx}It doesn't get any clearer for me than just telling it how many times I want it to loop without worrying about extra syntax that I'm likely to get wrong.. ;)

On 19/07/06, Chris McMahon 
[EMAIL PROTECTED] wrote:
On 7/19/06, mi [EMAIL PROTECTED] wrote: ahhh, That was it!!!I'm just NOT used to start an iteration
 form 0:-(THANKS a millionRuby folks don't generally use for loops:
1.upto 9 do |x|puts xendruby loop.rb123456789Exit code: 0

___Wtr-general mailing listWtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
-- I am the most humble person in the world!
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Best way to log Watir output?

2006-07-19 Thread Michael Bolton
The only resource I was able to find online pointed me back to
the test_logger.rb script in watir/examples/logging.  This script
manually logs each action by doing a result/escape on each assertion to
output the result to a .txt file.  While this works, it's tedious and
inefficient for a large script.  I thought there would have to be a
better way, such as grabbing the SCIte output, since it contains
exactly what I would want.

If all you want to do it to grab the output, the simple thing to do is to
pipe the output to a file:

myscript.rb  outputfile.txt

That's simplest; it may not be best.

Someone has now suggested that I take a look at WET to accompany
Ruby.  Is this, or another method, an accepted best practice as far as
Watir scripting goes?

There are no best practices.  Who cares what other people claim is best?
What works for /you/?

---Michael B.

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


Re: [Wtr-general] How to handle tab buttons

2006-07-19 Thread Zeljko Filipin
Your tab is just a cell in a table.ie.cell(:id, tbJobstd0).click
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Just wanted to invoke click event where the button have parameters in it

2006-07-19 Thread Zeljko Filipin
HTML that you provided is not valid. Three tags have the same id. Ids should be unique.Can you ask your developer to changebutton id=delete  'KH');Delete/button
to button id=KH  'KH');Delete/buttonIn short, change id=delete to id=KH.Then you could access it like this
ie.button(:id, KH).clickOn 7/19/06, VIKASH KUMAR [EMAIL PROTECTED] wrote:

Sir,  In my web page there are lots of buttons having same name, they are called using _javascript_. They are as follows:
  button type=button name=delete id=delete  'BF');Delete/button
button type=button name=delete id=delete  'BI');Delete/buttonbutton type=button name=delete id=delete  'KH');Delete/button
  ie.button(:index,3).click, this works great if we know the index, but if
 someone just doesn't know the index,knows only the parameter which is ('delete', 'KH'), then what is the solution for it?Please send me the solution for this.  Thanks in Advance
With Regards  Vikash Kumar 
	

	
		 
Find out what India is talking about on 
Yahoo! Answers India. 
Send FREE SMS from New Yahoo! Messenger to Mobile: Download 
NOW!
___Wtr-general mailing listWtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] File Download dialog never gets attached/found

2006-07-19 Thread John Krystynak
I want to get Watir to load a page, press a download file button and
save the file.

This first part works fine - and the File Download dialog comes up
-  PART 1 
require 'Watir'
include Watir

ie = IE.new
ie.goto(http://example.com;)
ie.button(:value,Login).click
ie.link(:id, csv_link).click

-

If I run PART 1 from the command line, it never exits, it just keeps
running while the File Download dialog is up.

However, if I include the autoit code (below) in the same file, it
never clicks the file dialog.

If I kill it the running PART I script, and then run the following:

% ruby autoitFS.rb myfile

where the autoitFS.rb is code like this:
- autoitFS.rb -
require 'win32ole'

autoit = WIN32OLE.new(AutoItX3.Control)
file = ARGV[0]

autoit.WinWait(File Download)
autoit.ControlClick(File Download, Would you like to open the file
or save it to your computer?, Save)
autoit.WinWait(Save As, Save in, 3)
autoit.ControlSetText(Save As, Save in, Edit1, E\:\\Docs\\ +
file + .csv)
autoit.ControlClick(Save As, Save in, Save)

--

It works...

To summarize: it works if I run the scripts separately - and I Ctrl-C
the first script when the dialog comes up.  It doesn't work if I
combine the scripts into one ruby file.

How can I get this to work from within one .rb file so I can loop over
a bunch of URLs?
Also, how can I get the first script to exit by itself?

I tried doing this from at the bottom of PART 1

system( ruby autoitFS.rb myfile )

but nothing happenend.

Thanks,
johnk

-- 
Compare New  Used Networking Equipment
http://routercomp.com
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] for loop syntax??

2006-07-19 Thread manishs
Does these constructs provide the current index value somehow?
Regards,
Manish


On Wednesday 19 July 2006 21:50, Paul Carvalho wrote:
 Ruby rocks!  My fav is:

   9.times {|x| puts x}

 It doesn't get any clearer for me than just telling it how many times I
 want it to loop without worrying about extra syntax that I'm likely to get
 wrong.. ;)

 On 19/07/06, Chris McMahon [EMAIL PROTECTED] wrote:
  On 7/19/06, mi [EMAIL PROTECTED] wrote:
   ahhh, That was it!!!  I'm just NOT used to start an iteration
   form 0:-(  THANKS a million
 
  Ruby folks don't generally use for loops:
 
 
  1.upto 9 do |x|
puts x
end
 
  ruby loop.rb
  1
  2
  3
  4
  5
  6
  7
  8
  9
 
  Exit code: 0
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general