你把你的代码和下面代码对比对比
#-*- coding: UTF-8 -*-
#导入常用的包
import os
import time
import unittest
from selenium import webdriver
from lib2to3.pgen2.driverimport Driver
from lib2to3.tests.supportimport 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.2.2'#系统版本
desired_caps['deviceName']='antester'#模拟器名称
desired_caps['app-package']='com.subject.zhongchou'#要测试的app
desired_caps['app-activity']='.ZhongChou'#当前活动应用
self.driver=webdriver.Remote('',desired_caps)
def tearDown(self):
self.driver.quit()
def test_login(self):
time.sleep(30)
#点击“注册登录”按钮