'Tests when run multiple times then driver is not working after getOrientaion(used for making the script wait) method is run
I've created an appium script and my testcases contain wait functionality i.e. I'm making any app like youtube or any game wait for long duration of times. The Wait code is like this:
for(int j=1; j<((min*2)+1);j++)
{
Thread.sleep(30000);
driver.getOrientation();}
Here min is the number of minutes that i'm trying to wait the application.
I'm also using invocationCount attribute of @Test testng to run tests multiple times. After first Iteration when this wait section comes then the script crashes i.e. the next driver command like driver.findelement... is not working.
It is giving error like this:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: 'POST /element' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details Build info: version: '4.1.3', revision: '7b1ebf28ef' System info: host: 'DESKTOP-M7R3JD6', ip: '192.168.52.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '16.0.2' Driver info: io.appium.java_client.android.AndroidDriver Command: [9d59677d-0ce4-4720-b837-8964d3946cf7, findElement {using=accessibility id, value=Camera}] Capabilities {appium:adbExecTimeout: 20000, appium:appActivity: com.android.dialer.main.imp..., appium:appPackage: com.sh.smart.caller, appium:databaseEnabled: false, appium:desired: {adbExecTimeout: 20000, appActivity: com.android.dialer.main.imp..., appPackage: com.sh.smart.caller, deviceName: Infinix HOT 12 PRO, newCommandTimeout: 36000, platformName: android, platformVersion: 12, udid: 085733723N000129}, appium:deviceApiLevel: 31, appium:deviceManufacturer: INFINIX, appium:deviceModel: Infinix X668, appium:deviceName: 085733723N000129, appium:deviceScreenDensity: 320, appium:deviceScreenSize: 720x1612, appium:deviceUDID: 085733723N000129, appium:javascriptEnabled: true, appium:locationContextEnabled: false, appium:networkConnectionEnabled: true, appium:newCommandTimeout: 36000, appium:pixelRatio: 2, appium:platformVersion: 12, appium:statBarHeight: 72, appium:takesScreenshot: true, appium:udid: 085733723N000129, appium:viewportRect: {height: 1372, left: 0, top: 72, width: 720}, appium:warnings: {}, appium:webStorageEnabled: false, platformName: android} Session ID: 9d59677d-0ce4-4720-b837-8964d3946cf7
What do i do to make it work?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
