Network error when trying to automate using Python (Appium 1.3.6 with iOS)

Hi all,
I’m currently trying to create automated tests using Appium 1.3.6 and Python for an iOS application. I’ve already run an Appium server (from Applications) and have used it (i.e. the inspector tool) to check out the UI elements of the app to be tested. I wrote a basic “Hello World” script in Python but it doesn’t work - i get some exception with status “13” and some html that contains “Network Error”; the aforementioned script is as follows:

from appium import webdriver
desired_caps = {}
desired_caps[‘appium-version’] = ‘1.3.6’
desired_caps[‘platformName’] = ‘iOS’
desired_caps[‘platformName’] = ‘8.1’
desired_caps[‘udid’] = ‘f21b01d695d715365c4371c5b96784ef88a8fb4a’
desired_caps[‘deviceName’] = ‘iPad’
desired_caps[‘bundleId’] = ‘com.company.Test’
desired_caps[‘app’] = ‘/Users/me/Desktop/app/…/Test.app’
desired_caps[‘browserName’] = ‘safari’
driver = webdriver.Remote(command_executor=‘http://localhost:4723/wd/hub’, desired_capabilities=desired_caps)
print

The error I receive is:

selenium.common.exceptions.WebDriverException: Message: <HTML><HEAD>
<TITLE>Network Error</TITLE>
</HEAD>
<BODY>
<FONT face="Helvetica">
<big><strong></strong></big><BR>
</FONT>
<blockquote>
<TABLE border=0 cellPadding=1 width="80%">
<TR><TD>
<FONT face="Helvetica">
<big>Network Error (tcp_error)</big>
<BR>
<BR>
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
A communication error occurred: "Connection refused"
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica" SIZE=2>
<BR>
For assistance, contact your network support team.
</FONT>
</TD></TR>
</TABLE>
</blockquote>
</FONT>
</BODY></HTML>

Am i missing something obvious?

This has been resolved! Many thanks to the 0 people who responded :smiley:

But seriously, i had much better luck:

  • not using an IDE. I was previously using PyCharm, i now run my application on the terminal (Mac Mini)
  • using the actual IP address of the machine in the Appium settings (using localhost:4723 … doesn’t work for me for some reason)

I now have the beginnings of a test framework for the app. Appium is quickly growing on me, many thanks to the community for this FOSS.

hi,PiMeasion
I have the same issue.
Could you tell me the solution?
Thanks

Now i run my application on terminal(ubuntu 14.04)
but it is the same as before.