Unable to Turn On/Off Airplane mode on Android 7 and above versions using toggleAirplaneMode() keyword

  • Katalon Studio Version: 7.8.0
  • OS Version: Windows 10
  • Browser Version:

Steps to Reproduce:

  1. On Android 7 or above versions when tried to Turn On/Off Airplane mode it is throwing error.

Expected behavior:

Screenshots:

Console Error Log:

com.kms.katalon.core.exception.StepFailedException: Cannot toogle airplane mode (Root cause: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\Chandra.Yanala\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s 13c907da shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true’ exited with code 255’; Stderr: 'Security exception: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=12618, uid=2000

java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=12618, uid=2000
at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:26071)
at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:25887)
at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:26757)
at com.android.server.am.ActivityManagerShellCommand.runSendBroadcast(ActivityManagerShellCommand.java:683)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:174)
at android.os.ShellCommand.exec(ShellCommand.java:103)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:20320)
at android.os.Binder.shellCommand(Binder.java:642)
at android.os.Binder.onTransact(Binder.java:540)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3442)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:4181)
at android.os.Binder.execTransact(Binder.java:739)’; Code: ‘255’
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘INLT30074’, ip: ‘192.168.0.6’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: com.kms.katalon.core.appium.driver.SwipeableAndroidDriver
Capabilities {app: C:\APKs\DEFAULT.apk, appPackage: com.nullint.hh, autoGrantPermissions: true, automationName: uiautomator2, chromedriverPort: 64585, databaseEnabled: false, desired: {app: C:\APKs\DEFAULT.apk, autoGrantPermissions: true, automationName: uiautomator2, chromedriverPort: 64585, deviceId: 13c907da, deviceName: samsung SM-T595 (Android 9), fullReset: true, newCommandTimeout: 1800, noReset: false, platform: ANDROID, platformName: android, platformVersion: 9, systemPort: 64666, udid: 13c907da}, deviceApiLevel: 28, deviceId: 13c907da, deviceManufacturer: samsung, deviceModel: SM-T595, deviceName: 13c907da, deviceScreenDensity: 280, deviceScreenSize: 1920x1200, deviceUDID: 13c907da, fullReset: true, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, newCommandTimeout: 1800, noReset: false, pixelRatio: 1.75, platform: ANDROID, platformName: Android, platformVersion: 9, statBarHeight: 42, systemPort: 64666, takesScreenshot: true, udid: 13c907da, viewportRect: {height: 1794, left: 0, top: 42, width: 1200}, warnings: {}, webStorageEnabled: false}
Session ID: 1da861c2-9a9e-47f6-ab26-5e04deeccff8
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.android.AndroidDriver.execute(AndroidDriver.java:1)
at com.kms.katalon.core.appium.driver.SwipeableAndroidDriver.execute(SwipeableAndroidDriver.java:1)
at io.appium.java_client.CommandExecutionHelper.execute(CommandExecutionHelper.java:27)
at io.appium.java_client.android.connection.HasNetworkConnection.setConnection(HasNetworkConnection.java:34)
at com.kms.katalon.core.mobile.keyword.builtin.ToggleAirplaneModeKeyword$_toggleAirplaneMode_closure1.doCall(ToggleAirplaneModeKeyword.groovy:64)
at com.kms.katalon.core.mobile.keyword.builtin.ToggleAirplaneModeKeyword$_toggleAirplaneMode_closure1.call(ToggleAirplaneModeKeyword.groovy)
at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.runKeyword(MobileKeywordMain.groovy:21)
at com.kms.katalon.core.mobile.keyword.builtin.ToggleAirplaneModeKeyword.toggleAirplaneMode(ToggleAirplaneModeKeyword.groovy:51)
at com.kms.katalon.core.mobile.keyword.builtin.ToggleAirplaneModeKeyword.execute(ToggleAirplaneModeKeyword.groovy:46)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:73)
at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords.toggleAirplaneMode(MobileBuiltInKeywords.groovy:1091)
at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords$toggleAirplaneMode$5.call(Unknown Source)
at com.null.automation.helper.turnAirplaneModeOn(helper.groovy:202)
at com.null.automation.helper$turnAirplaneModeOn$3.call(Unknown Source)
at rebootdevice.run(rebootdevice:35)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:393)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:384)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:363)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:355)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:251)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1622032616936.run(TempTestCase1622032616936.groovy:25)
)
at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:50)
at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.stepFailed(MobileKeywordMain.groovy:40)
at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.runKeyword(MobileKeywordMain.groovy:23)
at com.kms.katalon.core.mobile.keyword.builtin.ToggleAirplaneModeKeyword.toggleAirplaneMode(ToggleAirplaneModeKeyword.groovy:51)
at com.kms.katalon.core.mobile.keyword.builtin.ToggleAirplaneModeKeyword.execute(ToggleAirplaneModeKeyword.groovy:46)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:73)
at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords.toggleAirplaneMode(MobileBuiltInKeywords.groovy:1091)
at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords$toggleAirplaneMode$5.call(Unknown Source)
at com.null.automation.helper.turnAirplaneModeOn(helper.groovy:202)
at com.null.automation.helper$turnAirplaneModeOn$3.call(Unknown Source)
at rebootdevice.run(rebootdevice:35)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:393)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:384)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:363)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:355)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:251)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1622032616936.run(TempTestCase1622032616936.groovy:25)
Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\Chandra.Yanala\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s 13c907da shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true’ exited with code 255’; Stderr: 'Security exception: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=12618, uid=2000

java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=12618, uid=2000
at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:26071)
at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:25887)
at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:26757)
at com.android.server.am.ActivityManagerShellCommand.runSendBroadcast(ActivityManagerShellCommand.java:683)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:174)
at android.os.ShellCommand.exec(ShellCommand.java:103)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:20320)
at android.os.Binder.shellCommand(Binder.java:642)
at android.os.Binder.onTransact(Binder.java:540)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3442)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:4181)
at android.os.Binder.execTransact(Binder.java:739)’; Code: ‘255’
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘INLT30074’, ip: ‘192.168.0.6’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: com.kms.katalon.core.appium.driver.SwipeableAndroidDriver
Capabilities {app: C:\APKs\DEFAULT.apk, appPackage: com.nullint.hh, autoGrantPermissions: true, automationName: uiautomator2, chromedriverPort: 64585, databaseEnabled: false, desired: {app: C:\APKs\DEFAULT.apk, autoGrantPermissions: true, automationName: uiautomator2, chromedriverPort: 64585, deviceId: 13c907da, deviceName: samsung SM-T595 (Android 9), fullReset: true, newCommandTimeout: 1800, noReset: false, platform: ANDROID, platformName: android, platformVersion: 9, systemPort: 64666, udid: 13c907da}, deviceApiLevel: 28, deviceId: 13c907da, deviceManufacturer: samsung, deviceModel: SM-T595, deviceName: 13c907da, deviceScreenDensity: 280, deviceScreenSize: 1920x1200, deviceUDID: 13c907da, fullReset: true, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, newCommandTimeout: 1800, noReset: false, pixelRatio: 1.75, platform: ANDROID, platformName: Android, platformVersion: 9, statBarHeight: 42, systemPort: 64666, takesScreenshot: true, udid: 13c907da, viewportRect: {height: 1794, left: 0, top: 42, width: 1200}, warnings: {}, webStorageEnabled: false}
Session ID: 1da861c2-9a9e-47f6-ab26-5e04deeccff8
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.android.AndroidDriver.execute(AndroidDriver.java:1)
at com.kms.katalon.core.appium.driver.SwipeableAndroidDriver.execute(SwipeableAndroidDriver.java:1)
at io.appium.java_client.CommandExecutionHelper.execute(CommandExecutionHelper.java:27)
at io.appium.java_client.android.connection.HasNetworkConnection.setConnection(HasNetworkConnection.java:34)
at com.kms.katalon.core.mobile.keyword.builtin.ToggleAirplaneModeKeyword$_toggleAirplaneMode_closure1.doCall(ToggleAirplaneModeKeyword.groovy:64)
at com.kms.katalon.core.mobile.keyword.builtin.ToggleAirplaneModeKeyword$_toggleAirplaneMode_closure1.call(ToggleAirplaneModeKeyword.groovy)
at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.runKeyword(MobileKeywordMain.groovy:21)
… 19 more