Пожалуйста, проверьте журналы, которые мы только что выполнили
есть две кнопки, одна из которых - кнопка «Иллюстрация» на главной странице, вторая - «Выбор продукта» в разделе «Детали». Элемент страницы ienext появляется после нажатия кнопки иллюстрации. Как вы сказали, мы реализовали явное ожидание в обеих кнопках перед нажатием, мы не получили никакой ошибки для иллюстрации, так как вы можете проверить журналы, но кнопка иллюстрации не нажимала, и проблема с выбором продукта на следующей странице также не щелкает. так как выдает ошибку как отсутствие такого элемента даже после того, как вручную нажимаете кнопку иллюстрации n и переходите к следующей странице.
Вы можете предложить любую загрузку страницы в appium, это может быть потому, что мы написали скрипт для извлечения источника страницы перед выполнением операции встраница, на которой мы обнаружили, что xml загружается частично.
Журналы Appium
[HTTP] {"using":"xpath","value":"//android.view.View[@text='Illustration']"}
[W3C (b5d9b130)] Calling AppiumDriver.findElement() with args: ["xpath","//android.view.View[@text='Illustration']","b5d9b130-5e84-4675-928f-6ecb5a3f9eef"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 50000 ms for condition
[WD Proxy] Matched '/element' to command name 'findElement'
[WD Proxy] Proxying [POST /element] to [POST http://localhost:8202/wd/hub/session/74c0477c-ea91-466e-ad4a-20817a11dc2a/element] with body:
{"strategy":"xpath","selector":"//android.view.View[@text='Illustration']","context":"","multiple":false}
[WD Proxy] Got response with status 200: {"sessionId":"74c0477c-ea91-466e-ad4a-20817a11dc2a","value":{"ELEMENT":"0b9beaa1-1469-4c07-8c10-cdc2758d555b","element-6066-11e4-a52e-4f735466cecf":"0b9beaa1-1469-4c07-8c10-cdc2758d555b"}}
[W3C (b5d9b130)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"0b9beaa1-1469-4c07-8c10-cdc2758d555b","ELEMENT":"0b9beaa1-1469-4c07-8c10-cdc2758d555b"}
[HTTP] <-- POST /wd/hub/session/b5d9b130-5e84-4675-928f-6ecb5a3f9eef/element 200 698 ms - 137
[HTTP]
[HTTP] --> GET /wd/hub/session/b5d9b130-5e84-4675-928f-6ecb5a3f9eef/element/0b9beaa1-1469-4c07-8c10-cdc2758d555b/displayed
[HTTP] {}
[W3C (b5d9b130)] Calling AppiumDriver.elementDisplayed() with args: ["0b9beaa1-1469-4c07-8c10-cdc2758d555b","b5d9b130-5e84-4675-928f-6ecb5a3f9eef"]
[WD Proxy] Matched '/element/0b9beaa1-1469-4c07-8c10-cdc2758d555b/attribute/displayed' to command name 'getAttribute'
[WD Proxy] Proxying [GET /element/0b9beaa1-1469-4c07-8c10-cdc2758d555b/attribute/displayed] to [GET http://localhost:8202/wd/hub/session/74c0477c-ea91-466e-ad4a-20817a11dc2a/element/0b9beaa1-1469-4c07-8c10-cdc2758d555b/attribute/displayed] with body: {}
[WD Proxy] Got response with status 200: {"sessionId":"74c0477c-ea91-466e-ad4a-20817a11dc2a","value":"true"}
[W3C (b5d9b130)] Responding to client with driver.elementDisplayed() result: true
[HTTP] <-- GET /wd/hub/session/b5d9b130-5e84-4675-928f-6ecb5a3f9eef/element/0b9beaa1-1469-4c07-8c10-cdc2758d555b/displayed 200 26 ms - 14
[HTTP]
[HTTP] --> GET /wd/hub/session/b5d9b130-5e84-4675-928f-6ecb5a3f9eef/element/0b9beaa1-1469-4c07-8c10-cdc2758d555b/enabled
[HTTP] {}
[W3C (b5d9b130)] Calling AppiumDriver.elementEnabled() with args: ["0b9beaa1-1469-4c07-8c10-cdc2758d555b","b5d9b130-5e84-4675-928f-6ecb5a3f9eef"]
[WD Proxy] Matched '/element/0b9beaa1-1469-4c07-8c10-cdc2758d555b/attribute/enabled' to command name 'getAttribute'
[WD Proxy] Proxying [GET /element/0b9beaa1-1469-4c07-8c10-cdc2758d555b/attribute/enabled] to [GET http://localhost:8202/wd/hub/session/74c0477c-ea91-466e-ad4a-20817a11dc2a/element/0b9beaa1-1469-4c07-8c10-cdc2758d555b/attribute/enabled] with body: {}
[WD Proxy] Got response with status 200: {"sessionId":"74c0477c-ea91-466e-ad4a-20817a11dc2a","value":"true"}
[W3C (b5d9b130)] Responding to client with driver.elementEnabled() result: true
[HTTP] <-- GET /wd/hub/session/b5d9b130-5e84-4675-928f-6ecb5a3f9eef/element/0b9beaa1-1469-4c07-8c10-cdc2758d555b/enabled 200 25 ms - 14
[HTTP]
[HTTP] --> POST /wd/hub/session/b5d9b130-5e84-4675-928f-6ecb5a3f9eef/element/0b9beaa1-1469-4c07-8c10-cdc2758d555b/click
[HTTP] {"id":"0b9beaa1-1469-4c07-8c10-cdc2758d555b"}
[W3C (b5d9b130)] Calling AppiumDriver.click() with args: ["0b9beaa1-1469-4c07-8c10-cdc2758d555b","b5d9b130-5e84-4675-928f-6ecb5a3f9eef"]
[WD Proxy] Matched '/element/0b9beaa1-1469-4c07-8c10-cdc2758d555b/click' to command name 'click'
[WD Proxy] Proxying [POST /element/0b9beaa1-1469-4c07-8c10-cdc2758d555b/click] to [POST http://localhost:8202/wd/hub/session/74c0477c-ea91-466e-ad4a-20817a11dc2a/element/0b9beaa1-1469-4c07-8c10-cdc2758d555b/click] with body: {"element":"0b9beaa1-1469-4c07-8c10-cdc2758d555b"}
[WD Proxy] Got response with status 200: {"sessionId":"74c0477c-ea91-466e-ad4a-20817a11dc2a","value":null}
[W3C (b5d9b130)] Responding to client with driver.click() result: null
[HTTP] <-- POST /wd/hub/session/b5d9b130-5e84-4675-928f-6ecb5a3f9eef/element/0b9beaa1-1469-4c07-8c10-cdc2758d555b/click 200 79 ms - 14
[HTTP]
[HTTP] --> POST /wd/hub/session/b5d9b130-5e84-4675-928f-6ecb5a3f9eef/element
[HTTP] {"using":"xpath","value":"//android.view.View[@text=\"Protection Solution\"]"}
[W3C (b5d9b130)] Calling AppiumDriver.findElement() with args: ["xpath","//android.view.View[@text=\"Protection Solution\"]","b5d9b130-5e84-4675-928f-6ecb5a3f9eef"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 50000 ms for condition
[WD Proxy] Matched '/element' to command name 'findElement'
[WD Proxy] Proxying [POST /element] to [POST http://localhost:8202/wd/hub/session/74c0477c-ea91-466e-ad4a-20817a11dc2a/element] with body: {"strategy":"xpath","selector":"//android.view.View[@text=\"Protection Solution\"]","context":"","multiple":false}
[WD Proxy] Got an unexpected response with status 404: {"sessionId":"74c0477c-ea91-466e-ad4a-20817a11dc2a","value":{"error":"no such element","message":"An element could not be located on the page using the given search parameters","stacktrace":"io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon...
[W3C] Matched W3C error code 'no such element' to NoSuchElementError
[BaseDriver] Waited for 665 ms so far
[WD Proxy] Matched '/element' to command name 'findElement'
[WD Proxy] Proxying [POST /element] to [POST http://localhost:8202/wd/hub/session/74c0477c-ea91-466e-ad4a-20817a11dc2a/element] with body: {"strategy":"xpath","selector":"//android.view.View[@text=\"Protection Solution\"]","context":"","multiple":false}
[WD Proxy] Got an unexpected response with status 404: {"sessionId":"74c0477c-ea91-466e-ad4a-20817a11dc2a","value":{"error":"no such element","message":"An element could not be located on the page using the given search parameters","stacktrace":"io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon...
[W3C] Matched W3C error code 'no such element' to NoSuchElementError
[BaseDriver] Waited for 1788 ms so far
[W3C (b5d9b130)] Encountered internal error running command: NoSuchElementError: An element could not be located on the page using the given search parameters.
[W3C (b5d9b130)] at AndroidUiautomator2Driver.findElOrEls (C:\Users\Admin\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-android-driver\lib\commands\find.js:75:11)
[HTTP] <-- POST /wd/hub/session/b5d9b130-5e84-4675-928f-6ecb5a3f9eef/element 404 50639 ms - 446