Michael,
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.
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?
Thanks again,
Adam
--------------------------------------------------
Ruby's Logger object? What do you mean by "best"?
---Michael B.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Wednesday, July 19, 2006 10:21 AM
To: [email protected]
Subject: Wtr-general Digest, Vol 32, Issue 28
Send Wtr-general mailing list submissions to
[email protected]
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: for loop syntax?? (Cain, Mark)
2. Re: for loop syntax?? (Charley Baker)
3. Re: Page Loading Problem (Charley Baker)
4. Re: Best way to log Watir output? (Charley Baker)
5. Re: Best way to log Watir output? (Michael Bolton)
----------------------------------------------------------------------
Message: 1
Date: Wed, 19 Jul 2006 07:05:53 -0700
From: "Cain, Mark" <[EMAIL PROTECTED]>
Subject: Re: [Wtr-general] for loop syntax??
To: <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="US-ASCII"
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] On Behalf Of mi
Sent: Tuesday, July 18, 2006 4:23 PM
To: [email protected]
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
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
------------------------------
Message: 2
Date: Wed, 19 Jul 2006 08:43:20 -0600
From: "Charley Baker" <[EMAIL PROTECTED]>
Subject: Re: [Wtr-general] for loop syntax??
To: [email protected]
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"
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]> 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] On Behalf Of mi
> Sent: Tuesday, July 18, 2006 4:23 PM
> To: [email protected]
> 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
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
> _______________________________________________
> Wtr-general mailing list
> [email protected]
> 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: [email protected]
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
> [email protected]
> 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: [email protected]
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.
-Charley
On 7/19/06, Adam Reed <[EMAIL PROTECTED]> wrote:
>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/wtr-general/attachments/20060719/3d37e621
/attachment-0001.html
------------------------------
Message: 5
Date: Wed, 19 Jul 2006 11:20:53 -0400
From: "Michael Bolton" <[EMAIL PROTECTED]>
Subject: Re: [Wtr-general] Best way to log Watir output?
To: <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"
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: [email protected]
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: [email protected]
Subject: Wtr-general Digest, Vol 32, Issue 26
Send Wtr-general mailing list submissions to
[email protected]
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: <[email protected]>
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: [email protected]
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: [email protected]
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: [email protected]
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: [email protected]
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\unittests>all_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:
http://rubyforge.org/pipermail/wtr-general/attachments/20060718/5368a04f
/attachment-0001.html
------------------------------
Message: 2
Date: Tue, 18 Jul 2006 23:20:38 +0200
From: Xavier Noria <[EMAIL PROTECTED]>
Subject: [Wtr-general] problem with nested frames
To: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
Just in case this rings some bell.
I go to a page that has frames A and B. The latter in turn is a frameset
with 4 frames, say B1, ..., B4. The main area of the page is
B3 and I need to follow a link in B2 to change the main area. Problem is
B3, accessed as
ie.frame('B').frame('B3')
has the same HTML before and after the link in B2 is clicked. This
website is quite convoluted, but since Watir asks for frames to IE each
time I invoke frame() I don't understand what may be happening.
Any idea?
-- fxn
------------------------------
Message: 3
Date: Tue, 18 Jul 2006 16:23:15 -0700
From: mi <[EMAIL PROTECTED]>
Subject: [Wtr-general] for loop syntax??
To: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
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
------------------------------
Message: 4
Date: Tue, 18 Jul 2006 19:36:39 -0700 (PDT)
From: David Solis <[EMAIL PROTECTED]>
Subject: [Wtr-general] Page Loading Problem
To: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/wtr-general/attachments/20060718/75ebd76e
/attachment.html
------------------------------
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
End of Wtr-general Digest, Vol 32, Issue 26
*******************************************
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
------------------------------
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
End of Wtr-general Digest, Vol 32, Issue 28
*******************************************
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general