Guest User

Untitled

a guest
Nov 25th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.08 KB | None | 0 0
  1. (venv) C:\Users\sjim\Dropbox\python\py\PFQA\test>py.test test_modify_group.py
  2. ============================= test session starts =============================
  3. platform win32 -- Python 3.6.2, pytest-4.0.0, py-1.7.0, pluggy-0.8.0
  4. rootdir: C:\Users\sjim\Dropbox\python\py\PFQA\test, inifile:
  5. collected 2 items
  6.  
  7. test_modify_group.py
  8. DevTools listening on ws://127.0.0.1:62386/devtools/browser/fa9b8d33-37e7-46e5-9606-3dc3098b342d
  9. EEE [100%]
  10.  
  11. =================================== ERRORS ====================================
  12. __________________ ERROR at setup of test_modify_group_name ___________________
  13.  
  14. request = <SubRequest 'app' for <Function 'test_modify_group_name'>>
  15.  
  16. @pytest.fixture
  17. def app(request):
  18. global fixture
  19. if fixture is None:
  20. fixture = Application()
  21. else:
  22. if not fixture.is_valid():
  23. fixture = Application()
  24. > fixture.session.ensure_login(username="admin", password="secret")
  25.  
  26. ..\conftest.py:15:
  27. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  28. ..\fixture\session.py:42: in ensure_login
  29. if self.is_logged_in():
  30. ..\fixture\session.py:32: in is_logged_in
  31. return len(wd.find_element_by_link_text("Logout")) > 0
  32. c:\python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py:428: in find_element_by_link_text
  33. return self.find_element(by=By.LINK_TEXT, value=link_text)
  34. c:\python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py:978: in find_element
  35. 'value': value})['value']
  36. c:\python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py:321: in execute
  37. self.error_handler.check_response(response)
  38. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  39.  
  40. self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x047CA030>
  41. response = {'sessionId': 'ae64adc155ad4e1c04711df0e8246283', 'status': 7, 'value': {'message': 'no such element: Unable to locate...ver info: chromedriver=2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90),platform=Windows NT 10.0.14393 x86_64)'}}
  42.  
  43. def check_response(self, response):
  44. """
  45. Checks that a JSON response from the WebDriver does not have an error.
  46.  
  47. :Args:
  48. - response - The JSON response from the WebDriver server as a dictionary
  49. object.
  50.  
  51. :Raises: If the response contains an error message.
  52. """
  53. status = response.get('status', None)
  54. if status is None or status == ErrorCode.SUCCESS:
  55. return
  56. value = None
  57. message = response.get("message", "")
  58. screen = response.get("screen", "")
  59. stacktrace = None
  60. if isinstance(status, int):
  61. value_json = response.get('value', None)
  62. if value_json and isinstance(value_json, basestring):
  63. import json
  64. try:
  65. value = json.loads(value_json)
  66. if len(value.keys()) == 1:
  67. value = value['value']
  68. status = value.get('error', None)
  69. if status is None:
  70. status = value["status"]
  71. message = value["value"]
  72. if not isinstance(message, basestring):
  73. value = message
  74. message = message.get('message')
  75. else:
  76. message = value.get('message', None)
  77. except ValueError:
  78. pass
  79.  
  80. exception_class = ErrorInResponseException
  81. if status in ErrorCode.NO_SUCH_ELEMENT:
  82. exception_class = NoSuchElementException
  83. elif status in ErrorCode.NO_SUCH_FRAME:
  84. exception_class = NoSuchFrameException
  85. elif status in ErrorCode.NO_SUCH_WINDOW:
  86. exception_class = NoSuchWindowException
  87. elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
  88. exception_class = StaleElementReferenceException
  89. elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
  90. exception_class = ElementNotVisibleException
  91. elif status in ErrorCode.INVALID_ELEMENT_STATE:
  92. exception_class = InvalidElementStateException
  93. elif status in ErrorCode.INVALID_SELECTOR \
  94. or status in ErrorCode.INVALID_XPATH_SELECTOR \
  95. or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
  96. exception_class = InvalidSelectorException
  97. elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
  98. exception_class = ElementNotSelectableException
  99. elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
  100. exception_class = ElementNotInteractableException
  101. elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
  102. exception_class = InvalidCookieDomainException
  103. elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
  104. exception_class = UnableToSetCookieException
  105. elif status in ErrorCode.TIMEOUT:
  106. exception_class = TimeoutException
  107. elif status in ErrorCode.SCRIPT_TIMEOUT:
  108. exception_class = TimeoutException
  109. elif status in ErrorCode.UNKNOWN_ERROR:
  110. exception_class = WebDriverException
  111. elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
  112. exception_class = UnexpectedAlertPresentException
  113. elif status in ErrorCode.NO_ALERT_OPEN:
  114. exception_class = NoAlertPresentException
  115. elif status in ErrorCode.IME_NOT_AVAILABLE:
  116. exception_class = ImeNotAvailableException
  117. elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
  118. exception_class = ImeActivationFailedException
  119. elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
  120. exception_class = MoveTargetOutOfBoundsException
  121. elif status in ErrorCode.JAVASCRIPT_ERROR:
  122. exception_class = JavascriptException
  123. elif status in ErrorCode.SESSION_NOT_CREATED:
  124. exception_class = SessionNotCreatedException
  125. elif status in ErrorCode.INVALID_ARGUMENT:
  126. exception_class = InvalidArgumentException
  127. elif status in ErrorCode.NO_SUCH_COOKIE:
  128. exception_class = NoSuchCookieException
  129. elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
  130. exception_class = ScreenshotException
  131. elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
  132. exception_class = ElementClickInterceptedException
  133. elif status in ErrorCode.INSECURE_CERTIFICATE:
  134. exception_class = InsecureCertificateException
  135. elif status in ErrorCode.INVALID_COORDINATES:
  136. exception_class = InvalidCoordinatesException
  137. elif status in ErrorCode.INVALID_SESSION_ID:
  138. exception_class = InvalidSessionIdException
  139. elif status in ErrorCode.UNKNOWN_METHOD:
  140. exception_class = UnknownMethodException
  141. else:
  142. exception_class = WebDriverException
  143. if value == '' or value is None:
  144. value = response['value']
  145. if isinstance(value, basestring):
  146. if exception_class == ErrorInResponseException:
  147. raise exception_class(response, value)
  148. raise exception_class(value)
  149. if message == "" and 'message' in value:
  150. message = value['message']
  151.  
  152. screen = None
  153. if 'screen' in value:
  154. screen = value['screen']
  155.  
  156. stacktrace = None
  157. if 'stackTrace' in value and value['stackTrace']:
  158. stacktrace = []
  159. try:
  160. for frame in value['stackTrace']:
  161. line = self._value_or_default(frame, 'lineNumber', '')
  162. file = self._value_or_default(frame, 'fileName', '<anonymous>')
  163. if line:
  164. file = "%s:%s" % (file, line)
  165. meth = self._value_or_default(frame, 'methodName', '<anonymous>')
  166. if 'className' in frame:
  167. meth = "%s.%s" % (frame['className'], meth)
  168. msg = " at %s (%s)"
  169. msg = msg % (meth, file)
  170. stacktrace.append(msg)
  171. except TypeError:
  172. pass
  173. if exception_class == ErrorInResponseException:
  174. raise exception_class(response, message)
  175. elif exception_class == UnexpectedAlertPresentException:
  176. alert_text = None
  177. if 'data' in value:
  178. alert_text = value['data'].get('text')
  179. elif 'alert' in value:
  180. alert_text = value['alert'].get('text')
  181. raise exception_class(message, screen, stacktrace, alert_text)
  182. > raise exception_class(message, screen, stacktrace)
  183. E selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"link text","selector":"Logout"}
  184. E (Session info: chrome=70.0.3538.102)
  185. E (Driver info: chromedriver=2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90),platform=Windows NT 10.0.14393 x86_64)
  186.  
  187. c:\python36-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py:242: NoSuchElementException
  188. _________________ ERROR at setup of test_modify_group_header __________________
  189.  
  190. request = <SubRequest 'app' for <Function 'test_modify_group_header'>>
  191.  
  192. @pytest.fixture
  193. def app(request):
  194. global fixture
  195. if fixture is None:
  196. fixture = Application()
  197. else:
  198. if not fixture.is_valid():
  199. fixture = Application()
  200. > fixture.session.ensure_login(username="admin", password="secret")
  201.  
  202. ..\conftest.py:15:
  203. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  204. ..\fixture\session.py:42: in ensure_login
  205. if self.is_logged_in():
  206. ..\fixture\session.py:32: in is_logged_in
  207. return len(wd.find_element_by_link_text("Logout")) > 0
  208. c:\python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py:428: in find_element_by_link_text
  209. return self.find_element(by=By.LINK_TEXT, value=link_text)
  210. c:\python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py:978: in find_element
  211. 'value': value})['value']
  212. c:\python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py:321: in execute
  213. self.error_handler.check_response(response)
  214. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  215.  
  216. self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x047CA030>
  217. response = {'sessionId': 'ae64adc155ad4e1c04711df0e8246283', 'status': 7, 'value': {'message': 'no such element: Unable to locate...ver info: chromedriver=2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90),platform=Windows NT 10.0.14393 x86_64)'}}
  218.  
  219. def check_response(self, response):
  220. """
  221. Checks that a JSON response from the WebDriver does not have an error.
  222.  
  223. :Args:
  224. - response - The JSON response from the WebDriver server as a dictionary
  225. object.
  226.  
  227. :Raises: If the response contains an error message.
  228. """
  229. status = response.get('status', None)
  230. if status is None or status == ErrorCode.SUCCESS:
  231. return
  232. value = None
  233. message = response.get("message", "")
  234. screen = response.get("screen", "")
  235. stacktrace = None
  236. if isinstance(status, int):
  237. value_json = response.get('value', None)
  238. if value_json and isinstance(value_json, basestring):
  239. import json
  240. try:
  241. value = json.loads(value_json)
  242. if len(value.keys()) == 1:
  243. value = value['value']
  244. status = value.get('error', None)
  245. if status is None:
  246. status = value["status"]
  247. message = value["value"]
  248. if not isinstance(message, basestring):
  249. value = message
  250. message = message.get('message')
  251. else:
  252. message = value.get('message', None)
  253. except ValueError:
  254. pass
  255.  
  256. exception_class = ErrorInResponseException
  257. if status in ErrorCode.NO_SUCH_ELEMENT:
  258. exception_class = NoSuchElementException
  259. elif status in ErrorCode.NO_SUCH_FRAME:
  260. exception_class = NoSuchFrameException
  261. elif status in ErrorCode.NO_SUCH_WINDOW:
  262. exception_class = NoSuchWindowException
  263. elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
  264. exception_class = StaleElementReferenceException
  265. elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
  266. exception_class = ElementNotVisibleException
  267. elif status in ErrorCode.INVALID_ELEMENT_STATE:
  268. exception_class = InvalidElementStateException
  269. elif status in ErrorCode.INVALID_SELECTOR \
  270. or status in ErrorCode.INVALID_XPATH_SELECTOR \
  271. or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
  272. exception_class = InvalidSelectorException
  273. elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
  274. exception_class = ElementNotSelectableException
  275. elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
  276. exception_class = ElementNotInteractableException
  277. elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
  278. exception_class = InvalidCookieDomainException
  279. elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
  280. exception_class = UnableToSetCookieException
  281. elif status in ErrorCode.TIMEOUT:
  282. exception_class = TimeoutException
  283. elif status in ErrorCode.SCRIPT_TIMEOUT:
  284. exception_class = TimeoutException
  285. elif status in ErrorCode.UNKNOWN_ERROR:
  286. exception_class = WebDriverException
  287. elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
  288. exception_class = UnexpectedAlertPresentException
  289. elif status in ErrorCode.NO_ALERT_OPEN:
  290. exception_class = NoAlertPresentException
  291. elif status in ErrorCode.IME_NOT_AVAILABLE:
  292. exception_class = ImeNotAvailableException
  293. elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
  294. exception_class = ImeActivationFailedException
  295. elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
  296. exception_class = MoveTargetOutOfBoundsException
  297. elif status in ErrorCode.JAVASCRIPT_ERROR:
  298. exception_class = JavascriptException
  299. elif status in ErrorCode.SESSION_NOT_CREATED:
  300. exception_class = SessionNotCreatedException
  301. elif status in ErrorCode.INVALID_ARGUMENT:
  302. exception_class = InvalidArgumentException
  303. elif status in ErrorCode.NO_SUCH_COOKIE:
  304. exception_class = NoSuchCookieException
  305. elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
  306. exception_class = ScreenshotException
  307. elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
  308. exception_class = ElementClickInterceptedException
  309. elif status in ErrorCode.INSECURE_CERTIFICATE:
  310. exception_class = InsecureCertificateException
  311. elif status in ErrorCode.INVALID_COORDINATES:
  312. exception_class = InvalidCoordinatesException
  313. elif status in ErrorCode.INVALID_SESSION_ID:
  314. exception_class = InvalidSessionIdException
  315. elif status in ErrorCode.UNKNOWN_METHOD:
  316. exception_class = UnknownMethodException
  317. else:
  318. exception_class = WebDriverException
  319. if value == '' or value is None:
  320. value = response['value']
  321. if isinstance(value, basestring):
  322. if exception_class == ErrorInResponseException:
  323. raise exception_class(response, value)
  324. raise exception_class(value)
  325. if message == "" and 'message' in value:
  326. message = value['message']
  327.  
  328. screen = None
  329. if 'screen' in value:
  330. screen = value['screen']
  331.  
  332. stacktrace = None
  333. if 'stackTrace' in value and value['stackTrace']:
  334. stacktrace = []
  335. try:
  336. for frame in value['stackTrace']:
  337. line = self._value_or_default(frame, 'lineNumber', '')
  338. file = self._value_or_default(frame, 'fileName', '<anonymous>')
  339. if line:
  340. file = "%s:%s" % (file, line)
  341. meth = self._value_or_default(frame, 'methodName', '<anonymous>')
  342. if 'className' in frame:
  343. meth = "%s.%s" % (frame['className'], meth)
  344. msg = " at %s (%s)"
  345. msg = msg % (meth, file)
  346. stacktrace.append(msg)
  347. except TypeError:
  348. pass
  349. if exception_class == ErrorInResponseException:
  350. raise exception_class(response, message)
  351. elif exception_class == UnexpectedAlertPresentException:
  352. alert_text = None
  353. if 'data' in value:
  354. alert_text = value['data'].get('text')
  355. elif 'alert' in value:
  356. alert_text = value['alert'].get('text')
  357. raise exception_class(message, screen, stacktrace, alert_text)
  358. > raise exception_class(message, screen, stacktrace)
  359. E selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"link text","selector":"Logout"}
  360. E (Session info: chrome=70.0.3538.102)
  361. E (Driver info: chromedriver=2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90),platform=Windows NT 10.0.14393 x86_64)
  362.  
  363. c:\python36-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py:242: NoSuchElementException
  364. ________________ ERROR at teardown of test_modify_group_header ________________
  365.  
  366. tp = <class 'selenium.common.exceptions.NoSuchElementException'>, value = None
  367. tb = None
  368.  
  369. def reraise(tp, value, tb=None):
  370. try:
  371. if value is None:
  372. value = tp()
  373. if value.__traceback__ is not tb:
  374. raise value.with_traceback(tb)
  375. > raise value
  376.  
  377. c:\python36-32\lib\site-packages\six.py:693:
  378. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  379. c:\python36-32\lib\site-packages\six.py:693: in reraise
  380. raise value
  381. c:\python36-32\lib\site-packages\six.py:693: in reraise
  382. raise value
  383. ..\conftest.py:22: in fin
  384. fixture.session.ensure_logout()
  385. ..\fixture\session.py:26: in ensure_logout
  386. if self.is_logged_in():
  387. ..\fixture\session.py:32: in is_logged_in
  388. return len(wd.find_element_by_link_text("Logout")) > 0
  389. c:\python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py:428: in find_element_by_link_text
  390. return self.find_element(by=By.LINK_TEXT, value=link_text)
  391. c:\python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py:978: in find_element
  392. 'value': value})['value']
  393. c:\python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py:321: in execute
  394. self.error_handler.check_response(response)
  395. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  396.  
  397. self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x047CA030>
  398. response = {'sessionId': 'ae64adc155ad4e1c04711df0e8246283', 'status': 7, 'value': {'message': 'no such element: Unable to locate...ver info: chromedriver=2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90),platform=Windows NT 10.0.14393 x86_64)'}}
  399.  
  400. def check_response(self, response):
  401. """
  402. Checks that a JSON response from the WebDriver does not have an error.
  403.  
  404. :Args:
  405. - response - The JSON response from the WebDriver server as a dictionary
  406. object.
  407.  
  408. :Raises: If the response contains an error message.
  409. """
  410. status = response.get('status', None)
  411. if status is None or status == ErrorCode.SUCCESS:
  412. return
  413. value = None
  414. message = response.get("message", "")
  415. screen = response.get("screen", "")
  416. stacktrace = None
  417. if isinstance(status, int):
  418. value_json = response.get('value', None)
  419. if value_json and isinstance(value_json, basestring):
  420. import json
  421. try:
  422. value = json.loads(value_json)
  423. if len(value.keys()) == 1:
  424. value = value['value']
  425. status = value.get('error', None)
  426. if status is None:
  427. status = value["status"]
  428. message = value["value"]
  429. if not isinstance(message, basestring):
  430. value = message
  431. message = message.get('message')
  432. else:
  433. message = value.get('message', None)
  434. except ValueError:
  435. pass
  436.  
  437. exception_class = ErrorInResponseException
  438. if status in ErrorCode.NO_SUCH_ELEMENT:
  439. exception_class = NoSuchElementException
  440. elif status in ErrorCode.NO_SUCH_FRAME:
  441. exception_class = NoSuchFrameException
  442. elif status in ErrorCode.NO_SUCH_WINDOW:
  443. exception_class = NoSuchWindowException
  444. elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
  445. exception_class = StaleElementReferenceException
  446. elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
  447. exception_class = ElementNotVisibleException
  448. elif status in ErrorCode.INVALID_ELEMENT_STATE:
  449. exception_class = InvalidElementStateException
  450. elif status in ErrorCode.INVALID_SELECTOR \
  451. or status in ErrorCode.INVALID_XPATH_SELECTOR \
  452. or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
  453. exception_class = InvalidSelectorException
  454. elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
  455. exception_class = ElementNotSelectableException
  456. elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
  457. exception_class = ElementNotInteractableException
  458. elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
  459. exception_class = InvalidCookieDomainException
  460. elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
  461. exception_class = UnableToSetCookieException
  462. elif status in ErrorCode.TIMEOUT:
  463. exception_class = TimeoutException
  464. elif status in ErrorCode.SCRIPT_TIMEOUT:
  465. exception_class = TimeoutException
  466. elif status in ErrorCode.UNKNOWN_ERROR:
  467. exception_class = WebDriverException
  468. elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
  469. exception_class = UnexpectedAlertPresentException
  470. elif status in ErrorCode.NO_ALERT_OPEN:
  471. exception_class = NoAlertPresentException
  472. elif status in ErrorCode.IME_NOT_AVAILABLE:
  473. exception_class = ImeNotAvailableException
  474. elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
  475. exception_class = ImeActivationFailedException
  476. elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
  477. exception_class = MoveTargetOutOfBoundsException
  478. elif status in ErrorCode.JAVASCRIPT_ERROR:
  479. exception_class = JavascriptException
  480. elif status in ErrorCode.SESSION_NOT_CREATED:
  481. exception_class = SessionNotCreatedException
  482. elif status in ErrorCode.INVALID_ARGUMENT:
  483. exception_class = InvalidArgumentException
  484. elif status in ErrorCode.NO_SUCH_COOKIE:
  485. exception_class = NoSuchCookieException
  486. elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
  487. exception_class = ScreenshotException
  488. elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
  489. exception_class = ElementClickInterceptedException
  490. elif status in ErrorCode.INSECURE_CERTIFICATE:
  491. exception_class = InsecureCertificateException
  492. elif status in ErrorCode.INVALID_COORDINATES:
  493. exception_class = InvalidCoordinatesException
  494. elif status in ErrorCode.INVALID_SESSION_ID:
  495. exception_class = InvalidSessionIdException
  496. elif status in ErrorCode.UNKNOWN_METHOD:
  497. exception_class = UnknownMethodException
  498. else:
  499. exception_class = WebDriverException
  500. if value == '' or value is None:
  501. value = response['value']
  502. if isinstance(value, basestring):
  503. if exception_class == ErrorInResponseException:
  504. raise exception_class(response, value)
  505. raise exception_class(value)
  506. if message == "" and 'message' in value:
  507. message = value['message']
  508.  
  509. screen = None
  510. if 'screen' in value:
  511. screen = value['screen']
  512.  
  513. stacktrace = None
  514. if 'stackTrace' in value and value['stackTrace']:
  515. stacktrace = []
  516. try:
  517. for frame in value['stackTrace']:
  518. line = self._value_or_default(frame, 'lineNumber', '')
  519. file = self._value_or_default(frame, 'fileName', '<anonymous>')
  520. if line:
  521. file = "%s:%s" % (file, line)
  522. meth = self._value_or_default(frame, 'methodName', '<anonymous>')
  523. if 'className' in frame:
  524. meth = "%s.%s" % (frame['className'], meth)
  525. msg = " at %s (%s)"
  526. msg = msg % (meth, file)
  527. stacktrace.append(msg)
  528. except TypeError:
  529. pass
  530. if exception_class == ErrorInResponseException:
  531. raise exception_class(response, message)
  532. elif exception_class == UnexpectedAlertPresentException:
  533. alert_text = None
  534. if 'data' in value:
  535. alert_text = value['data'].get('text')
  536. elif 'alert' in value:
  537. alert_text = value['alert'].get('text')
  538. raise exception_class(message, screen, stacktrace, alert_text)
  539. > raise exception_class(message, screen, stacktrace)
  540. E selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"link text","selector":"Logout"}
  541. E (Session info: chrome=70.0.3538.102)
  542. E (Driver info: chromedriver=2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90),platform=Windows NT 10.0.14393 x86_64)
  543.  
  544. c:\python36-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py:242: NoSuchElementException
  545. ========================== 3 error in 18.09 seconds ===========================
Add Comment
Please, Sign In to add comment