Facing Session Expired error in the GPS location Screen even though I have already applied the wait command there. Also have applied the capabilities and increased the timeout of the appium server.
Thread. sleep(5000)
dc.setCapability(“newCommandTimeout”, 180);
@jay_gandhi Check if the issue is related to network connectivity: Sometimes, this error can occur due to a network issue, so make sure that your device is connected to a stable network.
@Iniyavans, the Device is connected to the Stable Network. I have restarted the Appium server and also increase the time but still facing a session expired issue.
@jay_gandhi could you post the new log with that error? The last one you posted does not have that error.
Error in current log is ‘NoSuchElementError’:
[debug] e[35m[WD Proxy]e[39m Proxying [POST /element] to [POST http://127.0.0.1:8200/wd/hub/session/2b53bed3-016b-45fd-ac2b-08e9e54249be/element] with body: {“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘1’] “,“context”:””,“multiple”:false}
[info] e[35m[WD Proxy]e[39m Got response with status 404: {“sessionId”:“2b53bed3-016b-45fd-ac2b-08e9e54249be”,“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:90)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:67)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:266)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:260)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCont…
[debug] e[35m[W3C]e[39m Matched W3C error code ‘no such element’ to NoSuchElementError
My feeling is that if you are able to correctly identify this element you will be good to go.