Issue Details (XML | Word | Printable)

Key: WTR-285
Type: Improvement Improvement
Status: Open Open
Priority: Blocker Blocker
Assignee: Unassigned
Reporter: Mike Andrzejewski
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Watir

FireWatir doesn't work on JRuby [patch]

Created: 05/Feb/09 07:44 AM   Updated: 22/Apr/09 05:49 PM
Component/s: FireWatir
Affects Version/s: 1.6.2
Fix Version/s: Next

File Attachments: 1. Text File firewatir_jruby.patch (1 kB) 05/Feb/09 07:59 AM - Mike Andrzejewski

Environment: JRuby


 Description  « Hide

On JRuby, browser's binary detection according to platform does'nt work.

Here is a patch to lib/firewatir/firefox.rb to support JRuby on any platform :

— gems/firewatir-1.6.2/lib/firewatir/firefox.rb 2009-02-05 12:26:00.000000000 +0100
+++ gems/firewatir-1.6.2/lib/firewatir/firefox.rb 2009-02-05 14:33:42.000000000 +0100
@@ -133,8 +133,12 @@

waitTime = options[:waitTime] || 2

  • case RUBY_PLATFORM
  • when /mswin/
    + platform = RUBY_PLATFORM
    + if platform.start_with?("java")
    + platform = java.lang.System.getProperty("os.name")
    + end
    + case platform
    + when /mswin|windows/i
  1. Get the path to Firefox.exe using Registry.
    require 'win32/registry.rb'
    path_to_bin = ""
    @@ -150,10 +154,8 @@

when /linux/i
path_to_bin = `which firefox`.strip

  • when /darwin/i
    + when /darwin|mac os/i
    path_to_bin = '/Applications/Firefox.app/Contents/MacOS/firefox'
  • when /java/
  • raise "Not implemented: Create a browser finder in JRuby"
    end
    @t = Thread.new
    Unknown macro: { system("#{path_to_bin} -jssh #{profile_opt}")}

    sleep waitTime


Sort Order: Ascending order - Click to sort in descending order
Mike Andrzejewski added a comment - 05/Feb/09 07:59 AM

Patch file attached