appium+python自动化测试:ImportError: No module named extensions.context
手机端自动化测试 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
引入有问题 查看引入报是否正确 缺少模块,重新安装下
页:
[1]