Friday, March 12, 2010

Chapter 60: Is Watir Project ready for Google Summer of Code?

Here are my suggested Google Summer of Code project ideas.

Should we propose them?

Yes, I know this is last minute. We have until 6pm EST today (3/12/2010).

Expect the first to be part of the Selenium project page
and the second one to be on a Watir project page.

######################################################

Safari Driver/Target for ruby-based selenium-webdriver
---------------------------------------------------------------------------

Summary
Create safari browser driver (:safari) for the ruby-based
selenium-webdriver gem to be uses with watir-webdriver.

Tags
Se2, webdriver, watir, watirspec, watir-webdriver

Status
Draft

Mentor
TBD (technical)
Al Snow (general/watir community contact)

Description
The current selenium-webdriver does not support the safari
browser. Previous research suggests that the :remote
target, code within the safariwatir tool, backseat in github,
and firedriver in github may jump start this development.

The overall goal is to use this in connection with watir-webdriver
and run it against watirspec (similar to rubyspec).

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

=============================================================


Finish watirspec (clean run) against watir-webdriver
----------------------------------------------------------------------

Summary
Get watir-webdriver to run all of the watirspec specs cleanly.
Possible targets include :ie, :ff, and :chrome.

Tags
watir, webdriver, watir-webdriver

Status
Draft

Mentor
TBD (technical)
Al Snow (general/watir community contact)

Description
Watirspec is a set of ruby-based specs that
specify how watir-webdriver should work.

===================================================================
TODO's:

Twitter: @safariwatir, @watir
IRC: #watir

E-groups:
wtr-development@rubyforge.org
watir-general@googlegroups.com
webdriver@googlegroups.com
selenium-developers@googlegroups.com

Three main developers:
Jari Bakken (watir-webdriver, @jarib),
Simon Stewart (selenium-webdriver, @shs96c),
Tom Copeland (@safariwatir)

Sunday, February 28, 2010

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

My Letter to the Watir/Selenium Communities:

Everyone,
For the past several weeks, I have been working with the new version
of Watir (watir-webdriver). I have documented my journey on my wiki
and one of my blogs (Chapters 51-58, see last one for current summary).

Now it is time to check in and verify what other people have been doing
in this area (especially with the safari driver for watir-webdriver) and
see if other people would like to help to create a "branch" (fork)
for this work.

I will update my blog with the responses and post to
the wtr-development and webdriver e-groups.

Thanks in advance,
Al Snow
Linkedin: http://www.linkedin.com/in/alsnow
Google Talk: jasnow1
Twitter: jasnow

PS. Remember to include :
Twitter: @safariwatir
IRC: #watir
E-groups:
wtr-development@rubyforge.org
watir-general@googlegroups.com
webdriver@googlegroups.com
selenium-developers@googlegroups.com
Three main developers: Jari, Simon, Tom

Here is where I will post the responses/reactions.

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)

    Chapter 57: Watir-Webdriver Journey

    Letter Asking for Status of Safari Driver for selenium-webdriver

    1. Is anyone working on the "safari" port of watir-webdriver/selenium-webdriver?
    2. If I set WATIR_WEBDRIVER_BROWSER to "safari" and use ":safari", I get "unknown driver".
    3. Before I start peeling the onion (a fork), I would like to ensure that no one is working on the safari port.
    4. FYI: Here is my recent work at Chapters 51-56 of my blog: http://my-ruby-journey.blogspot.com/
    5. My previous research appears that "safari" port work completely be isolated inside selenium-webdriver.
    6. Found this:
    7. -- http://nexus.openqa.org/content/repositories/releases/org/openqa/selenium/webdriver/webdriver-safari/
    8. -- http://groups.google.com/group/webdriver/browse_thread/thread/65b317dcad5399a6?pli=1
    9. Also know about safariwatir and can maybe merge this with the selenium-webdriver code, but this is onlyfor Apple (Applescript/not PC), so still pondering.

    Wednesday, February 24, 2010

    Chapter 56: Watir-Webdriver Journey

    1. If I set "WATIR_WEBDRIVER_BROWSER" to "safari".
    2. Use this ruby/watir script:
    require "watir-webdriver"
    browser = Watir::Browser.new(:safari)
    sleep 2
    browser.close

    3. Then I get this:
    C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/selenium-webdriver-0.0.17/com
    on/src/rb/lib/selenium/webdriver/driver.rb:44:in `for': unknown driver: :safari (A
    gumentError)
    from C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/selenium-webdriv
    r-0.0.17/common/src/rb/lib/selenium/webdriver.rb:61:in `for'
    from C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/watir-webdriver-
    .0.1.dev5/lib/watir-webdriver/browser.rb:28:in `initialize'
    from use-it.rb:10:in `new'
    from use-it.rb:10

    Sunday, February 21, 2010

    Chapter 55: Watir-Webdriver Journey

    1. Added "require 'watir/ie' to setup.rb in watir directory and ran core tests.
    2. Command: ruby core_tests.rb 2>&1 |tee o_watir_core_tests.feb21b
    Loaded suite core_tests
    Started
    .............................................................................................................................................
    ....................................................................................................................................................
    Finished in 206.192 seconds.
    289 tests, 1420 assertions, 0 failures, 0 errors

    Monday, February 15, 2010

    Chapter 54: Watir-Webdriver Journey

    Decide to move "DONE" section from wiki page to this blog so here it is.

    DONE:Now on the Journey
    1. After playing isolating the filefield_spec.rb spec and getting it to run separately, I decide that the best use of my time was to see if I could get watirspec to run against IE.
    2. I grep'ed for firefox and found that all I needed to do was set a environment variable, WATIR_WEBDRIVER_BROWSER to either "ie" or "chrome" (not comma!!!).
    3. I first set the env variable to chrome and got 803 of 807 failures in 27.437 seconds, so I went over to "ie" and ran it and got 151 of 807 in 469.372 seconds (both on Vista/64).
    4. I will try configuration changes and rerun them. Found this reference regarding running Watir Unit Tests http://wiki.openqa.org/display/WTR/Run+Unit+Tests so I installed activesupport (2.3.5) and found that I already had user-choices (1.1.6.1). Also checked that that active content suggestion was checked under Advanced/ Security setting. Also checked that all new windows open as windows (not tabs) was set.
    5. Also will try to run tests under Administrator window and still got 153 of 807 in 446.004 seconds. Also got a dialog popup when test suite tried to open a file. Here is the results: http://pastie.org/825967
    6. Also use this to debug: http://angrez.blogspot.com/2006/12/firewatir-how-to.html
    7. Tried watir unit tests and got error too. After some study, found a not on "Run Unit Tests" that unit tests were broken with R1.6 watir gem, so stopped.