Adventures In Real Life
Wednesday, June 21, 2006
Running with WATIR
I mentioned
WATIR
a while back and I have been using it almost every day for the last month or so. The more I use it the more I like it. WATIR is built around Ruby as I mentioned earlier. So I've been looking into Ruby more and more. I have to say I really like it and am starting to use it for some repeative tasks. For example I have a WATIR test that logs into the applications, hits some links etc. It takes about 40 to 60 seconds to run. Well I decided that I really wanted to have a way to run it multiple times in a row. Well, I decided to write a quick Ruby script to take care of this for me. It took about two minutes to look up the system function, which works almost exactly as it does in PERL, another 5 minutes to code and debug and I was done
i = 0
done = ARGV[0]
testScript = ARGV[1]
if(done == nil) or (testScript == nil)
print "usage: ruby runmore.rb N ScriptName\n\r"
print "N equals number of times test should run\n\r"
print "ScriptName equals the ruby/watir script you want to run"
else
while i < done.to_i do
system("ruby #{testScript}")
i = i + 1
end
end
I'm really beginning to enjoy Ruby it's as readable as VB and as writable as PERL. Not bad for a interpeted language that doesn't use semicolons
Happy Coding
P.S. yes, I wrote a script to run another script...
Programming
|
Technology
6/21/2006 3:24:09 PM (Pacific Daylight Time, UTC-07:00)
Comments [0]
Name
E-mail
Home page
Remember Me
Comment (HTML not allowed)
Enter the code shown (prevents robots):
© Copyright 2009 Russell A. Kelly
Theme design by
Bryan Bell
newtelligence dasBlog 1.8.5223.1
|
|
| Page rendered at 1/6/2009 1:00:43 AM (Pacific Standard Time, UTC-08:00)
On this page....
<
January 2009
>
Sun
Mon
Tue
Wed
Thu
Fri
Sat
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
Search
Contact
Russell Kelly
I'm a Sr. Web Developer with 10 years of experience in Web Development.
About Me
Navigation
Home
Top 5 Technical Posts
Top 5 Family Posts
Categories
Apple
Art
Cars
Family
Funny
General
health
Motorcycles
Music
Photography
productivity
Programming
Rant
Technology
Blogroll
43 Folders
Chardy
The Adventures of Chardy
Coding Horror
Dad Gone Mad
Infinities Loop
David Reed explains how ASP.NET really works.
Joel on Software
Life Reboot
Lifehacker
Tech tricks, tips and downloads for getting things done
Photos of Real Life
PixieStitch
Yes, She's back and rock'n you sewing world
Scott Guthrie's Blog
Scott Hanselman
Super Green
A movement to invoke the City of Los Angeles and the State of California to take action on the pollution problems, particularly in the L.A. River and Bologna Creek
The Kneeslider
All things on two wheels
The Wayward WebLog
Tim Ferriss
Author of the four hour work week
Worst Than Failure
Zen Habits
Sign In