About

  • Just as watermelon contains about 93% water, this WatirMelon blog contains about 93% Watir.
  • WatirMelon is written and maintained by me: Alister Scott.
  • I work as a software tester, here in sunny climatic Brisbane in Australia.
  • As you would expect, the thoughts here are of my own and not my employer.
  • I am the Wiki Web Master for the Watir Project.
  • Please don’t ask me Watir support questions on this page or this blog. Use the Watir community mailing list or Stack Overflow please.
  • You can contact me via alister dot scott at gmail dot com.
  • You can find me on LinkedIn: View Alister Scott's profile on LinkedIn
  • All the examples here will be based upon the Depot Ruby on Rails application from the Agile Rails Book (via Bret Pettichord).
  • This is because you can easily download this application and run it locally to try out any of the ideas.
  • You can try my WatirMelon framework here.
  • The watermelon header image is by Darwin Bell (Creative Commons).

8 thoughts on “About

  1. I am using watir for automated testing of an application. In my application i want to use send keys option.I tried in various ways of giving send keys but its not working. Instead of send key its typing the Key spelling in text box. Note : – I am using firefox browser and using ubuntu 10.04 os for testing. Is this the reason for the failure of Send_keys.I am attaching an example that i used kindly reply.

    require “rubygems”
    require “watir-webdriver”
    browser = Watir::Browser.new :ff
    browser.goto(“http://www.google.co.in”)
    browser.text_field(:name, “q”).set “watir”
    browser.send_keys (“{ENTER}”)

    Narasimha Aluru
    aluru.simha@gmail.com

    • You need to use something like this:
      browser.send_keys :return
      Full list of codes available here

      • I find it interesting that you ask people not to post support questions to your blog, but you answer them anyway. Regardless, you are a pillar of the Watir support community. If you had a donations page, I would gladly contribute!

  2. I am trying to automate a slider using watir-webdriver and ruby but am having no luck. I want to be able to manipulate the slider to either increase or decrease the value. I have searched everywhere and asked a few of my colleagues but no one has an answer. I am attaching a piece of HTML code for the slider. Any help would be much appreciated.

    Azher Hussain
    azherjh@gmail.com

    • Please ask on the Watir mailing list: https://groups.google.com/forum/#!forum/watir-general or StackOverflow for a prompt response

  3. Thanks so much for your blog, it’s saved me many hours already. I’m looking into using a combination of watir and jenkins to run frontend tests for several of our applications. We currently use an ancient version of sitescope that doesn’t support javascript or any newer web techs.

    I’ve never touched Ruby before this, so it’s been a learning experience.

    Hoping maybe you might know off the top of your head what might be the issue here? Out of 10 servers, half of them (sometimes less, sometimes more) will fail looking for ajax driven results in a page. Taking a screenshot after the failures shows the missing data. To “fix” the issue, I find myself having to do this:

    browser.text_field(:name, “SearchField”).set “66852694″
    browser.button(:name, “submit”).click
    sleep 1
    checkhtml(mynode,”Search”,”#{browser.html}”,”(Account Info)”)

    Putting a sleep in there before I run my checkhtml subroutine seems to be the fix. But, I “thought” using a click was supposed to cause watir to wait until the page finished loading?
    Hate having to add a sleep after every click, some of our apps use 100+ webservers, so this will add quite a bit of time to a 10 step test.

    I’m passing the browser.html like that because on some pages, the text I’m looking for might be in a different frame and I hadn’t figured out how to handle that yet.

    Thanks again for a great blog.

    In case it makes a diff, what I’m using:

    require ‘watir-webdriver’
    require ‘headless’
    require ‘rubygems’
    require ‘thread’
    require ‘fileutils’

    ruby 1.9.2p290
    Red Hat Enterprise Linux Server release 5.4 (Tikanga)

    • I’m sorry, just saw this bit… I’ll try and figure it out.

      “Please don’t ask me Watir support questions on this page or this blog. Use the Watir community mailing list or Stack Overflow please.”

      Thanks again.

      • It is meant to wait until the browser is ready, but ajax calls can through that out.
        So, I’d try one of the ‘wait’ methods available on this page: http://watirwebdriver.com/waiting/ to wait for a known element to appear.
        I’m not sure what your checkhtml method does, but you shouldn’t need to use the html, you should be able to assert something in the DOM.

Leave a Reply

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

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. 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