How to run Google Chrome with Selenium RC?

asp.netNunitSelenium

asp.net Problem Overview


I am trying to test my site with Selenium RC + Nunit + asp.net.

I can get my tests to work in Firefox,Safari,opera,IE 8 but not google chrome. I put this in for the browser arugment

 selenium = new DefaultSelenium(Server, ServerPort,
                                          "*chrome", DomainURL);

This always loads up Firefox though and not good chrome.

asp.net Solutions


Solution 1 - asp.net

If I remember correctly, "*chrome" is used to launch a special mode of Firefox (a mode in which your application has more privilegies -- with less security restrictions) ; so, the fact that it's Firefox that is launched, and not Google Chrome, is normal.

If you want to launch Google Chrome, you will have to use something else than "*chrome".


Using Selenium RC in interactive mode, with something like this :

$ java -jar selenium-server.jar -interactive

and using the getNewBrowserSession command not correctly :

cmd=getNewBrowserSession

I get the list of browsers is supports :

23:43:09.317 INFO - Got result: Failed to start new browser session: Browser not supported:
(Did you forget to add a *?)

Supported browsers include:
  *firefox
  *mock
  *firefoxproxy
  *pifirefox
  *chrome
  *iexploreproxy
  *iexplore
  *firefox3
  *safariproxy
  *googlechrome
  *konqueror
  *firefox2
  *safari
  *piiexplore
  *firefoxchrome
  *opera
  *iehta
  *custom
 on session null

So, I'm guessing you should be able to launch Google Chrome using "*googlechrome" instead of "*chrome".


I'm not on Windows, so I can't try by myself... And I cannot find anything in the documentation to back me up... Still, with a bit of luck, this might help you...

Anyway, have fun !


As a sidenote : Google Chrome is not the one which invented the term "chrome", actually ; it means plenty of things, like Chrome Mozilla or User Interface Chrome

Solution 2 - asp.net

Using the browser *googlechrome is OK.

Solution 3 - asp.net

Actually "*chrome" represented by Firefox browser.

Solution 4 - asp.net

You can use *googlechrome else use *custom path_to_Chrome.exe file

Solution 5 - asp.net

If you have added the chrome.exe path in to the path variable, give directly *googlechrome in place of *chrome else give the path of chrome.exe along with that.

Eg/

Selenium selenium = new DefaultSelenium("localhost",4444,"*googlechrome C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe","http://www.google.com");

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionchobo2View Question on Stackoverflow
Solution 1 - asp.netPascal MARTINView Answer on Stackoverflow
Solution 2 - asp.netHarkueView Answer on Stackoverflow
Solution 3 - asp.netSudarsanView Answer on Stackoverflow
Solution 4 - asp.netHarshavardhan KonakanchiView Answer on Stackoverflow
Solution 5 - asp.netChanGanView Answer on Stackoverflow