TA的每日心情 | 擦汗 昨天 09:07 |
---|
签到天数: 527 天 连续签到: 4 天 [LV.9]测试副司令
|
1测试积点
问题:
求教:新手求教:self.driver.swipe () 执行报错 AttributeError: 'WebDriver' object has no
attribute 'swipe'
#我的脚本:
- <font face="微软雅黑" size="3">#-*- coding: UTF-8 -*-
- import os
- import time
- import unittest
- from selenium import webdriver
- from lib2to3.pgen2.driver import Driver
- from lib2to3.tests.support import driver
- PATH=lambda p:os.path.abspath(os.path.join(os.path.dirname(__file__),p))
- global driver
- class LoginAndroidTests(unittest.TestCase):
- def setUp(self):
- desired_caps={}
- desired_caps['device'] = 'android'
- desired_caps['platformName']='Android'
- desired_caps['browserName']=''
- desired_caps['version']='4.4.2'
- desired_caps['deviceName']='HUAWEI H60-L01'
- desired_caps['appPackage']='com.vehicles.activities'
- desired_caps['appActivity']='.activity.Init.InitActivity'
- self.driver=webdriver.Remote('http://localhost:4723/wd/hub',desired_caps)
- def tearDown(self):
- self.driver.quit()
- def test_login(self):
- print"开始执行脚本"
- time.sleep(20)
- self.driver.swipe(460,193,460,924,1000)
- print "下拉刷新成功"
- if __name__ == '__main__':
- unittest.main()</font>
复制代码
省略了登录部分的脚本,因为想快速定位self.driver.swipe()的问题。
查过api文档了,觉得没有写错,也谷歌过报错了,没有找到解决方案,请指点我一下,非常感谢!
|
|