public static void main(String[] args) throws MalformedURLException, InterruptedException {
复制代码
Thread.sleep(13000);MultiTouchAction mta = new MultiTouchAction(ad);TouchAction tA1 = new TouchAction(ad);TouchAction tA2 = new TouchAction(ad);int x = ad.manage().window().getSize().getWidth();int y = ad.manage().window().getSize().getHeight()ointOption S1 = PointOption.point(x*4/10,y*4/10)ointOption D1 = PointOption.point(x*2/10,y*2/10)ointOption S2 = PointOption.point(x*6/10,y*6/10)ointOption D2 = PointOption.point(x*8/10,y*8/10);Duration du = Duration.ofMillis(2000);WaitOptions wo = WaitOptions.waitOptions(du);tA1.press(S1).waitAction(wo).moveTo(D1).release();tA1.press(S2).waitAction(wo).moveTo(D2).release();mta.add(tA1).add(tA2);mta.perform(); }
}
Exception in thread "main" org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot read property 'action' of undefined (WARNING: The server did not provide any stacktrace information)
**[MJSONWP (64fb9c2b)] at AndroidUiautomator2Driver.parseTouch (C:\Users\sjfang\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-android-driver\lib\commands\touch.js:194:16)
**[MJSONWP (64fb9c2b)] at parseTouch (C:\Users\sjfang\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-android-driver\lib\commands\touch.js:292:23)
**[MJSONWP (64fb9c2b)] at mapper (C:\Users\sjfang\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:79:24)
**[HTTP] <-- POST /wd/hub/session/64fb9c2b-550d-4f2c-ae07-2a1ffebe2e98/touch/multi/perform 500 4 ms - 213