File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
website_and_docs/content/documentation/webdriver/elements Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ val vegetable: WebElement = driver.findElement(By.className("tomatoes"))
6161{{< /tabpane >}}
6262
6363
64- ### 在部分DOM中查找元素
64+ ### 在部分DOM(DOM子集)中查找元素
6565
6666以上代码无法获取在样例第二个列表中的"tomato"元素。如果知道目标元素所属位置且希望获取指定范围里的元素而不是整个上下文中的第一个,可以进行部分搜索。
6767
@@ -108,7 +108,7 @@ val fruit = fruits.findElement(By.className("tomatoes"))
108108
109109为了略微提高性能,我们可以使用 CSS 或 XPath 在单个命令中查找该元素。请查看在[ 最佳实践] ({{< ref "/documentation/test_practices/encouraged" >}})中的[ 使用定位器的提示] ({{< ref "/documentation/test_practices/encouraged/locators" >}})部分。
110110
111- 如下所示,我们通过CSS路径定位器查找元素 :
111+ 如下所示,我们通过CSS选择器查找元素 :
112112
113113{{< tabpane langEqualsHeader=true >}}
114114 {{< tab header="Java" >}}
You can’t perform that action at this time.
0 commit comments