代码
def get_Keypad_Number():
Keypad_Number_1 = ("xpath","//*[contains(@text,'3')]")
Number1 = WebDriverWait(driver,10,0.1).until(EC.presence_of_element_located(Keypad_Number_1))
Number1.click()Appium--server的报错信息
[HTTP] <-- POST /wd/hub/session/dd525ec2-e2b7-4ef9-ae15-8ea58b5f700a/element 500 24 ms - 164
[HTTP]
[HTTP] --> POST /wd/hub/session/dd525ec2-e2b7-4ef9-ae15-8ea58b5f700a/element
[HTTP] {"using":"xpath","value":"//*[contains(@text,'3')]","sessionId":"dd525ec2-e2b7-4ef9-ae15-8ea58b5f700a"}
[W3C] Calling AppiumDriver.findElement() with args: ["xpath","//*[contains(@text,'3')]","dd525ec2-e2b7-4ef9-ae15-8ea58b5f700a"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 0 ms for condition
[JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8206/wd/hub/session/61c727a2-1fec-4db0-a6a4-7ed294d0cd73/element] with body: {"strategy":"xpath","selector":"//*[contains(@text,'3')]","context":"","multiple":false}
[MJSONWP] Encountered internal error running command: {"w3cStatus":400,"jsonwp":{"sessionId":"61c727a2-1fec-4db0-a6a4-7ed294d0cd73","status":7,"value":"An element could not be located on the page using the given search parameters."}} ProxyRequestError: Could not proxy command to remote server. Original error: 500 - {"sessionId":"61c727a2-1fec-4db0-a6a4-7ed294d0cd73","status":7,"value":"An element could not be located on the page using the given search parameters."}
[MJSONWP] at JWProxy.proxy$ (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:152:13)
[MJSONWP] at tryCatch (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
[MJSONWP] at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
[MJSONWP] at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
[MJSONWP] at GeneratorFunctionPrototype.invoke (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
[MJSONWP] at
[MJSONWP] Matched JSONWP error code 7 to NoSuchElementError
[HTTP] <-- POST /wd/hub/session/dd525ec2-e2b7-4ef9-ae15-8ea58b5f700a/element 500 22 ms - 164
[HTTP]控制台的报错信息
Traceback (most recent call last): File "E:\Appium\FXJC_Appium_Python\Start_Appium.py", line 118, in <module> login_new() File "E:\Appium\FXJC_Appium_Python\Start_Appium.py", line 107, in login_new get_Keypad_Number() File "E:\Appium\FXJC_Appium_Python\Start_Appium.py", line 84, in get_Keypad_Number Number1 = WebDriverWait(driver,10,0.1).until(EC.presence_of_element_located(Keypad_Number_1)) File "C:\Python36\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: [Finished in 66.9s with exit code 1]
老师,因为我们APP的密码必须要用软件自带的数字键盘来进行输入,所以我就想用了你这个获取tost元素的方法去获取键盘上的按钮的元素。我在获取到这个键盘上的数字3的这个元素后,然后实现对它的点击,结果报错了。
1、这个为什么会报错呢?
2、有没有方法可以获取点击密码数字键盘上的元素呢?
求老师帮忙指点一二...