setCapability to transform JS array to Java array