0
votes

I've refactored my script several times to get it working and now getting and error. Please can someone help me to understand what actually is displaying on screen and where am I going wrong?

Im getting these errors each time running it inside the terminal.

test_login_valid_password (main.HmaAndroidLoginTest) ... ERROR test_login_valid_username (main.HmaAndroidLoginTest) ... ERROR

======================================================================

ERROR: test_login_valid_password (main.HmaAndroidLoginTest)

Traceback (most recent call last): File "Android01.py", line 13, in setUp self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps) File "build/bdist.macosx-10.10-intel/egg/appium/webdriver/webdriver.py", line 37, in init super(WebDriver, self).init(command_executor, desired_capabilities, browser_profile, proxy, keep_alive) File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 87, in init self.start_session(desired_capabilities, browser_profile) File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 136, in start_session 'desiredCapabilities': desired_capabilities, File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 194, in execute response = self.command_executor.execute(driver_command, params) File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/remote_connection.py", line 395, in execute return self._request(command_info[0], url, body=data) File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/remote_connection.py", line 463, in _request resp = opener.open(request, timeout=self._timeout) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open response = self._open(req, data) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open '_open', req) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain result = func(*args) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1227, in http_open return self.do_open(httplib.HTTPConnection, req) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1197, in do_open raise URLError(err) URLError:

======================================================================

ERROR: test_login_valid_username (main.HmaAndroidLoginTest)

Traceback (most recent call last): File "Android01.py", line 13, in setUp self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps) File "build/bdist.macosx-10.10-intel/egg/appium/webdriver/webdriver.py", line 37, in init super(WebDriver, self).init(command_executor, desired_capabilities, browser_profile, proxy, keep_alive) File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 87, in init self.start_session(desired_capabilities, browser_profile) File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 136, in start_session 'desiredCapabilities': desired_capabilities, File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 194, in execute response = self.command_executor.execute(driver_command, params) File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/remote_connection.py", line 395, in execute return self._request(command_info[0], url, body=data) File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/remote_connection.py", line 463, in _request resp = opener.open(request, timeout=self._timeout) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open response = self._open(req, data) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open '_open', req) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain result = func(*args) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1227, in http_open return self.do_open(httplib.HTTPConnection, req) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1197, in do_open raise URLError(err) URLError:


Ran 2 tests in 0.014s

FAILED (errors=2)

1

1 Answers

1
votes

Okay, so I figured that it was a case that the Appium Server wasn't running and each time you run a new set of tests, you must refresh the Appium Server.

Also tidying up the script, the tests passed.