handle ios system pop ups - ios

I have to have handle system pop up on iOS. I have tried below solution but they do not help:
1. driver.findElement(By.name("OK")).click();
2. capabilities.setCapability("autoAcceptAlerts", true);
These solution do not help.
I went through http://bitbar.com/appium-tip-9-how-to-automatically-dismiss-dialogs-and-autoaccept-alerts/ which says to use image recognition to handle alerts.
Is there any solution which can help me handle these pop-ups. Or if anyone is aware of any script which can be called at time of popup appearance to handle these pop ups.
Also, I came to know that appium can handle system pop-ups for ios 10. Is there any solution for lower versions.

I installed appium 1.6.3 and tested for handling ios system pop ups and I was able to click on Install button for one of the pop up using element.click() method.

Related

Cordova FCM - delay ios notfication permission pop up

I'm using https://github.com/fechanique/cordova-plugin-fcm plugin and it works great for both platforms.
However, on iOS, the notification permission pop up is invoked right at the launch of the app, and I want it to appear only after the login process is complete.
I have zero knowledge in objective-C so i can't override the classes.
Can anyone please help?
Found a solution in case anyone encounters the same problem in the future...
https://github.com/jjrom/cordova-plugin-fcm/commit/4fedc72b2d94d85a67f6266aef13e774b7a16bfe

Automatically dismiss iOS Alerts when automating an app with Appium

I am using Ruby in a Cucumber automation framework to automate my Android and iOS application. I am using Appium 1.6.4 beta as it supports iOS 10.2.
When the Appium server first installs the iOS app on the device it is prompted with an Alert Dialog asking if I want to allow notifications. With Appium as far as I can tell the "autoAcceptAlerts" capability does not currently work.
My main question is how would I go about checking if the alert dialog is there and then use something like find_element to press the "Allow" button but not have to edit my feature files. Is there a way I can use my "Log in as an Existing User" step to check for the alert and dismiss it if it's there and if not just continue with the login flow?
I tried to use find_element(xpath to OK button).exists? to make an if/else statement but I think I'm just doing it wrong. If the alert is not present the step fails and my test run stops.
I'm sorry if this question was answered somewhere on her but I've been unable to find a good answer for this question myself. Thank you for any help you can provide.
According to documentation from the Appium team it appears as though the desired capability for automatically accepting all dialogs is broken. As such I have hard-coded the action rather than relying on appium. Perhaps this will be fixed in the next version.
You can use #driver.switch_to.alert.accept to Accept or #driver.switch_to.alert.dismiss to dismiss the Alert.
If you are unsure about the alert, use begin/rescue to handle the exception

Is it possible to "Debug View Hierarchy" in Xcode for an app extension?

I'm trying to debug the view hierarchy in an app extension, but I don't get anything useful.
Are there any limitations to using this feature with extensions?
If not, what could I possibly be doing wrong?
I have the feeling there might be since the app is actually running inside a third party's UI. Would this be to keep people from "looking inside someone else's app"?
No, it seems not possible at this time. On Xcode8 iOS10, it shows nothing for keyboard extension.
An alternative choice is Reveal. On latest version, it supports App Extension. Actually it is what I am using right now.

Is there anyway of opening the container app from an app extension in iOS 8.3?

I have all the editing functionality in the container app of my keyboard extension, and I have a button to open the container app on the keyboard. I was using these methods openURL not work in Action Extension
However, in iOS8.3 apple changed his mind again. And, I cannot find a way to open the container app.
Has anyone any idea how to do it? Please, help!
Apple hasn't changed its mind on this even once, let alone "again". Only today extensions support opening their containing app, others do not. The workarounds that people found were-- from Apple's perspective-- bugs that were fixed.
There is no supported way to do what you want. If you find some workaround, you should expect it to disappear in the next iOS update.

Programmatically suspend/close the app

How can I suspend/close my iPad app programmatically? I wanted to show the terms of use on app start up. If user presses the Accept button the app should continue. If user presses the Decline button the app should be suspended/closed.
PS : The app is built using Titanium Appcelerator framework.
you could try calling exit() but, to be honest, i doubt that the behaviour you want is desirable. i haven't seen any other apps do it - i'm not sure it'd be considered acceptable by Apple.
You never exit from an iPhone or iPad application.
If it does apple takes it as a crash and surely reject your application.
In your case, the best solution will be displaying another screen which display a message like: "You cannot access the application until you accept the terms" or something like that.
You can use exit(0); whenever you want to exit the app. I have implemented this code in my project and it works perfectly fine for me.

Resources