July 25, 2010 12:31 am

WTANZ 07 – Web page automation with Ruby / Watir

Filed under: Software Quality,Software Testing,Weekend Testing — ramsblog @ 12:31 am

As usual, I was not sure if I was going to login tonight. However, just made it somehow. The first question I was asked was if i have done the homework. For not looking at the mission completely and not being sure of joining, obviously I had not done my homework.

Oliver got me started with links and pointers right away. I had to do the following:

1. Download Ruby and Install http://watir.com/installation/#win
2. go over the wiki for some details to update and install further components
3. install Watir.

Mission for this session can be found here: http://weekendtesting.com/discussions?vasthtmlaction=viewtopic&t=126.0 

it took a while with several glitches to get through, but got back to track with the session. Oliver walked us through basic commands to navigate the page, locate the page controls, etc. and put the exercise for the team to put the learning into practice. hmmm.. great approach, the lessons have to be applied immediately to get better at it and theoretical knowledge is not good enough.

as we went along, we tried several commands and controls to get hand of it.

What I learned:
> certainly a great start learning another tool/language
> teamwork in helping each other getting upto speed
> got some hang of ruby/watir which i had never used before
> while following the chat, i tried copying the commands so i could get upto speed and worked well at the same time.
> I still couldn’t get the regular expression search working, i need to try it over again.
> attend  another similar session 🙂

my sample code:

>> b = Watir::Browser.new
>> b.goto("http://weekendtesting.com")
>> b.text.include?"Forum"
>> b.link(:text,"Forum").click
>> b.text.include?"Next weekend Testing Session"
>> b.text.include?"Forum"
>> b.text.include?"Next Weekend"
>> b.text_field(:id,"log").set "<username>"
>> b.text_field(:id,"pwd").set "<password>"
>> b.checkbox(:id,"rememberme").click
>> b.button(:value,"Login").click
>> b.text_field(:id,"s4").set "comments via Watir on july 24 WTANZ 07"
>> b.button(:value, "Submit Comment").click
>> b.link(:text, "Next Weekend Testing Session").click
>> b.link(:text, "WTANZ session #07 – Test Automation with Watir").click
>> b.text.include?"Reply"
>> b.link(:text, "Reply").click
>> b.text_field(:name,"message").set "Reply WTANZ 07 message via Watir on july>
>> b.button(:value, "Submit").click

What would have helped me in this session:
> a little homework would have helped, but with the team’s sharing all through the session, helped get back on track
> when working on Web page automation, getting to know the control properties
> using home computer, i didn’t have the IE web developer add-in or fiddler tool  installed, and having those would help get the control properties sooner.
> the posts, and search worked well on this session, I need to venture into validating if the actions really took place in addition to visual verification.

There was a great debriefing / retrospection session after the learning and applying tasks. There were conversations around Watir, Cucumber, Selenium, and other tools. No, i haven’t used any of these. It would be interesting to know how these several tools scale up to the robust web automation.

There is always a challenge of changing the Control IDs and Names in regular coding cycle. How would a tool cope up with such changes. We had once taken an approach of keeping these in configuration / resource file, so we wouldn’t have to change the code with any of those controls changes.

Overall, it was a great session. Thank you Marlena (@marlenac), Oliver (@Oliver_NZ) and the team.



  1. It was great to have you join! Thanks for writing up such a lovely summary 🙂

    Comment by Marlena Compton — July 26, 2010 2:22 am @ 2:22 am | Reply

  2. Blogging frequency “monthly” 🙂

    Comment by bach — July 26, 2010 11:43 am @ 11:43 am | Reply

    • just noting down 🙂

      Comment by bach — July 26, 2010 11:44 am @ 11:44 am | Reply

      • hehhee.. Bach, i will try to get back for regular posts 🙂

        Comment by Ram — August 16, 2010 12:58 am @ 12:58 am

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: