gpt4 book ai didi

java - Selenium无效选择器异常: Locator startegy 'name' is not supported for this session

转载 作者:行者123 更新时间:2023-12-01 09:52:58 24 4
gpt4 key购买 nike

我正在使用 Appium 和 TestNG 在 ipad 模拟器的浏览器中运行的 java 中自动执行我的测试。问题是,当我尝试点击此代码来查找元素时:By.name("person"); 该操作未执行!

最佳答案

从 1.5 Appium 版本开始 - “名称”定位器已弃用“删除长期弃用的名称定位器策略”。

我们可以像这样点击显示文本:

MobileElement makeTextLocartor = (MobileElement) wd

.findElementByAndroidUIAutomator("new UiSelector().text(\"+<your_text>+\")");

makeTextLocartor.click();

此链接将为您提供帮助:https://www.youtube.com/watch?v=bT3tqaLNn-Y

关于java - Selenium无效选择器异常: Locator startegy 'name' is not supported for this session,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37487485/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com