4

I've been using Watir for a month or so now and use

profile = Selenium::WebDriver::Firefox::Profile.new
profile.proxy = Selenium::WebDriver::Proxy.new :http=> proxy  # proxy = "IP:Port"

This works great for Firefox. However, I'd like to use Chrome as well on my Ubuntu Lucid dev machine. When I use

Selenium::WebDriver::Chrome::Profile.new

I get an @model=nil when I use puts profile.inspect. As a result I can't get out through the proxy and I can't use

profile.native_events = false

All of the code I'm trying to use works fine for a Firefox browser (obviously all Selenium::WebDriver::Chrome instances are replaced with Selenium::WebDriver::Firefox). And I can get Chrome to see the outside world when I bypass the proxy or set it up in Ubuntu so everything goes through the proxy but that isn't ideal and doesn't solve the native_events issue.

From what I can tell so far Chrome is a lot faster to load as a program. And significantly faster on the retrieval of URLs. So I could do a lot more testing if I were to use Chrome but for now these Selenium::WebDriver issues are preventing me from doing so.

5
  • added watir-webdriver tab since you'd be using that if you are using 'watir' to drive chrome. And just to get the obvious question out of the way, have you properly installed chromedriver? code.google.com/p/selenium/wiki/ChromeDriver Nov 8, 2011 at 19:58
  • Thanks, I don't have enough rep to add the watir-webdriver tag. And yes I've installed chromedriver. I can actually get Chrome up and running I just can't use the Selenium::WebDriver stuff to work. I've seen some instantiations of the Watir::Browser :chrome with switches that could allow a proxy but haven't yet figured out what I'm doing wrong with them because they don't work. However, even if they did I'd like to turn off the native_events - I've seen native_events related to issues with wait_until_... not working properly and I have a script that appears to have this problem.
    – gabe
    Nov 8, 2011 at 20:57
  • Yeah I can add tags but not if the tag is new. You have to have a reputation of over 1500 to create a new tag - according to the error message I keep getting when I try to use watir-webdriver as a tag. Thanks
    – gabe
    Nov 9, 2011 at 0:05
  • well that's strange, considering that it's an existing tag with something like 115 SO items tagged with it.. so no idea why it thinks you are trying to create a new tag.. something to take up with the SO folks or ask about in meta perhaps. Nov 9, 2011 at 0:47
  • I ran into a similar problem with chromedriver on Windows. I was able to dig into the stacktrace, which showed me where in the Webdriver code it was failing. Turned out the chromedriver wasn't placed in a directory in the PATH. I recommend you dig into the stacktrace--if available--and see if there's more info in there. Post what you find and we'll help out. Nov 16, 2011 at 15:40

2 Answers 2

1

If you are using Firefox driver you do not have to go through the additional steps. However, we have to go through the additional steps if we use chromedriver.

Did you perform those steps?

1

To use Chrome in Webdriver you have to be sure you did two things:

  • chromedriver.exe is on your classpath
  • you have to build a wrapper so the code knows where to find the binary and can start the chromedriverservice. More info can be found here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.