Koray Tugay
Koray Tugay

Reputation: 23780

Can I run Selenium on Computer A, and see the browser in Computer B?

Imagine I have some Selenium Project ready on Computer A. When you run this project, a new browser opens in Computer A, and connects to www.somesite.com and runs the tests..

Now, also on computer A, imagine I am running a web page, which has a button, which triggers these tests...

So when I navigate to www.ipofcomptera.com and click "Run Tests", a new browser opens in Computer A, and runs the tests...

What I want is, I either want that browser opens in Computer B ( The computer I am reaching to Computer A ) or, it may as well run in A but I want to see all the steps on my computer as well.

Hope my question clear, Thanks

Upvotes: 2

Views: 4616

Answers (2)

Amey
Amey

Reputation: 8548

You can look up this documents to better understand RemoteWebDriver

In short things you would need to do

  1. Download Selenium Server on Computer B
  2. Start the server on Computer B by doing so java -jar selenium-server-standalone-2.32.0.jar
  3. Change your code on Computer A from WebDriver driver = new FirefoxDriver();

to

DesiredCapabilities capability = DesiredCapabilities.firefox();    
WebDriver driver = new RemoteWebDriver(new URL("http://computerB:4444/wd/hub"), capability);

And if all the required ports are open, it should all work well.

Upvotes: 0

Franz Ebner
Franz Ebner

Reputation: 5096

That's exactly what Selenium Grid is for!

Have fun

And please reconsider the usage of Selenium RC which is actually an undead, better use the RemoteWebDriver instead.

Upvotes: 2

Related Questions