51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1205|回复: 6
打印 上一主题 下一主题

Appium 多点触摸报错

[复制链接]
  • TA的每日心情
    无聊
    昨天 09:47
  • 签到天数: 528 天

    连续签到: 1 天

    [LV.9]测试副司令

    跳转到指定楼层
    1#
    发表于 2021-7-2 13:06:31 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    1测试积点
    代码:
    1. package samoyed;

    2. import java.net.MalformedURLException;
    3. import java.net.URL;
    4. import java.time.Duration;

    5. import org.openqa.selenium.WebElement;
    6. import org.openqa.selenium.remote.DesiredCapabilities;

    7. import io.appium.java_client.MultiTouchAction;
    8. import io.appium.java_client.TouchAction;
    9. import io.appium.java_client.android.AndroidDriver;
    10. import io.appium.java_client.touch.WaitOptions;
    11. import io.appium.java_client.touch.offset.PointOption;

    12. public class Zoom {

    13. public static AndroidDriver ad;

    14. 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(); }
    }

    Eclipse 报错:
    1. 十一月 03, 2020 5:16:54 下午 io.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0 信息: Detected dialect: OSS
    2. 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)
    3. Command duration or timeout: 0 milliseconds
    4. Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
    5. System info: host: 'T480S-SJFANG', ip: '10.66.40.99', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_202-release'
    6. Driver info: io.appium.java_client.android.AndroidDriver
    7. Capabilities {appActivity: com.baidu.baidumaps.Welcome..., appPackage: com.baidu.BaiduMap, automationName: uiautomator2, databaseEnabled: false, desired: {appActivity: com.baidu.baidumaps.Welcome..., appPackage: com.baidu.BaiduMap, automationName: uiautomator2, deviceName: 127.0.0.1:62001, noReset: true, platformName: Android}, deviceApiLevel: 22, deviceManufacturer: OPPO, deviceModel: OPPO R11, deviceName: 127.0.0.1:62001, deviceScreenDensity: 240, deviceScreenSize: 720x1280, deviceUDID: 127.0.0.1:62001, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, noReset: true, pixelRatio: 1.5, platform: LINUX, platformName: Android, platformVersion: 5.1.1, statBarHeight: 38, takesScreenshot: true, viewportRect: {height: 1242, left: 0, top: 38, width: 720}, warnings: {}, webStorageEnabled: false}
    8. Session ID: 64fb9c2b-550d-4f2c-ae07-2a1ffebe2e98
    9. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    10. at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    11. at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    12. at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    13. at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
    14. at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
    15. at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)
    16. at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80)
    17. at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44)
    18. at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
    19. at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
    20. at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
    21. at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
    22. at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
    23. at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
    24. at io.appium.java_client.PerformsTouchActions.performMultiTouchAction(PerformsTouchActions.java:58)
    25. at io.appium.java_client.MultiTouchAction.perform(MultiTouchAction.java:74)
    26. at samoyed.Zoom.Zoom(Zoom.java:61)
    27. at samoyed.Zoom.main(Zoom.java:32)

    28. Appium 报错:

    29. [MJSONWP (64fb9c2b)] Encountered internal error running command: TypeError: Cannot read property 'action' of undefined

    30. **[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)

    31. **[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)

    32. **[MJSONWP (64fb9c2b)] at mapper (C:\Users\sjfang\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:79:24)

    33. **[HTTP] <-- POST /wd/hub/session/64fb9c2b-550d-4f2c-ae07-2a1ffebe2e98/touch/multi/perform 500 4 ms - 213
    复制代码


    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    昨天 08:48
  • 签到天数: 1802 天

    连续签到: 1 天

    [LV.Master]测试大本营

    2#
    发表于 2021-7-5 09:15:46 | 只看该作者
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    2024-10-22 14:23
  • 签到天数: 1007 天

    连续签到: 1 天

    [LV.10]测试总司令

    3#
    发表于 2021-7-5 09:34:24 | 只看该作者
    Cannot read property 'action' of undefined
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    昨天 10:24
  • 签到天数: 1517 天

    连续签到: 1 天

    [LV.Master]测试大本营

    4#
    发表于 2021-7-5 10:59:28 | 只看该作者
    换个版本试试
    回复

    使用道具 举报

  • TA的每日心情
    擦汗
    昨天 14:30
  • 签到天数: 752 天

    连续签到: 1 天

    [LV.10]测试总司令

    5#
    发表于 2021-7-5 12:13:42 | 只看该作者
    换个版本试试
    回复

    使用道具 举报

  • TA的每日心情
    擦汗
    昨天 14:30
  • 签到天数: 752 天

    连续签到: 1 天

    [LV.10]测试总司令

    6#
    发表于 2021-7-5 12:15:44 | 只看该作者
    换个版本试试
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    昨天 09:30
  • 签到天数: 992 天

    连续签到: 1 天

    [LV.10]测试总司令

    7#
    发表于 2021-7-5 14:57:37 | 只看该作者
    回复

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-19 06:16 , Processed in 0.069770 second(s), 22 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表