Chrome on Ruby WebDriver

73 views
Skip to first unread message

aidy lewis

unread,
Nov 16, 2009, 2:47:40 PM11/16/09
to webd...@googlegroups.com
Hi,

Has anyone managed to get the Chrome driver working in Ruby WebDriver
on Windows? I originally received a path error, so a did gsub to
impose window directory separators and now I am getting a socket error
in CreateProcess() in process.rb.

Aidy

Jari Bakken

unread,
Nov 17, 2009, 1:36:29 PM11/17/09
to webd...@googlegroups.com

Yep, it worked fine for me last I tried. I also answered your bug
report, so please take a look at that.
Please update the issue with any relevant new information (like where
you did a gsub and the full stacktrace of the socket error).

tiva

unread,
Dec 23, 2009, 4:08:11 AM12/23/09
to webdriver
Hi Jari,
I have encountered the same error again with CreateProcess(). I
am trying to run web driver in IE using the ruby bindings on Windows
Vista. My attempts at fixing the problem included changing the
binary_path variable in launcher.rb since "//" was used to separate
the folders. This unfortunately still didn't help but the error
begins after process.start. Please let me know any solutions. By the
way I am using the latest version of the ruby bindings 0.0.13.

Thanks,
Avit

On Nov 17, 10:36 am, Jari Bakken <jari.bak...@gmail.com> wrote:


> On Mon, Nov 16, 2009 at 8:47 PM, aidy lewis <aidy.le...@googlemail.com> wrote:
>
> > Hi,
>
> > Has anyone managed to get the Chrome driver working in Ruby WebDriver
> > on Windows? I originally received a path error, so a did gsub to
> > impose window directory separators and now I am getting a socket error

> > inCreateProcess() in process.rb.

Jari Bakken

unread,
Dec 23, 2009, 2:33:21 PM12/23/09
to webd...@googlegroups.com
On Wed, Dec 23, 2009 at 10:08 AM, tiva <tiva...@gmail.com> wrote:
> Hi Jari,
>    I have encountered the same error again with CreateProcess().  I
> am trying to run web driver in IE using the ruby bindings on Windows
> Vista.

I assume you mean Chrome, not IE.

> My attempts at fixing the problem included changing the
> binary_path variable in launcher.rb since "//" was used to separate
> the folders.  This unfortunately still didn't help but the error
> begins after process.start.  Please let me know any solutions.  By the
> way I am using the latest version of the ruby bindings 0.0.13.
>

In XP, the direction of the directory separators in the argument to
Process.create doesn't matter . I'll have access to a Vista machine to
look into this after the holiday. It would be helpful if you could
tell me

1. Exactly how you changed binary_path in launcher.rb
2. The full backtrace of the error.
3. The full path of your Chrome binary.

It would also be good to know if this script works (replace with the
correct path if necessary):

http://gist.github.com/262724

I'm aware that WebDriver can't currently find the correct path for
Chrome on localized versions of Windows.
I guess the best solution would be to look it up in the Windows
registry (the ruby bindings already do this for Firefox).

Jari


> Thanks,
> Avit
>
> On Nov 17, 10:36 am, Jari Bakken <jari.bak...@gmail.com> wrote:
>> On Mon, Nov 16, 2009 at 8:47 PM, aidy lewis <aidy.le...@googlemail.com> wrote:
>>
>> > Hi,
>>
>> > Has anyone managed to get the Chrome driver working in Ruby WebDriver
>> > on Windows? I originally received a path error, so a did gsub to
>> > impose window directory separators and now I am getting a socket error
>> > inCreateProcess() in process.rb.
>>
>> Yep, it worked fine for me last I tried. I also answered your bug
>> report, so please take a look at that.
>> Please update the issue with any relevant new information (like where
>> you did a gsub and the full stacktrace of the socket error).
>

> --
>
> You received this message because you are subscribed to the Google Groups "webdriver" group.
> To post to this group, send email to webd...@googlegroups.com.
> To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
>
>
>

Daniel Wagner-Hall

unread,
Dec 23, 2009, 3:46:44 PM12/23/09
to webd...@googlegroups.com
This is the same as
http://code.google.com/p/selenium/issues/detail?id=265 - 2003 is
basically Vista (with some of the cruft removed).

The problem here is that on Vista and Windows 7, the Chrome executable
will be in:

ENV['HOME']\AppData\Local\Google\Chrome\Application\chrome.exe

whereas on XP it will be in ENV['HOME']\Local Settings\Application
Data\Google\Chrome\Application\chrome.exe

I'm not sure how to differentiate between versions of Windows in Ruby,
but some ideas, in decreasing order of brittleness:

1) See if the first file exists, if not, see if the second exists
2) Get the output of the command `ver` and interpret that (would need
to work out how - for me XP returns 5.1.2600, Windows 7 returns
6.1.7600, Vista I would guess would be 6.x.y...
3) See whether ENV['HOME'] is foo:/Users - if so, we're probably on
Vista/Win7 so use that path...
On my XP machine, I don't have an ENV['HOME'] set, it returns nil, but
I do have HOMEDRIVE and HOMEPATH which together form the desired
path...
4) ?

Daniel Wagner-Hall

unread,
Dec 23, 2009, 3:48:37 PM12/23/09
to webd...@googlegroups.com
Also, it seems ENV['USERPROFILE'] is a much less brittle version of
ENV['HOME'] - it is defined (properly) for both of my Windows
machines, and gives what we are expecting from ENV['HOME']

Jari Bakken

unread,
Jan 5, 2010, 9:11:41 AM1/5/10
to webd...@googlegroups.com
tiva, aidy

Could you try the latest gem (0.0.14) and see how it works for you -
this is hopefully fixed as of r7987.

Reply all
Reply to author
Forward
0 new messages