Tap button 'Install' on alert when installing profile not working

Hi!
I’m working with real device.
With the code below I can tap on button at corner top - right
WebElement install = driver.findElement(MobileBy.IosUIAutomation(“UIATarget.localTarget().frontMostApp().mainWindow().navigationBar().buttons()[2]”));
driver.tap(1, install, 1);

After the button ‘Install’ on alert appear, i can’t use web inspector on Appium to get element.
How can handle tap event button ‘Install’ on alert?

Thanks and regard.
Toan

Toan,

Try using uiautomatorviewer. It might not be able to grab the screen elements if appium has an active connection.

If you don’t have to worry about localization testing, you can find the element by_name using ‘Install’.

Failing that, ask your developers about the install button – does it have a resource id? If they can provide that to you, you can locate the element by_id

Uiautomatorviewer supports on Android platform, but here i’m working on iOS real device (9.0.1).
The attached file is a layout default when installing profile. It’s not a application of dev created, so i can’t know any attribute of button ‘Install’.

Sorry, I should have recognized the iOS screen.

You could program in a manual tap, and you’ll be “guessing” where the install button sits to get a tap right on it.