为啥报ERROR: test_01 (__main__.CaseTest)

来源:5-12 多线程、unittest、启动服务逻辑串联

慕九州8263646

2019-09-05

![图片描述

图片描述

E

ERROR: test_01 (main.CaseTest)

Traceback (most recent call last):
File “D:/PythonWork/Appium_test/case/test_case.py”, line 25, in test_01
self.login_business.login_pass()
File “D:\PythonWork\Appium_test\business\login_business.py”, line 9, in login_pass
self.login_handle.send_username(‘18705092501’)
File “D:\PythonWork\Appium_test\handle\login_handle.py”, line 9, in send_username
self.login_page.get_username_element().send_keys(user)
File “D:\PythonWork\Appium_test\page\login_page.py”, line 18, in get_username_element
return self.get_by_local.get_element(‘username’)
File “D:\PythonWork\Appium_test\util\get_by_local.py”, line 15, in get_element
return self.driver.find_element_by_id(local_by)
File “C:\Users\AV\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 360, in find_element_by_id
return self.find_element(by=By.ID, value=id_)
File “C:\Users\AV\AppData\Local\Programs\Python\Python37\lib\site-packages\appium\webdriver\webdriver.py”, line 276, in find_element
’value’: value})[‘value’]
File “C:\Users\AV\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 321, in execute
self.error_handler.check_response(response)
File “C:\Users\AV\AppData\Local\Programs\Python\Python37\lib\site-packages\appium\webdriver\errorhandler.py”, line 29, in check_response
raise wde
File “C:\Users\AV\AppData\Local\Programs\Python\Python37\lib\site-packages\appium\webdriver\errorhandler.py”, line 24, in check_response
super(MobileErrorHandler, self).check_response(response)
File “C:\Users\AV\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\errorhandler.py”, line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: An element could not be located on the page using the given search parameters.

写回答

1回答

Mushishi

2019-09-05

selenium.common.exceptions.NoSuchElementException: Message: An element could not be located on the page using the given search parameters.

看这句,告诉你 这个元素没找到。

self.get_by_local.get_element(‘username’)

0
0

Python主讲移动端自动化测试框架Appium

APP自动化基础知识、po模型、关键字模型、服务自动化、持续集成

1508 学习 · 1333 问题

查看课程