Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.59 KB | None | 0 0
  1. /Users/home/Documents/Dmytro/python/PyCharmProjects/python_mantis/env/bin/python "/Applications/PyCharm CE.app/Contents/helpers/pycharm/pytestrunner.py" -p pytest_teamcity /Users/home/Documents/Dmytro/python/PyCharmProjects/python_mantis/test/test_signup_new_account.py "-k test_signup_new_account"
  2. Testing started at 22:38 ...
  3. ============================= test session starts ==============================
  4. platform darwin -- Python 3.6.0, pytest-3.0.7, py-1.4.33, pluggy-0.4.0
  5. rootdir: /Users/home/Documents/Dmytro/python/PyCharmProjects/python_mantis/test, inifile:
  6. collected 1 items
  7.  
  8. test_signup_new_account.py F
  9. app = <helpers.application.Application object at 0x10b416c50>
  10.  
  11. def test_signup_new_account(app):
  12. if app.session.is_logged_in_as(app.config["webadmin"]["username"]):
  13. app.session.logout()
  14. username = random_string("user_", 10)
  15. email = username + "@localhost"
  16. password = "test"
  17. app.james.ensure_user_exists(username, password)
  18. > app.signup.new_user(username, email, password)
  19.  
  20. test_signup_new_account.py:16:
  21. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  22. ../helpers/signup.py:20: in new_user
  23. self.type_in(wd.find_element_by_name("password"), password)
  24. ../env/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py:365: in find_element_by_name
  25. return self.find_element(by=By.NAME, value=name)
  26. ../env/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py:752: in find_element
  27. 'value': value})['value']
  28. ../env/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py:236: in execute
  29. self.error_handler.check_response(response)
  30. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  31.  
  32. self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x10a3fbba8>
  33. response = {'status': 500, 'value': '{"name":"findElement","sessionId":"b7d72195-bd80-054e-97db-31ff7bc39622","status":7,"value":...pey1hmsnm/extensions/fxdriver@googlecode.com/components/command-processor.js","lineNumber":12608,"columnNumber":5}]}}'}
  34.  
  35. def check_response(self, response):
  36. """
  37. Checks that a JSON response from the WebDriver does not have an error.
  38.  
  39. :Args:
  40. - response - The JSON response from the WebDriver server as a dictionary
  41. object.
  42.  
  43. :Raises: If the response contains an error message.
  44. """
  45. status = response.get('status', None)
  46. if status is None or status == ErrorCode.SUCCESS:
  47. return
  48.  
  49. value = None
  50. message = response.get("message", "")
  51. screen = response.get("screen", "")
  52. stacktrace = None
  53. if isinstance(status, int):
  54. value_json = response.get('value', None)
  55. if value_json and isinstance(value_json, basestring):
  56. import json
  57. try:
  58. value = json.loads(value_json)
  59. status = value.get('error', None)
  60. if status is None:
  61. status = value["status"]
  62. message = value["value"]
  63. if not isinstance(message, basestring):
  64. value = message
  65. try:
  66. message = message['message']
  67. except TypeError:
  68. message = None
  69. else:
  70. message = value.get('message', None)
  71. except ValueError:
  72. pass
  73.  
  74. exception_class = ErrorInResponseException
  75. if status in ErrorCode.NO_SUCH_ELEMENT:
  76. exception_class = NoSuchElementException
  77. elif status in ErrorCode.NO_SUCH_FRAME:
  78. exception_class = NoSuchFrameException
  79. elif status in ErrorCode.NO_SUCH_WINDOW:
  80. exception_class = NoSuchWindowException
  81. elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
  82. exception_class = StaleElementReferenceException
  83. elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
  84. exception_class = ElementNotVisibleException
  85. elif status in ErrorCode.INVALID_ELEMENT_STATE:
  86. exception_class = InvalidElementStateException
  87. elif status in ErrorCode.INVALID_SELECTOR \
  88. or status in ErrorCode.INVALID_XPATH_SELECTOR \
  89. or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
  90. exception_class = InvalidSelectorException
  91. elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
  92. exception_class = ElementNotSelectableException
  93. elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
  94. exception_class = WebDriverException
  95. elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
  96. exception_class = WebDriverException
  97. elif status in ErrorCode.TIMEOUT:
  98. exception_class = TimeoutException
  99. elif status in ErrorCode.SCRIPT_TIMEOUT:
  100. exception_class = TimeoutException
  101. elif status in ErrorCode.UNKNOWN_ERROR:
  102. exception_class = WebDriverException
  103. elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
  104. exception_class = UnexpectedAlertPresentException
  105. elif status in ErrorCode.NO_ALERT_OPEN:
  106. exception_class = NoAlertPresentException
  107. elif status in ErrorCode.IME_NOT_AVAILABLE:
  108. exception_class = ImeNotAvailableException
  109. elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
  110. exception_class = ImeActivationFailedException
  111. elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
  112. exception_class = MoveTargetOutOfBoundsException
  113. else:
  114. exception_class = WebDriverException
  115. if value == '' or value is None:
  116. value = response['value']
  117. if isinstance(value, basestring):
  118. if exception_class == ErrorInResponseException:
  119. raise exception_class(response, value)
  120. raise exception_class(value)
  121. if message == "" and 'message' in value:
  122. message = value['message']
  123.  
  124. screen = None
  125. if 'screen' in value:
  126. screen = value['screen']
  127.  
  128. stacktrace = None
  129. if 'stackTrace' in value and value['stackTrace']:
  130. stacktrace = []
  131. try:
  132. for frame in value['stackTrace']:
  133. line = self._value_or_default(frame, 'lineNumber', '')
  134. file = self._value_or_default(frame, 'fileName', '<anonymous>')
  135. if line:
  136. file = "%s:%s" % (file, line)
  137. meth = self._value_or_default(frame, 'methodName', '<anonymous>')
  138. if 'className' in frame:
  139. meth = "%s.%s" % (frame['className'], meth)
  140. msg = " at %s (%s)"
  141. msg = msg % (meth, file)
  142. stacktrace.append(msg)
  143. except TypeError:
  144. pass
  145. if exception_class == ErrorInResponseException:
  146. raise exception_class(response, message)
  147. elif exception_class == UnexpectedAlertPresentException and 'alert' in value:
  148. raise exception_class(message, screen, stacktrace, value['alert'].get('text'))
  149. > raise exception_class(message, screen, stacktrace)
  150. E selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: {"method":"name","selector":"password"}
  151. E Stacktrace:
  152. E at FirefoxDriver.prototype.findElementInternal_ (file:///var/folders/yl/31n5lgk52rvbhm0hgjqy9w5m0000gp/T/tmpey1hmsnm/extensions/fxdriver@googlecode.com/components/driver-component.js:10770)
  153. E at FirefoxDriver.prototype.findElement (file:///var/folders/yl/31n5lgk52rvbhm0hgjqy9w5m0000gp/T/tmpey1hmsnm/extensions/fxdriver@googlecode.com/components/driver-component.js:10779)
  154. E at DelayedCommand.prototype.executeInternal_/h (file:///var/folders/yl/31n5lgk52rvbhm0hgjqy9w5m0000gp/T/tmpey1hmsnm/extensions/fxdriver@googlecode.com/components/command-processor.js:12661)
  155. E at DelayedCommand.prototype.executeInternal_ (file:///var/folders/yl/31n5lgk52rvbhm0hgjqy9w5m0000gp/T/tmpey1hmsnm/extensions/fxdriver@googlecode.com/components/command-processor.js:12666)
  156. E at DelayedCommand.prototype.execute/< (file:///var/folders/yl/31n5lgk52rvbhm0hgjqy9w5m0000gp/T/tmpey1hmsnm/extensions/fxdriver@googlecode.com/components/command-processor.js:12608)
  157.  
  158. ../env/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py:192: NoSuchElementException
  159.  
  160.  
  161. =================================== FAILURES ===================================
  162. ___________________________ test_signup_new_account ____________________________
  163.  
  164. app = <helpers.application.Application object at 0x10b416c50>
  165.  
  166. def test_signup_new_account(app):
  167. if app.session.is_logged_in_as(app.config["webadmin"]["username"]):
  168. app.session.logout()
  169. username = random_string("user_", 10)
  170. email = username + "@localhost"
  171. password = "test"
  172. app.james.ensure_user_exists(username, password)
  173. > app.signup.new_user(username, email, password)
  174.  
  175. test_signup_new_account.py:16:
  176. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  177. ../helpers/signup.py:20: in new_user
  178. self.type_in(wd.find_element_by_name("password"), password)
  179. ../env/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py:365: in find_element_by_name
  180. return self.find_element(by=By.NAME, value=name)
  181. ../env/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py:752: in find_element
  182. 'value': value})['value']
  183. ../env/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py:236: in execute
  184. self.error_handler.check_response(response)
  185. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  186.  
  187. self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x10a3fbba8>
  188. response = {'status': 500, 'value': '{"name":"findElement","sessionId":"b7d72195-bd80-054e-97db-31ff7bc39622","status":7,"value":...pey1hmsnm/extensions/fxdriver@googlecode.com/components/command-processor.js","lineNumber":12608,"columnNumber":5}]}}'}
  189.  
  190. def check_response(self, response):
  191. """
  192. Checks that a JSON response from the WebDriver does not have an error.
  193.  
  194. :Args:
  195. - response - The JSON response from the WebDriver server as a dictionary
  196. object.
  197.  
  198. :Raises: If the response contains an error message.
  199. """
  200. status = response.get('status', None)
  201. if status is None or status == ErrorCode.SUCCESS:
  202. return
  203.  
  204. value = None
  205. message = response.get("message", "")
  206. screen = response.get("screen", "")
  207. stacktrace = None
  208. if isinstance(status, int):
  209. value_json = response.get('value', None)
  210. if value_json and isinstance(value_json, basestring):
  211. import json
  212. try:
  213. value = json.loads(value_json)
  214. status = value.get('error', None)
  215. if status is None:
  216. status = value["status"]
  217. message = value["value"]
  218. if not isinstance(message, basestring):
  219. value = message
  220. try:
  221. message = message['message']
  222. except TypeError:
  223. message = None
  224. else:
  225. message = value.get('message', None)
  226. except ValueError:
  227. pass
  228.  
  229. exception_class = ErrorInResponseException
  230. if status in ErrorCode.NO_SUCH_ELEMENT:
  231. exception_class = NoSuchElementException
  232. elif status in ErrorCode.NO_SUCH_FRAME:
  233. exception_class = NoSuchFrameException
  234. elif status in ErrorCode.NO_SUCH_WINDOW:
  235. exception_class = NoSuchWindowException
  236. elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
  237. exception_class = StaleElementReferenceException
  238. elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
  239. exception_class = ElementNotVisibleException
  240. elif status in ErrorCode.INVALID_ELEMENT_STATE:
  241. exception_class = InvalidElementStateException
  242. elif status in ErrorCode.INVALID_SELECTOR \
  243. or status in ErrorCode.INVALID_XPATH_SELECTOR \
  244. or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
  245. exception_class = InvalidSelectorException
  246. elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
  247. exception_class = ElementNotSelectableException
  248. elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
  249. exception_class = WebDriverException
  250. elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
  251. exception_class = WebDriverException
  252. elif status in ErrorCode.TIMEOUT:
  253. exception_class = TimeoutException
  254. elif status in ErrorCode.SCRIPT_TIMEOUT:
  255. exception_class = TimeoutException
  256. elif status in ErrorCode.UNKNOWN_ERROR:
  257. exception_class = WebDriverException
  258. elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
  259. exception_class = UnexpectedAlertPresentException
  260. elif status in ErrorCode.NO_ALERT_OPEN:
  261. exception_class = NoAlertPresentException
  262. elif status in ErrorCode.IME_NOT_AVAILABLE:
  263. exception_class = ImeNotAvailableException
  264. elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
  265. exception_class = ImeActivationFailedException
  266. elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
  267. exception_class = MoveTargetOutOfBoundsException
  268. else:
  269. exception_class = WebDriverException
  270. if value == '' or value is None:
  271. value = response['value']
  272. if isinstance(value, basestring):
  273. if exception_class == ErrorInResponseException:
  274. raise exception_class(response, value)
  275. raise exception_class(value)
  276. if message == "" and 'message' in value:
  277. message = value['message']
  278.  
  279. screen = None
  280. if 'screen' in value:
  281. screen = value['screen']
  282.  
  283. stacktrace = None
  284. if 'stackTrace' in value and value['stackTrace']:
  285. stacktrace = []
  286. try:
  287. for frame in value['stackTrace']:
  288. line = self._value_or_default(frame, 'lineNumber', '')
  289. file = self._value_or_default(frame, 'fileName', '<anonymous>')
  290. if line:
  291. file = "%s:%s" % (file, line)
  292. meth = self._value_or_default(frame, 'methodName', '<anonymous>')
  293. if 'className' in frame:
  294. meth = "%s.%s" % (frame['className'], meth)
  295. msg = " at %s (%s)"
  296. msg = msg % (meth, file)
  297. stacktrace.append(msg)
  298. except TypeError:
  299. pass
  300. if exception_class == ErrorInResponseException:
  301. raise exception_class(response, message)
  302. elif exception_class == UnexpectedAlertPresentException and 'alert' in value:
  303. raise exception_class(message, screen, stacktrace, value['alert'].get('text'))
  304. > raise exception_class(message, screen, stacktrace)
  305. E selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: {"method":"name","selector":"password"}
  306. E Stacktrace:
  307. E at FirefoxDriver.prototype.findElementInternal_ (file:///var/folders/yl/31n5lgk52rvbhm0hgjqy9w5m0000gp/T/tmpey1hmsnm/extensions/fxdriver@googlecode.com/components/driver-component.js:10770)
  308. E at FirefoxDriver.prototype.findElement (file:///var/folders/yl/31n5lgk52rvbhm0hgjqy9w5m0000gp/T/tmpey1hmsnm/extensions/fxdriver@googlecode.com/components/driver-component.js:10779)
  309. E at DelayedCommand.prototype.executeInternal_/h (file:///var/folders/yl/31n5lgk52rvbhm0hgjqy9w5m0000gp/T/tmpey1hmsnm/extensions/fxdriver@googlecode.com/components/command-processor.js:12661)
  310. E at DelayedCommand.prototype.executeInternal_ (file:///var/folders/yl/31n5lgk52rvbhm0hgjqy9w5m0000gp/T/tmpey1hmsnm/extensions/fxdriver@googlecode.com/components/command-processor.js:12666)
  311. E at DelayedCommand.prototype.execute/< (file:///var/folders/yl/31n5lgk52rvbhm0hgjqy9w5m0000gp/T/tmpey1hmsnm/extensions/fxdriver@googlecode.com/components/command-processor.js:12608)
  312.  
  313. ../env/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py:192: NoSuchElementException
  314. =========================== 1 failed in 8.70 seconds ===========================
  315.  
  316. Process finished with exit code 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement