Issue Details (XML | Word | Printable)

Key: WTR-282
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Blocker Blocker
Assignee: Unassigned
Reporter: andyl
Votes: 1
Watchers: 0
Operations

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

Watir doesn't work on Cygwin [patch]

Created: 01/Feb/09 09:34 PM   Updated: 19/Jan/13 08:40 AM   Resolved: 19/Jan/13 08:40 AM
Component/s: Modal Web Dialog
Affects Version/s: 1.6.2
Fix Version/s: Soon

Environment: WinXP / Cygwin


 Description  « Hide

On Cygwin, I ran into two separate problems that prevented Watir 1.6.2 from working.

First, the 'win32ole.so' file that ships with Watir appears to be incompatible with the version that is installed with my copy of Cygwin-
ruby. (see http://pastie.org/374756)

An error message 'bad file permissions' was generated when trying to run 'x = Watir::IE.new' from within IRB.

My workaround was to copy the 'ruby' version of win32ole.so into the 'watir' directories. (see http://pastie.org/374865)

Once this was done, another error occured - relating to modal dialogs. (see http://pastie.org/374865)

This was fixed by commenting out 2 lines in the Watir source code:

File - modal_dialog.rb Line - 65 GetUnknown.call ...
File - win32.rb Line - 6 GetUnknown = Win32API.new(...

Once these lines were commented out, watir worked.

Ideas for fixes:

  • Fix the modal dialog issue with conditional execution:
    GetUnknown.call (...) unless RUBY_PLATFORM == 'i386-cygwin'
    GetUnknown=Win32APUI.new(... unless RUBY_PLATFORM =='i386-cygwin'
  • Fix the win32ole issue by not bundling this file in the gem (Brett thinks maybe it is not needed??)
  • Cygwin support: run regression tests on cygwin!!


Sort Order: Ascending order - Click to sort in descending order
QA guy added a comment - 29/Jan/10 12:15 PM

Having the same issue. Please patch when you can. Thanks.


fourchette added a comment - 17/Aug/10 08:18 AM

reproduced with
Windows XP SP3 32bits

using environement below

$ uname -a
CYGWIN_NT-5.1 mtb-p1247630 1.7.6(0.230/5/3) 2010-08-16 16:06 i686 Cygwin

$ ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]

$ gem list

      • LOCAL GEMS ***

activesupport (2.3.8)
builder (2.1.2)
color (1.4.1)
commonwatir (1.6.5)
fastercsv (1.5.3)
firewatir (1.6.5)
hoe (2.6.1)
json_pure (1.4.3)
nokogiri (1.4.3.1)
pdf-writer (1.1.8)
rake (0.8.7)
rcov (0.9.8)
rspec (1.3.0)
rubyforge (2.0.4)
ruport (1.6.3)
s4t-utils (1.0.4)
transaction-simple (1.4.0)
user-choices (1.1.6.1)
watir (1.6.5)
win32-api (1.4.6)
win32-process (0.6.2)
windows-api (0.4.0)
windows-pr (1.0.9)
wirble (0.1.3)
xml-simple (1.0.12)


fourchette added a comment - 31/Aug/10 02:44 PM

thanks andy, your suggestion worked !

so

1. replace the win32ole.so file so it matches the default ruby one

2. add the : unless RUBY_PLATFORM == 'i386-cygwin'
at File - win32.rb Line - 6 GetUnknown = Win32API.new(...

and the default Watir example works

(didn't need the other line update, maybe it will resurface later when i more seriously use watir)

watir team : please run tests on cygwin too


Jarmo Pertman added a comment - 02/Sep/10 03:10 AM

I have a completely different question which is not directly related with this issue - why are you even using Cygwin with Ruby and Firewatir? Just out of curiousity what's the real life usecase.


fourchette added a comment - 02/Sep/10 03:51 AM

simple : i am coerced into using windows. but i do like the wealth of the gnu environment, for starters using bash instead of cmd is a real productivity gain.
besides the whole cygwin install/update model is just great.
So well it is just convenient to install and use ruby from the cygwin install instead of the ruby one click installer.

that was for the first point.

second point is i am evaluating watir and trying to figure out if it is really a benefit compared to selenium for instance (so far i am not convinced but willing to really investigate the issue). so i need to see the same testing script working on both ie and firefox. following andy comments on http://jira.openqa.org/browse/WTR-453 i have been able to get watir to work with IE too.

that was the second point

last but not last, i faced plain not-working-firewatir going through the route of the watir installation guide http://watir.com/installation/#win
so i opened up a discution on stackoverflow there: http://stackoverflow.com/questions/3602466/firefox-and-watir-wouldnt-work-on-windows-due-to-a-singularize-method-not-found/

that was the last point.

i think having watir actually support cygwin seems really easy honnestly (about 3 lines to update, only 10 caracters for firewatir), so it is worth doing i'd say.


Bret Pettichord added a comment - 02/Sep/10 05:21 PM

You may be interested to know that I tested early versions of Watir on cygwin regularly. There is some code in our unit tests which is there specifically to support the file syntax of cygwin.


Zeljko added a comment - 19/Jan/13 08:40 AM

If this is still a problem, please report it here: https://github.com/watir/watir-classic/issues