Appium directory is invalid: Cannot find appium executable file


#1

Hello Team,

I am facing issues with Katalon studio,

Please help in resolving the issue
a) Why katalon studio always ask activation after update to latest version

b) Running Script on Mobile Browser

c) After the upgrade to 7.x.x,
I am getting the error : - “Appium directory is invalid: Cannot find appium executable file.”

So basically i was getting the error : error eperm operation not permitted package.json
which i resolved by the technote: https://alastaircrabtree.com/fixing-intermittant-eperm-operation-not-permitted-on-npm-install/

and my appium version is : 1.151.1

However, now I have npm directory in c:(folder)\npm…so my path of Appium directoy in Katalon is : C:\BuildAgent\npm\node_modules\appium\lib

I am able to detect the Android device locally, I have properly entered the desired capabilities.
And when i try to run the script on Android it says:

2019-11-08 14:34:34.186 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2019-11-08 14:34:34.196 INFO c.k.katalon.core.main.TestCaseExecutor - START Test Cases/MobileWebBrowser
2019-11-08 14:34:35.545 DEBUG testcase.MobileWebBrowser - 1: openBrowser("")
2019-11-08 14:34:36.236 INFO c.k.k.core.webui.driver.DriverFactory - Starting ‘Android’ driver
2019-11-08 14:34:36.365 INFO c.k.k.c.w.driver.WebMobileDriverFactory - User set preference: [‘browserName’, ‘chrome’]
2019-11-08 14:34:36.366 INFO c.k.k.c.w.driver.WebMobileDriverFactory - User set preference: ['version ', ‘’]
2019-11-08 14:34:36.367 INFO c.k.k.c.w.driver.WebMobileDriverFactory - User set preference: [‘platformName’, ‘ANDROID’]
2019-11-08 14:34:36.369 INFO c.k.k.c.w.driver.WebMobileDriverFactory - User set preference: [‘platformVersion’, ‘6.0.1’]
2019-11-08 14:34:36.370 INFO c.k.k.c.w.driver.WebMobileDriverFactory - User set preference: [‘deviceName’, ‘LGK425f37cd6f3’]
2019-11-08 14:34:36.371 INFO c.k.k.c.w.driver.WebMobileDriverFactory - User set preference: [‘unicodeKeyboard’, ‘true’]
2019-11-08 14:34:36.371 INFO c.k.k.c.w.driver.WebMobileDriverFactory - User set preference: [‘deviceId’, ‘LGK425f37cd6f3’]
2019-11-08 14:34:36.458 ERROR c.k.k.core.keyword.internal.KeywordMain - :x: Unable to open browser with url: ‘’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to open browser with url: ‘’
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword.openBrowser(OpenBrowserKeyword.groovy:81)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword.execute(OpenBrowserKeyword.groovy:67)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.openBrowser(WebUiBuiltInKeywords.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$openBrowser.call(Unknown Source)
at MobileWebBrowser.run(MobileWebBrowser:26)
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:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
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 TempTestCase1573241664828.run(TempTestCase1573241664828.groovy:23)
Caused by: com.kms.katalon.core.appium.exception.AppiumStartException: Appium directory is invalid: Cannot find appium executable file.
at com.kms.katalon.core.appium.driver.AppiumDriverManager.findAppiumJS(AppiumDriverManager.java:386)
at com.kms.katalon.core.appium.driver.AppiumDriverManager.startAppiumServer(AppiumDriverManager.java:301)
at com.kms.katalon.core.appium.driver.AppiumDriverManager.startAppiumServerJS(AppiumDriverManager.java:261)
at com.kms.katalon.core.appium.driver.AppiumDriverManager.startAppiumServerJS(AppiumDriverManager.java:406)
at com.kms.katalon.core.appium.driver.AppiumDriverManager.ensureServicesStarted(AppiumDriverManager.java:243)
at com.kms.katalon.core.appium.driver.AppiumDriverManager.createMobileDriver(AppiumDriverManager.java:472)
at com.kms.katalon.core.webui.driver.WebMobileDriverFactory.createMobileDriver(WebMobileDriverFactory.java:132)
at com.kms.katalon.core.webui.driver.DriverFactory.startNewBrowser(DriverFactory.java:316)
at com.kms.katalon.core.webui.driver.DriverFactory.openWebDriver(DriverFactory.java:206)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword$_openBrowser_closure1.doCall(OpenBrowserKeyword.groovy:74)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword$_openBrowser_closure1.call(OpenBrowserKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword.openBrowser(OpenBrowserKeyword.groovy:81)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword.execute(OpenBrowserKeyword.groovy:67)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.openBrowser(WebUiBuiltInKeywords.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$openBrowser.call(Unknown Source)
at Script1572025859697.run(Script1572025859697.groovy:26)
… 11 more
)

Kindly help me as I am stuck up and unable to proceed further.


#2

Hi @Ameet_Thakkar

May I see the preferences that you set ? Can you use C:\BuildAgent\npm\node_modules\appium
instead of C:\BuildAgent\npm\node_modules\appium\lib ?

The documentation suggests that the folder should not end with lib, but rather appium.


#3

Hi ThanhTo,

Changing the path to \appium helped. So the Appium directory invalid error is resolved. Many thanks to you for the help.

With that, i moved 1 step further.
Now with this, i face another error - Original error: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\at275j\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s LGK425f37cd6f3 forward tcp:8200 tcp:6790’ exited with code 1’; Stderr: ‘adb.exe: error: more than one device/emulator’; Code: '1’

2019-11-13 15:29:08.236 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2019-11-13 15:29:08.245 INFO c.k.katalon.core.main.TestCaseExecutor - START Test Cases/MobileWebBrowser
2019-11-13 15:29:09.243 DEBUG testcase.MobileWebBrowser - 1: openBrowser("")
2019-11-13 15:29:09.737 INFO c.k.k.core.webui.driver.DriverFactory - Starting ‘Android’ driver
2019-11-13 15:29:09.840 INFO c.k.k.c.w.driver.WebMobileDriverFactory - User set preference: [‘browserName’, ‘chrome’]
2019-11-13 15:29:09.841 INFO c.k.k.c.w.driver.WebMobileDriverFactory - User set preference: ['version ', ‘’]
2019-11-13 15:29:09.842 INFO c.k.k.c.w.driver.WebMobileDriverFactory - User set preference: [‘platformName’, ‘ANDROID’]
2019-11-13 15:29:09.843 INFO c.k.k.c.w.driver.WebMobileDriverFactory - User set preference: [‘platformVersion’, ‘6.0.1’]
2019-11-13 15:29:09.844 INFO c.k.k.c.w.driver.WebMobileDriverFactory - User set preference: [‘deviceName’, ‘LGK425f37cd6f3’]
2019-11-13 15:29:09.846 INFO c.k.k.c.w.driver.WebMobileDriverFactory - User set preference: [‘unicodeKeyboard’, ‘true’]
2019-11-13 15:29:09.847 INFO c.k.k.c.w.driver.WebMobileDriverFactory - User set preference: [‘automationName’, ‘UiAutomator2’]
2019-11-13 15:29:09.849 INFO c.k.k.c.w.driver.WebMobileDriverFactory - User set preference: [‘deviceId’, ‘LGK425f37cd6f3’]
e[35m[Appium]e[39m Welcome to Appium v1.15.1
e[35m[Appium]e[39m Non-default server args:
e[35m[Appium]e[39m port: 53065
e[35m[Appium]e[39m loglevel: info
e[35m[Appium]e[39m chromeDriverPort: 53072
e[35m[Appium]e[39m tmpDir: C:\Users\at275j\AppData\Local\Temp\Katalon\Appium\Temp1573676949893
e[35m[Appium]e[39m Appium REST http interface listener started on 0.0.0.0:53065
2019-11-13 15:29:16.759 INFO c.k.k.c.a.driver.AppiumDriverManager - Appium server started on port 53,065
e[35m[HTTP]e[39m e[37m–>e[39m e[37mGETe[39m e[37m/wd/hub/statuse[39m
e[35m[HTTP]e[39m e[90m{}e[39m
e[35m[HTTP]e[39m e[37m<-- GET /wd/hub/status e[39me[32m200e[39m e[90m8 ms - 68e[39m
e[35m[HTTP]e[39m e[90me[39m
e[35m[HTTP]e[39m e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/sessione[39m
e[35m[HTTP]e[39m e[90m{“desiredCapabilities”:{“newCommandTimeout”:1800,“platformVersion”:“6.0.1”,“automationName”:“UiAutomator2”,“browserName”:“Chrome”,“unicodeKeyboard”:true,“platformName”:“Android”,“udid”:“LGK425f37cd6f3”,“deviceId”:“LGK425f37cd6f3”,“deviceName”:“test”,“platform”:“ANDROID”,“version\t”:""},“capabilities”:{“firstMatch”:[{“appium:automationName”:“UiAutomator2”,“browserName”:“Chrome”,“deviceId”:“LGK425f37cd6f3”,“appium:deviceName”:“test”,“appium:newCommandTimeout”:1800,“platform”:“ANDROID”,“platformName”:“android”,“appium:platformVersion”:“6.0.1”,“appium:udid”:“LGK425f37cd6f3”,“appium:unicodeKeyboard”:true,“version\t”:""}]}}e[39m
e[35m[BaseDriver]e[39m The capabilities [“deviceId”,“platform”,“version\t”] are not standard capabilities and should have an extension prefix
e[35m[Appium]e[39m Appium v1.15.1 creating new AndroidUiautomator2Driver (v1.37.2) session
e[35m[BaseDriver]e[39m The following capabilities were provided, but are not recognized by Appium:
e[35m[BaseDriver]e[39m deviceId
e[35m[BaseDriver]e[39m platform
e[35m[BaseDriver]e[39m version
e[35m[BaseDriver]e[39m Session created with session id: ca0b199f-0d9b-4c58-a202-34e3c467902f
e[35m[UiAutomator2]e[39m We’re going to run a Chrome-based session
e[35m[UiAutomator2]e[39m Chrome-type package and activity are com.android.chrome and com.google.android.apps.chrome.Main
e[35m[UiAutomator2]e[39m Starting ‘com.android.chrome’ directly on the device
e[35m[ADB]e[39m Found 1 ‘build-tools’ folders under ‘C:\Users\at275j.katalon\tools\android_sdk’ (newest first):
e[35m[ADB]e[39m C:/Users/at275j/.katalon/tools/android_sdk/build-tools/29.0.2
e[35m[ADB]e[39m Using ‘adb.exe’ from ‘C:\Users\at275j.katalon\tools\android_sdk\platform-tools\adb.exe’
e[35m[AndroidDriver]e[39m Retrieving device list
e[35m[AndroidDriver]e[39m Using device: LGK425f37cd6f3
e[35m[ADB]e[39m Using ‘adb.exe’ from ‘C:\Users\at275j.katalon\tools\android_sdk\platform-tools\adb.exe’
e[35m[AndroidDriver]e[39m No app sent in, not parsing package/activity
e[35m[ADB]e[39m Cannot extract apk info using apkanalyzer. Falling back to aapt. Original error: Could not find ‘apkanalyzer.bat’ in [“C:\Users\at275j\.katalon\tools\android_sdk\platform-tools\apkanalyzer.bat”,“C:\Users\at275j\.katalon\tools\android_sdk\emulator\apkanalyzer.bat”,“C:\Users\at275j\.katalon\tools\android_sdk\tools\apkanalyzer.bat”,“C:\Users\at275j\.katalon\tools\android_sdk\tools\bin\apkanalyzer.bat”,“C:\Users\at275j\.katalon\tools\android_sdk\build-tools\29.0.2\apkanalyzer.bat”]. Do you have Android Build Tools installed at ‘C:\Users\at275j.katalon\tools\android_sdk’?
e[35m[ADB]e[39m Using ‘aapt.exe’ from ‘C:\Users\at275j.katalon\tools\android_sdk\build-tools\29.0.2\aapt.exe’
e[35m[ADB]e[39m Cannot extract apk info using apkanalyzer. Falling back to aapt. Original error: Could not find ‘apkanalyzer.bat’ in [“C:\Users\at275j\.katalon\tools\android_sdk\platform-tools\apkanalyzer.bat”,“C:\Users\at275j\.katalon\tools\android_sdk\emulator\apkanalyzer.bat”,“C:\Users\at275j\.katalon\tools\android_sdk\tools\apkanalyzer.bat”,“C:\Users\at275j\.katalon\tools\android_sdk\tools\bin\apkanalyzer.bat”,“C:\Users\at275j\.katalon\tools\android_sdk\build-tools\29.0.2\apkanalyzer.bat”]. Do you have Android Build Tools installed at ‘C:\Users\at275j.katalon\tools\android_sdk’?
e[35m[ADB]e[39m Using ‘apksigner.bat’ from ‘C:\Users\at275j.katalon\tools\android_sdk\build-tools\29.0.2\apksigner.bat’
e[35m[UiAutomator2]e[39m Server packages are not going to be (re)installed
e[35m[UiAutomator2]e[39m Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id
2019-11-13 15:30:15.784 INFO c.k.k.c.a.driver.AppiumDriverManager - deviceId = LGK425f37cd6f3
2019-11-13 15:30:15.785 INFO c.k.k.c.a.driver.AppiumDriverManager - deviceName = LGE LG-K425 (Android 6.0.1)
2019-11-13 15:30:15.786 INFO c.k.k.c.a.driver.AppiumDriverManager - deviceModel = LG-K425
2019-11-13 15:30:15.787 INFO c.k.k.c.a.driver.AppiumDriverManager - deviceManufacturer = LGE
2019-11-13 15:30:15.788 INFO c.k.k.c.a.driver.AppiumDriverManager - deviceOS = Android
2019-11-13 15:30:15.788 INFO c.k.k.c.a.driver.AppiumDriverManager - deviceOSVersion = 6.0.1
2019-11-13 15:30:15.803 ERROR c.k.k.core.keyword.internal.KeywordMain - :x: Unable to open browser with url: ‘’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to open browser with url: ‘’
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword.openBrowser(OpenBrowserKeyword.groovy:81)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword.execute(OpenBrowserKeyword.groovy:67)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.openBrowser(WebUiBuiltInKeywords.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$openBrowser.call(Unknown Source)
at MobileWebBrowser.run(MobileWebBrowser:26)
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:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
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 TempTestCase1573676941560.run(TempTestCase1573676941560.groovy:23)
Caused by: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\at275j\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s LGK425f37cd6f3 forward tcp:8200 tcp:6790’ exited with code 1’; Stderr: ‘adb.exe: error: more than one device/emulator’; Code: ‘1’
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘GACDTL02AT275J’, ip: ‘135.70.208.128’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_181’
Driver info: driver.version: SwipeableAndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\at275j\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s LGK425f37cd6f3 forward tcp:8200 tcp:6790’ exited with code 1’; Stderr: ‘adb.exe: error: more than one device/emulator’; Code: ‘1’
at getResponseForW3CError (C:\BuildAgent\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
at asyncHandler (C:\BuildAgent\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:388:37)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘GACDTL02AT275J’, ip: ‘135.70.208.128’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_181’
Driver info: driver.version: SwipeableAndroidDriver

Please let me know how to fix that error.

Best Regards
Ameet


#4

Can you confirm that there were no errors when downloading appium from the console? Also have you watched the video that @ThanhTo recommended, I feel it’s one of the best online for getting this working? I was able to follow this and setup my android device using the following versions:

|Software |Version |
|NPM |v6.120.0 |
|APPIUM |v1.8.1 |
|NODE.JS | v12.13.0 |
|Katalon |v7 |

I’m also using the ADB drivers for android
|ADB Driver for Androids|

Make sure that all your version are compatible with each other. You may have to use APPIUM 1.7.1 or 1.5.2 as the video recommends this but after researching it seems 1.8.1 is now stable with Katalon.

You can re-install appium by doing the following globally:

npm uninstall -g appium
npm install -g appium@1.8.1

You may also want to look into these error

  • Unable to open browser with url: ‘’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to open browser with url: ‘’

  • e[35m[BaseDriver]e[39m The following capabilities were provided, but are not recognized by Appium:
    e[35m[BaseDriver]e[39m deviceId
    e[35m[BaseDriver]e[39m platform
    e[35m[BaseDriver]e[39m version
    e[35m[BaseDriver]e[39m Session created with session id: ca0b199f-0d9b-4c58-a202-34e3c467902f