How to connect iphone emulator to selgrid 2?

老子叫甜甜 提交于 2019-12-08 01:40:58

问题


I have done all the steps listed here to setup a webdriver backed iphone emulator. I am also able to run my scripts of the emulator when running them locally using the below code while creating my driver instance.

driver = Selenium::WebDriver.for :remote, :url => "http://localhost:3001/wd/hub", :desired_capabilities => :iphone

What I intend to do is connect this emulator to sel grid 2, which has the hub running remotely on a windows machine.

Can some one please share the command to start the selenium webdriver node on the mac machine(coincidentally my local machine).

Some thing like

java -jar selenium-server-standalone-2.21.0.jar -role webdriver -hubHost remotewindowmachine.com -hubPort 4444 -hub http://remotewindowmachine.com:4444/grid/register -host iphoneIP/hub -port 3001 -browser browserName=iphone

which throws an error

Exception in thread "main" java.net.BindException: Selenium is already running on port 3001.

Which seems kind of obvious, but i am confused as to whats to be done about it.

So can someone help me out?


回答1:


You dont have to run the node registration command to register it in a grid.

The reason for your error

In iPhone(and emulator) when you start iWebDriverApp it starts in port 3001 as remote control. So when you try to start another node in the same machine on same port(3001) its going to throw this error.

The solution

I have not tried it in an emulator, but in the actual device. After installing the iWebDriverApp in your device, you need to set the hub details for the app. This can be done by going to Settings->iWebDriverApp. you will find textboxes to specify Hub URL and the port. Then restart the iWebDriverApp again. Your iphone will be in the grid.



来源:https://stackoverflow.com/questions/10523649/how-to-connect-iphone-emulator-to-selgrid-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!