Implicit and explicit wait dont work on a Hybrid App

Currently i’m having problems with Appium. Working on a hybrid app and switched to a webview. The tests work if i use Thread.sleep, but when i use implicit wait it doesn’t.

      public void setUp() throws Exception {
            File classpathRoot = new File(System.getProperty("user.dir"));
            File appDir = new File(classpathRoot, "/src/testdata/");
            File app = new File(appDir, "CordovaApp-debug.apk");
            DesiredCapabilities capabilities = new DesiredCapabilities();
        	capabilities.setCapability("device", "Android");
           capabilities.setCapability("deviceName","Motox");
            capabilities.setCapability("platformVersion", "4.4");
                  capabilities.setCapability("app", app.getAbsolutePath());
            capabilities.setCapability("appPackage", "com.testing.Testing");
            capabilities.setCapability("appActivity", "CordovaApp");
              driver=new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
            driver.manage().timeouts().implicitlyWait(60,TimeUnit.SECONDS);
    
     @Test
      public void ChangingLanguage() throws InterruptedException {
    	
    	
    
    		for (int i = 0; i < 20; i++) {
    			  String nr =   driver.getContextHandles().toString();
    		if (nr.contains("WEBVIEW")) {
    				driver.context("WEBVIEW_com.testing.Testing");
    			break;
    		}
    		else
    		{Thread.sleep(5000);}}
 WelcomeView.HaveanAccount(driver).click();
 Login.EmailBox(driver).sendkeys("[email protected]");

I’m getting a exception. org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 475 milliseconds

Even though i specificed that it should wait atleast 60 seconds. I tried testing a native app and there it was fine. It timed out after trying for 60 seconds. Any ideas or suggestions.

Same thing here :frowning: When I am on Native_app context - implicitly works, when on webview\chromium - works not.

    String ANDROID_APP_PACKAGE = "com.litslink.lavo";
    String ANDROID_DEVICE_SOCKET = ANDROID_APP_PACKAGE + "_devtools_remote";
    capabilities.setCapability("androidDeviceSocket", ANDROID_DEVICE_SOCKET);
    ChromeOptions chromeOptions = new ChromeOptions();
    capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
    capabilities.setCapability("deviceName","Galaxy S6");
    capabilities.setCapability("platformVersion", "6.0.1");
    capabilities.setCapability("automationName", "UiAutomator2");
    capabilities.setCapability("platformName", "Android");
    capabilities.setCapability("appPackage", ANDROID_APP_PACKAGE);
    capabilities.setCapability("appActivity", ANDROID_APP_PACKAGE + ".MainActivity");
    driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
    driver.manage().timeouts().implicitlyWait(35, TimeUnit.SECONDS);