Command "seetest:client.launch" always returns unknown error ([Ljava.lang.Object; cannot be cast to java.util.ArrayList)

I found command “seetest:client.launch” returns unknown error ([Ljava.lang.Object; cannot be cast to java.util.ArrayList) using appium studio (11.5.75) when I use Python and android device. Below is detailed error:

>>>driver.execute_script(“seetest:client.launch(\“com.experitest.ExperiBank/.LoginActivity\”, \“true\”, \“true\”)”)
Traceback (most recent call last):
File “”, line 1, in
File “C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 627, in execute_script
‘args’: converted_args})[‘value’]
File “C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 312, in execute
self.error_handler.check_response(response)
File “C:\Python27\lib\site-packages\appium\webdriver\errorhandler.py”, line 29, in check_response
raise wde
selenium.common.exceptions.WebDriverException: Message: unknown error ([Ljava.lang.Object; cannot be cast to java.util.ArrayList)

This error also happens on command: driver.execute_script(“seetest:client.deviceAction(‘Unlock’)”), but command driver.execute_script(“seetest:client.deviceAction(‘Wake’)”) works well.

I’ve seen this type of issue using java appium client. What matters is which “type” of driver you are using. If using type AppiumDriver, then the return value is of type Object. If using SeeTestClient (which extends off of AppiumDriver) the return type could be something different.

Hi wakelt,

I also follow your guide to do test as below:
AndroidDriver driver;
SeeTestClient client;

	DesiredCapabilities dc = new DesiredCapabilities();
	dc.setCapability("reportDirectory", "report");
	dc.setCapability("reportFormat", "xml");
	dc.setCapability("testName", "testName");
	dc.setCapability("platformName", "android");
	dc.setCapability("instrumentApp", true);
	String abc= "http://127.0.0.1:4723/wd/hub";
	driver = new AndroidDriver(new URL(abc), dc);
	client = new SeeTestClient(driver);
	client.deviceAction("Unlock");

It also returns the same error:
Exception in thread “main” org.openqa.selenium.WebDriverException: unknown error ([Ljava.lang.Object; cannot be cast to java.util.ArrayList) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 5.10 seconds
Build info: version: ‘2.53.1’, revision: ‘a36b8b1cd5757287168e54b817830adce9b0158d’, time: ‘2016-06-30 19:26:09’
System info: host: ‘Linksys-PC’, ip: ‘192.168.100.127’, os.name: ‘Windows 7’, os.arch: ‘x86’, os.version: ‘6.1’, java.version: ‘1.8.0_162’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities [{device.majorVersion=6.0.x, dontGoHomeOnQuit=false, device.os=Android, noReset=false, dontStopAppOnReset=false, reservationDuration=240, reportFormat=xml, fullReset=false, platform=ANY, desired={instrumentApp=true, reportDirectory=report, reportFormat=xml, platformName=Android, testName=testName}, device.serialNumber=031991f5307b84f3, locationServicesAuthorized=false, device.version=6.0.1, reportDirectory=report, autoWebview=false, platformName=Android, testName=testName, device.screenSize=1080x1920, useKeystore=false, instrumentApp=true, device.manufacture=LGE, device.category=PHONE, autoDismissAlerts=false, reportUrl=C:\Users\Linksys\appiumstudio-reports\report\test10, keystorePath=~/.android/debug.keystore, waitForDeviceTimeout=120000, device.model=Nexus 5, device.name=Nexus 5, projectName=, autoAcceptAlerts=false}]
Session ID: 3f8a0d7d-f2d5-44d4-920d-8746bb351f18
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:577)
at com.experitest.appium.SeeTestClient.execute(SeeTestClient.java:31)
at com.experitest.appium.SeeTestClient.execute(SeeTestClient.java:27)
at com.experitest.appium.SeeTestClient.deviceAction(SeeTestClient.java:163)
at apptest.Test.main(Test.java:34)

First off…I don’t work for Experitest, I simply use their tools and documentation. Hopefully Experitest will chime in.

Looking at the stack trace above, seems the Response generated by the deviceAction() command was somehow in error. I can’t be sure why as I haven’t played with the deviceAction command.

One thing you may want to do is look at the Appium Server log files (they are available thru the Appium Studio console). There may be a clue as to what the issue is.

Good Luck !

Hey jixiaoqiang,

I would like to set up a meeting to view the issue first hand.
Please see the PM I sent you with my contact details.

Hi Eor,

I found parameter “instrument” of SeeTestClient.launch is set to “true”, this error will happens, but if it is set to “false”, this error doesn’t happen.

This error happened on SeeTestClient.deviceAction(“Unlock”) can be reproduced sometimes.

I will send test code to your email. Thanks.

could be that the deviceAction() command only responds properly when using specific driver context.