51Testing软件测试论坛

标题: appium+python自动化测试:ImportError: No module named extensions.context [打印本页]

作者: Sy_松    时间: 2018-12-19 11:57
标题: 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

作者: qqq911    时间: 2019-3-8 10:55
引入有问题
作者: jingzizx    时间: 2019-3-8 12:32
查看引入报是否正确
作者: abcsell    时间: 2019-3-8 13:40
缺少模块,重新安装下




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2