栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

报错解决:selenium.common.exceptions.WebDriverException: Message: An unknown server-side error

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

报错解决:selenium.common.exceptions.WebDriverException: Message: An unknown server-side error

报错代码
from appium import webdriver
from selenium.webdriver.support.ui import WebDriverWait

desired_caps={}
desired_caps['platformName']='Android'
desired_caps['platformVersion']='7.1.2'
desired_caps['deviceName']='127.0.0.1:21503'

desired_caps['app']=r'D:appium_appdr.fone3.2.0.apk'
desired_caps['appPackage']='com.wondershare.drfone'
desired_caps['appActivity']='com.wondershare.drfone.ui.activity.WelcomeActivity'

# 服务器端口
driver=webdriver.Remote('http://localhost:4723/wd/hub',desired_caps)
driver.implicitly_wait(3)

driver.find_element_by_id('com.wondershare.drfone:id/btnBackup').click()

WebDriverWait(driver,15).until(lambda x:x.find_element_by_class_name('android.widget.Button'))
driver.find_element_by_class_name('android.widget.Button').click()

WebDriverWait(driver,8).until(lambda x:x.find_element_by_android_uiautomator('new UiSelector().text("Refresh")'))
driver.find_element_by_android_uiautomator('new UiSelector().text("Refresh")').click()


WebDriverWait(driver,8).until(lambda x:x.find_element_by_class_name('android.webkit.WebView'))
contexts=driver.contexts
print(contexts)

driver.switch_to.context('WEBVIEW_com.wondershare.drfone')
driver.find_element_by_id('email').send_keys('shuqing2018@163.com')
driver.find_element_by_class_name('btn_send').click()

driver.switch_to.context('NATIVE_APP')
driver.find_element_by_class_name('android.widget.ImageButton').click
错误信息

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: No Chromedriver found that can automate Chrome '68.0.3440'. You could also try to enable automated chromedrivers download server feature. See https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/web/chromedriver.md for more details

自己的本地 appium server 没有配置 chromedriver.exe

配置 chromedriver.exe

尽量保证模拟器的和PC端的版本一样下载
## 替换或保存chromedriver.exe
默认路径
C:UsersAppDataLocalProgramsAppiumresourcesappnode_modulesappiumnode_modulesappium-chromedriverchromedriverwin下将下载的chromedrive替换掉原来的即可
我的安装路径
C:Usersyunaonode_modulesappium-chromedriverchromedriverwin

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/689381.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号