Airtext连接chrome谷歌浏览器报错

Airtext连接chrome报错

近期在使用AirtestIDE连接chrome的时候,发现可以正常打开浏览器进行录制,在识别控件的时候也可以正常识别,但是运行录制好的脚本的时候会报错如下:

javascript 复制代码
[Start running..]
do not connect device
save log in '\AirtestIDE\scripts\d91e047757e8c18b825a54eda6bb8efd'
[10:20:53][ERROR]<airtest.core.api> Traceback (most recent call last):
  File "airtest\cli\runner.py", line 72, in runTest
  File "\fx.air\fx.py", line 8, in <module>
    driver.get("www.baidu.com")
  File "airtest\utils\logwraper.py", line 124, in wrapper
  File "\AirtestIDE-win-1.2.15\AirtestIDE\airtest_selenium\proxy.py", line 287, in get
    super(WebChrome, self).get(address)
  File "\AirtestIDE-win-1.2.15\AirtestIDE\selenium\webdriver\remote\webdriver.py", line 333, in get
    self.execute(Command.GET, {'url': url})
  File "\AirtestIDE-win-1.2.15\AirtestIDE\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "\AirtestIDE-win-1.2.15\AirtestIDE\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: unhandled inspector error: {"code":-32000,"message":"Cannot navigate to invalid URL"}
  (Session info: chrome=110.0.5481.178)
  (Driver info: chromedriver=2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7),platform=Windows NT 10.0.19044 x86_64)
======================================================================
ERROR: runTest (app.widgets.code_runner.ide_launcher.AirtestIDECase)
----------------------------------------------------------------------

在窗口上也有一条warning:

javascript 复制代码
UserWarning: DOM.describeNode error: Could not find node with given id

经过检查发现,Airtest封装是带有chromedriver,只是版本比较旧,基础打开chrome跟控件识别还是可以的,但是在运行脚本的时候就会报错。

想要正常使用airtest-selenium去编写chrome的脚本时,目前可以参考这篇文章所提供的chrome版本,并下载对应的chromedriver,这样就可以很好的运行啦~

下载好了对应的chromedriver之后,可以到本地查看chrome的地址,将对应版本的chromedriver放到chrome的所属文件夹下,如下图:

如果还有不清楚的地方,可以参考这篇教程噢~

目前浏览器只兼容了chrome的部分版本以及Firefox这两个浏览器,更高版本的chrome以及ie的兼容我们也在快马加鞭的更新中~

相关推荐
EVE จุ๊บ1 天前
playwright和selenium的区别是什么
selenium·测试工具
中屹指纹浏览器svip3 天前
中屹指纹浏览器和普通 Chrome 有什么区别?
前端·chrome·中屹指纹浏览器
qetfw3 天前
Bash 基础:脚本执行、引号与命令替换验证
linux·开发语言·chrome·bash
你挚爱的强哥3 天前
如何设置 Chrome 打开默认页面不要是360的主页https://hao.360.com/?src=lm&ls=n6205869099
前端·chrome·360首页劫持
Frag0ut4 天前
Chrome隐私沙盒与Cookieless实战:2026年广告归因合规迁移指南
chrome·谷歌浏览器·使用技巧·广告归因·隐私沙盒·topics api·cookieless
qetfw4 天前
Bash 变量:export、位置参数与默认值展开验证
linux·开发语言·chrome·bash
软件派4 天前
Chrome 插件开发实战指南
前端·chrome
qetfw5 天前
Bash 字符串处理:参数展开、序列与脚本执行方式
linux·开发语言·chrome·bash
白日做梦Q5 天前
Chrome商店访问不了,无法现在安装插件?利用Edge商店迁移扩展完整实操教程问题背景
前端·chrome·edge
其实防守也摸鱼5 天前
Cylab在线靶场——挑战图书馆初学者指南
服务器·前端·数据库·chrome·安全·网络安全·靶场