Unable to connect to iPhone with RemoteWebDriver

453 views
Skip to first unread message

Sagar

unread,
Apr 5, 2012, 8:40:41 AM4/5/12
to Selenium Users
Hi,
I am trying to connect to iPhone device through RemoteWebdriver. I
have followed steps given on IPhoneDriver page. The code to connect
iPhone looks as follows:

@BeforeClass
public void beforeClass() throws Exception{
WebDriver driver = new RemoteWebDriver(new URL("http://
172.27.47.41:3001/hub/" DesiredCapabilities.iphone());
}

where -
URL: the URL displayed on iPhone device after WebDriver app is started
on device

However, the Constructor throws following error:
FAILED CONFIGURATION: @BeforeClass beforeClass
org.openqa.selenium.remote.UnreachableBrowserException: Could not
start a new session. Possible causes are invalid address of the remote
server or browser start-up failure.
Build info: version: '2.19.0', revision: '15849', time: '2012-02-08
16:12:19'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1',
java.version: '1.6.0_30'
Driver info: driver.version: RemoteWebDriver


Some configuration info:
Selenium version: 2.19.0
OS: Windows 7
Browser: iPhone
Browser version: iPhone 4.3.2

More info:
Machine is on the same network as the iPhone. However, I cannot ping
the iPhone IP from machine.
The URL on iPhone reads as "http://172.27.47.41:3001/hub/". It DOES
NOT HAVE "/wd/hub/" as path, just "/hub/"




Some doubts:
1. Do we need to configure port forwarding for iPhone similar to what
we do for Android?
2. The URL displayed in WebDriver app on iPhone could not be opened in
my host browser. Is it the correct behaviour? The similar URL for
Android can be browsed from host.


Will be grateful for the help.
Thanks,
Sagar

Luke Inman-Semerau

unread,
Apr 5, 2012, 2:25:23 PM4/5/12
to seleniu...@googlegroups.com
The fact that the url shows just "/hub" suggests that you are pretty out of date with changes to the iWebDriver project. Please update your svn copy.

At some point I also added code for the ip address displayed to show the Wifi network IP over the carrier's IP (it used to always show the carrier's).

If you do not have time to update your code and deploy the new iWebDriver project, you can look in your device settings and see what your current IP address is assigned to it from the WIFI and use that IP address instead.

-Luke


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


Sagar

unread,
Apr 9, 2012, 10:52:00 AM4/9/12
to Selenium Users
Hi Luke,
Thanks for the prompt reply.

We built new iWebDriver from latest trunk. The WebDriver app now shows
the complete URL at the bottom.

However, when I try to ping the device IP from host (as suggested in
issue 3653), I get following error:
Reply from 172.27.47.68: Destination host unreachable

And, again the beforeClass method is throwing same exception.
Can it be like the port 3001 on the iPhone device is blocked in WiFi
profile...???

Please help with the issue.

Thanks,
Sagar





On Apr 5, 11:25 pm, Luke Inman-Semerau <luke.seme...@gmail.com> wrote:
> The fact that the url shows just "/hub" suggests that you are pretty out of
> date with changes to the iWebDriver project. Please update your svn copy.
>
> At some point I also added code for the ip address displayed to show the
> Wifi network IP over the carrier's IP (it used to always show the
> carrier's).
>
> If you do not have time to update your code and deploy the new iWebDriver
> project, you can look in your device settings and see what your current IP
> address is assigned to it from the WIFI and use that IP address instead.
>
> -Luke
>

Luke Inman-Semerau

unread,
Apr 9, 2012, 1:24:03 PM4/9/12
to seleniu...@googlegroups.com
ping won't work, a valid test to see if you can connect to the device is to point your browser to:

http://<ip of ios>:3001/wd/hub/status

If you can not connect then you are likely NOT on the same network.

If your computer and phone are on the same wifi network, check that your computer is also not physically plugged in with a network cable and that you are not using any VPN like software.

Aniket Gadre

unread,
Apr 9, 2012, 2:03:59 PM4/9/12
to seleniu...@googlegroups.com
Ping works actually. If you just wish to check whether device and your machine and are in same network. U can just ping your device IP from your machine and you should get response. 

As pointed out by Luke, VPN might cause problem as it takes you into different domain and hence the IP address would be assigned from the connected network
Best Regards,
Aniket Gadre
Test Automation Lead
Amdocs , Pune.
E-add: aniket...@amdocs.com

Sagar

unread,
Apr 12, 2012, 8:59:29 AM4/12/12
to Selenium Users
Hi all,

Thanks for the help.
I got my iWebDriver working on iPod touch OS 5.0.1

However, there seems a new issue popping up now.
The test script connects to iWebDriver on device through above
mentioned beforeClass() method.
But driver.get(url) seems to open the desktop version of the website
on iPod.

And all the subsequent test methods fail after that.

Please help and let me know what I'm doing wrong here. How can I get
mobile version of website on my device.

Thanks,
Sagar

On Apr 9, 11:03 pm, Aniket Gadre <aniket....@gmail.com> wrote:
> Ping works actually. If you just wish to check whether device and your
> machine and are in same network. U can just ping your device IP from your
> machine and you should get response.
>
> As pointed out by Luke, VPN might cause problem as it takes you into
> different domain and hence the IP address would be assigned from the
> connected network
>
> On Mon, Apr 9, 2012 at 10:54 PM, Luke Inman-Semerau
> <luke.seme...@gmail.com>wrote:
>
>
>
> > ping won't work, a valid test to see if you can connect to the device is
> > to point your browser to:
>
> > http://<ip of ios>:3001/wd/hub/status
>
> > If you can not connect then you are likely NOT on the same network.
>
> > If your computer and phone are on the same wifi network, check that your
> > computer is also not physically plugged in with a network cable and that
> > you are not using any VPN like software.
>
> E-add: aniket.ga...@amdocs.com

Sagar

unread,
Apr 18, 2012, 5:52:44 AM4/18/12
to Selenium Users
Hi,

Anyone, please help with the above issue.
Looks like Selenium is not even able to connect to iPhone with Remote
WebDriver.

Will be very grateful for help.

Thanks,
Sagar

Shashidhar G

unread,
Jul 15, 2014, 4:37:25 AM7/15/14
to seleniu...@googlegroups.com
Hi Every one,

I am trying to test a physical IPhone device from Windows 7 machine using c# language but getting below error 


 "I am getting an error "invalidoperationexception was unhandled" -

 "Error forwarding the new session cannot find : Capabilities [{platform=MAC, browserName=iPhone, version=}]"


I am able to ping the ip address of iphone device in my windows machine[Connected with WI-FI network] with no firewall settings.


I have also done the correct port settings in IPhonewebdriver app in Iphone i,e. host name and port correctly.


my code: 

driver = new RemoteWebDriver(new Uri("http://<ip of iphone>/wd/hub"), DesiredCapabilities.IPhone());


I have started a hub: java -jar selenium-server-standalone-2.42.2.jar -role hub -port 4444


I have started a node java -jar selenium-server-standalone-2.42.2.jar -role webdriver –browser "browserName=iphone,version=7.0.3,maxinstance=1,platform=MAC" hubHost localhost -port 3001

prasad bhagwat

unread,
Jul 16, 2014, 5:31:40 AM7/16/14
to seleniu...@googlegroups.com

Yes we need to configure corresponding port for same


> 2. The URL displayed in WebDriver app on iPhone could not be opened in
> my host browser. Is it the correct behaviour? The similar URL for
> Android can be browsed from host.
>

>I think URL should open in your browser successfully

> Will be grateful for the help.
> Thanks,
> Sagar
>

Reply all
Reply to author
Forward
0 new messages