Open/Close Browserstack local connection

Hi All,

I would really appreciate some help with regards to creating a local browserstack connection from Katalon.

I am running my Katalon tests through Jenkins.

My tests work locally when I initiate the browserstack executable myself manually, but if I attempt to open a local connection through the browserstack plugin in Jenkins I just receive the below error:

[BrowserStack] Local: Starting BrowserStack Local…
FATAL: JSONObject[“message”] is not a JSONObject.
FATAL: null
java.io.IOException
at com.browserstack.automate.ci.jenkins.BrowserStackBuildWrapper.setUp(BrowserStackBuildWrapper.java:67)
at hudson.model.Build$BuildExecution.doRun(Build.java:157)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1818)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE

My katalon script in my testcase includes:

String username = System.getenv(“BROWSERSTACK_USERNAME”);
String accessKey = System.getenv(“BROWSERSTACK_ACCESS_KEY”);
String browserstackLocal = System.getenv(“BROWSERSTACK_LOCAL”);
String browserstackLocalIdentifier = System.getenv(“BROWSERSTACK_LOCAL_IDENTIFIER”);

I have browserstack.local set to true in the Remote preferences.

Any help would be appreciated