Advertisement
Guest User

Untitled

a guest
Feb 25th, 2019
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 49.94 KB | None | 0 0
  1. Testing started at 3:05 PM ...
  2. C:\Users\obulygin\PycharmProjects\python_train\venv\Scripts\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.4\helpers\pycharm\_jb_pytest_runner.py" --path C:/Users/obulygin/PycharmProjects/python/test/test_add_group.py
  3. Launching pytest with arguments C:/Users/obulygin/PycharmProjects/python/test/test_add_group.py in C:\Users\obulygin\PycharmProjects\python\test
  4.  
  5. ============================= test session starts =============================
  6. platform win32 -- Python 3.7.2, pytest-4.3.0, py-1.7.0, pluggy-0.8.1
  7. rootdir: C:\Users\obulygin\PycharmProjects\python\test, inifile:collected 2 items
  8.  
  9. test_add_group.py E
  10. test setup failed
  11. request = <SubRequest 'app' for <Function test_add_group>>
  12.  
  13. @pytest.fixture
  14. def app(request):
  15. global fixture
  16. if fixture is None:
  17. fixture = Application()
  18. else:
  19. if not fixture.is_valid():
  20. fixture = Application()
  21. > fixture.session.ensure_login(username=None, password=None)
  22.  
  23. ..\conftest.py:14:
  24. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  25. ..\fixture\session.py:36: in ensure_login
  26. if self.is_logged_in():
  27. ..\fixture\session.py:28: in is_logged_in
  28. return len(wd.find_element_by_link_text("Logout")) > 0
  29. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:428: in find_element_by_link_text
  30. return self.find_element(by=By.LINK_TEXT, value=link_text)
  31. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:978: in find_element
  32. 'value': value})['value']
  33. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:321: in execute
  34. self.error_handler.check_response(response)
  35. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  36.  
  37. self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x045EB030>
  38. response = {'status': 500, 'value': '{"value":{"error":"unknown error","message":"Failed to convert data to an object","stacktrace":""}}'}
  39.  
  40. def check_response(self, response):
  41. """
  42. Checks that a JSON response from the WebDriver does not have an error.
  43.  
  44. :Args:
  45. - response - The JSON response from the WebDriver server as a dictionary
  46. object.
  47.  
  48. :Raises: If the response contains an error message.
  49. """
  50. status = response.get('status', None)
  51. if status is None or status == ErrorCode.SUCCESS:
  52. return
  53. value = None
  54. message = response.get("message", "")
  55. screen = response.get("screen", "")
  56. stacktrace = None
  57. if isinstance(status, int):
  58. value_json = response.get('value', None)
  59. if value_json and isinstance(value_json, basestring):
  60. import json
  61. try:
  62. value = json.loads(value_json)
  63. if len(value.keys()) == 1:
  64. value = value['value']
  65. status = value.get('error', None)
  66. if status is None:
  67. status = value["status"]
  68. message = value["value"]
  69. if not isinstance(message, basestring):
  70. value = message
  71. message = message.get('message')
  72. else:
  73. message = value.get('message', None)
  74. except ValueError:
  75. pass
  76.  
  77. exception_class = ErrorInResponseException
  78. if status in ErrorCode.NO_SUCH_ELEMENT:
  79. exception_class = NoSuchElementException
  80. elif status in ErrorCode.NO_SUCH_FRAME:
  81. exception_class = NoSuchFrameException
  82. elif status in ErrorCode.NO_SUCH_WINDOW:
  83. exception_class = NoSuchWindowException
  84. elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
  85. exception_class = StaleElementReferenceException
  86. elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
  87. exception_class = ElementNotVisibleException
  88. elif status in ErrorCode.INVALID_ELEMENT_STATE:
  89. exception_class = InvalidElementStateException
  90. elif status in ErrorCode.INVALID_SELECTOR \
  91. or status in ErrorCode.INVALID_XPATH_SELECTOR \
  92. or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
  93. exception_class = InvalidSelectorException
  94. elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
  95. exception_class = ElementNotSelectableException
  96. elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
  97. exception_class = ElementNotInteractableException
  98. elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
  99. exception_class = InvalidCookieDomainException
  100. elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
  101. exception_class = UnableToSetCookieException
  102. elif status in ErrorCode.TIMEOUT:
  103. exception_class = TimeoutException
  104. elif status in ErrorCode.SCRIPT_TIMEOUT:
  105. exception_class = TimeoutException
  106. elif status in ErrorCode.UNKNOWN_ERROR:
  107. exception_class = WebDriverException
  108. elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
  109. exception_class = UnexpectedAlertPresentException
  110. elif status in ErrorCode.NO_ALERT_OPEN:
  111. exception_class = NoAlertPresentException
  112. elif status in ErrorCode.IME_NOT_AVAILABLE:
  113. exception_class = ImeNotAvailableException
  114. elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
  115. exception_class = ImeActivationFailedException
  116. elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
  117. exception_class = MoveTargetOutOfBoundsException
  118. elif status in ErrorCode.JAVASCRIPT_ERROR:
  119. exception_class = JavascriptException
  120. elif status in ErrorCode.SESSION_NOT_CREATED:
  121. exception_class = SessionNotCreatedException
  122. elif status in ErrorCode.INVALID_ARGUMENT:
  123. exception_class = InvalidArgumentException
  124. elif status in ErrorCode.NO_SUCH_COOKIE:
  125. exception_class = NoSuchCookieException
  126. elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
  127. exception_class = ScreenshotException
  128. elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
  129. exception_class = ElementClickInterceptedException
  130. elif status in ErrorCode.INSECURE_CERTIFICATE:
  131. exception_class = InsecureCertificateException
  132. elif status in ErrorCode.INVALID_COORDINATES:
  133. exception_class = InvalidCoordinatesException
  134. elif status in ErrorCode.INVALID_SESSION_ID:
  135. exception_class = InvalidSessionIdException
  136. elif status in ErrorCode.UNKNOWN_METHOD:
  137. exception_class = UnknownMethodException
  138. else:
  139. exception_class = WebDriverException
  140. if value == '' or value is None:
  141. value = response['value']
  142. if isinstance(value, basestring):
  143. if exception_class == ErrorInResponseException:
  144. raise exception_class(response, value)
  145. raise exception_class(value)
  146. if message == "" and 'message' in value:
  147. message = value['message']
  148.  
  149. screen = None
  150. if 'screen' in value:
  151. screen = value['screen']
  152.  
  153. stacktrace = None
  154. if 'stackTrace' in value and value['stackTrace']:
  155. stacktrace = []
  156. try:
  157. for frame in value['stackTrace']:
  158. line = self._value_or_default(frame, 'lineNumber', '')
  159. file = self._value_or_default(frame, 'fileName', '<anonymous>')
  160. if line:
  161. file = "%s:%s" % (file, line)
  162. meth = self._value_or_default(frame, 'methodName', '<anonymous>')
  163. if 'className' in frame:
  164. meth = "%s.%s" % (frame['className'], meth)
  165. msg = " at %s (%s)"
  166. msg = msg % (meth, file)
  167. stacktrace.append(msg)
  168. except TypeError:
  169. pass
  170. if exception_class == ErrorInResponseException:
  171. raise exception_class(response, message)
  172. elif exception_class == UnexpectedAlertPresentException:
  173. alert_text = None
  174. if 'data' in value:
  175. alert_text = value['data'].get('text')
  176. elif 'alert' in value:
  177. alert_text = value['alert'].get('text')
  178. raise exception_class(message, screen, stacktrace, alert_text)
  179. > raise exception_class(message, screen, stacktrace)
  180. E selenium.common.exceptions.WebDriverException: Message: Failed to convert data to an object
  181.  
  182. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py:242: WebDriverException
  183. E
  184. test setup failed
  185. request = <SubRequest 'app' for <Function test_add_empty_group>>
  186.  
  187. @pytest.fixture
  188. def app(request):
  189. global fixture
  190. if fixture is None:
  191. fixture = Application()
  192. else:
  193. if not fixture.is_valid():
  194. fixture = Application()
  195. > fixture.session.ensure_login(username=None, password=None)
  196.  
  197. ..\conftest.py:14:
  198. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  199. ..\fixture\session.py:36: in ensure_login
  200. if self.is_logged_in():
  201. ..\fixture\session.py:28: in is_logged_in
  202. return len(wd.find_element_by_link_text("Logout")) > 0
  203. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:428: in find_element_by_link_text
  204. return self.find_element(by=By.LINK_TEXT, value=link_text)
  205. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:978: in find_element
  206. 'value': value})['value']
  207. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:321: in execute
  208. self.error_handler.check_response(response)
  209. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  210.  
  211. self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x045BC630>
  212. response = {'status': 500, 'value': '{"value":{"error":"unknown error","message":"Failed to convert data to an object","stacktrace":""}}'}
  213.  
  214. def check_response(self, response):
  215. """
  216. Checks that a JSON response from the WebDriver does not have an error.
  217.  
  218. :Args:
  219. - response - The JSON response from the WebDriver server as a dictionary
  220. object.
  221.  
  222. :Raises: If the response contains an error message.
  223. """
  224. status = response.get('status', None)
  225. if status is None or status == ErrorCode.SUCCESS:
  226. return
  227. value = None
  228. message = response.get("message", "")
  229. screen = response.get("screen", "")
  230. stacktrace = None
  231. if isinstance(status, int):
  232. value_json = response.get('value', None)
  233. if value_json and isinstance(value_json, basestring):
  234. import json
  235. try:
  236. value = json.loads(value_json)
  237. if len(value.keys()) == 1:
  238. value = value['value']
  239. status = value.get('error', None)
  240. if status is None:
  241. status = value["status"]
  242. message = value["value"]
  243. if not isinstance(message, basestring):
  244. value = message
  245. message = message.get('message')
  246. else:
  247. message = value.get('message', None)
  248. except ValueError:
  249. pass
  250.  
  251. exception_class = ErrorInResponseException
  252. if status in ErrorCode.NO_SUCH_ELEMENT:
  253. exception_class = NoSuchElementException
  254. elif status in ErrorCode.NO_SUCH_FRAME:
  255. exception_class = NoSuchFrameException
  256. elif status in ErrorCode.NO_SUCH_WINDOW:
  257. exception_class = NoSuchWindowException
  258. elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
  259. exception_class = StaleElementReferenceException
  260. elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
  261. exception_class = ElementNotVisibleException
  262. elif status in ErrorCode.INVALID_ELEMENT_STATE:
  263. exception_class = InvalidElementStateException
  264. elif status in ErrorCode.INVALID_SELECTOR \
  265. or status in ErrorCode.INVALID_XPATH_SELECTOR \
  266. or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
  267. exception_class = InvalidSelectorException
  268. elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
  269. exception_class = ElementNotSelectableException
  270. elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
  271. exception_class = ElementNotInteractableException
  272. elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
  273. exception_class = InvalidCookieDomainException
  274. elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
  275. exception_class = UnableToSetCookieException
  276. elif status in ErrorCode.TIMEOUT:
  277. exception_class = TimeoutException
  278. elif status in ErrorCode.SCRIPT_TIMEOUT:
  279. exception_class = TimeoutException
  280. elif status in ErrorCode.UNKNOWN_ERROR:
  281. exception_class = WebDriverException
  282. elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
  283. exception_class = UnexpectedAlertPresentException
  284. elif status in ErrorCode.NO_ALERT_OPEN:
  285. exception_class = NoAlertPresentException
  286. elif status in ErrorCode.IME_NOT_AVAILABLE:
  287. exception_class = ImeNotAvailableException
  288. elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
  289. exception_class = ImeActivationFailedException
  290. elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
  291. exception_class = MoveTargetOutOfBoundsException
  292. elif status in ErrorCode.JAVASCRIPT_ERROR:
  293. exception_class = JavascriptException
  294. elif status in ErrorCode.SESSION_NOT_CREATED:
  295. exception_class = SessionNotCreatedException
  296. elif status in ErrorCode.INVALID_ARGUMENT:
  297. exception_class = InvalidArgumentException
  298. elif status in ErrorCode.NO_SUCH_COOKIE:
  299. exception_class = NoSuchCookieException
  300. elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
  301. exception_class = ScreenshotException
  302. elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
  303. exception_class = ElementClickInterceptedException
  304. elif status in ErrorCode.INSECURE_CERTIFICATE:
  305. exception_class = InsecureCertificateException
  306. elif status in ErrorCode.INVALID_COORDINATES:
  307. exception_class = InvalidCoordinatesException
  308. elif status in ErrorCode.INVALID_SESSION_ID:
  309. exception_class = InvalidSessionIdException
  310. elif status in ErrorCode.UNKNOWN_METHOD:
  311. exception_class = UnknownMethodException
  312. else:
  313. exception_class = WebDriverException
  314. if value == '' or value is None:
  315. value = response['value']
  316. if isinstance(value, basestring):
  317. if exception_class == ErrorInResponseException:
  318. raise exception_class(response, value)
  319. raise exception_class(value)
  320. if message == "" and 'message' in value:
  321. message = value['message']
  322.  
  323. screen = None
  324. if 'screen' in value:
  325. screen = value['screen']
  326.  
  327. stacktrace = None
  328. if 'stackTrace' in value and value['stackTrace']:
  329. stacktrace = []
  330. try:
  331. for frame in value['stackTrace']:
  332. line = self._value_or_default(frame, 'lineNumber', '')
  333. file = self._value_or_default(frame, 'fileName', '<anonymous>')
  334. if line:
  335. file = "%s:%s" % (file, line)
  336. meth = self._value_or_default(frame, 'methodName', '<anonymous>')
  337. if 'className' in frame:
  338. meth = "%s.%s" % (frame['className'], meth)
  339. msg = " at %s (%s)"
  340. msg = msg % (meth, file)
  341. stacktrace.append(msg)
  342. except TypeError:
  343. pass
  344. if exception_class == ErrorInResponseException:
  345. raise exception_class(response, message)
  346. elif exception_class == UnexpectedAlertPresentException:
  347. alert_text = None
  348. if 'data' in value:
  349. alert_text = value['data'].get('text')
  350. elif 'alert' in value:
  351. alert_text = value['alert'].get('text')
  352. raise exception_class(message, screen, stacktrace, alert_text)
  353. > raise exception_class(message, screen, stacktrace)
  354. E selenium.common.exceptions.WebDriverException: Message: Failed to convert data to an object
  355.  
  356. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py:242: WebDriverException
  357. E
  358. test_add_group.py:9 (test_add_empty_group)
  359. tp = <class 'selenium.common.exceptions.WebDriverException'>, value = None
  360. tb = None
  361.  
  362. def reraise(tp, value, tb=None):
  363. try:
  364. if value is None:
  365. value = tp()
  366. if value.__traceback__ is not tb:
  367. raise value.with_traceback(tb)
  368. > raise value
  369.  
  370. ..\..\python_train\venv\lib\site-packages\six.py:693:
  371. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  372. ..\..\python_train\venv\lib\site-packages\six.py:693: in reraise
  373. raise value
  374. ..\..\python_train\venv\lib\site-packages\six.py:693: in reraise
  375. raise value
  376. ..\conftest.py:20: in fin
  377. fixture.session.ensure_logout()
  378. ..\fixture\session.py:23: in ensure_logout
  379. if self.is_logged_in():
  380. ..\fixture\session.py:28: in is_logged_in
  381. return len(wd.find_element_by_link_text("Logout")) > 0
  382. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:428: in find_element_by_link_text
  383. return self.find_element(by=By.LINK_TEXT, value=link_text)
  384. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:978: in find_element
  385. 'value': value})['value']
  386. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:321: in execute
  387. self.error_handler.check_response(response)
  388. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  389.  
  390. self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x045BC630>
  391. response = {'status': 500, 'value': '{"value":{"error":"unknown error","message":"Failed to decode response from marionette","stacktrace":""}}'}
  392.  
  393. def check_response(self, response):
  394. """
  395. Checks that a JSON response from the WebDriver does not have an error.
  396.  
  397. :Args:
  398. - response - The JSON response from the WebDriver server as a dictionary
  399. object.
  400.  
  401. :Raises: If the response contains an error message.
  402. """
  403. status = response.get('status', None)
  404. if status is None or status == ErrorCode.SUCCESS:
  405. return
  406. value = None
  407. message = response.get("message", "")
  408. screen = response.get("screen", "")
  409. stacktrace = None
  410. if isinstance(status, int):
  411. value_json = response.get('value', None)
  412. if value_json and isinstance(value_json, basestring):
  413. import json
  414. try:
  415. value = json.loads(value_json)
  416. if len(value.keys()) == 1:
  417. value = value['value']
  418. status = value.get('error', None)
  419. if status is None:
  420. status = value["status"]
  421. message = value["value"]
  422. if not isinstance(message, basestring):
  423. value = message
  424. message = message.get('message')
  425. else:
  426. message = value.get('message', None)
  427. except ValueError:
  428. pass
  429.  
  430. exception_class = ErrorInResponseException
  431. if status in ErrorCode.NO_SUCH_ELEMENT:
  432. exception_class = NoSuchElementException
  433. elif status in ErrorCode.NO_SUCH_FRAME:
  434. exception_class = NoSuchFrameException
  435. elif status in ErrorCode.NO_SUCH_WINDOW:
  436. exception_class = NoSuchWindowException
  437. elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
  438. exception_class = StaleElementReferenceException
  439. elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
  440. exception_class = ElementNotVisibleException
  441. elif status in ErrorCode.INVALID_ELEMENT_STATE:
  442. exception_class = InvalidElementStateException
  443. elif status in ErrorCode.INVALID_SELECTOR \
  444. or status in ErrorCode.INVALID_XPATH_SELECTOR \
  445. or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
  446. exception_class = InvalidSelectorException
  447. elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
  448. exception_class = ElementNotSelectableException
  449. elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
  450. exception_class = ElementNotInteractableException
  451. elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
  452. exception_class = InvalidCookieDomainException
  453. elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
  454. exception_class = UnableToSetCookieException
  455. elif status in ErrorCode.TIMEOUT:
  456. exception_class = TimeoutException
  457. elif status in ErrorCode.SCRIPT_TIMEOUT:
  458. exception_class = TimeoutException
  459. elif status in ErrorCode.UNKNOWN_ERROR:
  460. exception_class = WebDriverException
  461. elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
  462. exception_class = UnexpectedAlertPresentException
  463. elif status in ErrorCode.NO_ALERT_OPEN:
  464. exception_class = NoAlertPresentException
  465. elif status in ErrorCode.IME_NOT_AVAILABLE:
  466. exception_class = ImeNotAvailableException
  467. elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
  468. exception_class = ImeActivationFailedException
  469. elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
  470. exception_class = MoveTargetOutOfBoundsException
  471. elif status in ErrorCode.JAVASCRIPT_ERROR:
  472. exception_class = JavascriptException
  473. elif status in ErrorCode.SESSION_NOT_CREATED:
  474. exception_class = SessionNotCreatedException
  475. elif status in ErrorCode.INVALID_ARGUMENT:
  476. exception_class = InvalidArgumentException
  477. elif status in ErrorCode.NO_SUCH_COOKIE:
  478. exception_class = NoSuchCookieException
  479. elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
  480. exception_class = ScreenshotException
  481. elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
  482. exception_class = ElementClickInterceptedException
  483. elif status in ErrorCode.INSECURE_CERTIFICATE:
  484. exception_class = InsecureCertificateException
  485. elif status in ErrorCode.INVALID_COORDINATES:
  486. exception_class = InvalidCoordinatesException
  487. elif status in ErrorCode.INVALID_SESSION_ID:
  488. exception_class = InvalidSessionIdException
  489. elif status in ErrorCode.UNKNOWN_METHOD:
  490. exception_class = UnknownMethodException
  491. else:
  492. exception_class = WebDriverException
  493. if value == '' or value is None:
  494. value = response['value']
  495. if isinstance(value, basestring):
  496. if exception_class == ErrorInResponseException:
  497. raise exception_class(response, value)
  498. raise exception_class(value)
  499. if message == "" and 'message' in value:
  500. message = value['message']
  501.  
  502. screen = None
  503. if 'screen' in value:
  504. screen = value['screen']
  505.  
  506. stacktrace = None
  507. if 'stackTrace' in value and value['stackTrace']:
  508. stacktrace = []
  509. try:
  510. for frame in value['stackTrace']:
  511. line = self._value_or_default(frame, 'lineNumber', '')
  512. file = self._value_or_default(frame, 'fileName', '<anonymous>')
  513. if line:
  514. file = "%s:%s" % (file, line)
  515. meth = self._value_or_default(frame, 'methodName', '<anonymous>')
  516. if 'className' in frame:
  517. meth = "%s.%s" % (frame['className'], meth)
  518. msg = " at %s (%s)"
  519. msg = msg % (meth, file)
  520. stacktrace.append(msg)
  521. except TypeError:
  522. pass
  523. if exception_class == ErrorInResponseException:
  524. raise exception_class(response, message)
  525. elif exception_class == UnexpectedAlertPresentException:
  526. alert_text = None
  527. if 'data' in value:
  528. alert_text = value['data'].get('text')
  529. elif 'alert' in value:
  530. alert_text = value['alert'].get('text')
  531. raise exception_class(message, screen, stacktrace, alert_text)
  532. > raise exception_class(message, screen, stacktrace)
  533. E selenium.common.exceptions.WebDriverException: Message: Failed to decode response from marionette
  534.  
  535. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py:242: WebDriverException
  536. [100%]
  537.  
  538. =================================== ERRORS ====================================
  539. ______________________ ERROR at setup of test_add_group _______________________
  540.  
  541. request = <SubRequest 'app' for <Function test_add_group>>
  542.  
  543. @pytest.fixture
  544. def app(request):
  545. global fixture
  546. if fixture is None:
  547. fixture = Application()
  548. else:
  549. if not fixture.is_valid():
  550. fixture = Application()
  551. > fixture.session.ensure_login(username=None, password=None)
  552.  
  553. ..\conftest.py:14:
  554. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  555. ..\fixture\session.py:36: in ensure_login
  556. if self.is_logged_in():
  557. ..\fixture\session.py:28: in is_logged_in
  558. return len(wd.find_element_by_link_text("Logout")) > 0
  559. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:428: in find_element_by_link_text
  560. return self.find_element(by=By.LINK_TEXT, value=link_text)
  561. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:978: in find_element
  562. 'value': value})['value']
  563. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:321: in execute
  564. self.error_handler.check_response(response)
  565. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  566.  
  567. self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x045EB030>
  568. response = {'status': 500, 'value': '{"value":{"error":"unknown error","message":"Failed to convert data to an object","stacktrace":""}}'}
  569.  
  570. def check_response(self, response):
  571. """
  572. Checks that a JSON response from the WebDriver does not have an error.
  573.  
  574. :Args:
  575. - response - The JSON response from the WebDriver server as a dictionary
  576. object.
  577.  
  578. :Raises: If the response contains an error message.
  579. """
  580. status = response.get('status', None)
  581. if status is None or status == ErrorCode.SUCCESS:
  582. return
  583. value = None
  584. message = response.get("message", "")
  585. screen = response.get("screen", "")
  586. stacktrace = None
  587. if isinstance(status, int):
  588. value_json = response.get('value', None)
  589. if value_json and isinstance(value_json, basestring):
  590. import json
  591. try:
  592. value = json.loads(value_json)
  593. if len(value.keys()) == 1:
  594. value = value['value']
  595. status = value.get('error', None)
  596. if status is None:
  597. status = value["status"]
  598. message = value["value"]
  599. if not isinstance(message, basestring):
  600. value = message
  601. message = message.get('message')
  602. else:
  603. message = value.get('message', None)
  604. except ValueError:
  605. pass
  606.  
  607. exception_class = ErrorInResponseException
  608. if status in ErrorCode.NO_SUCH_ELEMENT:
  609. exception_class = NoSuchElementException
  610. elif status in ErrorCode.NO_SUCH_FRAME:
  611. exception_class = NoSuchFrameException
  612. elif status in ErrorCode.NO_SUCH_WINDOW:
  613. exception_class = NoSuchWindowException
  614. elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
  615. exception_class = StaleElementReferenceException
  616. elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
  617. exception_class = ElementNotVisibleException
  618. elif status in ErrorCode.INVALID_ELEMENT_STATE:
  619. exception_class = InvalidElementStateException
  620. elif status in ErrorCode.INVALID_SELECTOR \
  621. or status in ErrorCode.INVALID_XPATH_SELECTOR \
  622. or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
  623. exception_class = InvalidSelectorException
  624. elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
  625. exception_class = ElementNotSelectableException
  626. elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
  627. exception_class = ElementNotInteractableException
  628. elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
  629. exception_class = InvalidCookieDomainException
  630. elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
  631. exception_class = UnableToSetCookieException
  632. elif status in ErrorCode.TIMEOUT:
  633. exception_class = TimeoutException
  634. elif status in ErrorCode.SCRIPT_TIMEOUT:
  635. exception_class = TimeoutException
  636. elif status in ErrorCode.UNKNOWN_ERROR:
  637. exception_class = WebDriverException
  638. elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
  639. exception_class = UnexpectedAlertPresentException
  640. elif status in ErrorCode.NO_ALERT_OPEN:
  641. exception_class = NoAlertPresentException
  642. elif status in ErrorCode.IME_NOT_AVAILABLE:
  643. exception_class = ImeNotAvailableException
  644. elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
  645. exception_class = ImeActivationFailedException
  646. elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
  647. exception_class = MoveTargetOutOfBoundsException
  648. elif status in ErrorCode.JAVASCRIPT_ERROR:
  649. exception_class = JavascriptException
  650. elif status in ErrorCode.SESSION_NOT_CREATED:
  651. exception_class = SessionNotCreatedException
  652. elif status in ErrorCode.INVALID_ARGUMENT:
  653. exception_class = InvalidArgumentException
  654. elif status in ErrorCode.NO_SUCH_COOKIE:
  655. exception_class = NoSuchCookieException
  656. elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
  657. exception_class = ScreenshotException
  658. elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
  659. exception_class = ElementClickInterceptedException
  660. elif status in ErrorCode.INSECURE_CERTIFICATE:
  661. exception_class = InsecureCertificateException
  662. elif status in ErrorCode.INVALID_COORDINATES:
  663. exception_class = InvalidCoordinatesException
  664. elif status in ErrorCode.INVALID_SESSION_ID:
  665. exception_class = InvalidSessionIdException
  666. elif status in ErrorCode.UNKNOWN_METHOD:
  667. exception_class = UnknownMethodException
  668. else:
  669. exception_class = WebDriverException
  670. if value == '' or value is None:
  671. value = response['value']
  672. if isinstance(value, basestring):
  673. if exception_class == ErrorInResponseException:
  674. raise exception_class(response, value)
  675. raise exception_class(value)
  676. if message == "" and 'message' in value:
  677. message = value['message']
  678.  
  679. screen = None
  680. if 'screen' in value:
  681. screen = value['screen']
  682.  
  683. stacktrace = None
  684. if 'stackTrace' in value and value['stackTrace']:
  685. stacktrace = []
  686. try:
  687. for frame in value['stackTrace']:
  688. line = self._value_or_default(frame, 'lineNumber', '')
  689. file = self._value_or_default(frame, 'fileName', '<anonymous>')
  690. if line:
  691. file = "%s:%s" % (file, line)
  692. meth = self._value_or_default(frame, 'methodName', '<anonymous>')
  693. if 'className' in frame:
  694. meth = "%s.%s" % (frame['className'], meth)
  695. msg = " at %s (%s)"
  696. msg = msg % (meth, file)
  697. stacktrace.append(msg)
  698. except TypeError:
  699. pass
  700. if exception_class == ErrorInResponseException:
  701. raise exception_class(response, message)
  702. elif exception_class == UnexpectedAlertPresentException:
  703. alert_text = None
  704. if 'data' in value:
  705. alert_text = value['data'].get('text')
  706. elif 'alert' in value:
  707. alert_text = value['alert'].get('text')
  708. raise exception_class(message, screen, stacktrace, alert_text)
  709. > raise exception_class(message, screen, stacktrace)
  710. E selenium.common.exceptions.WebDriverException: Message: Failed to convert data to an object
  711.  
  712. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py:242: WebDriverException
  713. ___________________ ERROR at setup of test_add_empty_group ____________________
  714.  
  715. request = <SubRequest 'app' for <Function test_add_empty_group>>
  716.  
  717. @pytest.fixture
  718. def app(request):
  719. global fixture
  720. if fixture is None:
  721. fixture = Application()
  722. else:
  723. if not fixture.is_valid():
  724. fixture = Application()
  725. > fixture.session.ensure_login(username=None, password=None)
  726.  
  727. ..\conftest.py:14:
  728. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  729. ..\fixture\session.py:36: in ensure_login
  730. if self.is_logged_in():
  731. ..\fixture\session.py:28: in is_logged_in
  732. return len(wd.find_element_by_link_text("Logout")) > 0
  733. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:428: in find_element_by_link_text
  734. return self.find_element(by=By.LINK_TEXT, value=link_text)
  735. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:978: in find_element
  736. 'value': value})['value']
  737. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:321: in execute
  738. self.error_handler.check_response(response)
  739. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  740.  
  741. self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x045BC630>
  742. response = {'status': 500, 'value': '{"value":{"error":"unknown error","message":"Failed to convert data to an object","stacktrace":""}}'}
  743.  
  744. def check_response(self, response):
  745. """
  746. Checks that a JSON response from the WebDriver does not have an error.
  747.  
  748. :Args:
  749. - response - The JSON response from the WebDriver server as a dictionary
  750. object.
  751.  
  752. :Raises: If the response contains an error message.
  753. """
  754. status = response.get('status', None)
  755. if status is None or status == ErrorCode.SUCCESS:
  756. return
  757. value = None
  758. message = response.get("message", "")
  759. screen = response.get("screen", "")
  760. stacktrace = None
  761. if isinstance(status, int):
  762. value_json = response.get('value', None)
  763. if value_json and isinstance(value_json, basestring):
  764. import json
  765. try:
  766. value = json.loads(value_json)
  767. if len(value.keys()) == 1:
  768. value = value['value']
  769. status = value.get('error', None)
  770. if status is None:
  771. status = value["status"]
  772. message = value["value"]
  773. if not isinstance(message, basestring):
  774. value = message
  775. message = message.get('message')
  776. else:
  777. message = value.get('message', None)
  778. except ValueError:
  779. pass
  780.  
  781. exception_class = ErrorInResponseException
  782. if status in ErrorCode.NO_SUCH_ELEMENT:
  783. exception_class = NoSuchElementException
  784. elif status in ErrorCode.NO_SUCH_FRAME:
  785. exception_class = NoSuchFrameException
  786. elif status in ErrorCode.NO_SUCH_WINDOW:
  787. exception_class = NoSuchWindowException
  788. elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
  789. exception_class = StaleElementReferenceException
  790. elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
  791. exception_class = ElementNotVisibleException
  792. elif status in ErrorCode.INVALID_ELEMENT_STATE:
  793. exception_class = InvalidElementStateException
  794. elif status in ErrorCode.INVALID_SELECTOR \
  795. or status in ErrorCode.INVALID_XPATH_SELECTOR \
  796. or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
  797. exception_class = InvalidSelectorException
  798. elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
  799. exception_class = ElementNotSelectableException
  800. elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
  801. exception_class = ElementNotInteractableException
  802. elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
  803. exception_class = InvalidCookieDomainException
  804. elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
  805. exception_class = UnableToSetCookieException
  806. elif status in ErrorCode.TIMEOUT:
  807. exception_class = TimeoutException
  808. elif status in ErrorCode.SCRIPT_TIMEOUT:
  809. exception_class = TimeoutException
  810. elif status in ErrorCode.UNKNOWN_ERROR:
  811. exception_class = WebDriverException
  812. elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
  813. exception_class = UnexpectedAlertPresentException
  814. elif status in ErrorCode.NO_ALERT_OPEN:
  815. exception_class = NoAlertPresentException
  816. elif status in ErrorCode.IME_NOT_AVAILABLE:
  817. exception_class = ImeNotAvailableException
  818. elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
  819. exception_class = ImeActivationFailedException
  820. elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
  821. exception_class = MoveTargetOutOfBoundsException
  822. elif status in ErrorCode.JAVASCRIPT_ERROR:
  823. exception_class = JavascriptException
  824. elif status in ErrorCode.SESSION_NOT_CREATED:
  825. exception_class = SessionNotCreatedException
  826. elif status in ErrorCode.INVALID_ARGUMENT:
  827. exception_class = InvalidArgumentException
  828. elif status in ErrorCode.NO_SUCH_COOKIE:
  829. exception_class = NoSuchCookieException
  830. elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
  831. exception_class = ScreenshotException
  832. elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
  833. exception_class = ElementClickInterceptedException
  834. elif status in ErrorCode.INSECURE_CERTIFICATE:
  835. exception_class = InsecureCertificateException
  836. elif status in ErrorCode.INVALID_COORDINATES:
  837. exception_class = InvalidCoordinatesException
  838. elif status in ErrorCode.INVALID_SESSION_ID:
  839. exception_class = InvalidSessionIdException
  840. elif status in ErrorCode.UNKNOWN_METHOD:
  841. exception_class = UnknownMethodException
  842. else:
  843. exception_class = WebDriverException
  844. if value == '' or value is None:
  845. value = response['value']
  846. if isinstance(value, basestring):
  847. if exception_class == ErrorInResponseException:
  848. raise exception_class(response, value)
  849. raise exception_class(value)
  850. if message == "" and 'message' in value:
  851. message = value['message']
  852.  
  853. screen = None
  854. if 'screen' in value:
  855. screen = value['screen']
  856.  
  857. stacktrace = None
  858. if 'stackTrace' in value and value['stackTrace']:
  859. stacktrace = []
  860. try:
  861. for frame in value['stackTrace']:
  862. line = self._value_or_default(frame, 'lineNumber', '')
  863. file = self._value_or_default(frame, 'fileName', '<anonymous>')
  864. if line:
  865. file = "%s:%s" % (file, line)
  866. meth = self._value_or_default(frame, 'methodName', '<anonymous>')
  867. if 'className' in frame:
  868. meth = "%s.%s" % (frame['className'], meth)
  869. msg = " at %s (%s)"
  870. msg = msg % (meth, file)
  871. stacktrace.append(msg)
  872. except TypeError:
  873. pass
  874. if exception_class == ErrorInResponseException:
  875. raise exception_class(response, message)
  876. elif exception_class == UnexpectedAlertPresentException:
  877. alert_text = None
  878. if 'data' in value:
  879. alert_text = value['data'].get('text')
  880. elif 'alert' in value:
  881. alert_text = value['alert'].get('text')
  882. raise exception_class(message, screen, stacktrace, alert_text)
  883. > raise exception_class(message, screen, stacktrace)
  884. E selenium.common.exceptions.WebDriverException: Message: Failed to convert data to an object
  885.  
  886. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py:242: WebDriverException
  887. __________________ ERROR at teardown of test_add_empty_group __________________
  888.  
  889. tp = <class 'selenium.common.exceptions.WebDriverException'>, value = None
  890. tb = None
  891.  
  892. def reraise(tp, value, tb=None):
  893. try:
  894. if value is None:
  895. value = tp()
  896. if value.__traceback__ is not tb:
  897. raise value.with_traceback(tb)
  898. > raise value
  899.  
  900. ..\..\python_train\venv\lib\site-packages\six.py:693:
  901. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  902. ..\..\python_train\venv\lib\site-packages\six.py:693: in reraise
  903. raise value
  904. ..\..\python_train\venv\lib\site-packages\six.py:693: in reraise
  905. raise value
  906. ..\conftest.py:20: in fin
  907. fixture.session.ensure_logout()
  908. ..\fixture\session.py:23: in ensure_logout
  909. if self.is_logged_in():
  910. ..\fixture\session.py:28: in is_logged_in
  911. return len(wd.find_element_by_link_text("Logout")) > 0
  912. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:428: in find_element_by_link_text
  913. return self.find_element(by=By.LINK_TEXT, value=link_text)
  914. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:978: in find_element
  915. 'value': value})['value']
  916. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py:321: in execute
  917. self.error_handler.check_response(response)
  918. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  919.  
  920. self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x045BC630>
  921. response = {'status': 500, 'value': '{"value":{"error":"unknown error","message":"Failed to decode response from marionette","stacktrace":""}}'}
  922.  
  923. def check_response(self, response):
  924. """
  925. Checks that a JSON response from the WebDriver does not have an error.
  926.  
  927. :Args:
  928. - response - The JSON response from the WebDriver server as a dictionary
  929. object.
  930.  
  931. :Raises: If the response contains an error message.
  932. """
  933. status = response.get('status', None)
  934. if status is None or status == ErrorCode.SUCCESS:
  935. return
  936. value = None
  937. message = response.get("message", "")
  938. screen = response.get("screen", "")
  939. stacktrace = None
  940. if isinstance(status, int):
  941. value_json = response.get('value', None)
  942. if value_json and isinstance(value_json, basestring):
  943. import json
  944. try:
  945. value = json.loads(value_json)
  946. if len(value.keys()) == 1:
  947. value = value['value']
  948. status = value.get('error', None)
  949. if status is None:
  950. status = value["status"]
  951. message = value["value"]
  952. if not isinstance(message, basestring):
  953. value = message
  954. message = message.get('message')
  955. else:
  956. message = value.get('message', None)
  957. except ValueError:
  958. pass
  959.  
  960. exception_class = ErrorInResponseException
  961. if status in ErrorCode.NO_SUCH_ELEMENT:
  962. exception_class = NoSuchElementException
  963. elif status in ErrorCode.NO_SUCH_FRAME:
  964. exception_class = NoSuchFrameException
  965. elif status in ErrorCode.NO_SUCH_WINDOW:
  966. exception_class = NoSuchWindowException
  967. elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
  968. exception_class = StaleElementReferenceException
  969. elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
  970. exception_class = ElementNotVisibleException
  971. elif status in ErrorCode.INVALID_ELEMENT_STATE:
  972. exception_class = InvalidElementStateException
  973. elif status in ErrorCode.INVALID_SELECTOR \
  974. or status in ErrorCode.INVALID_XPATH_SELECTOR \
  975. or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
  976. exception_class = InvalidSelectorException
  977. elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
  978. exception_class = ElementNotSelectableException
  979. elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
  980. exception_class = ElementNotInteractableException
  981. elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
  982. exception_class = InvalidCookieDomainException
  983. elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
  984. exception_class = UnableToSetCookieException
  985. elif status in ErrorCode.TIMEOUT:
  986. exception_class = TimeoutException
  987. elif status in ErrorCode.SCRIPT_TIMEOUT:
  988. exception_class = TimeoutException
  989. elif status in ErrorCode.UNKNOWN_ERROR:
  990. exception_class = WebDriverException
  991. elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
  992. exception_class = UnexpectedAlertPresentException
  993. elif status in ErrorCode.NO_ALERT_OPEN:
  994. exception_class = NoAlertPresentException
  995. elif status in ErrorCode.IME_NOT_AVAILABLE:
  996. exception_class = ImeNotAvailableException
  997. elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
  998. exception_class = ImeActivationFailedException
  999. elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
  1000. exception_class = MoveTargetOutOfBoundsException
  1001. elif status in ErrorCode.JAVASCRIPT_ERROR:
  1002. exception_class = JavascriptException
  1003. elif status in ErrorCode.SESSION_NOT_CREATED:
  1004. exception_class = SessionNotCreatedException
  1005. elif status in ErrorCode.INVALID_ARGUMENT:
  1006. exception_class = InvalidArgumentException
  1007. elif status in ErrorCode.NO_SUCH_COOKIE:
  1008. exception_class = NoSuchCookieException
  1009. elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
  1010. exception_class = ScreenshotException
  1011. elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
  1012. exception_class = ElementClickInterceptedException
  1013. elif status in ErrorCode.INSECURE_CERTIFICATE:
  1014. exception_class = InsecureCertificateException
  1015. elif status in ErrorCode.INVALID_COORDINATES:
  1016. exception_class = InvalidCoordinatesException
  1017. elif status in ErrorCode.INVALID_SESSION_ID:
  1018. exception_class = InvalidSessionIdException
  1019. elif status in ErrorCode.UNKNOWN_METHOD:
  1020. exception_class = UnknownMethodException
  1021. else:
  1022. exception_class = WebDriverException
  1023. if value == '' or value is None:
  1024. value = response['value']
  1025. if isinstance(value, basestring):
  1026. if exception_class == ErrorInResponseException:
  1027. raise exception_class(response, value)
  1028. raise exception_class(value)
  1029. if message == "" and 'message' in value:
  1030. message = value['message']
  1031.  
  1032. screen = None
  1033. if 'screen' in value:
  1034. screen = value['screen']
  1035.  
  1036. stacktrace = None
  1037. if 'stackTrace' in value and value['stackTrace']:
  1038. stacktrace = []
  1039. try:
  1040. for frame in value['stackTrace']:
  1041. line = self._value_or_default(frame, 'lineNumber', '')
  1042. file = self._value_or_default(frame, 'fileName', '<anonymous>')
  1043. if line:
  1044. file = "%s:%s" % (file, line)
  1045. meth = self._value_or_default(frame, 'methodName', '<anonymous>')
  1046. if 'className' in frame:
  1047. meth = "%s.%s" % (frame['className'], meth)
  1048. msg = " at %s (%s)"
  1049. msg = msg % (meth, file)
  1050. stacktrace.append(msg)
  1051. except TypeError:
  1052. pass
  1053. if exception_class == ErrorInResponseException:
  1054. raise exception_class(response, message)
  1055. elif exception_class == UnexpectedAlertPresentException:
  1056. alert_text = None
  1057. if 'data' in value:
  1058. alert_text = value['data'].get('text')
  1059. elif 'alert' in value:
  1060. alert_text = value['alert'].get('text')
  1061. raise exception_class(message, screen, stacktrace, alert_text)
  1062. > raise exception_class(message, screen, stacktrace)
  1063. E selenium.common.exceptions.WebDriverException: Message: Failed to decode response from marionette
  1064.  
  1065. ..\..\python_train\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py:242: WebDriverException
  1066. =========================== 3 error in 8.06 seconds ===========================
  1067. Process finished with exit code 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement