请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

dos命令执行会报错message:A session is either terminated or not started

我启动appium客户端执行用例没有报错,
然后我通过dos命令执行用例却报错
Traceback (most recent call last):
File “D:\software_pakage\pthyon\PyCharm Community Edition 2018.3.2\helpers\pydev\pydevd.py”, line 1741, in
main()
File “D:\software_pakage\pthyon\PyCharm Community Edition 2018.3.2\helpers\pydev\pydevd.py”, line 1735, in main
globals = debugger.run(setup[‘file’], None, None, is_module)
File “D:\software_pakage\pthyon\PyCharm Community Edition 2018.3.2\helpers\pydev\pydevd.py”, line 1135, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File “D:\software_pakage\pthyon\PyCharm Community Edition 2018.3.2\helpers\pydev_pydev_imps_pydev_execfile.py”, line 18, in execfile
exec(compile(contents+"\n", file, ‘exec’), glob, loc)
File “D:/lishaohui/learn_appium/venv/bussiness/login_bussiness.py”, line 31, in
lb.login()
File “D:/lishaohui/learn_appium/venv/bussiness/login_bussiness.py”, line 8, in login
self.hl.jump_to_homepage()
File “D:\lishaohui\learn_appium\venv\handle\login_handle.py”, line 11, in jump_to_homepage
WebDriverWait(self.driver,10).until(EC.presence_of_element_located((By.ID,“com.tianyuyou.shop:id/b5”)))
File “D:\lishaohui\learn_appium\venv\lib\site-packages\selenium\webdriver\support\wait.py”, line 71, in until
value = method(self._driver)
File “D:\lishaohui\learn_appium\venv\lib\site-packages\selenium\webdriver\support\expected_conditions.py”, line 64, in call
return _find_element(driver, self.locator)
File “D:\lishaohui\learn_appium\venv\lib\site-packages\selenium\webdriver\support\expected_conditions.py”, line 415, in _find_element
raise e
File “D:\lishaohui\learn_appium\venv\lib\site-packages\selenium\webdriver\support\expected_conditions.py”, line 411, in _find_element
return driver.find_element(*by)
File “D:\lishaohui\learn_appium\venv\lib\site-packages\appium\webdriver\webdriver.py”, line 276, in find_element
’value’: value})[‘value’]
File “D:\lishaohui\learn_appium\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 321, in execute
self.error_handler.check_response(response)
File “D:\lishaohui\learn_appium\venv\lib\site-packages\appium\webdriver\errorhandler.py”, line 29, in check_response
raise wde
File “D:\lishaohui\learn_appium\venv\lib\site-packages\appium\webdriver\errorhandler.py”, line 24, in check_response
super(MobileErrorHandler, self).check_response(response)
File “D:\lishaohui\learn_appium\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py”, line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidSessionIdException: Message: A session is either terminated or not started
百度无解。。。

正在回答 回答被采纳积分+3

1回答

Mushishi 2019-12-02 23:00:21

你appium没有启动,driver没有创建起来

0 回复 有任何疑惑可以回复我~
  • 提问者 shaohui_Tester #1
    关键我用appium客户端却可以执行,dos命令启动appium运行却不行
    回复 有任何疑惑可以回复我~ 2019-12-03 11:30:54
  • 提问者 shaohui_Tester #2
    dos命令启动appium,运行时我真机端的app已被启动但是后面执行动作却没有继续就报错了
    回复 有任何疑惑可以回复我~ 2019-12-03 11:33:01
  • Mushishi 回复 提问者 shaohui_Tester #3
    你dos的时候是不是server分没有执行,就是我们启动appium服务,然后把driver传递case里面
    回复 有任何疑惑可以回复我~ 2019-12-05 09:05:27
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信