NoSuchElementFoundException when I am trying to click on elements in android web view


#1

appium version: 1.12.1
windows 10
working platform=android version 5.1.1
Not working in android version 4.4, 6.0 and above

I am trying to click on the element in android web view where it is showing NoSuchElementFoundException

appDebuggingMode is on and also I have used a method to switch the context but it is showing available context as [NATIVE_APP] in all android platform

element is clickable in android version 5.1.1 (without switching the context working in native context) and not working in android version 4.4, 6.0 and above

I am trying to switch the context by using:

Set availableContexts = driver.getContextHandles();

	System.out.println("context available " +availableContexts);

	for (String context : availableContexts) 
              {
		if (context.contains("WEBVIEW")) {
			
			driver.context(context);		
				break;

				}
	 }

I am trying to click on the element by:

WebDriverWait wait = new WebDriverWait(driver, 120);
wait.until(ExpectedConditions.visibilityOf(element)); 
element.click();

Please provide me solution to solve this problem.