Friday, February 26, 2010

Chapter 58: Creating Ruby-based Safari Driver for Selenium-webdriver

GOAL: Get experience with ruby-related, Watir-related technologies. Do no harm.
require "watir-webdriver"
browser = Watir::Browser.new(:safari)
sleep 2
browser.close
  • FYI: My previous research appears that "safari" driver work completely
    be isolated inside selenium-webdriver.
  • 2/26/2010: Set WATIR_WEBDRIVER_BROWSER to "safari" and
    use ":safari", I saw "
    unknown driver" message with a stub.
  • 2/26/2010: Added two line to driver.rb file and rerun test file.
  • 2/26/2010: NOTE: "jobbie" directory is IE code.
  • 2/26/2010: Got stuck on no gemspec for selenium-webdriver so stop for now.
  • Installed jeweler (1.2.1): gem install technicalpickles-jeweler
  • 2/27/2010: After sleeping on it and finding that the selenium-webdriver is
    probably embedded deep inside selenium, I have decided to decide on this tomorrow.
  • 2/28/2010: Deciding on how to trim this Yak (add ruby-based safari-driver to
    selenium-webdriver running under watir-webdriver).
  • 2/28/2010: Decided to write an email to inform people, e-groups, IRC,
    twitter of my work. Ask for past work and help, then decide course.
    • Assume everyone follows one of the appropriate e-groups.
    • Will use webdriver@googlegroups.com and selenium-dev lists.
      Also the wtr-development@rubyforge.org list (on Rubyforge IIRC).
      Then watir-general@googlegroups.com.
      (only once)
    • Maybe use IRC (freenode) with #watir.
    • Also @safariwatir on twitter.
    • Contact people involved:
      • Jari Bakken (watir-webdriver) -- jarib/watir-webdriver on github
      • Simon Stewart (selenium-webdriver) (0.0.17)
        • Sai (Thoughworker) - was:
        • Contact Sai, Prashant@Sun/Oracle.
      • Dave Hoover (original safariwatir author) - more in section 6.20 of my notebook.
      • Tom Copeland (lead safariwatir developer) (0.3.37) (NOTE: Work with Tom
        if we decide (probably use submodule) to merge safariwatir as safari driver guts.

RESPONSE TO EMAIL in Blog Post #59:
  1. Doing research on how to add software to existing open source projects. Wow,
    this is the only thing I found where google-ing.

    http://my-ruby-journey.blogspot.com/2010/02/chapter-58-watir-webdriver-journey.html

    Best Practices for Working with Open-Source Developers.
    \
  2. Received one new follower of my blog.
  3. My own thoughts:

  1. AFTER STUB: Where to learn more about safari drivers?
    • Look at selenium-webdriver ticketing system. (unclear where that is)
    • Set up safariwatir on Mac (maybe merge with selenium-webdriver). Clone code:
      git clone http://github.com/redsquirrel/safariwatir.git (2/26/2010: done on PC/Must do on MAC too).
    • Study webdriver-safari code on openqa. (2/26/2010: Deferred)
    • Maybe fork watirspec later.
    • Will focus less on watirspec until after creating the STUB.

MORE RESPONSES (Jari's Emails: 3/2/2010)
  • > My focus is to glue the ruby-based watir-webdriver and selenium-
    > webdriver
    > code together with existing (or new if we have to) safari driver code

    watir-webdriver doesn't need any code changes to work with new drivers
    introduced in the selenium-webdriver back-end. As long as the Safari
    driver honors the semantics of the WebDriver API, it should all just
    work from the Watir side.
  • > Do you have the gemspec files embedded in your selenium code tree
    > to build the gem for the ruby-based selenium-webdriver gem that I
    > found on gemcutter.org (http://rubygems.org/gems/selenium-webdriver)?

    There's no gemspec file, but you can build the gem using `rake gem:gem` in
    your working copy.
  • > After we get the ruby glue code in place, then we can see what safari-specific
    > code is best to use (your java version, safariwatir version,
    etc).

    Since the Safari driver is based on the remote driver, the amount of
    work needed to make it
    work from Ruby is practically negligible. If
    you're interested in how the Safari driver is
    implemented natively,
    you should look at the branch linked in Miklos email.

EVEN MORE RESPONSES (Jari's Emails: 3/3/2010)

    No comments:

    Post a Comment