Unable to accept Noification permission alert via appium automation code
Tried multiple ways but could not resolve the issue.
Logs are below
[35m[HTTP]e[39m e[90m{“script”:“mobile: alert”,“args”:[{“action”:“accept”}]}e[39m
[debug] e[35m[W3C (d1a96719)]e[39m Calling AppiumDriver.execute() with args: [“mobile: alert”,[{“action”:“accept”}],“d1a96719-2204-427a-ae6d-3d3a175b6b7e”]
[debug] e[35m[XCUITest]e[39m Executing command ‘execute’
[debug] e[35m[WD Proxy]e[39m Matched ‘/alert/accept’ to command name ‘postAcceptAlert’
[debug] e[35m[WD Proxy]e[39m Proxying [POST /alert/accept] to [POST http://127.0.0.1:8200/session/3E11ED17-1B72-4424-9F3F-1583EB59287A/alert/accept] with body: {}
e[35m[WD Proxy]e[39m Got response with status 500: {“value”:{“error”:“unknown error”,“message”:"* -[__NSArrayM insertObject:atIndex:]:** object cannot be nil",“traceback”:"(\n\t0 CoreFoundation 0x000000018083d110 16FAA70C-278C-3561-859E-CEC407C2DC7C + 626960\n\t1 libobjc.A.dylib 0x0000000199078d64 objc_exception_throw + 60\n\t2 CoreFoundation 0x0000000180946564 16FAA70C-278C-3561-859E-CEC407C2DC7C + 1713508\n\t3 CoreFoundation 0x00000001809437e0 16FAA70C-278C-3561-859E-CEC407C2DC7C + 1701856\n\t4 CoreFoundation 0x00000001807b1a5c 16FAA70C-278C-3561-859E-CEC407C2DC7C + 55900\n\t5 XCUIAutomation 0x0000000100e5ffa8 __104-[XCAXClient_iOS interruptingUIElementsAffectingSnapshot:checkForHandledElement:containsHandledElement:]_block_invoke + 1012\n\t6 XCTestCore 0x000000010089bff0 -[XCTContext _runActivityNamed:type:block:] + 256\n\t7 XCTestCore 0x000000010089b184 +[XCTContex…
[debug] e[35m[W3C]e[39m Matched W3C error code ‘unknown error’ to UnknownError
[debug] e[35m[W3C (d1a96719)]e[39m Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
[debug] e[35m[W3C (d1a96719)]e[39m at errorFromW3CJsonCode (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:780:25)
[debug] e[35m[W3C (d1a96719)]e[39m at ProxyRequestError.getActualError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:663:14)
[debug] e[35m[W3C (d1a96719)]e[39m at JWProxy.command (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:272:19)
[debug] e[35m[W3C (d1a96719)]e[39m at runMicrotasks ()
[debug] e[35m[W3C (d1a96719)]e[39m at processTicksAndRejections (internal/process/task_queues.js:93:5)
[debug] e[35m[W3C (d1a96719)]e[39m at XCUITestDriver.proxyCommand (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/proxy-helper.js:96:12)
[debug] e[35m[W3C (d1a96719)]e[39m at XCUITestDriver.postAcceptAlert (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/alert.js:20:10)
[debug] e[35m[W3C (d1a96719)]e[39m at XCUITestDriver.mobileHandleAlert (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/alert.js:34:14)
[debug] e[35m[W3C (d1a96719)]e[39m at XCUITestDriver.executeMobile (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/execute.js:131:10)
[debug] e[35m[W3C (d1a96719)]e[39m at XCUITestDriver.execute (/usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/lib/commands/execute.js:15:12)
[debug] e[35m[W3C (d1a96719)]e[39m at XCUITestDriver.execute (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/execute.js:16:10)
e[35m[HTTP]e[39m e[37m<-- POST /wd/hub/session/d1a96719-2204-427a-ae6d-3d3a175b6b7e/execute/sync e[39me[31m500e[39m e[90m736 ms - 1701e[39m
e[35m[HTTP]e[39m e[90me[39m
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘C02WP0FUHTD8’, ip: ‘fe80:0:0:0:c69:e750:3089:42f9%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.16’, java.version: ‘14.0.2’
Driver info: io.appium.java_client.ios.IOSDriver
Capabilities {app: /Users/kg036443/Documents/G…, automationName: XCuiTest, browserName: , clearSystemFiles: true, databaseEnabled: false, device: iPhone, deviceName: Office iphone, enablePerformanceLogging: true, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: false, newCommandTimeout: 20000, platform: MAC, platformName: iOS, platformVersion: 15.2, printPageSourceOnFindFailure: true, takesScreenshot: true, udid: 00008030-0009648C3690402E, useNewWDA: true, wdaLocalPort: 8200, webStorageEnabled: false}
Session ID: d1a96719-2204-427a-ae6d-3d3a175b6b7e
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:489)
at saaas.api.ProvisionUsingAppStepDefinition.launch_the_authentication_app(ProvisionUsingAppStepDefinition.java:203)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at cucumber.runtime.Utils$1.call(Utils.java:26)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:20)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:48)
at cucumber.runner.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:50)
at cucumber.runner.TestStep.executeStep(TestStep.java:63)
at cucumber.runner.TestStep.run(TestStep.java:49)
at cucumber.runner.PickleStepTestStep.run(PickleStepTestStep.java:43)
at cucumber.runner.TestCase.run(TestCase.java:44)
at cucumber.runner.Runner.runPickle(Runner.java:40)
at cucumber.runtime.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:146)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:68)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:23)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:73)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:124)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:65)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at cucumber.api.junit.Cucumber$1.evaluate(Cucumber.java:133)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:542)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:770)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:464)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)