|
手机端自动化测试 appium+python+模拟器的环境
demo:
#coding=utf-8
import time
import os
from appium import webdriver
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '7.0'
desired_caps['deviceName'] = 'emulator-5554'
desired_caps['appPackage'] = 'com.android.launcher3'
desired_caps['appActivity'] = '.Launcher t7'
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
运行的后报错:
Traceback (most recent call last):
File "/Users/hhht/PycharmProjects/untitled1/demo.py", line 5, in <module>
from appium import webdriver
File "/Users/hhht/untitled1/lib/python2.7/site-packages/appium/webdriver/__init__.py", line 19, in <module>
from .webdriver import WebDriver as Remote
File "/Users/hhht/untitled1/lib/python2.7/site-packages/appium/webdriver/webdriver.py", line 31, in <module>
from .extensions.context import Context
ImportError: No module named extensions.context
|
|