使用Python脚本在移动设备上打开应用程序时出现服务器端错误

时间:2018-04-16 09:30:56

标签: python testing selenium-webdriver automation appium

计划 -

from appium import webdriver

desired_caps = {}
desired_caps['platformName'] = 'Android'  
desired_caps['platformVersion'] = '7.0'
desired_caps['appiumVersion'] = '1.6.0'    
desired_caps['deviceName'] = 'Moto'    
#desired_caps['browserName'] = ''
desired_caps['name'] = 'Sample Test' 
desired_caps['app'] ='Settings'   
desired_caps['appPackage'] ='com.android.settings'  
#desired_caps['username'] = 'Akshit'
desired_caps['appActivity']='com.android.settings.Settings'                  
#com.android.settings/com.android.settings.Settings}

self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)

# Test Actions here...

driver.quit()

错误 -

Traceback (most recent call last):
  File "C:\Python27\Programs\appiumTest.py", line 18, in <module>
    self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
  File "C:\Python27\lib\site-packages\appium\webdriver\webdriver.py", line 36, in __init__
    super(WebDriver, self).__init__(command_executor, desired_capabilities, browser_profile, proxy, keep_alive)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 92, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 179, in start_session
    response = self.execute(Command.NEW_SESSION, capabilities)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 238, in execute
    self.error_handler.check_response(response)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 193, in check_response
    raise exception_class(message, screen, stacktrace)
WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Cannot read property 'forceStop' of undefined

环境---

  

Appium版本 - 1.6.0

     

Windows-10

     

NPM版本 - 5.6.0

     

Selenium- 3.3.1

HI,  我使用的是Windows 10.在我的系统中,只有Appium(1.6.0)正在运行。我已经尝试过1.6.1,1.7.2,1.7.5,1.7.0并且我也尝试安装像npm install -g appium --no-shrinkwrap这样的appium来解决这个错误,但它无法正常工作。 感谢

0 个答案:

没有答案