对遗产能力的支持被弃用;您正在发送“ devicename”这是无效的能力

发布于 2025-02-02 13:23:15 字数 236 浏览 3 评论 0 原文

我试图使用Java和Appium设置一个项目。事实是我只是在学习它,我被陷入了代码的前几行 问题的屏幕截图

我正在尝试设置“所需功能”,但是有一个问题说明问题这些是无效的功能。我也试图研究文档,但无法弄清楚如何修复它。如果任何人都能提供帮助,将会有很大的帮助。

I was trying to setup a project with Java and Appium. Thing is that I am just learning it and I got stuck on first few lines of the code
Screenshot of the issue

I am trying to set the "Desired Capabilities" but there is an issue stating that these are invalid capabilities. I have tried to look into the docs as well but cannot figure out how to fix it. Would be great help if anyone can help it out.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

泪眸﹌ 2025-02-09 13:23:15

您可以尝试将“ Appium:”添加到功能中

DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability("appium:deviceName", "deviceName");
cap.setCapability("appium:app", fs.getAbsolutePath());

You can try adding "appium:" to the capabilities

DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability("appium:deviceName", "deviceName");
cap.setCapability("appium:app", fs.getAbsolutePath());
黒涩兲箜 2025-02-09 13:23:15

尝试从 uiautomator2options 类获取实例以应用特定功能,而不是 DesiredCapabilities 从AndroidDriver获得实例时。

UiAutomator2Options options = new UiAutomator2Options();
options.setDeviceName("testemulator");

Try to get instance from UiAutomator2Options class to applies specific capabilities instead of DesiredCapabilities when you get instance from AndroidDriver.

https://www.selenium.dev/blog/2022/legacy-protocol-support/

UiAutomator2Options options = new UiAutomator2Options();
options.setDeviceName("testemulator");
痴骨ら 2025-02-09 13:23:15

我认为,硒/独立粉红色的“最新”标签正在变化,这引起了这个问题。

尝试拉出先验版本。我在“最新”中遇到的错误与您相同的错误,但我拉了“ 101.0.4951.41”,我的测试再次工作。

I think there was a change to the "latest" tag for selenium/standalone-chrome which is causing this problem.

Try pulling a prior version. I had your the same error you had with "latest" but I pulled "101.0.4951.41" and my tests are working again.

滿滿的愛 2025-02-09 13:23:15

尝试拉出先验版本。我在“最新”中遇到的错误与您相同的错误,但我拉了“ 101.0.4951.41”,我的测试再次工作。

嗨,我不清楚。请问什么。

Try pulling a prior version. I had your the same error you had with "latest" but I pulled "101.0.4951.41" and my tests are working again.

Hi, It's not clear to me. Prior version of what please.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文