From amatei at softwin.ro Fri Apr 1 03:07:22 2005
From: amatei at softwin.ro (Andrei MATEI)
Date: Fri, 1 Apr 2005 11:07:22 +0300
Subject: [Wtr-general] hidden field
In-Reply-To: <200503311306.j2VD6mAI013206@ls413.htnet.hr>
Message-ID: <2000SRVMJiQTyfPefLJ000008dd@softwin.ro>
Sorry, I don't understand and can't make it work. From what I see in your
message, it seems to me that you have another text field in your page, named
"OWS:val_10_da:Date", and this is the one flashing, not the hidden field.
_____
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of ?eljko Filipin
Sent: Thursday, March 31, 2005 4:07 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] hidden field
I had the same problem just a few days ago until I found field that fills my
hidden field. Maybe your problem is the same (and maybe not).
Try the following:
- open irb
- go to page with hidden field
- use ie.showAllObjects to list all objects of the page
- use flash method to flash every object (at this step I found filed that
fills my hidden filed)
My example:
HTML / JS:
...document.f.val_10.value =
validDate(document.f.elements('OWS:val_10_da:Date').value)...
IRB:
hidden name=val_10
text id=OWS:val_10_da:Date
I tried
ie.textField(:id, "OWS:val_10_da:Date").flash
and it flashed my "hidden" field.
If you did not understand anything, send it back.
Zeljko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050401/ba4e1f56/attachment.html
From zeljko.filipin at tkoznazna.hr Fri Apr 1 03:28:56 2005
From: zeljko.filipin at tkoznazna.hr (=?iso-8859-2?Q?=AEeljko_Filipin?=)
Date: Fri, 1 Apr 2005 10:28:56 +0200
Subject: [Wtr-general] hidden field
In-Reply-To: <2000SRVMJiQTyfPefLJ000008dd@softwin.ro>
Message-ID: <200504010828.j318SRAI027512@ls413.htnet.hr>
Have you used flash method to flash all fields at that page? I your field
did not flash, then your problem is not the same as mine.
I only know HTML, not javascript, and page I tested contains both. I found
text "Date/Time:" and after it a filed I thought I need to fill (screen shot
is at attachment), looked at source and found
...
Date/Time:
...
...
I tried to fill hidden field, but I should fill javascript field
"...document.f.val_10.value =
validDate(document.f.elements('OWS:val_10_da:Date').value)...#. All because
I do not know JS.
Why do you want to fill hidden field? Can you send problem description,
source, screen shot...?
________________________________
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andrei MATEI
Sent: Friday, April 01, 2005 10:07 AM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] hidden field
Sorry, I don't understand and can't make it work. From what I see in your
message, it seems to me that you have another text field in your page, named
"OWS:val_10_da:Date", and this is the one flashing, not the hidden field.
________________________________
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of ?eljko Filipin
Sent: Thursday, March 31, 2005 4:07 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] hidden field
I had the same problem just a few days ago until I found field that fills my
hidden field. Maybe your problem is the same (and maybe not).
Try the following:
- open irb
- go to page with hidden field
- use ie.showAllObjects to list all objects of the page
- use flash method to flash every object (at this step I found filed that
fills my hidden filed)
My example:
HTML / JS:
...document.f.val_10.value =
validDate(document.f.elements('OWS:val_10_da:Date').value)...
IRB:
hidden name=val_10
text id=OWS:val_10_da:Date
I tried
ie.textField(:id, "OWS:val_10_da:Date").flash
and it flashed my "hidden" field.
If you did not understand anything, send it back.
Zeljko
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hidden.png
Type: image/png
Size: 413 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050401/7bab404b/attachment.png
From christopher.mcmahon at gmail.com Fri Apr 1 10:02:40 2005
From: christopher.mcmahon at gmail.com (Chris McMahon)
Date: Fri, 1 Apr 2005 09:02:40 -0600
Subject: [Wtr-general] hidden field
In-Reply-To: <200504010828.j318SRAI027512@ls413.htnet.hr>
References: <2000SRVMJiQTyfPefLJ000008dd@softwin.ro>
<200504010828.j318SRAI027512@ls413.htnet.hr>
Message-ID: <72799cd7050401070255f3bc75@mail.gmail.com>
> Why do you want to fill hidden field? Can you send problem description,
> source, screen shot...?
This is a good point. Manipulating a hidden field is arguably not a
valid test. I wouldn't want to try to justify the utility of
manipulating a hidden field.
Maybe you could make the field not-hidden, and then manipulate it?
-Chris
From jkohl at telusplanet.net Fri Apr 1 10:53:46 2005
From: jkohl at telusplanet.net (Jonathan Kohl)
Date: Fri, 1 Apr 2005 08:53:46 -0700
Subject: [Wtr-general] hidden field
In-Reply-To: <72799cd7050401070255f3bc75@mail.gmail.com>
Message-ID: <20050401155244.ELDK5410.priv-edtnes40.telusplanet.net@tintin>
Generally, I've found a hidden field is filled in with JavaScript, or some
other mechanism that is triggered by manipulating a visible object on the
screen. In my watir automation experience, I've always had hidden fields get
set the same way they would as a user. The only exception is if the hidden
field is populated by JavaScript, you may need to use "fire_event" to
trigger it. There might be one field that has a JavaScript "fireEvent" tied
to it, so you'll have to trigger that after filling in data.
Can you send the HTML source for the page that contains the hidden field? If
you are uncomfortable sending it to the list, feel free to email it to me
personally and I'll try it out.
Thanks;
-Jonathan
> -----Original Message-----
> From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-
> bounces at rubyforge.org] On Behalf Of Chris McMahon
> Sent: April 1, 2005 8:03 AM
> To: wtr-general at rubyforge.org
> Subject: Re: [Wtr-general] hidden field
>
> > Why do you want to fill hidden field? Can you send problem description,
> > source, screen shot...?
>
> This is a good point. Manipulating a hidden field is arguably not a
> valid test. I wouldn't want to try to justify the utility of
> manipulating a hidden field.
>
> Maybe you could make the field not-hidden, and then manipulate it?
> -Chris
> _______________________________________________
> Wtr-general mailing list
> Wtr-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
From paul.rogers at shaw.ca Fri Apr 1 12:05:31 2005
From: paul.rogers at shaw.ca (Paul Rogers)
Date: Fri, 01 Apr 2005 10:05:31 -0700
Subject: [Wtr-general] hidden field
In-Reply-To: <72799cd7050401070255f3bc75@mail.gmail.com>
Message-ID: <001d01c536dd$035372c0$6400a8c0@NewDell>
I was wondering why you would want to do this too. Users don't access
these things, which is why we havent exposed any methods to do it.
You can do it if you want, in watir.rb cut n paste the TextField class
and change the getObject line in the construcor to include "hidden".
Unfortunately there is not an easy way to over ride this behaviour
(which is why you have to cut n paste).
If you have to do this, I expect there is a better way to test what you
are doing - or are you trying to test hacking attempts?
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon
Sent: 01 April 2005 08:03
To: wtr-general at rubyforge.org
Subject: Re: [Wtr-general] hidden field
> Why do you want to fill hidden field? Can you send problem
> description, source, screen shot...?
This is a good point. Manipulating a hidden field is arguably not a
valid test. I wouldn't want to try to justify the utility of
manipulating a hidden field.
Maybe you could make the field not-hidden, and then manipulate it?
-Chris
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
From Mark_Cain at rl.gov Fri Apr 1 12:57:36 2005
From: Mark_Cain at rl.gov (Cain, Mark)
Date: Fri, 1 Apr 2005 09:57:36 -0800
Subject: [Wtr-general] Parent window receiving child window data
Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04E154EB8@EX5V.rl.gov>
Thanks Paul, I have got this mostly to work. However, I find I need to
put a wait in after the button click before the attach function finds
the title consistently. I am using ie.wait(3) but this is throwing a
JavaScript error and then an exception:
1) Error:
test5_ca(TC_PER):
WIN32OLERuntimeError: focus
OLE error code:800A083E in htmlfile
Can't move focus to the control because it is
invisible, not enabled, or of a type that does not accept the focus.
HRESULT error code:0x80020009
Exception occurred.
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2866:in
`method_missing'
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2866:in `set'
Originator.rb:165:in `test5_ca'
6 tests, 2 assertions, 0 failures, 1 errors
W, [01-Apr-2005 09:16:10#4144] WARN -- : runtime error in wait
Am I using this correctly? Any insight?
Also, when using the attach method as you describe sometimes the parent
process loses the ability to give focus to textareas. The script
returns to the parent application as expected and finds the first
textarea and fills in the text, but stops for the second saying it
cannot find or give focus to the field. I have looked through the
source and find all textareas on the page are visible and editable.
Thanks,
--Mark
________________________________
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Thursday, March 31, 2005 12:48 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Parent window receiving child window data
for problem1, this code should work - it is used in several of the unit
tests - obviously change the captions etc to what you are using
ie=IE.start('mainpage.html')
ie.button(:caption, "Open Child").click
child_window = IE.attach(:title, 'Child Window')
child_window.text_field(:index,1).set("In the Child")
for 2 - the only way we might cause a javascript error is if you use
the capture_events method ( as we intercept the new window and create
our own)
Hope that helps
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark
Sent: 31 March 2005 10:45
To: wtr-general at rubyforge.org
Subject: [Wtr-general] Parent window receiving child window data
In my application, there is a button which causes a child window
to open (new window). On the child window there is form data that the
user can select and post back (1 to n times) to the same child form.
Once that is completed a 'Close Window' button on the child form post
all the data back to the parent.
Problem:
1. Once the child window is open I cannot seem to input
data using WATIR. I have tried the attach method and the newWindow
method, but cannot seem to be able to get at the object on the child
form.
2. If in my script I click the Close Window button on the
child form window there is a JavaScript error: 'parent.opener.document'
is null or not an object.
Is anyone else having a similar problem? What did you do to
correct this?
Thanks,
____________________
Mark L. Cain
LMIT - E*STARS(r) ~ Lead Test Engineer
1981 Snyder, MSIN: G3-62, Richland, WA 99352
Mark_Cain at RL.gov
509.376.5458
"640 Kilobytes of computer memory ought to be enough for
anybody." - Bill Gates, 1981
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050401/02db06f0/attachment.html
From paul.rogers at shaw.ca Fri Apr 1 13:25:32 2005
From: paul.rogers at shaw.ca (Paul Rogers)
Date: Fri, 01 Apr 2005 11:25:32 -0700
Subject: [Wtr-general] Parent window receiving child window data
In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04E154EB8@EX5V.rl.gov>
Message-ID: <002301c536e8$314efd60$6400a8c0@NewDell>
instead of ie.wait ( which is really an internal method ) try just using
sleep -
ie.button(:value, "Open New Window").click
sleep 3
ie.attach(:title, "New window")
for the second problem, trying doing a ie.show_all_objects we will then
be able to see what objects are there
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark
Sent: 01 April 2005 10:58
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Parent window receiving child window data
Thanks Paul, I have got this mostly to work. However, I find I need to
put a wait in after the button click before the attach function finds
the title consistently. I am using ie.wait(3) but this is throwing a
JavaScript error and then an exception:
1) Error:
test5_ca(TC_PER):
WIN32OLERuntimeError: focus
OLE error code:800A083E in htmlfile
Can't move focus to the control because it is
invisible, not enabled, or of a type that does not accept the focus.
HRESULT error code:0x80020009
Exception occurred.
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2866:in
`method_missing'
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2866:in `set'
Originator.rb:165:in `test5_ca'
6 tests, 2 assertions, 0 failures, 1 errors
W, [01-Apr-2005 09:16:10#4144] WARN -- : runtime error in wait
Am I using this correctly? Any insight?
Also, when using the attach method as you describe sometimes the parent
process loses the ability to give focus to textareas. The script
returns to the parent application as expected and finds the first
textarea and fills in the text, but stops for the second saying it
cannot find or give focus to the field. I have looked through the
source and find all textareas on the page are visible and editable.
Thanks,
--Mark
_____
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Thursday, March 31, 2005 12:48 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Parent window receiving child window data
for problem1, this code should work - it is used in several of the unit
tests - obviously change the captions etc to what you are using
ie=IE.start('mainpage.html')
ie.button(:caption, "Open Child").click
child_window = IE.attach(:title, 'Child Window')
child_window.text_field(:index,1).set("In the Child")
for 2 - the only way we might cause a javascript error is if you use
the capture_events method ( as we intercept the new window and create
our own)
Hope that helps
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark
Sent: 31 March 2005 10:45
To: wtr-general at rubyforge.org
Subject: [Wtr-general] Parent window receiving child window data
In my application, there is a button which causes a child window to open
(new window). On the child window there is form data that the user can
select and post back (1 to n times) to the same child form. Once that
is completed a 'Close Window' button on the child form post all the data
back to the parent.
Problem:
1. Once the child window is open I cannot seem to input data using
WATIR. I have tried the attach method and the newWindow method, but
cannot seem to be able to get at the object on the child form.
2. If in my script I click the Close Window button on the child
form window there is a JavaScript error: 'parent.opener.document' is
null or not an object.
Is anyone else having a similar problem? What did you do to correct
this?
Thanks,
____________________
Mark L. Cain
LMIT - E*STARSR ~ Lead Test Engineer
1981 Snyder, MSIN: G3-62, Richland, WA 99352
Mark_Cain at RL.gov
509.376.5458
"640 Kilobytes of computer memory ought to be enough for anybody." -
Bill Gates, 1981
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050401/242d7409/attachment.html
From jkohl at telusplanet.net Fri Apr 1 13:37:26 2005
From: jkohl at telusplanet.net (Jonathan Kohl)
Date: Fri, 1 Apr 2005 11:37:26 -0700
Subject: [Wtr-general] XML logging update
Message-ID: <20050401183622.PZWI27369.priv-edtnes51.telusplanet.net@tintin>
I've got some simple logging working using REXML, but I'm not very happy
with it. I'll have another look at it when I have some spare time. At this
point I'm thinking about maybe doing an XML Formatter for logging instead of
REXML.
-Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050401/a3431579/attachment.html
From Mark_Cain at rl.gov Fri Apr 1 14:49:29 2005
From: Mark_Cain at rl.gov (Cain, Mark)
Date: Fri, 1 Apr 2005 11:49:29 -0800
Subject: [Wtr-general] Parent window receiving child window data
Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04E154EBA@EX5V.rl.gov>
Thank you Paul! That worked, but I still get this when the script
ends-it does not cause the script to stop thankfully.
W, [01-Apr-2005 11:01:36#4128] WARN -- : runtime error in wait
W, [01-Apr-2005 11:02:18#4128] WARN -- : runtime error in wait
The other problem turned out to be a div tag that controls flow for
legacy code. The textarea was not hidden but the div tag way.
Thanks again I have now been able to create a baseline of the main use
case script that will be used for writing other use case scripts for
this app-as well as another customer version of the same app. I will
only have to change to few minor things to leverage about a dozen or
more scripts. This is huge for my team since this is the first
automation that has been done here! A milestone has been reached thanks
to WATIR!
--Mark
________________________________
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Friday, April 01, 2005 10:26 AM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Parent window receiving child window data
instead of ie.wait ( which is really an internal method ) try just using
sleep -
ie.button(:value, "Open New Window").click
sleep 3
ie.attach(:title, "New window")
for the second problem, trying doing a ie.show_all_objects we will then
be able to see what objects are there
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark
Sent: 01 April 2005 10:58
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Parent window receiving child window
data
Thanks Paul, I have got this mostly to work. However, I find I
need to put a wait in after the button click before the attach function
finds the title consistently. I am using ie.wait(3) but this is
throwing a JavaScript error and then an exception:
1) Error:
test5_ca(TC_PER):
WIN32OLERuntimeError: focus
OLE error code:800A083E in htmlfile
Can't move focus to the control because
it is invisible, not enabled, or of a type that does not accept the
focus.
HRESULT error code:0x80020009
Exception occurred.
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2866:in
`method_missing'
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2866:in
`set'
Originator.rb:165:in `test5_ca'
6 tests, 2 assertions, 0 failures, 1 errors
W, [01-Apr-2005 09:16:10#4144] WARN -- : runtime error in wait
Am I using this correctly? Any insight?
Also, when using the attach method as you describe sometimes the
parent process loses the ability to give focus to textareas. The script
returns to the parent application as expected and finds the first
textarea and fills in the text, but stops for the second saying it
cannot find or give focus to the field. I have looked through the
source and find all textareas on the page are visible and editable.
Thanks,
--Mark
________________________________
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Thursday, March 31, 2005 12:48 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Parent window receiving child window
data
for problem1, this code should work - it is used in several of
the unit tests - obviously change the captions etc to what you are using
ie=IE.start('mainpage.html')
ie.button(:caption, "Open Child").click
child_window = IE.attach(:title, 'Child Window')
child_window.text_field(:index,1).set("In the Child")
for 2 - the only way we might cause a javascript error is if
you use the capture_events method ( as we intercept the new window and
create our own)
Hope that helps
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark
Sent: 31 March 2005 10:45
To: wtr-general at rubyforge.org
Subject: [Wtr-general] Parent window receiving child
window data
In my application, there is a button which causes a
child window to open (new window). On the child window there is form
data that the user can select and post back (1 to n times) to the same
child form. Once that is completed a 'Close Window' button on the child
form post all the data back to the parent.
Problem:
1. Once the child window is open I cannot seem to
input data using WATIR. I have tried the attach method and the
newWindow method, but cannot seem to be able to get at the object on the
child form.
2. If in my script I click the Close Window button
on the child form window there is a JavaScript error:
'parent.opener.document' is null or not an object.
Is anyone else having a similar problem? What did you
do to correct this?
Thanks,
____________________
Mark L. Cain
LMIT - E*STARS(r) ~ Lead Test Engineer
1981 Snyder, MSIN: G3-62, Richland, WA 99352
Mark_Cain at RL.gov
509.376.5458
"640 Kilobytes of computer memory ought to be enough for
anybody." - Bill Gates, 1981
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050401/38cf7749/attachment.html
From paul.rogers at shaw.ca Fri Apr 1 15:02:00 2005
From: paul.rogers at shaw.ca (Paul Rogers)
Date: Fri, 01 Apr 2005 13:02:00 -0700
Subject: [Wtr-general] Parent window receiving child window data
In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04E154EBA@EX5V.rl.gov>
Message-ID: <003c01c536f5$aa715a50$6400a8c0@NewDell>
if you goto watir.rb ( normally in
C:\ruby\lib\ruby\site_ruby\1.8\watir.rb ) and search for "runtime error
in wait" you can remove a comment char and see the exception. I'd be
interested to see what it is. There was a bug to do with frames that I
though i'd fixed
Can you also do
puts IE::REVISION
$Revision: 1.133 $
to see which version it is
Thanks
Paul
ps can I add those comments to our testimonials page?
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark
Sent: 01 April 2005 12:49
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Parent window receiving child window data
Thank you Paul! That worked, but I still get this when the script
ends-it does not cause the script to stop thankfully.
W, [01-Apr-2005 11:01:36#4128] WARN -- : runtime error in wait
W, [01-Apr-2005 11:02:18#4128] WARN -- : runtime error in wait
The other problem turned out to be a div tag that controls flow for
legacy code. The textarea was not hidden but the div tag way.
Thanks again I have now been able to create a baseline of the main use
case script that will be used for writing other use case scripts for
this app-as well as another customer version of the same app. I will
only have to change to few minor things to leverage about a dozen or
more scripts. This is huge for my team since this is the first
automation that has been done here! A milestone has been reached thanks
to WATIR!
--Mark
_____
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Friday, April 01, 2005 10:26 AM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Parent window receiving child window data
instead of ie.wait ( which is really an internal method ) try just using
sleep -
ie.button(:value, "Open New Window").click
sleep 3
ie.attach(:title, "New window")
for the second problem, trying doing a ie.show_all_objects we will then
be able to see what objects are there
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark
Sent: 01 April 2005 10:58
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Parent window receiving child window data
Thanks Paul, I have got this mostly to work. However, I find I need to
put a wait in after the button click before the attach function finds
the title consistently. I am using ie.wait(3) but this is throwing a
JavaScript error and then an exception:
1) Error:
test5_ca(TC_PER):
WIN32OLERuntimeError: focus
OLE error code:800A083E in htmlfile
Can't move focus to the control because it is
invisible, not enabled, or of a type that does not accept the focus.
HRESULT error code:0x80020009
Exception occurred.
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2866:in
`method_missing'
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2866:in `set'
Originator.rb:165:in `test5_ca'
6 tests, 2 assertions, 0 failures, 1 errors
W, [01-Apr-2005 09:16:10#4144] WARN -- : runtime error in wait
Am I using this correctly? Any insight?
Also, when using the attach method as you describe sometimes the parent
process loses the ability to give focus to textareas. The script
returns to the parent application as expected and finds the first
textarea and fills in the text, but stops for the second saying it
cannot find or give focus to the field. I have looked through the
source and find all textareas on the page are visible and editable.
Thanks,
--Mark
_____
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Thursday, March 31, 2005 12:48 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Parent window receiving child window data
for problem1, this code should work - it is used in several of the unit
tests - obviously change the captions etc to what you are using
ie=IE.start('mainpage.html')
ie.button(:caption, "Open Child").click
child_window = IE.attach(:title, 'Child Window')
child_window.text_field(:index,1).set("In the Child")
for 2 - the only way we might cause a javascript error is if you use
the capture_events method ( as we intercept the new window and create
our own)
Hope that helps
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark
Sent: 31 March 2005 10:45
To: wtr-general at rubyforge.org
Subject: [Wtr-general] Parent window receiving child window data
In my application, there is a button which causes a child window to open
(new window). On the child window there is form data that the user can
select and post back (1 to n times) to the same child form. Once that
is completed a 'Close Window' button on the child form post all the data
back to the parent.
Problem:
1. Once the child window is open I cannot seem to input data using
WATIR. I have tried the attach method and the newWindow method, but
cannot seem to be able to get at the object on the child form.
2. If in my script I click the Close Window button on the child
form window there is a JavaScript error: 'parent.opener.document' is
null or not an object.
Is anyone else having a similar problem? What did you do to correct
this?
Thanks,
____________________
Mark L. Cain
LMIT - E*STARSR ~ Lead Test Engineer
1981 Snyder, MSIN: G3-62, Richland, WA 99352
Mark_Cain at RL.gov
509.376.5458
"640 Kilobytes of computer memory ought to be enough for anybody." -
Bill Gates, 1981
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050401/0c292ed9/attachment.html
From chrishedges at gmail.com Sun Apr 3 00:22:34 2005
From: chrishedges at gmail.com (Chris Hedges)
Date: Sat, 2 Apr 2005 22:22:34 -0700
Subject: [Wtr-general] Mouse-overs
Message-ID: <5820aff60504022122627d6710@mail.gmail.com>
Here is a good way to utilize the mouse-over drop-down menus for IE.
I add some sleeps and flashes for visual.
Just make sure that your pop-up blockers are off.
require 'thread'
require 'watir'
require 'test/unit'
require 'test/unit/ui/console/testrunner'
require 'watir/testUnitAddons'
include Watir
testSite = 'http://www.fortlewis.edu'
$ie = IE.new
ie2 = nil
puts "## Beginning of Example: FortLewis.edu"
puts " "
sleep 1
puts "Step 1: go to the test site: " + testSite
$ie.goto(testSite)
$ie.link(:text," Prospective Students ").fireEvent("onMouseOver")
sleep 1
$ie.link(:text," Prospective Students ").fireEvent("onMouseOut")
$ie.link(:text," Current Students ").fireEvent("onMouseOver")
$ie.link(:url,"http://faculty.fortlewis.edu/").flash
sleep 1
$ie.link(:url,"http://faculty.fortlewis.edu/").click
sleep 1
ie2 = IE.attach(:title, "Faculty Web Sites @ Fort Lewis College,
Durango Colorado")
ie2.link(:url,"http://faculty.fortlewis.edu/ADAMS_E").flash
ie2.link(:url,"http://faculty.fortlewis.edu/ADAMS_E").click
sleep 1
ie2.link(:url,"classnotesandassignments.html").flash
ie2.link(:url,"classnotesandassignments.html").click
sleep 1
ie2.link(:url,"CLASSES/CS496SENIORSEMINAR/CS496W05/index.HTML").flash
ie2.link(:url,"CLASSES/CS496SENIORSEMINAR/CS496W05/index.HTML").click
sleep 1
ie2.link(:url,"schedulew05.html").flash
ie2.link(:url,"schedulew05.html").click
sleep 1
ie2.link(:url,"TopicProposalScheduleW05.htm").flash
ie2.link(:url,"TopicProposalScheduleW05.htm").click
From paul.rogers at shaw.ca Sun Apr 3 15:12:36 2005
From: paul.rogers at shaw.ca (Paul Rogers)
Date: Sun, 03 Apr 2005 13:12:36 -0600
Subject: [Wtr-general] Mouse-overs
In-Reply-To: <5820aff60504022122627d6710@mail.gmail.com>
Message-ID: <001001c53881$187032b0$6400a8c0@NewDell>
Chris this is great! Do you think we can add it to the examples?
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris Hedges
Sent: 02 April 2005 22:23
To: wtr-general at rubyforge.org
Subject: [Wtr-general] Mouse-overs
Here is a good way to utilize the mouse-over drop-down menus for IE.
I add some sleeps and flashes for visual.
Just make sure that your pop-up blockers are off.
require 'thread'
require 'watir'
require 'test/unit'
require 'test/unit/ui/console/testrunner'
require 'watir/testUnitAddons'
include Watir
testSite = 'http://www.fortlewis.edu'
$ie = IE.new
ie2 = nil
puts "## Beginning of Example: FortLewis.edu"
puts " "
sleep 1
puts "Step 1: go to the test site: " + testSite
$ie.goto(testSite)
$ie.link(:text," Prospective Students
").fireEvent("onMouseOver")
sleep 1
$ie.link(:text," Prospective Students
").fireEvent("onMouseOut")
$ie.link(:text," Current Students ").fireEvent("onMouseOver")
$ie.link(:url,"http://faculty.fortlewis.edu/").flash
sleep 1
$ie.link(:url,"http://faculty.fortlewis.edu/").click
sleep 1
ie2 = IE.attach(:title, "Faculty Web Sites @ Fort Lewis College, Durango
Colorado") ie2.link(:url,"http://faculty.fortlewis.edu/ADAMS_E").flash
ie2.link(:url,"http://faculty.fortlewis.edu/ADAMS_E").click
sleep 1
ie2.link(:url,"classnotesandassignments.html").flash
ie2.link(:url,"classnotesandassignments.html").click
sleep 1
ie2.link(:url,"CLASSES/CS496SENIORSEMINAR/CS496W05/index.HTML").flash
ie2.link(:url,"CLASSES/CS496SENIORSEMINAR/CS496W05/index.HTML").click
sleep 1
ie2.link(:url,"schedulew05.html").flash
ie2.link(:url,"schedulew05.html").click
sleep 1
ie2.link(:url,"TopicProposalScheduleW05.htm").flash
ie2.link(:url,"TopicProposalScheduleW05.htm").click
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
From paul.rogers at shaw.ca Sun Apr 3 19:53:53 2005
From: paul.rogers at shaw.ca (Paul Rogers)
Date: Sun, 03 Apr 2005 17:53:53 -0600
Subject: [Wtr-general] Watir 1.2 released
Message-ID: <001e01c538a8$640dbbd0$6400a8c0@NewDell>
Watir release 1.2
This release contains several new features:
URL List
--------
The list of unique urls that has been visited is now available. Use the
following to access, and clear it
ie.url_list # returns an array of the unique urls visited
ie.clear_url_list # clear the list
Properties for Objects
----------------------
It is now possible to do:
button = ie.button(:index,1)
puts button.name
puts button.id
puts button.value
The properties depend upon the object, but include href, innerText ( for
links ) as well as those aboev. Consult the API reference for full
details
Iterator objects
----------------
It is now possible to iterate through most types of element. For
example:
ie.buttons.each do |button|
if button.name == "Test Button"
button.click
break
end
end
This release also contains many bug fizes to the tables code, a new
graphical installer, and better api documentation
Many thanks to all who have contributed!
From amatei at softwin.ro Mon Apr 4 06:42:10 2005
From: amatei at softwin.ro (Andrei MATEI)
Date: Mon, 4 Apr 2005 13:42:10 +0300
Subject: [Wtr-general] hidden field
In-Reply-To: <001d01c536dd$035372c0$6400a8c0@NewDell>
Message-ID: <2000SRVGWSa1aNEVJpj0000095e@softwin.ro>
Thank you all for your answers.
I am trying to set the value of a hidden field because that hidden field is
normally filled by javascript when you perform some actions on a Microsoft
IE TreeView control (I'm using asp.net). This renders as a strange object
(it uses some .htc behaviours) and I can't manipulate it using watir (or can
I ???).
Paul, I've done what you said and it worked. I also had to change the set
method of the TextField class and make it _not_ set focus on the object,
because the hidden field doesn't support focus. Maybe you would want to
include the feature in the next version, because I think it is important.
Anyway, I also was able to manipulate the hidden field doing something like:
y=$ie.getDocument.all['myHiddenField']
y.value="the value that I want"
body=$ie.getDocument().forms['form1']
body.submit()
This is great, but I am curious why stuff like this works... I can't find
the code for this stuff in watir.rb. When I say $ie.getDocument(), is the
return value actually a COM object? If so, are "forms", or "all", properties
of this object? Am I understanding this corectly?
Thanks a lot,
Andrei
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Friday, April 01, 2005 8:06 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] hidden field
I was wondering why you would want to do this too. Users don't access
these things, which is why we havent exposed any methods to do it.
You can do it if you want, in watir.rb cut n paste the TextField class
and change the getObject line in the construcor to include "hidden".
Unfortunately there is not an easy way to over ride this behaviour
(which is why you have to cut n paste).
If you have to do this, I expect there is a better way to test what you
are doing - or are you trying to test hacking attempts?
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon
Sent: 01 April 2005 08:03
To: wtr-general at rubyforge.org
Subject: Re: [Wtr-general] hidden field
> Why do you want to fill hidden field? Can you send problem
> description, source, screen shot...?
This is a good point. Manipulating a hidden field is arguably not a
valid test. I wouldn't want to try to justify the utility of
manipulating a hidden field.
Maybe you could make the field not-hidden, and then manipulate it?
-Chris
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
From paul.rogers at shaw.ca Mon Apr 4 11:08:38 2005
From: paul.rogers at shaw.ca (Paul Rogers)
Date: Mon, 04 Apr 2005 09:08:38 -0600
Subject: [Wtr-general] hidden field
In-Reply-To: <2000SRVGWSa1aNEVJpj0000095e@softwin.ro>
Message-ID: <003001c53928$2e745c60$6400a8c0@NewDell>
This page
http://authors.aspalliance.com/shark/articles/TreeView/DocTree.aspx
Has an IE treeview, and there does not appear to be anyway to manipulate
it.
Now, if we can work around that by making the hidden field accessible I
think that's something we should do
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andrei MATEI
Sent: 04 April 2005 04:42
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] hidden field
Thank you all for your answers.
I am trying to set the value of a hidden field because that hidden field
is normally filled by javascript when you perform some actions on a
Microsoft IE TreeView control (I'm using asp.net). This renders as a
strange object (it uses some .htc behaviours) and I can't manipulate it
using watir (or can I ???).
Paul, I've done what you said and it worked. I also had to change the
set method of the TextField class and make it _not_ set focus on the
object, because the hidden field doesn't support focus. Maybe you would
want to include the feature in the next version, because I think it is
important. Anyway, I also was able to manipulate the hidden field doing
something like:
y=$ie.getDocument.all['myHiddenField']
y.value="the value that I want" body=$ie.getDocument().forms['form1']
body.submit()
This is great, but I am curious why stuff like this works... I can't
find the code for this stuff in watir.rb. When I say $ie.getDocument(),
is the return value actually a COM object? If so, are "forms", or "all",
properties of this object? Am I understanding this corectly?
Thanks a lot,
Andrei
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Friday, April 01, 2005 8:06 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] hidden field
I was wondering why you would want to do this too. Users don't access
these things, which is why we havent exposed any methods to do it.
You can do it if you want, in watir.rb cut n paste the TextField class
and change the getObject line in the construcor to include "hidden".
Unfortunately there is not an easy way to over ride this behaviour
(which is why you have to cut n paste).
If you have to do this, I expect there is a better way to test what you
are doing - or are you trying to test hacking attempts?
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon
Sent: 01 April 2005 08:03
To: wtr-general at rubyforge.org
Subject: Re: [Wtr-general] hidden field
> Why do you want to fill hidden field? Can you send problem
> description, source, screen shot...?
This is a good point. Manipulating a hidden field is arguably not a
valid test. I wouldn't want to try to justify the utility of
manipulating a hidden field.
Maybe you could make the field not-hidden, and then manipulate it?
-Chris
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
From paul.rogers at shaw.ca Mon Apr 4 11:10:41 2005
From: paul.rogers at shaw.ca (Paul Rogers)
Date: Mon, 04 Apr 2005 09:10:41 -0600
Subject: [Wtr-general] Tables and flash
Message-ID: <003101c53928$77d2dcb0$6400a8c0@NewDell>
Has anybody had problems with tables and flash?
I was trying the timeclock and several tables did not flash when asked
to (specifically the one at the bottom with 'Recent Records'). There was
no error given.
I was able to access the contents of the table using to_a and the to_s
method worked to. Just not flash
I havent tried to debug further.
Paul
From chrishedges at gmail.com Mon Apr 4 11:14:07 2005
From: chrishedges at gmail.com (Chris Hedges)
Date: Mon, 4 Apr 2005 09:14:07 -0600
Subject: [Wtr-general] Mouse-overs
In-Reply-To: <001001c53881$187032b0$6400a8c0@NewDell>
References: <5820aff60504022122627d6710@mail.gmail.com>
<001001c53881$187032b0$6400a8c0@NewDell>
Message-ID: <5820aff6050404081479020c7b@mail.gmail.com>
Absolutely!
On Apr 3, 2005 1:12 PM, Paul Rogers wrote:
> Chris this is great! Do you think we can add it to the examples?
>
> Paul
>
> -----Original Message-----
> From: wtr-general-bounces at rubyforge.org
> [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris Hedges
> Sent: 02 April 2005 22:23
> To: wtr-general at rubyforge.org
> Subject: [Wtr-general] Mouse-overs
>
> Here is a good way to utilize the mouse-over drop-down menus for IE.
> I add some sleeps and flashes for visual.
> Just make sure that your pop-up blockers are off.
>
> require 'thread'
> require 'watir'
> require 'test/unit'
> require 'test/unit/ui/console/testrunner'
> require 'watir/testUnitAddons'
> include Watir
>
> testSite = 'http://www.fortlewis.edu'
> $ie = IE.new
> ie2 = nil
> puts "## Beginning of Example: FortLewis.edu"
> puts " "
> sleep 1
> puts "Step 1: go to the test site: " + testSite
> $ie.goto(testSite)
> $ie.link(:text," Prospective Students
> ").fireEvent("onMouseOver")
> sleep 1
> $ie.link(:text," Prospective Students
> ").fireEvent("onMouseOut")
> $ie.link(:text," Current Students ").fireEvent("onMouseOver")
> $ie.link(:url,"http://faculty.fortlewis.edu/").flash
> sleep 1
>
> $ie.link(:url,"http://faculty.fortlewis.edu/").click
> sleep 1
>
> ie2 = IE.attach(:title, "Faculty Web Sites @ Fort Lewis College, Durango
> Colorado") ie2.link(:url,"http://faculty.fortlewis.edu/ADAMS_E").flash
> ie2.link(:url,"http://faculty.fortlewis.edu/ADAMS_E").click
> sleep 1
> ie2.link(:url,"classnotesandassignments.html").flash
> ie2.link(:url,"classnotesandassignments.html").click
> sleep 1
> ie2.link(:url,"CLASSES/CS496SENIORSEMINAR/CS496W05/index.HTML").flash
> ie2.link(:url,"CLASSES/CS496SENIORSEMINAR/CS496W05/index.HTML").click
> sleep 1
>
> ie2.link(:url,"schedulew05.html").flash
> ie2.link(:url,"schedulew05.html").click
> sleep 1
>
> ie2.link(:url,"TopicProposalScheduleW05.htm").flash
> ie2.link(:url,"TopicProposalScheduleW05.htm").click
> _______________________________________________
> Wtr-general mailing list
> Wtr-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>
> _______________________________________________
> Wtr-general mailing list
> Wtr-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>
From paul.rogers at shaw.ca Mon Apr 4 11:21:46 2005
From: paul.rogers at shaw.ca (Paul Rogers)
Date: Mon, 04 Apr 2005 09:21:46 -0600
Subject: [Wtr-general] treeviews was ( hidden field )
In-Reply-To: <2000SRVGWSa1aNEVJpj0000095e@softwin.ro>
Message-ID: <003201c5392a$04771590$6400a8c0@NewDell>
The MSDN site (http://msdn.microsoft.com/library/default.asp )
Strangely does not use this control, so it can be accessed with this
code:
ie.goto( 'http://msdn.microsoft.com/library/default.asp')
ie.frame("fraLeftFrame").frame("fraDeeptree").link(:index,6).click
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andrei MATEI
Sent: 04 April 2005 04:42
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] hidden field
Thank you all for your answers.
I am trying to set the value of a hidden field because that hidden field
is normally filled by javascript when you perform some actions on a
Microsoft IE TreeView control (I'm using asp.net). This renders as a
strange object (it uses some .htc behaviours) and I can't manipulate it
using watir (or can I ???).
Paul, I've done what you said and it worked. I also had to change the
set method of the TextField class and make it _not_ set focus on the
object, because the hidden field doesn't support focus. Maybe you would
want to include the feature in the next version, because I think it is
important. Anyway, I also was able to manipulate the hidden field doing
something like:
y=$ie.getDocument.all['myHiddenField']
y.value="the value that I want" body=$ie.getDocument().forms['form1']
body.submit()
This is great, but I am curious why stuff like this works... I can't
find the code for this stuff in watir.rb. When I say $ie.getDocument(),
is the return value actually a COM object? If so, are "forms", or "all",
properties of this object? Am I understanding this corectly?
Thanks a lot,
Andrei
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Friday, April 01, 2005 8:06 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] hidden field
I was wondering why you would want to do this too. Users don't access
these things, which is why we havent exposed any methods to do it.
You can do it if you want, in watir.rb cut n paste the TextField class
and change the getObject line in the construcor to include "hidden".
Unfortunately there is not an easy way to over ride this behaviour
(which is why you have to cut n paste).
If you have to do this, I expect there is a better way to test what you
are doing - or are you trying to test hacking attempts?
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon
Sent: 01 April 2005 08:03
To: wtr-general at rubyforge.org
Subject: Re: [Wtr-general] hidden field
> Why do you want to fill hidden field? Can you send problem
> description, source, screen shot...?
This is a good point. Manipulating a hidden field is arguably not a
valid test. I wouldn't want to try to justify the utility of
manipulating a hidden field.
Maybe you could make the field not-hidden, and then manipulate it?
-Chris
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
From Mark_Cain at rl.gov Mon Apr 4 11:27:06 2005
From: Mark_Cain at rl.gov (Cain, Mark)
Date: Mon, 4 Apr 2005 08:27:06 -0700
Subject: [Wtr-general] Parent window receiving child window data
Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04E154EBC@EX5V.rl.gov>
Your directions below were uncleare to me. Did you mean in an IRB
session to search for the runtime error?
Yes you can add my comments to the testimonials page.
Thanks,
Mark
________________________________
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Friday, April 01, 2005 12:02 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Parent window receiving child window data
if you goto watir.rb ( normally in
C:\ruby\lib\ruby\site_ruby\1.8\watir.rb ) and search for "runtime error
in wait" you can remove a comment char and see the exception. I'd be
interested to see what it is. There was a bug to do with frames that I
though i'd fixed
Can you also do
puts IE::REVISION
$Revision: 1.133 $
to see which version it is
Thanks
Paul
ps can I add those comments to our testimonials page?
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark
Sent: 01 April 2005 12:49
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Parent window receiving child window
data
Thank you Paul! That worked, but I still get this when the
script ends-it does not cause the script to stop thankfully.
W, [01-Apr-2005 11:01:36#4128] WARN -- : runtime error in wait
W, [01-Apr-2005 11:02:18#4128] WARN -- : runtime error in wait
The other problem turned out to be a div tag that controls flow
for legacy code. The textarea was not hidden but the div tag way.
Thanks again I have now been able to create a baseline of the
main use case script that will be used for writing other use case
scripts for this app-as well as another customer version of the same
app. I will only have to change to few minor things to leverage about a
dozen or more scripts. This is huge for my team since this is the first
automation that has been done here! A milestone has been reached thanks
to WATIR!
--Mark
________________________________
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Friday, April 01, 2005 10:26 AM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Parent window receiving child window
data
instead of ie.wait ( which is really an internal method ) try
just using sleep -
ie.button(:value, "Open New Window").click
sleep 3
ie.attach(:title, "New window")
for the second problem, trying doing a ie.show_all_objects we
will then be able to see what objects are there
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark
Sent: 01 April 2005 10:58
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Parent window receiving child
window data
Thanks Paul, I have got this mostly to work. However, I
find I need to put a wait in after the button click before the attach
function finds the title consistently. I am using ie.wait(3) but this
is throwing a JavaScript error and then an exception:
1) Error:
test5_ca(TC_PER):
WIN32OLERuntimeError: focus
OLE error code:800A083E in
htmlfile
Can't move focus to the control
because it is invisible, not enabled, or of a type that does not accept
the focus.
HRESULT error code:0x80020009
Exception occurred.
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2866:in `method_missing'
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2866:in `set'
Originator.rb:165:in `test5_ca'
6 tests, 2 assertions, 0 failures, 1 errors
W, [01-Apr-2005 09:16:10#4144] WARN -- : runtime error
in wait
Am I using this correctly? Any insight?
Also, when using the attach method as you describe
sometimes the parent process loses the ability to give focus to
textareas. The script returns to the parent application as expected and
finds the first textarea and fills in the text, but stops for the second
saying it cannot find or give focus to the field. I have looked through
the source and find all textareas on the page are visible and editable.
Thanks,
--Mark
________________________________
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Thursday, March 31, 2005 12:48 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Parent window receiving child
window data
for problem1, this code should work - it is used in
several of the unit tests - obviously change the captions etc to what
you are using
ie=IE.start('mainpage.html')
ie.button(:caption, "Open Child").click
child_window = IE.attach(:title, 'Child Window')
child_window.text_field(:index,1).set("In the Child")
for 2 - the only way we might cause a javascript error
is if you use the capture_events method ( as we intercept the new window
and create our own)
Hope that helps
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark
Sent: 31 March 2005 10:45
To: wtr-general at rubyforge.org
Subject: [Wtr-general] Parent window receiving
child window data
In my application, there is a button which
causes a child window to open (new window). On the child window there
is form data that the user can select and post back (1 to n times) to
the same child form. Once that is completed a 'Close Window' button on
the child form post all the data back to the parent.
Problem:
1. Once the child window is open I cannot
seem to input data using WATIR. I have tried the attach method and the
newWindow method, but cannot seem to be able to get at the object on the
child form.
2. If in my script I click the Close
Window button on the child form window there is a JavaScript error:
'parent.opener.document' is null or not an object.
Is anyone else having a similar problem? What
did you do to correct this?
Thanks,
____________________
Mark L. Cain
LMIT - E*STARS(r) ~ Lead Test Engineer
1981 Snyder, MSIN: G3-62, Richland, WA 99352
Mark_Cain at RL.gov
509.376.5458
"640 Kilobytes of computer memory ought to be
enough for anybody." - Bill Gates, 1981
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050404/0241238e/attachment.html
From paul.rogers at shaw.ca Mon Apr 4 11:59:32 2005
From: paul.rogers at shaw.ca (Paul Rogers)
Date: Mon, 04 Apr 2005 09:59:32 -0600
Subject: [Wtr-general] treeviews was ( hidden field )
In-Reply-To: <003201c5392a$04771590$6400a8c0@NewDell>
Message-ID: <003c01c5392f$4ab96f80$6400a8c0@NewDell>
Another popular treeview is Joust ( http://www.ivanpeters.com/ )
This can be accessed easily:
ie.goto('http://www.ivanpeters.com/')
irb(main):039:0> ie.show_frames
there are 4 frames
frame index: 0 name: title
frame index: 1 name: menu
frame index: 2 name: menuCntrl
frame index: 3 name: text
ie.frame("menu").link(:text , /Wel/).flash
Because of the images used, its easier to iterate through the links
collection or use :index
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: 04 April 2005 09:22
To: wtr-general at rubyforge.org
Subject: [Wtr-general] treeviews was ( hidden field )
The MSDN site (http://msdn.microsoft.com/library/default.asp ) Strangely
does not use this control, so it can be accessed with this
code:
ie.goto( 'http://msdn.microsoft.com/library/default.asp')
ie.frame("fraLeftFrame").frame("fraDeeptree").link(:index,6).click
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andrei MATEI
Sent: 04 April 2005 04:42
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] hidden field
Thank you all for your answers.
I am trying to set the value of a hidden field because that hidden field
is normally filled by javascript when you perform some actions on a
Microsoft IE TreeView control (I'm using asp.net). This renders as a
strange object (it uses some .htc behaviours) and I can't manipulate it
using watir (or can I ???).
Paul, I've done what you said and it worked. I also had to change the
set method of the TextField class and make it _not_ set focus on the
object, because the hidden field doesn't support focus. Maybe you would
want to include the feature in the next version, because I think it is
important. Anyway, I also was able to manipulate the hidden field doing
something like:
y=$ie.getDocument.all['myHiddenField']
y.value="the value that I want" body=$ie.getDocument().forms['form1']
body.submit()
This is great, but I am curious why stuff like this works... I can't
find the code for this stuff in watir.rb. When I say $ie.getDocument(),
is the return value actually a COM object? If so, are "forms", or "all",
properties of this object? Am I understanding this corectly?
Thanks a lot,
Andrei
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Friday, April 01, 2005 8:06 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] hidden field
I was wondering why you would want to do this too. Users don't access
these things, which is why we havent exposed any methods to do it.
You can do it if you want, in watir.rb cut n paste the TextField class
and change the getObject line in the construcor to include "hidden".
Unfortunately there is not an easy way to over ride this behaviour
(which is why you have to cut n paste).
If you have to do this, I expect there is a better way to test what you
are doing - or are you trying to test hacking attempts?
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon
Sent: 01 April 2005 08:03
To: wtr-general at rubyforge.org
Subject: Re: [Wtr-general] hidden field
> Why do you want to fill hidden field? Can you send problem
> description, source, screen shot...?
This is a good point. Manipulating a hidden field is arguably not a
valid test. I wouldn't want to try to justify the utility of
manipulating a hidden field.
Maybe you could make the field not-hidden, and then manipulate it?
-Chris
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
From amatei at softwin.ro Tue Apr 5 07:05:38 2005
From: amatei at softwin.ro (Andrei MATEI)
Date: Tue, 5 Apr 2005 14:05:38 +0300
Subject: [Wtr-general] treeviews was ( hidden field )
In-Reply-To: <003c01c5392f$4ab96f80$6400a8c0@NewDell>
Message-ID: <2000SRV4HGXAwxXSXI300000a57@softwin.ro>
I meant in my particular case I can use a hidden field. The IE TreeView
Control does not have a hidden field.
Where can I find some good documentation about all the features in watir/IE
COM interface?
Thanks,
Andrei Matei
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Monday, April 04, 2005 7:00 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] treeviews was ( hidden field )
Another popular treeview is Joust ( http://www.ivanpeters.com/ )
This can be accessed easily:
ie.goto('http://www.ivanpeters.com/')
irb(main):039:0> ie.show_frames
there are 4 frames
frame index: 0 name: title
frame index: 1 name: menu
frame index: 2 name: menuCntrl
frame index: 3 name: text
ie.frame("menu").link(:text , /Wel/).flash
Because of the images used, its easier to iterate through the links
collection or use :index
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: 04 April 2005 09:22
To: wtr-general at rubyforge.org
Subject: [Wtr-general] treeviews was ( hidden field )
The MSDN site (http://msdn.microsoft.com/library/default.asp ) Strangely
does not use this control, so it can be accessed with this
code:
ie.goto( 'http://msdn.microsoft.com/library/default.asp')
ie.frame("fraLeftFrame").frame("fraDeeptree").link(:index,6).click
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andrei MATEI
Sent: 04 April 2005 04:42
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] hidden field
Thank you all for your answers.
I am trying to set the value of a hidden field because that hidden field
is normally filled by javascript when you perform some actions on a
Microsoft IE TreeView control (I'm using asp.net). This renders as a
strange object (it uses some .htc behaviours) and I can't manipulate it
using watir (or can I ???).
Paul, I've done what you said and it worked. I also had to change the
set method of the TextField class and make it _not_ set focus on the
object, because the hidden field doesn't support focus. Maybe you would
want to include the feature in the next version, because I think it is
important. Anyway, I also was able to manipulate the hidden field doing
something like:
y=$ie.getDocument.all['myHiddenField']
y.value="the value that I want" body=$ie.getDocument().forms['form1']
body.submit()
This is great, but I am curious why stuff like this works... I can't
find the code for this stuff in watir.rb. When I say $ie.getDocument(),
is the return value actually a COM object? If so, are "forms", or "all",
properties of this object? Am I understanding this corectly?
Thanks a lot,
Andrei
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Friday, April 01, 2005 8:06 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] hidden field
I was wondering why you would want to do this too. Users don't access
these things, which is why we havent exposed any methods to do it.
You can do it if you want, in watir.rb cut n paste the TextField class
and change the getObject line in the construcor to include "hidden".
Unfortunately there is not an easy way to over ride this behaviour
(which is why you have to cut n paste).
If you have to do this, I expect there is a better way to test what you
are doing - or are you trying to test hacking attempts?
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon
Sent: 01 April 2005 08:03
To: wtr-general at rubyforge.org
Subject: Re: [Wtr-general] hidden field
> Why do you want to fill hidden field? Can you send problem
> description, source, screen shot...?
This is a good point. Manipulating a hidden field is arguably not a
valid test. I wouldn't want to try to justify the utility of
manipulating a hidden field.
Maybe you could make the field not-hidden, and then manipulate it?
-Chris
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
From amatei at softwin.ro Tue Apr 5 07:06:37 2005
From: amatei at softwin.ro (Andrei MATEI)
Date: Tue, 5 Apr 2005 14:06:37 +0300
Subject: [Wtr-general] database support
Message-ID: <2000SRVbI7bPKdhn3Wf00000a58@softwin.ro>
Hi again,
How can I access a SQL Server database from Ruby? Is there a library that I
can use?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050405/a9a995d5/attachment.html
From avik.sengupta at gmail.com Tue Apr 5 08:55:12 2005
From: avik.sengupta at gmail.com (Avik Sengupta)
Date: Tue, 5 Apr 2005 18:25:12 +0530
Subject: [Wtr-general] Http Basic Authentication
Message-ID: <76fd89bb050405055554c3ae78@mail.gmail.com>
Is there a way to use Watir to test websites using HTTP Basic
Authentication (ie, the big grey username/password box thrown up by
the browser) ?
Regards
-
Avik
From paul.rogers at shaw.ca Tue Apr 5 09:43:46 2005
From: paul.rogers at shaw.ca (Paul Rogers)
Date: Tue, 05 Apr 2005 07:43:46 -0600
Subject: [Wtr-general] Http Basic Authentication
In-Reply-To: <76fd89bb050405055554c3ae78@mail.gmail.com>
Message-ID: <001b01c539e5$7d4e3aa0$6400a8c0@NewDell>
Yes, but you will have to use the winclickers.rb
There is a method called clearSecurityAlertBox()
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Avik Sengupta
Sent: 05 April 2005 06:55
To: Wtr-general at rubyforge.org
Subject: [Wtr-general] Http Basic Authentication
Is there a way to use Watir to test websites using HTTP Basic
Authentication (ie, the big grey username/password box thrown up by the
browser) ?
Regards
-
Avik
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
From paul.rogers at shaw.ca Tue Apr 5 10:00:05 2005
From: paul.rogers at shaw.ca (Paul Rogers)
Date: Tue, 05 Apr 2005 08:00:05 -0600
Subject: [Wtr-general] database support
In-Reply-To: <2000SRVbI7bPKdhn3Wf00000a58@softwin.ro>
Message-ID: <001c01c539e7$c4e667f0$6400a8c0@NewDell>
http://ruby-dbi.sourceforge.net/
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andrei MATEI
Sent: 05 April 2005 05:07
To: wtr-general at rubyforge.org
Subject: [Wtr-general] database support
Hi again,
How can I access a SQL Server database from Ruby? Is there a library
that I can use?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050405/aa1a297e/attachment.html
From paul.rogers at shaw.ca Tue Apr 5 10:02:44 2005
From: paul.rogers at shaw.ca (Paul Rogers)
Date: Tue, 05 Apr 2005 08:02:44 -0600
Subject: [Wtr-general] treeviews was ( hidden field )
In-Reply-To: <2000SRV4HGXAwxXSXI300000a57@softwin.ro>
Message-ID: <002101c539e8$23fce7a0$6400a8c0@NewDell>
I added support for hidden fields anyway
Check the rdoc for the watir api - its on wtr.rubyforge.org
The unittests are also a good place to look - normally
c:\watir-bonus\unittests
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andrei MATEI
Sent: 05 April 2005 05:06
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] treeviews was ( hidden field )
I meant in my particular case I can use a hidden field. The IE TreeView
Control does not have a hidden field. Where can I find some good
documentation about all the features in watir/IE COM interface?
Thanks,
Andrei Matei
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Monday, April 04, 2005 7:00 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] treeviews was ( hidden field )
Another popular treeview is Joust ( http://www.ivanpeters.com/ )
This can be accessed easily:
ie.goto('http://www.ivanpeters.com/')
irb(main):039:0> ie.show_frames
there are 4 frames
frame index: 0 name: title
frame index: 1 name: menu
frame index: 2 name: menuCntrl
frame index: 3 name: text
ie.frame("menu").link(:text , /Wel/).flash
Because of the images used, its easier to iterate through the links
collection or use :index
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: 04 April 2005 09:22
To: wtr-general at rubyforge.org
Subject: [Wtr-general] treeviews was ( hidden field )
The MSDN site (http://msdn.microsoft.com/library/default.asp ) Strangely
does not use this control, so it can be accessed with this
code:
ie.goto( 'http://msdn.microsoft.com/library/default.asp')
ie.frame("fraLeftFrame").frame("fraDeeptree").link(:index,6).click
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andrei MATEI
Sent: 04 April 2005 04:42
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] hidden field
Thank you all for your answers.
I am trying to set the value of a hidden field because that hidden field
is normally filled by javascript when you perform some actions on a
Microsoft IE TreeView control (I'm using asp.net). This renders as a
strange object (it uses some .htc behaviours) and I can't manipulate it
using watir (or can I ???).
Paul, I've done what you said and it worked. I also had to change the
set method of the TextField class and make it _not_ set focus on the
object, because the hidden field doesn't support focus. Maybe you would
want to include the feature in the next version, because I think it is
important. Anyway, I also was able to manipulate the hidden field doing
something like:
y=$ie.getDocument.all['myHiddenField']
y.value="the value that I want" body=$ie.getDocument().forms['form1']
body.submit()
This is great, but I am curious why stuff like this works... I can't
find the code for this stuff in watir.rb. When I say $ie.getDocument(),
is the return value actually a COM object? If so, are "forms", or "all",
properties of this object? Am I understanding this corectly?
Thanks a lot,
Andrei
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Friday, April 01, 2005 8:06 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] hidden field
I was wondering why you would want to do this too. Users don't access
these things, which is why we havent exposed any methods to do it.
You can do it if you want, in watir.rb cut n paste the TextField class
and change the getObject line in the construcor to include "hidden".
Unfortunately there is not an easy way to over ride this behaviour
(which is why you have to cut n paste).
If you have to do this, I expect there is a better way to test what you
are doing - or are you trying to test hacking attempts?
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon
Sent: 01 April 2005 08:03
To: wtr-general at rubyforge.org
Subject: Re: [Wtr-general] hidden field
> Why do you want to fill hidden field? Can you send problem
> description, source, screen shot...?
This is a good point. Manipulating a hidden field is arguably not a
valid test. I wouldn't want to try to justify the utility of
manipulating a hidden field.
Maybe you could make the field not-hidden, and then manipulate it?
-Chris
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
From christopher.mcmahon at gmail.com Tue Apr 5 11:09:48 2005
From: christopher.mcmahon at gmail.com (Chris McMahon)
Date: Tue, 5 Apr 2005 10:09:48 -0500
Subject: [Wtr-general] database support
In-Reply-To: <2000SRVbI7bPKdhn3Wf00000a58@softwin.ro>
References: <2000SRVbI7bPKdhn3Wf00000a58@softwin.ro>
Message-ID: <72799cd705040508093474b65c@mail.gmail.com>
> How can I access a SQL Server database from Ruby? Is there a library that I
> can use?
Use the ODBC feature of Ruby's DBI library. Here's some example code:
@connection = connect('db-instance', 'username', 'password')
assert @connection
q = @connection.prepare("SELECT * FROM table")
q.execute
@table_contents = q.fetch_all
Untested, but should work. I did this for real just a couple of days ago.
-Chris
From bret at pettichord.com Tue Apr 5 09:55:52 2005
From: bret at pettichord.com (Bret Pettichord)
Date: Tue, 05 Apr 2005 08:55:52 -0500
Subject: [Wtr-general] database support
In-Reply-To: <2000SRVbI7bPKdhn3Wf00000a58@softwin.ro>
Message-ID: <5.1.0.14.2.20050405085434.01b9fff0@127.0.0.1>
Here is some sample code for accessing SQL Server courtesy of Chris McMahon:
require 'odbc'
include ODBC
class TC_add_claim_kitchen_sink < Test::Unit::TestCase
def setup
@connection = connect('tw-wea', 'std', 'std')
assert @connection
q = @connection.prepare("SELECT id FROM claim WHERE claim_number =
12345678901")
q.execute
@current_claim_id = q.fetch_all
return unless @current_claim_id
['benefit_period', 'days_worked', 'effective_dated_benefit_salary',
'effective_dated_claim_statuses', 'effective_dated_contract_days',
'last_day_worked'].each {|table| sql_execute("DELETE FROM
#{table} WHERE claim_id = #{@current_claim_id}")}
sql_execute("DELETE FROM claim WHERE claim_number = 12345678901")
end
def sql_execute sql_string
@connection.prepare(sql_string).execute
end
...
At 06:06 AM 4/5/2005, Andrei MATEI wrote:
>Hi again,
>
>
>
>How can I access a SQL Server database from Ruby? Is there a library that
>I can use?
>
>
>
>Thanks
>_______________________________________________
>Wtr-general mailing list
>Wtr-general at rubyforge.org
>http://rubyforge.org/mailman/listinfo/wtr-general
_____________________
Bret Pettichord
www.pettichord.com
From christopher.mcmahon at gmail.com Tue Apr 5 12:53:41 2005
From: christopher.mcmahon at gmail.com (Chris McMahon)
Date: Tue, 5 Apr 2005 11:53:41 -0500
Subject: [Wtr-general] database support
In-Reply-To: <5.1.0.14.2.20050405085434.01b9fff0@127.0.0.1>
References: <2000SRVbI7bPKdhn3Wf00000a58@softwin.ro>
<5.1.0.14.2.20050405085434.01b9fff0@127.0.0.1>
Message-ID: <72799cd7050405095358307bbc@mail.gmail.com>
On Apr 5, 2005 8:55 AM, Bret Pettichord wrote:
> Here is some sample code for accessing SQL Server courtesy of Chris McMahon:
>
I guess that wasn't proprietary after all. =)
-C
From c.r.mcgrath at gmail.com Tue Apr 5 18:00:42 2005
From: c.r.mcgrath at gmail.com (Chris McGrath)
Date: Tue, 5 Apr 2005 23:00:42 +0100
Subject: [Wtr-general] database support
In-Reply-To: <2000SRVbI7bPKdhn3Wf00000a58@softwin.ro>
References: <2000SRVbI7bPKdhn3Wf00000a58@softwin.ro>
Message-ID:
If you're familiar with ADO at all, you can also use it through WIN32OLE
require 'win32ole'
rs = WIN32OLE.new("ADODB.Recordset")
...
Chris
On Apr 5, 2005 12:06 PM, Andrei MATEI wrote:
>
>
>
> Hi again,
>
>
>
> How can I access a SQL Server database from Ruby? Is there a library that I
> can use?
>
>
>
> Thanks
> _______________________________________________
> Wtr-general mailing list
> Wtr-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>
>
>
From lsusilo at rsasecurity.com Wed Apr 6 13:24:19 2005
From: lsusilo at rsasecurity.com (Susilo, Laudhi)
Date: Wed, 6 Apr 2005 10:24:19 -0700
Subject: [Wtr-general] Getting text out of table's cell
Message-ID: <2548B245CD5B9D45AC32CF3889D2E6D001FDEB26@rsana-ex-va1.NA.RSA.NET>
Could anyone please point me out on how to get the text out of this
element by using its id?
I try to use getObject(:id, "id=tblshResults[4][1]") and it returns a
valid object. How do I get the text?
Full
Thanks,
Laudhi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050406/c411735a/attachment.html
From paul.rogers at shaw.ca Wed Apr 6 13:45:25 2005
From: paul.rogers at shaw.ca (Paul Rogers)
Date: Wed, 06 Apr 2005 11:45:25 -0600
Subject: [Wtr-general] Getting text out of table's cell
In-Reply-To: <2548B245CD5B9D45AC32CF3889D2E6D001FDEB26@rsana-ex-va1.NA.RSA.NET>
Message-ID: <005601c53ad0$69cbce20$6400a8c0@NewDell>
my_string = ie.cell(:id , 'blshResults[4][1]').text
should do it - see table_test.rb in the unittests directory
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Susilo, Laudhi
Sent: 06 April 2005 11:24
To: wtr-general at rubyforge.org
Subject: [Wtr-general] Getting text out of table's cell
Could anyone please point me out on how to get the text out of this
element by using its id?
I try to use getObject(:id, "id=tblshResults[4][1]") and it returns a
valid object. How do I get the text?
Full
Thanks,
Laudhi
From Mark_Cain at rl.gov Thu Apr 7 15:58:05 2005
From: Mark_Cain at rl.gov (Cain, Mark)
Date: Thu, 7 Apr 2005 12:58:05 -0700
Subject: [Wtr-general] Getting text out of table's cell
Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04E154ED0@EX5V.rl.gov>
What if you have cells that do not have any id property set?
A7
Other Problem
How would I access the delete and edit buttons in turn for cell value
A7?
Thanks,
--Mark
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Wednesday, April 06, 2005 10:45 AM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Getting text out of table's cell
my_string = ie.cell(:id , 'blshResults[4][1]').text
should do it - see table_test.rb in the unittests directory
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Susilo, Laudhi
Sent: 06 April 2005 11:24
To: wtr-general at rubyforge.org
Subject: [Wtr-general] Getting text out of table's cell
Could anyone please point me out on how to get the text out of this
element by using its id?
I try to use getObject(:id, "id=tblshResults[4][1]") and it returns a
valid object. How do I get the text?
Full
Thanks,
Laudhi
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
From paul.rogers at shaw.ca Thu Apr 7 16:47:28 2005
From: paul.rogers at shaw.ca (Paul Rogers)
Date: Thu, 07 Apr 2005 14:47:28 -0600
Subject: [Wtr-general] Getting text out of table's cell
In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04E154ED0@EX5V.rl.gov>
Message-ID: <006f01c53bb3$03f5eac0$6400a8c0@NewDell>
For the general case,
Ie.table(:id, 'my_table')[1][2].text
Where [1] is the row number and [2] is the cell ( these are 1 based)
You can of course use :index in place of :id
Or just get the whole table as an array
my_array = Ie.table(:id, 'my_table').to_a
Which will now be a 2 d array
If your row has an id you can use
Ie.row(:id:,'my_row')[2].text
Where [2] is the cell number
To access buttons, you can use this, thanks to Lorenzo!
table = ie.table(:index,1)
table[1][1].button.click
Maybe we should also add some iterators for row, and cell
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark
Sent: 07 April 2005 13:58
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Getting text out of table's cell
What if you have cells that do not have any id property set?
A7
Other Problem
How would I access the delete and edit buttons in turn for cell value
A7?
Thanks,
--Mark
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Wednesday, April 06, 2005 10:45 AM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Getting text out of table's cell
my_string = ie.cell(:id , 'blshResults[4][1]').text
should do it - see table_test.rb in the unittests directory
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Susilo, Laudhi
Sent: 06 April 2005 11:24
To: wtr-general at rubyforge.org
Subject: [Wtr-general] Getting text out of table's cell
Could anyone please point me out on how to get the text out of this
element by using its id? I try to use getObject(:id,
"id=tblshResults[4][1]") and it returns a valid object. How do I get the
text?
Full
Thanks,
Laudhi
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
From amatei at softwin.ro Fri Apr 8 07:32:48 2005
From: amatei at softwin.ro (Andrei MATEI)
Date: Fri, 8 Apr 2005 14:32:48 +0300
Subject: [Wtr-general] Getting text out of table's cell
In-Reply-To: <006f01c53bb3$03f5eac0$6400a8c0@NewDell>
Message-ID: <2000SRVQW2arWCwbn8k00000cf6@softwin.ro>
What about something like accessing the third button in a certain cell?
In my opinion, every "container object", like a table, a cell, a div, span,
etc. should contain methods for accessing every other object, so you could
do something like:
Ie.table(:id,'my_table')[1][2].textField(:name,"something")...
Is this possible right now?
Thanks,
Andrei
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Thursday, April 07, 2005 11:47 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Getting text out of table's cell
For the general case,
Ie.table(:id, 'my_table')[1][2].text
Where [1] is the row number and [2] is the cell ( these are 1 based)
You can of course use :index in place of :id
Or just get the whole table as an array
my_array = Ie.table(:id, 'my_table').to_a
Which will now be a 2 d array
If your row has an id you can use
Ie.row(:id:,'my_row')[2].text
Where [2] is the cell number
To access buttons, you can use this, thanks to Lorenzo!
table = ie.table(:index,1)
table[1][1].button.click
Maybe we should also add some iterators for row, and cell
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark
Sent: 07 April 2005 13:58
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Getting text out of table's cell
What if you have cells that do not have any id property set?
A7
Other Problem
How would I access the delete and edit buttons in turn for cell value
A7?
Thanks,
--Mark
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Wednesday, April 06, 2005 10:45 AM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Getting text out of table's cell
my_string = ie.cell(:id , 'blshResults[4][1]').text
should do it - see table_test.rb in the unittests directory
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Susilo, Laudhi
Sent: 06 April 2005 11:24
To: wtr-general at rubyforge.org
Subject: [Wtr-general] Getting text out of table's cell
Could anyone please point me out on how to get the text out of this
element by using its id? I try to use getObject(:id,
"id=tblshResults[4][1]") and it returns a valid object. How do I get the
text?
Full
Thanks,
Laudhi
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
From paul.rogers at shaw.ca Sat Apr 9 19:21:55 2005
From: paul.rogers at shaw.ca (Paul Rogers)
Date: Sat, 09 Apr 2005 17:21:55 -0600
Subject: [Wtr-general] Getting text out of table's cell
In-Reply-To: <2000SRVQW2arWCwbn8k00000cf6@softwin.ro>
Message-ID: <003801c53d5a$ebc0cfc0$6400a8c0@NewDell>
Ive added this in. Get the latest from cvs also see the table_test to
see how it works - you'll need to update the html test files too.
Bret, can you take a look through the code and see if you are happy with
the way Ive done it?
Lorenzo - you added this feature to start, is the latest implementation
satisfactory for your needs?
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andrei MATEI
Sent: 08 April 2005 05:33
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Getting text out of table's cell
What about something like accessing the third button in a certain cell?
In my opinion, every "container object", like a table, a cell, a div,
span, etc. should contain methods for accessing every other object, so
you could do something like:
Ie.table(:id,'my_table')[1][2].textField(:name,"something")...
Is this possible right now?
Thanks,
Andrei
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Thursday, April 07, 2005 11:47 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Getting text out of table's cell
For the general case,
Ie.table(:id, 'my_table')[1][2].text
Where [1] is the row number and [2] is the cell ( these are 1 based) You
can of course use :index in place of :id
Or just get the whole table as an array
my_array = Ie.table(:id, 'my_table').to_a
Which will now be a 2 d array
If your row has an id you can use
Ie.row(:id:,'my_row')[2].text
Where [2] is the cell number
To access buttons, you can use this, thanks to Lorenzo!
table = ie.table(:index,1)
table[1][1].button.click
Maybe we should also add some iterators for row, and cell
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark
Sent: 07 April 2005 13:58
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Getting text out of table's cell
What if you have cells that do not have any id property set?
A7
Other Problem
How would I access the delete and edit buttons in turn for cell value
A7?
Thanks,
--Mark
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Wednesday, April 06, 2005 10:45 AM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Getting text out of table's cell
my_string = ie.cell(:id , 'blshResults[4][1]').text
should do it - see table_test.rb in the unittests directory
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Susilo, Laudhi
Sent: 06 April 2005 11:24
To: wtr-general at rubyforge.org
Subject: [Wtr-general] Getting text out of table's cell
Could anyone please point me out on how to get the text out of this
element by using its id? I try to use getObject(:id,
"id=tblshResults[4][1]") and it returns a valid object. How do I get the
text?
Full
Thanks,
Laudhi
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
From lorenzo_jorquera at yahoo.com Mon Apr 11 10:25:50 2005
From: lorenzo_jorquera at yahoo.com (Lorenzo Jorquera)
Date: Mon, 11 Apr 2005 09:25:50 -0500 (CDT)
Subject: [Wtr-general] Getting text out of table's cell
In-Reply-To: <003801c53d5a$ebc0cfc0$6400a8c0@NewDell>
Message-ID: <20050411142550.44547.qmail@web32201.mail.mud.yahoo.com>
I've tried it and it is working fine for me.
However, I have a question:
I understand that the ability to find an object in a row is useful, but why do we need to identify an object inside a cell? I mean, why do we have to write
Ie.table(:id,'my_table')[1][2].textField(:name,"something")
instead of
Ie.table(:id,'my_table')[1][2].textField
Is it posible to have more than one textField (or any other object) in a cell?
Lorenzo.
Paul Rogers wrote:
Ive added this in. Get the latest from cvs also see the table_test to
see how it works - you'll need to update the html test files too.
Bret, can you take a look through the code and see if you are happy with
the way Ive done it?
Lorenzo - you added this feature to start, is the latest implementation
satisfactory for your needs?
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andrei MATEI
Sent: 08 April 2005 05:33
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Getting text out of table's cell
What about something like accessing the third button in a certain cell?
In my opinion, every "container object", like a table, a cell, a div,
span, etc. should contain methods for accessing every other object, so
you could do something like:
Ie.table(:id,'my_table')[1][2].textField(:name,"something")...
Is this possible right now?
Thanks,
Andrei
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Thursday, April 07, 2005 11:47 PM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Getting text out of table's cell
For the general case,
Ie.table(:id, 'my_table')[1][2].text
Where [1] is the row number and [2] is the cell ( these are 1 based) You
can of course use :index in place of :id
Or just get the whole table as an array
my_array = Ie.table(:id, 'my_table').to_a
Which will now be a 2 d array
If your row has an id you can use
Ie.row(:id:,'my_row')[2].text
Where [2] is the cell number
To access buttons, you can use this, thanks to Lorenzo!
table = ie.table(:index,1)
table[1][1].button.click
Maybe we should also add some iterators for row, and cell
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark
Sent: 07 April 2005 13:58
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Getting text out of table's cell
What if you have cells that do not have any id property set?
A7
Other Problem
[input] 7);" type=button value=Delete>
[input] 7);" type=button value=Edit>
How would I access the delete and edit buttons in turn for cell value
A7?
Thanks,
--Mark
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers
Sent: Wednesday, April 06, 2005 10:45 AM
To: wtr-general at rubyforge.org
Subject: RE: [Wtr-general] Getting text out of table's cell
my_string = ie.cell(:id , 'blshResults[4][1]').text
should do it - see table_test.rb in the unittests directory
Paul
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Susilo, Laudhi
Sent: 06 April 2005 11:24
To: wtr-general at rubyforge.org
Subject: [Wtr-general] Getting text out of table's cell
Could anyone please point me out on how to get the text out of this
element by using its id? I try to use getObject(:id,
"id=tblshResults[4][1]") and it returns a valid object. How do I get the
text?
Full
Thanks,
Laudhi
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
---------------------------------
Do You Yahoo!?
Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo.
Vis?ta Yahoo! Noticias.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050411/a710d7bb/attachment.html
From paul.rogers at shaw.ca Mon Apr 11 11:28:05 2005
From: paul.rogers at shaw.ca (Paul Rogers)
Date: Mon, 11 Apr 2005 09:28:05 -0600
Subject: [Wtr-general] www.Watir.com
Message-ID: <003601c53eab$121baae0$6400a8c0@NewDell>
Ive registered this domain
It just redirects to http://wtr.rubyforge.org
Paul
From paul.rogers at shaw.ca Mon Apr 11 11:53:41 2005
From: paul.rogers at shaw.ca (Paul Rogers)
Date: Mon, 11 Apr 2005 09:53:41 -0600
Subject: [Wtr-general] Getting text out of table's cell
In-Reply-To: <20050411142550.44547.qmail@web32201.mail.mud.yahoo.com>
Message-ID: <003a01c53eae$a5ae91c0$6400a8c0@NewDell>
It certainly is possible to have many buttons or textfields in a cell
consider the following: