import os
import unittest
import time
import HTMLTestRunner
from appium import webdriver
from _operator import contains
class Taobao(unittest.TestCase):
def setUp(self):
desired_caps={}
desired_caps['platformName']='Android'
desired_caps['platformVersion']='5.1'
desired_caps['deviceName']='TA0040261F'
desired_caps['packageName']='com.taobao.taobao'
desired_caps['packageActivity']='com.taobao.tao.homepage.MainActivity3'
self.driver=webdriver.Remote('http://localhost:4723/wd/hub',desired_caps)
xxxxxxxxxxxxxxxxxx
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(Taobao)
unittest.TextTestRunner(verbosity=2).run(suite)
报如下错误
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: The desired capabilities must include either an app, package or browser
然后我也尝试过给它安装包的具体路径,进入淘宝的 home 页之后一直报 package 或 activity 不正确
也试过把 com.taobao.tao.homepage.MainActivity3 改成淘宝的欢迎 activity 也不成 求解。。