Can't click on 'Allow' button on Notification popup at startup on IOS
See original GitHub issueThe problem
When appium starts my app, I get a system notification popup at start up, regarding allowing, or not allowing my app to send notifications. There’s two buttons to choose from: “Don’t Allow” and “Allow”. In my Test I want to click on “Allow”. But seems Appium ckicks on the wrong one. “Don’t Allow”.
Environment
- Appium version: 1.6.3
- Desktop OS/version used to run Appium: Mac OSX 10.12.3 (Sierra)
- Node.js version: 7.5.0
- Mobile platform/version under test: IOS 10.2.1
- Real device is used
- Appium CLI, using Java client.
Details
By looking at my app, this appears to happen (while debug stepping my test):
Appium clicks twice, first time on “Don’t Allow” button, which causes the popup to dissapear. Then appium clicks again (instantly) on the location where the “Allow” button was, which happens to be the location of a “connect to facebook” button on my app.
Additionally: my app always runs in Landscape mode
Link to Appium logs
Appium logs: https://gist.github.com/alexander-poulikakos/c2547ea4cf990d7f1d2d079b77075561
Appium doctor:
$ appium-doctor --ios
info AppiumDoctor Appium Doctor v.1.4.1
info AppiumDoctor ### Diagnostic starting ###
info AppiumDoctor ✔ The Node.js binary was found at: /usr/local/bin/node
info AppiumDoctor ✔ Node version is 7.5.0
info AppiumDoctor ✔ Xcode is installed at: /Applications/Xcode.app/Contents/Developer
info AppiumDoctor ✔ Xcode Command Line Tools are installed.
info AppiumDoctor ✔ DevToolsSecurity is enabled.
info AppiumDoctor ✔ The Authorization DB is set up properly.
info AppiumDoctor ✔ Carthage was found at: /usr/local/bin/carthage
info AppiumDoctor ✔ HOME is set to: /Users/alexanderpoulikakos
info AppiumDoctor ### Diagnostic completed, no fix needed. ###
info AppiumDoctor
info AppiumDoctor Everything looks good, bye!
info AppiumDoctor
Code To Reproduce Issue [ Good To Have ]
IOSDriver<IOSElement> appium = ...;
System.out.println(appium.getPageSource()); // I have a break point here to ensure the Notifications popup is visible before continuing
IOSElement allow = appium.findElementByName("Allow");
System.out.println(allow.getText()); // See printout in log for this
System.out.println(allow.getLocation()); // See printout in log for this
new TouchAction(appium).tap(allow).perform();
Issue Analytics
- State:
- Created 7 years ago
- Comments:28 (1 by maintainers)
Top GitHub Comments
Try
methods to handle alerts
I’ve resolved this issue using: