Automating deeplinks with iOS real device

Hey @Aleksei, thank you very much on your help and effort.
Unfortunately, your recommendation doesn’t help.

I’ve also tried live testing session, and check the scenario manually on remote iOS device. And also there, OPEN in app button dialog isn’t displayed. It’s looks like this is the BitBar related problem.

I’ve wrote to their support to see what we can do.

Thanks again, cheers!

But can you tap Go button on keyboard instead?

Yes @Aleksei, I can tap Go button properly. But when I tap Go button, page is just loaded in Safari and keyboard is closed. There is no OPEN in app button when test is executed on the remote real iOS device.
I have successfully done all of those steps:

  1. Start native iOS application and do “Forgot password” steps which sends email at the end.
  2. In the background via API, email reset password link is extracted which I’m 100% sure is correct.
  3. Then do next scripts, like your solution:
    final Map<String, Object> ourAppArgs = new HashMap<>();
    ourAppArgs.put("bundleId", "our.app.bundle.id") 
    
    final Map<String, Object> safariArgs = new HashMap<>();
    safariArgs.put("bundleId", "com.apple.mobilesafari");
    
    driver.executeScript("mobile: terminateApp", safariArgs);
    driver.executeScript("mobile: launchApp", safariArgs);
    
    // define all the elements related to Safari, then:
    
    urlBarOpenBtn.click();
    urlBarTxtField.sendKeys(resetPassUrl);
    goBtn.click();
    openInAppBtn.click();
    
    driver.getPageSource();
    assertEquals(RUNNING_IN_FOREGROUND.ordinal(), Integer.valueOf(driver.executeScript("mobile: queryAppState", ourAppArgs).toString()));
    // continue with the actions in our app
    

All this code works very fine on our local real iOS device. But there is only a problem with the remote real iOS device. Possibly because of the provider setup and iOS version. Because they still do not provide iOS 17, only iOS 16.6.1 as highest version.

This is how it looks on remote BitBar real iOS device:

And this is how it looks on our local real iOS device:

what you enter in:

urlBarTxtField.sendKeys(resetPassUrl);

on screenshot i see you entered valid url which shows your site and site itself triggering to open some deep link.

for example I enter text like: “my_app://deep_link_value” and i have similar screen as in example link above

I mean looks like problem not in your code but in Web/Backend/BitBar_device. Try to enter same URL manually while your app installed on remote device. You should same fail to see popUp with Open button.

Yes, the problem is with the BitBar device. Their support told me that they re-sign iOS apps when installing them on their remote devices. So, some of the functions are disabled because of the security, like Apple pay, Wallet, etc.

Anyway, your solution helped me to solve opening deep links locally. Nice job.

Thank you @Aleksei