Hi everyone !
I got an issue, and after scanning the web I still don’t find the solution…
I use a native app with the Facebook WebView connect. After the connection, I got the alert “Open this page in…” with the two options “Cancel” and “Open”. My problem is that I can’t back to my native app.
Here my code :
Set<String> contextNames = AppiumTest.driver.getContextHandles(); for (String contextName : contextNames) { System.out.println(contextNames); } AppiumTest.driver.context(String.valueOf(contextNames.toArray()[1])); System.out.println(AppiumTest.driver.getCapabilities()); log("Fill the Email text field with : " + TestAccount.accountMail); AppiumTest.driver.findElement(By.name("email")).sendKeys(TestAccount.accountMail); log("Fill the Password text field with : " + TestAccount.facebookPassword); getFacebookPasswordTextField().sendKeys(TestAccount.facebookPassword); log("Tap on the Facebook WebView Log In button"); getFacebookWebviewLogInButton().click(); sleep(7); log("Accept the accessibilities by tapping on the OK button"); AppiumTest.driver.findElement(By.name("__CONFIRM__")).click(); AppiumTest.driver.context(String.valueOf(contextNames.toArray()[0])); new TouchAction((MobileDriver) getDriver()).tap(250, 367).perform(); // I try here to click on the button sleep(7);
Even if my tap action is before or after the changeContext, there is no action. Also, I’ve enabled the autoAcceptAlerts=true.
Do you have any suggest ?