The Selenium Fury gem is ready! Page object factory for Selenium and Ruby.

I have been working on converting our page object factory to open source for a few weeks. Now it is time to launch the  HomeAway sponsored open source project under the Apache 2.0 license.  It is a furiously quick way to implement test automation.  I am planning to add more configuration options in the future.

This project started when I had to test a page with 300+ check boxes and I did not want to enter them by hand.  I used the page object generator to build a page of ruby variables with Selenium locators. Everything was great until some number of the check boxes changed their ids and my tests started failing.  I needed  a quick way to find out how many changed so I could update the locators by hand or regenerate the page.  This is where the validators came in.  I used Ruby’s support of reflection to open a class, navigate to the url of the page and use Selenium to validate the locators and return a list of missing locators on the page.  It worked perfectly for my page of 300+ check boxes.  I had over 40 that changed I quickly regenerated the page.

Install with:

  • gem install selenium_fury

Checkout the home page and examples at https://github.com/scottcsims/SeleniumFury

Thanks to HomeAway for sponsoring this project.

6 Comments

  1. Dave McNulla says:

    Looks cool Scott. I would like to try your factory but I cannot figure out what is missing when I get this error:
    >> require ‘selenium_fury’
    Bundler::GemNotFound: Could not find gem ‘faker (>= 0) ruby’ in any of the gem sources listed in your Gemfile.
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/resolver.rb:280:in `resolve’

    I am using ruby 1.8.7 on Mac Lion, ruby gems 1.8.17 (I tried at ruby gems 1.3.6 then updated to see if that helped). No rush but I would like to try it before I go to the Test Automation Bazaar (Mar21) if you have time to direct me.

    Thanks

  2. Dave McNulla says:

    Nevermind. I figured it out when I read the .gemspec file. I’ll give a real comment after I try it out.

    Dave

  3. ssims says:

    The project on github uses bundler so you will need to run bundle install to get it going. Although SelenimFury is a gem, so that means if you want to use it you can just do gem install selenium_fury and it will work for the demo in the github readme.

  4. ssims says:

    Sounds good! I am looking forward to hearing your feedback

  5. Dave McNulla says:

    Scott, I think that it’s slick. Being able to quickly check the elements on the page are all there is useful. Being able to interact with the page is great too. I also like cutting out the excess how=>what identifiers. The tough part (and probably due to much more experience with Watir than Selenium) is being able to work with select lists, check boxes, etc. – I could not get values from them nor interact in ways I am used to (check, set, select – I get a lot of ‘undefined method’ messages). I also had some trouble figuring out how to use the custom types – I wanted to click a div button in a popup but could not figure out how to. In summary, I think most of the limitations stem from my lack of experience with Selenium so documentation would be a new users first priority, but if the full support of elements is missing then I would have trouble doing more than a small demo on our stuff. I love the idea and talked with others about it, however we were not as ambitious as you are.

  6. ssims says:

    Dave, Glad you like it. I wanted to address one of your questions. When you define elements in a selenium fury PageObject class, there is not any code that modifies the Selenium::Webdriver::Element that is defined. You don’t have to worry about anything not working the exact same ways as if you did a driver.find_element to create your element. The Selenium Fury code just wraps utilities around how you get the webdriver elements but does not modify the element its self. I am planning write a post today just for you, I want to explain how and what the generator finds on the page. Thanks for the interest in the project!