Launch Mobile .apk stored inside SauceLabs Storage

Type your question here. Then choose a suitable category and tag(s) adam.brown

Hi all,

I’m trying to launch an app I have stored inside SauceLabs App Management Storage. The app is called MyApp.apk. My end goal is that my Katalon tests run against the app stored inside SauceLabs so that I can handle all of this via the pipeline

I’ve added all my desired capabilities as per SauceLabs instructions. I’ve removed the line of code in my test to launch a local copy of the app as I want to launch the app inside SauceLabs storage.

‘Open the application’
//Mobile.startApplication(RunConfiguration.getProjectDir() + “/Test Apps/” + GlobalVariable.AndroidAppFile, true)

When I run my test I get a No driver found error, which makes sense as I’m not launching the application.

I know I need to put something in “Mobile.startApplication” to start the driver, but I have no idea what to put. Can anyone help me?

Many thanks

Adam

Full Error:
=============== ROOT CAUSE =====================

For trouble shooting, please visit: https://docs.katalon.com/katalon-studio/docs/troubleshooting.html

================================================

12-06-2023 03:58:12 PM Test Cases/REMOVED/REMOVED

Elapsed time: 2.125s

Test Cases/Food Optimising Essentials/Food Optimising Essentials FAILED.

Reason:

com.kms.katalon.core.exception.StepFailedException: No driver found

at com.kms.katalon.core.mobile.helper.MobileScreenCaptor.getAnyAppiumDriver(MobileScreenCaptor.java:82)

at com.kms.katalon.core.mobile.helper.MobileScreenCaptor.take(MobileScreenCaptor.java:49)

at com.kms.katalon.core.helper.screenshot.ScreenCaptor.takeScreenshotAndGetAttributes(ScreenCaptor.java:37)

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.VerifyElementVisibleKeyword.verifyElementVisible(VerifyElementVisibleKeyword.groovy:85)

at com.kms.katalon.core.mobile.keyword.builtin.VerifyElementVisibleKeyword.execute(VerifyElementVisibleKeyword.groovy:64)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)

at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords.verifyElementVisible(MobileBuiltInKeywords.groovy:2031)

at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords$verifyElementVisible.call(Unknown Source)

at customfunctions.Login.privacyNoticeIsDisplayed(Login.groovy:64)

at customfunctions.Login.invokeMethod(Login.groovy)

at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:55)

at Food Optimising Essentials.run(Food Optimising Essentials:11)

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:448)

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)

at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:144)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:135)

at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)

at TempTestCase1701878289144.run(TempTestCase1701878289144.groovy:25)

1 Like

Hi,

I will take a look and back to you soon

1 Like

I think SauceLab is a cloud mobile, if you want to run any apk, you must first upload to SauceLab, SauceLab will give a aplication ID, that will be used in your script, then in testing script you start your app like this:
Mobile.startApplication(‘sauce://10160571901693383127229294’, true)

1 Like

Thanks for the reply

I’ve just tried that.

My file in SauceLabs has this File ID

and I’ve put this in my TestListener but I’m still getting the same error.

Mobile.startApplication(‘sauce://6541dda1-1f46-4ffa-bf22-9735b35cb8be’, true)

I write that as example, when I check with SauceLab document at here: Appium Testing with Real Devices | Sauce Labs Documentation, I guess you should change your command like that:
Mobile.startApplication(‘storage:filename=6541dda1-1f46-4ffa-bf22-9735b35cb8be’, true).
Hope this help.