【发布时间】:2019-07-21 02:42:20
【问题描述】:
我在使用 Appium 脚本获取设备大小时遇到问题。我的计划是制作一个类似下面的函数来获取屏幕大小,然后计算滑动操作中使用的点数。
size = self.driver.get_window_size()
start_y = size.height * 0.5
end_y = size.height * 0.5
start_x = size.width * 0.8
end_x = size.width * 0.2
self.driver.swipe(start_x, start_y, end_x, end_y, 400)
这段代码的问题是它显然没有返回具有高度和宽度属性的字典。错误:
File "/path/tests/AppiumTest.py", line 88, in swipe_right_to_left
start_x = size.width * 0.8
AttributeError: 'dict' object has no attribute 'width'
关于我做错了什么有什么想法吗?
【问题讨论】:
标签: android python appium appium-android