from appium import webdriver
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '6.0'
desired_caps['deviceName'] = '127.0.0.1:7555'
desired_caps['appPackage'] = 'com.android.settings'
desired_caps['appActivity'] = '.Settings'
driver = webdriver.Remote('http://localhost:4723/wd/hub',desired_caps)
driver.quit()
报错
C:\Users\ttt\python_test202110\venv\Scripts\python.exe C:/Users/ttt/python_test202110/test_app/demo1.py
Traceback (most recent call last):
File "C:\Users\ttt\python_test202110\test_app\demo1.py", line 17, in <module>
driver = webdriver.Remote('http://localhost:4723/wd/hub',desired_caps)
File "C:\Users\ttt\python_test202110\venv\lib\site-packages\appium\webdriver\webdriver.py", line 273, in __init__
super().__init__(
File "C:\Users\ttt\python_test202110\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 268, in __init__
self.start_session(capabilities, browser_profile)
File "C:\Users\ttt\python_test202110\venv\lib\site-packages\appium\webdriver\webdriver.py", line 364, in start_session
response = self.execute(RemoteCommand.NEW_SESSION, parameters)
File "C:\Users\ttt\python_test202110\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 424, in execute
self.error_handler.check_response(response)
File "C:\Users\ttt\python_test202110\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Could not sign with default certificate. Original error Command 'C:\Program Files\Java\bin\java.exe' not found. Is it installed?
Stacktrace:
UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not sign with default certificate. Original error Command 'C:\Program Files\Java\bin\java.exe' not found. Is it installed?
at getResponseForW3CError (C:\Users\ttt\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
at asyncHandler (C:\Users\ttt\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:381:37)
Process finished with exit code 1
appium上的报错