I want to handle the IOS alerts in simulator.
Ex:
When i install my app in simulator(iPhone 4s) then it is throwing message “This app allowing to access the current location” with Agree and Dont Agree. I want to click on either Agree or Don’t agree but how?
In iPhone, When you install the IOS apps like ola or Uber then one message is displays like
“Allow XXXXXX to access your location for searching cabs near you” with the following buttons
Dont Allow and Allow but how can identify the properties of this object using appium tool.
well if you are not even to start driver = no way. is it your case?
regarding “it is system throwing message” - it is visible in Appium inspector and pagesource with Simulator.
I installed one app in my mobile and i want to sign up via gmail or twitter then i click on anyone and selected particular screen opened. Now i want to identify the element properties in newly displayed screen.
And then search the results. If I was on a screen that had an Alert (popup), I would look for ‘UIAAlert’, and then accept or dismiss it. I also use these results to identify the page I’m on. To find individual elements I still do a find by or such.
system alert like allow use location to application
alert that is application use in code. this alert is absolutely look like system but generated application and THUS not visible if you are not automating (owner) of this application.
Even I need help as my app redirects to facebook login page. Where you able to handle it? So even I am facing the issue on the same so how can I handle this
But first check need to be optimized, as it’s quite slow because of xpath, any solution for this check ?
if(getDriver().findElements(By.xpath("//XCUIElementTypeAlert[contains(@name,'access your location while you are using the app')]")).size() ) {
JavascriptExecutor js = (JavascriptExecutor) getDriver();
HashMap<String, String> tapObject = new HashMap<String, String>();
tapObject.put("action", "accept");
tapObject.put("label", "Allow");
js.executeScript("mobile:alert", tapObject);
}