[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: how to click the Buttons in Forms

Ban Hoang

9/11/2006 8:54:00 PM



I still get an error if I use:
$ie.frame("bottom").button(:value, /Login/).click
----
1) Error:
test_01_LoginTestCase(TC_pulldownBox_Links_Clicks):
Watir::Exception::UnknownObjectException: Unable to locate object, using
value and (?-mix:Login)
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists'
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2009:in `click'
Login_test1.rb:24:in `test_01_LoginTestCase'

1 tests, 0 assertions, 0 failures, 1 errors
>Exit code: 1

-----
Try to use the .submit method:

$ie.frame("bottom").button(:name, /Login/).submit

And got the error
1) Error:
test_01_LoginTestCase(TC_pulldownBox_Links_Clicks):
NoMethodError: undefined method `submit' for #<Watir::Button:0x2cbdd54>
Login_test1.rb:24:in `test_01_LoginTestCase'




-----Original Message-----
From: list-bounce@example.com [mailto:list-bounce@example.com] On Behalf
Of Patrick Spence
Sent: Monday, September 11, 2006 12:36 PM
To: ruby-talk ML
Subject: Re: how to click the Buttons in Forms

Ban Hoang wrote:
> Hi ,
> $ie.frame("bottom").button(:value, ":: Login &gt;").click
> HTMl source: ( this is frame_bottom)
>
> <form name=form_login method=POST action=index.php target=_top>
>
> <tr>
>
> <td align=left><input name=email type=text value=""
> class=field size=15 maxlength=50></td>
>
> <td align=left><font face=verdana size=1>&nbsp;</font><input
> name=password type=password value="" class=field size=15
> maxlength=50></td>
>
> <td align=left><font face=verdana size=1>&nbsp;</font><input
> type=submit value=":: Login &gt;" class=button></td>
>
> </tr>
>
> </form>
>
> 1) Error:
>
> test_01_LoginTestCase(TC_pulldownBox_Links_Clicks):
>
> Watir::Exception::UnknownObjectException: Unable to locate object,
using
> value and :: Login &gt;
>
> c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists'
>
> c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2009:in `click'
>
> Login_test1.rb:25:in `test_01_LoginTestCase'
>

Just for S&G, try...

$ie.frame("bottom").button(:value, /Login/).click

Better yet, just call the .submit() method of the form itself.

--
Posted via http://www.ruby-....


2 Answers

Mike

11/21/2008 7:00:00 PM

0

If thats what your doing it should only be a few seconds

"vbasean" wrote:

> that's the whole deal. I'm not looping through the records. All I'm doing is:
> 1) Open
> 2) range("A1").copyfromrecordset rst
>
> two operations that progress through the recordset and I just want to show
> that progress.
>
> --
> ~Your Friend Chris
> http://myvbastuff.blo...
> thinking out loud
>
>
> "Mike" wrote:
>
> > Not sure without seeing your code but this is what i would do.
> > As your looping thru your recordset why not
> > rowNumber = 2 'Starting Row Number for data
> > Do While (Not rs.EOF)
> > Range("A1") = "Record number " r -2& " of " & rs.recordcount
> > rowNumber = rowNumber + 1
> > rs.MoveNext
> > Loop
> >
> > "vbasean" wrote:
> >
> > > Hey all,
> > >
> > > I'm trying to show progress on a large recordset
> > > I've dim'd an ADO recordset with events
> > >
> > > Dim WithEvents rst as ADODB.Recordset
> > >
> > > I've added the event for progress with a call to set a range with the progress
> > >
> > > I've set the screen to updating
> > >
> > > but it just won't show my progress, it locks up on the recordset open
> > > statement and does it's work without showing progress.
> > >
> > > Any suggestions?
> > > --
> > > ~Your Friend Chris
> > > http://myvbastuff.blo...
> > > thinking out loud

vbasean

11/21/2008 7:14:00 PM

0

I wish.. :D

try 4 minutes to open and 4 minutes to copy

i'm opening with the option of adAsyncFetch and I want the 'FetchProgress'
event to fire and show progress on the Worksheet.

what it appears is happening is that at first it progresses (2 steps) but
then it locks and waits until the operation is complete and then fires
another 'FetchProgress'


--
~Your Friend Chris
http://myvbastuff.blo...
thinking out loud


"Mike" wrote:

> If thats what your doing it should only be a few seconds
>
> "vbasean" wrote:
>
> > that's the whole deal. I'm not looping through the records. All I'm doing is:
> > 1) Open
> > 2) range("A1").copyfromrecordset rst
> >
> > two operations that progress through the recordset and I just want to show
> > that progress.
> >
> > --
> > ~Your Friend Chris
> > http://myvbastuff.blo...
> > thinking out loud
> >
> >
> > "Mike" wrote:
> >
> > > Not sure without seeing your code but this is what i would do.
> > > As your looping thru your recordset why not
> > > rowNumber = 2 'Starting Row Number for data
> > > Do While (Not rs.EOF)
> > > Range("A1") = "Record number " r -2& " of " & rs.recordcount
> > > rowNumber = rowNumber + 1
> > > rs.MoveNext
> > > Loop
> > >
> > > "vbasean" wrote:
> > >
> > > > Hey all,
> > > >
> > > > I'm trying to show progress on a large recordset
> > > > I've dim'd an ADO recordset with events
> > > >
> > > > Dim WithEvents rst as ADODB.Recordset
> > > >
> > > > I've added the event for progress with a call to set a range with the progress
> > > >
> > > > I've set the screen to updating
> > > >
> > > > but it just won't show my progress, it locks up on the recordset open
> > > > statement and does it's work without showing progress.
> > > >
> > > > Any suggestions?
> > > > --
> > > > ~Your Friend Chris
> > > > http://myvbastuff.blo...
> > > > thinking out loud