java - Selenium WebDriver dom 定位器解决方法

标签 java selenium selenium-webdriver selenium-ide

将测试用例从 Selenium IDE 导出到 java/junit/WebDriver 时,有没有办法对 Dom 定位器做一些解决方法?

这些尚未实现(大约几年了?)

我有一个错误:

// ERROR: Caught exception [Error: Dom locators are not implemented yet!]
// ERROR: Caught exception [Error: Dom locators are not implemented yet!]

我的示例dom定位器:

document.findflight.servClass[2] 

<input type="radio" value="Coach" name="servClass" checked="">
<font face="Arial, Helvetica, sans-serif">
    Economy class
    <br>
    <input type="radio" value="Business" name="servClass">
    Business class
    <br>
    <input type="radio" value="First" name="servClass">
    First class
</font>

最佳答案

你是对的,即使对于 Selenium WebDriver(例如),仍然没有直接导出到“实现的定位器”。因此,您可以通过手动选择一些直接定位器策略来解决此问题。只需查看 Selenium 定位器文档 here 中所有可能的内容即可。希望有帮助。

关于java - Selenium WebDriver dom 定位器解决方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36308321/

相关文章:

java - eclipse : Could not open editor after Eclipse PDT upgrade to version 5. 0.1.201706221952

java - 尝试捕捉细节

selenium - 什么是 Selenium 包装器?

java - Selenium - 选择带空格的 td 类

c# - 如何使用 Selenium WebDriver 在 Edge 的文本输入字段中输入电子邮件地址?

python - 使用 Selenium 通过 PhantomJS 中的超链接下载文件

Python Selenium 屏幕抓取

java - 从数据库中检索一个值并将其设置为Spring boot中的@Table Name值

java - 为什么 Android Studio 总是在应用程序设计中显示 ActionBar,即使在禁用时也是如此?

java - 如何同时运行多个线程进行自动化 Selenium 测试?