Appium is responding very very slow while launching the url


#1

Appium is responding very slow while launching the url. It takes a very long time to launch the url in the chrome browser. And so fails to click on accepting cookie popup. Need help on this. Please see my initialize browser method below:

if (“Android”.equalsIgnoreCase(platformName)) {
capabilities.setCapability(“automationName”, “uiautomator2”);
capabilities.setCapability(“platformVersion”, platformVersion);
capabilities.setCapability(“platformName”, platformName);
capabilities.setCapability(“browserName”, browserName);
capabilities.setCapability(“deviceName”, deviceName);
capabilities.setCapability(“newCommandTimeout”, 200);
capabilities.setCapability(“recreateChromeDriverSessions”, true);
capabilities.setCapability(“fullReset”, false);
capabilities.setCapability(“noReset”, true);
capabilities.setCapability(“disableWindowAnimation”, true);
capabilities.setCapability(“nativeWebScreenshot”, true);
driver = new AndroidDriver<>(new URL(“http://” + appiumServer + “:” + appiumPort + “/wd/hub”), capabilities);
logger.info("********");
logger.info(“Launching Chrome browser in android device”);
logger.info("");
driver.get(URL);
logger.info("
");
logger.info(“deleteAllCookies”);
logger.info("
");
driver.manage().deleteAllCookies();
WebDriverWait wait = new WebDriverWait(driver, 20);
element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//section[contains(@class,‘cookie-popover’)]")));
driver.findElement(By.xpath("//section[contains(@class,‘cookie-popover’)]/div/div/div[2]/button")).click();
driver.manage().timeouts().implicitlyWait(120, TimeUnit.SECONDS);
Thread.sleep(5000);
String sPath = System.getProperty(“user.dir”) + File.separator + “OR.properties”;
}

And my xml file looks like below:

<listeners>
        <listener class-name="com.poferries.testngexecute.ExtentReportListner"/>
</listeners>
	<parameter name="platformName" value="Android" />
	<parameter name="platformVersion" value="8.0.0" />
	<parameter name="deviceName" value="ce071827a2dbb80c05" />
	<parameter name="browserName" value="Chrome" />
	<parameter name="BrowserVersion" value="65.0.3325.181" />
	<parameter name="resetStatus" value="true" />
	<parameter name="URL" value="http://52.56.125.148" />
	<parameter name="androidPackage" value="com.android.chrome" />
	<parameter name="disableWindowAnimation" value="true" />
	<!-- >parameter name="autoWebview" value="false" / -->
	<parameter name="nativeWebScreenshot" value="true" />
	<parameter name="androidScreenshotPath" value="./screenshots" />
	<parameter name="driverPath" value="\\src\\test\\resources\\drivers\\chromedriver.exe" />
	<!-- parameter name="udid" value="4d00ad52e4995263" / -->
	<parameter name="reportPath" value="./testreports/30thApr2019/POFerries_B2C_TestSummaryReport_Android.html" />
	<parameter name="appiumServer" value="0.0.0.0" />
	<parameter name="appiumPort" value="4723" />
	<parameter name="bundleId" value="" />
	<parameter name="excelPath" value="" />
	<parameter name="bfullReset" value="false" />
	<test name="PO Ferries Test Automation in Android mobile" preserve-order="true">	
	<classes>			
		<class name="com.poferries.testngexecute.POFerries_RELEASE_2_BookJourney" />
	</classes>


</test> <!-- Test -->