[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Slowing down Watir tests

jeffz_2002

1/18/2006 4:53:00 AM

I'm writing Watir tests for an application. My company isn't used to
automated testing, so I'm assuming that some people are going to want
to follow each test while they run, to be sure that the appropriate
thing is occurring. I'm thinking that I might want to have the test
run a statement and print that statement out to the console, and the
user could then hit a key to go to the next statement.

I'm guessing that there's a clever way in Ruby to handle this, but it's
a wee bit beyond my current Ruby ability. Any ideas?

Thanks,

Jeff

5 Answers

Charles Mills

1/18/2006 6:40:00 AM

0

jeffz_2002@yahoo.com wrote:
> I'm writing Watir tests for an application. My company isn't used to
> automated testing, so I'm assuming that some people are going to want
> to follow each test while they run, to be sure that the appropriate
> thing is occurring. I'm thinking that I might want to have the test
> run a statement and print that statement out to the console, and the
> user could then hit a key to go to the next statement.
>
> I'm guessing that there's a clever way in Ruby to handle this, but it's
> a wee bit beyond my current Ruby ability. Any ideas?
>
> Thanks,
>
> Jeff

Run your tests from a computer on a dial-up connection :)

In all seriousness I am in a similar situation and have the same
question. Also is there an easy way to deal with java pop-up boxes?

-Charlie

Its Me

1/18/2006 3:13:00 PM

0

These should help:

set_fast_speed set_slow_speed


<jeffz_2002@yahoo.com> wrote in message
news:1137559978.550198.24960@g44g2000cwa.googlegroups.com...
> I'm writing Watir tests for an application. My company isn't used to
> automated testing, so I'm assuming that some people are going to want
> to follow each test while they run, to be sure that the appropriate
> thing is occurring. I'm thinking that I might want to have the test
> run a statement and print that statement out to the console, and the
> user could then hit a key to go to the next statement.
>
> I'm guessing that there's a clever way in Ruby to handle this, but it's
> a wee bit beyond my current Ruby ability. Any ideas?
>
> Thanks,
>
> Jeff
>


Chris McMahon

1/18/2006 10:32:00 PM

0

puts "hit RETURN to click button 1"
line = gets
button1.click

puts "now RETURN for button2"
line = gets
button2.click

-Chris

jeffz_2002

1/19/2006 5:24:00 PM

0

This works, but it's a hassle. Essentially, if I have a script like
this:

button1.click
button2.click

I'd like the interpreter to do something like what you've said ...
e.g.,

puts "button1.click"
line = gets
button1.click

puts "button2.click"
line = gets
button2.click

set_slow_speed does slow down the typing, but I was hoping for
something /even slower/, so people could see each line, think about
what it's doing, and then run that line when they want.

Anyway, this is all just a nice-to-have. I might just write a simple
processor that takes a given test and writes out a new .rb file with
extra code between each line, like the above example.

Thanks,
jz

bpettichord

2/14/2006 3:27:00 AM

0

You can control the speed of playback of Watir::IE

module Watir
class IE
def typingspeed(speed)
@typingspeed = speed
end
def sleeptime(pause)
@defaultSleepTime = pause
end
end
end

ie.typingspeed = 0.2
ie.sleeptime = 0.5

Bret