This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
1 / 6
Nov 2017

Hello All,

I am trying to handle the system dialogs for allowing notifications to iOS mobile. The application is a mobile app. The versions that I am using:

  • appium : 1.7.1
  • XCode - Xcode 9
    What I have tried:
    Setting the capability “autoAcceptAlerts : true”

The one which works with Xcode 8.3 and appium 1.6.4 is:
await this.driver.elementByAccessibilityId(‘Allow’).click() --> This does not work with Xcode 9 and appium 1.7.1

But we need to upgrade to latest versions of Appium and Xcode. So I would request if someone could help me out with on how to handle system alerts with the latest versions of appium and Xcode?

  • created

    Nov '17
  • last reply

    Nov '17
  • 5

    replies

  • 591

    views

  • 2

    users

  • 1

    link

did you tried using

driver.switchTo().alert() ;

before clicking on button.

Hello kumarsiva,

I am trying to do that actually but I am getting the error that switchTo() is not a function of driver. I think it is an issue with the framework setup.
This is a native app that I am testing, do you think that has anything to do with the “SwitchTo()” not working?

@kumarsiva Thank you for the link, I shall go through the same.
By the first looks of it I think the framework is referring to AppiumDriver as driver. Actually just started understanding the framework which was already built in for testing.I shall get back once I am sure on the driver reference.

@kumarsiva This is the line which sets the driver for the project presently:
driver = wd.promiseChainRemote(getServerConfig())
This seems to point to appium driver as mentioned in the code in comments. Can you please correct me if I am wrong.
If it is the appium driver then how can I change this to iOSDriver?

getServerConfig is just to set the capabilities etc for server.