diff --git a/documentation/_print/index.html b/documentation/_print/index.html index cb0a23196896..a5885d95a957 100644 --- a/documentation/_print/index.html +++ b/documentation/_print/index.html @@ -2702,14 +2702,36 @@
    driver = webdriver.Chrome()
 	driver.find_element(By.XPATH, "//input[@value='f']")
   
    var driver = new ChromeDriver();
-	driver.FindElement(By.Xpath("//input[@value='f']"));
+	  driver.FindElement(By.Xpath("//input[@value='f']"));
   
    driver.find_element(xpath: "//input[@value='f']")
View full example on GitHub
    let driver = await new Builder().forBrowser('chrome').build();
 	const loc = await driver.findElement(By.xpath('//input[@value='f']'));
   
-
    val driver = ChromeDriver()
-	val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
-  

Relative Locators

Selenium 4 introduces Relative Locators (previously +

    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	  val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
+  

Utilizing Locators

The FindElement makes using locators a breeze! For most languages, all you need to do is utilize webdriver.common.by.By, however in others it’s as simple as setting a parameter in the FindElement function>

Move Code

    import org.openqa.selenium.By;
+    WebDriver driver = new ChromeDriver();
+	driver.findElement(By.className("information"));
+  
    from selenium.webdriver.common.by import By
+    driver = webdriver.Chrome()
+	driver.find_element(By.CLASS_NAME, "information")
+  
    var driver = new ChromeDriver();
+	driver.FindElement(By.ClassName("information"));
+  
    driver.find_element(class: 'information')
    let driver = await new Builder().forBrowser('chrome').build();
+	const loc = await driver.findElement(By.className('information'));
+  
+
    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	val loc: WebElement = driver.findElement(By.className("information"))
+  

Relative Locators

Selenium 4 introduces Relative Locators (previously called Friendly Locators). These locators are helpful when it is not easy to construct a locator for the desired element, but easy to describe spatially where the element is in relation to an element that does have an easily constructed locator.

How it works

Selenium uses the JavaScript function @@ -2717,55 +2739,55 @@ to determine the size and position of elements on the page, and can use this information to locate neighboring elements.

Relative locator methods can take as the argument for the point of origin, either a previously located element reference, or another locator. In these examples we’ll be using locators only, but you could swap the locator in the final method with an element object and it will work the same.

Let us consider the below example for understanding the relative locators.

Relative Locators

Available relative locators

Above

If the email text field element is not easily identifiable for some reason, but the password text field element is, -we can locate the text field element using the fact that it is an “input” element “above” the password element.

Move Code

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, -we can locate the text field element using the fact that it is an “input” element “below” the email element.

Move Code

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, -we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

Move Code

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, +we can locate the text field element using the fact that it is an “input” element “below” the email element.

Move Code

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, -we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

Move Code

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, +we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

Move Code

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to -identify an element that is at most 50px away from the provided locator. -One great use case for this is to work with a form element that doesn’t have an easily constructed locator, -but its associated input label element does.

Move Code

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, +we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

Move Code

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

Move Code

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to +identify an element that is at most 50px away from the provided locator. +One great use case for this is to work with a form element that doesn’t have an easily constructed locator, +but its associated input label element does.

Move Code

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

2.5.3 - Finding web elements

Locating the elements based on the provided locator values.

One of the most fundamental aspects of using Selenium is obtaining element references to work with. +Kotlin

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

Move Code

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

2.5.3 - Finding web elements

Locating the elements based on the provided locator values.

One of the most fundamental aspects of using Selenium is obtaining element references to work with. Selenium offers a number of built-in locator strategies to uniquely identify an element. There are many ways to use the locators in very advanced scenarios. For the purposes of this documentation, let’s consider this HTML snippet:

<ol id="vegetables">
@@ -13921,7 +13943,7 @@
 No patent liability is assumed with respect
 to the use of the information contained herein.

Attributions

Selenium Main Repository

-5319 commits
+5320 commits
3352 commits
@@ -14213,9 +14235,9 @@ 538 commits
-217 commits
+219 commits
-153 commits
+154 commits
134 commits
@@ -14419,7 +14441,7 @@ 232 commits
-119 commits
+121 commits
114 commits
@@ -14471,6 +14493,8 @@ 6 commits
+6 commits
+ 6 commits
6 commits
@@ -14487,8 +14511,6 @@ 5 commits
-5 commits
- 5 commits
5 commits
@@ -14565,10 +14587,10 @@ 2 commits
+2 commits
+ 2 commits
-2 commits
- 2 commits
2 commits
@@ -14587,6 +14609,8 @@ 2 commits
+2 commits
+ 2 commits
2 commits
@@ -14607,8 +14631,6 @@ 2 commits
-2 commits
- 2 commits

Previous Selenium Website

417 commits
diff --git a/documentation/about/_print/index.html b/documentation/about/_print/index.html index 4a325355058f..50f9afd0a577 100644 --- a/documentation/about/_print/index.html +++ b/documentation/about/_print/index.html @@ -40,7 +40,7 @@ No patent liability is assumed with respect to the use of the information contained herein.

Attributions

Selenium Main Repository

-5319 commits
+5320 commits
3352 commits
@@ -332,9 +332,9 @@ 538 commits
-217 commits
+219 commits
-153 commits
+154 commits
134 commits
@@ -538,7 +538,7 @@ 232 commits
-119 commits
+121 commits
114 commits
@@ -590,6 +590,8 @@ 6 commits
+6 commits
+ 6 commits
6 commits
@@ -606,8 +608,6 @@ 5 commits
-5 commits
- 5 commits
5 commits
@@ -684,10 +684,10 @@ 2 commits
+2 commits
+ 2 commits
-2 commits
- 2 commits
2 commits
@@ -706,6 +706,8 @@ 2 commits
+2 commits
+ 2 commits
2 commits
@@ -726,8 +728,6 @@ 2 commits
-2 commits
- 2 commits

Previous Selenium Website

417 commits
diff --git a/documentation/about/copyright/index.html b/documentation/about/copyright/index.html index 23ee170642f4..29a44b59950c 100644 --- a/documentation/about/copyright/index.html +++ b/documentation/about/copyright/index.html @@ -26,7 +26,7 @@ No patent liability is assumed with respect to the use of the information contained herein.

Attributions

Selenium Main Repository

-5319 commits
+5320 commits
3352 commits
@@ -318,9 +318,9 @@ 538 commits
-217 commits
+219 commits
-153 commits
+154 commits
134 commits
@@ -524,7 +524,7 @@ 232 commits
-119 commits
+121 commits
114 commits
@@ -576,6 +576,8 @@ 6 commits
+6 commits
+ 6 commits
6 commits
@@ -592,8 +594,6 @@ 5 commits
-5 commits
- 5 commits
5 commits
@@ -670,10 +670,10 @@ 2 commits
+2 commits
+ 2 commits
-2 commits
- 2 commits
2 commits
@@ -692,6 +692,8 @@ 2 commits
+2 commits
+ 2 commits
2 commits
@@ -712,8 +714,6 @@ 2 commits
-2 commits
- 2 commits

Previous Selenium Website

417 commits
diff --git a/documentation/webdriver/_print/index.html b/documentation/webdriver/_print/index.html index 6695f1bd7a10..ad6d7422bf93 100644 --- a/documentation/webdriver/_print/index.html +++ b/documentation/webdriver/_print/index.html @@ -2503,14 +2503,36 @@
    driver = webdriver.Chrome()
 	driver.find_element(By.XPATH, "//input[@value='f']")
   
    var driver = new ChromeDriver();
-	driver.FindElement(By.Xpath("//input[@value='f']"));
+	  driver.FindElement(By.Xpath("//input[@value='f']"));
   
    driver.find_element(xpath: "//input[@value='f']")
View full example on GitHub
    let driver = await new Builder().forBrowser('chrome').build();
 	const loc = await driver.findElement(By.xpath('//input[@value='f']'));
   
-
    val driver = ChromeDriver()
-	val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
-  

Relative Locators

Selenium 4 introduces Relative Locators (previously +

    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	  val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
+  

Utilizing Locators

The FindElement makes using locators a breeze! For most languages, all you need to do is utilize webdriver.common.by.By, however in others it’s as simple as setting a parameter in the FindElement function>

Move Code

    import org.openqa.selenium.By;
+    WebDriver driver = new ChromeDriver();
+	driver.findElement(By.className("information"));
+  
    from selenium.webdriver.common.by import By
+    driver = webdriver.Chrome()
+	driver.find_element(By.CLASS_NAME, "information")
+  
    var driver = new ChromeDriver();
+	driver.FindElement(By.ClassName("information"));
+  
    driver.find_element(class: 'information')
    let driver = await new Builder().forBrowser('chrome').build();
+	const loc = await driver.findElement(By.className('information'));
+  
+
    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	val loc: WebElement = driver.findElement(By.className("information"))
+  

Relative Locators

Selenium 4 introduces Relative Locators (previously called Friendly Locators). These locators are helpful when it is not easy to construct a locator for the desired element, but easy to describe spatially where the element is in relation to an element that does have an easily constructed locator.

How it works

Selenium uses the JavaScript function @@ -2518,55 +2540,55 @@ to determine the size and position of elements on the page, and can use this information to locate neighboring elements.

Relative locator methods can take as the argument for the point of origin, either a previously located element reference, or another locator. In these examples we’ll be using locators only, but you could swap the locator in the final method with an element object and it will work the same.

Let us consider the below example for understanding the relative locators.

Relative Locators

Available relative locators

Above

If the email text field element is not easily identifiable for some reason, but the password text field element is, -we can locate the text field element using the fact that it is an “input” element “above” the password element.

Move Code

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, -we can locate the text field element using the fact that it is an “input” element “below” the email element.

Move Code

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, -we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

Move Code

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, +we can locate the text field element using the fact that it is an “input” element “below” the email element.

Move Code

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, -we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

Move Code

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, +we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

Move Code

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to -identify an element that is at most 50px away from the provided locator. -One great use case for this is to work with a form element that doesn’t have an easily constructed locator, -but its associated input label element does.

Move Code

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, +we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

Move Code

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

Move Code

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to +identify an element that is at most 50px away from the provided locator. +One great use case for this is to work with a form element that doesn’t have an easily constructed locator, +but its associated input label element does.

Move Code

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

5.3 - Finding web elements

Locating the elements based on the provided locator values.

One of the most fundamental aspects of using Selenium is obtaining element references to work with. +Kotlin

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

Move Code

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

5.3 - Finding web elements

Locating the elements based on the provided locator values.

One of the most fundamental aspects of using Selenium is obtaining element references to work with. Selenium offers a number of built-in locator strategies to uniquely identify an element. There are many ways to use the locators in very advanced scenarios. For the purposes of this documentation, let’s consider this HTML snippet:

<ol id="vegetables">
diff --git a/documentation/webdriver/elements/_print/index.html b/documentation/webdriver/elements/_print/index.html
index 42864e3e1e92..82afdb99ee04 100644
--- a/documentation/webdriver/elements/_print/index.html
+++ b/documentation/webdriver/elements/_print/index.html
@@ -244,14 +244,36 @@
   
    driver = webdriver.Chrome()
 	driver.find_element(By.XPATH, "//input[@value='f']")
   
    var driver = new ChromeDriver();
-	driver.FindElement(By.Xpath("//input[@value='f']"));
+	  driver.FindElement(By.Xpath("//input[@value='f']"));
   
    driver.find_element(xpath: "//input[@value='f']")
View full example on GitHub
    let driver = await new Builder().forBrowser('chrome').build();
 	const loc = await driver.findElement(By.xpath('//input[@value='f']'));
   
-
    val driver = ChromeDriver()
-	val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
-  

Relative Locators

Selenium 4 introduces Relative Locators (previously +

    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	  val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
+  

Utilizing Locators

The FindElement makes using locators a breeze! For most languages, all you need to do is utilize webdriver.common.by.By, however in others it’s as simple as setting a parameter in the FindElement function>

Move Code

    import org.openqa.selenium.By;
+    WebDriver driver = new ChromeDriver();
+	driver.findElement(By.className("information"));
+  
    from selenium.webdriver.common.by import By
+    driver = webdriver.Chrome()
+	driver.find_element(By.CLASS_NAME, "information")
+  
    var driver = new ChromeDriver();
+	driver.FindElement(By.ClassName("information"));
+  
    driver.find_element(class: 'information')
    let driver = await new Builder().forBrowser('chrome').build();
+	const loc = await driver.findElement(By.className('information'));
+  
+
    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	val loc: WebElement = driver.findElement(By.className("information"))
+  

Relative Locators

Selenium 4 introduces Relative Locators (previously called Friendly Locators). These locators are helpful when it is not easy to construct a locator for the desired element, but easy to describe spatially where the element is in relation to an element that does have an easily constructed locator.

How it works

Selenium uses the JavaScript function @@ -259,55 +281,55 @@ to determine the size and position of elements on the page, and can use this information to locate neighboring elements.

Relative locator methods can take as the argument for the point of origin, either a previously located element reference, or another locator. In these examples we’ll be using locators only, but you could swap the locator in the final method with an element object and it will work the same.

Let us consider the below example for understanding the relative locators.

Relative Locators

Available relative locators

Above

If the email text field element is not easily identifiable for some reason, but the password text field element is, -we can locate the text field element using the fact that it is an “input” element “above” the password element.

Move Code

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, -we can locate the text field element using the fact that it is an “input” element “below” the email element.

Move Code

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, -we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

Move Code

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, +we can locate the text field element using the fact that it is an “input” element “below” the email element.

Move Code

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, -we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

Move Code

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, +we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

Move Code

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to -identify an element that is at most 50px away from the provided locator. -One great use case for this is to work with a form element that doesn’t have an easily constructed locator, -but its associated input label element does.

Move Code

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, +we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

Move Code

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

Move Code

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to +identify an element that is at most 50px away from the provided locator. +One great use case for this is to work with a form element that doesn’t have an easily constructed locator, +but its associated input label element does.

Move Code

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

3 - Finding web elements

Locating the elements based on the provided locator values.

One of the most fundamental aspects of using Selenium is obtaining element references to work with. +Kotlin

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

Move Code

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

3 - Finding web elements

Locating the elements based on the provided locator values.

One of the most fundamental aspects of using Selenium is obtaining element references to work with. Selenium offers a number of built-in locator strategies to uniquely identify an element. There are many ways to use the locators in very advanced scenarios. For the purposes of this documentation, let’s consider this HTML snippet:

<ol id="vegetables">
diff --git a/documentation/webdriver/elements/locators/index.html b/documentation/webdriver/elements/locators/index.html
index 7e72f7ea7f9f..116dba2f3851 100644
--- a/documentation/webdriver/elements/locators/index.html
+++ b/documentation/webdriver/elements/locators/index.html
@@ -1,7 +1,7 @@
 Locator strategies | Selenium
 

Locator strategies

Ways to identify one or more specific elements in the DOM.

A locator is a way to identify elements on a page. It is the argument passed to the + Print entire section



Locator strategies

Ways to identify one or more specific elements in the DOM.

A locator is a way to identify elements on a page. It is the argument passed to the Finding element methods.

Check out our encouraged test practices for tips on locators, including which to use when and why to declare locators separately from the finding methods.

Traditional Locators

Selenium provides support for these 8 traditional location strategies in WebDriver:

LocatorDescription
class nameLocates elements whose class name contains the search value (compound class names are not permitted)
css selectorLocates elements matching a CSS selector
idLocates elements whose ID attribute matches the search value
nameLocates elements whose NAME attribute matches the search value
link textLocates anchor elements whose visible text matches the search value
partial link textLocates anchor elements whose visible text contains the search value. If multiple elements are matching, only the first one will be selected.
tag nameLocates elements whose tag name matches the search value
xpathLocates elements matching an XPath expression

Creating Locators

To work on a web element using Selenium, we need to first locate it on the web page. @@ -208,14 +208,36 @@

    driver = webdriver.Chrome()
 	driver.find_element(By.XPATH, "//input[@value='f']")
   
    var driver = new ChromeDriver();
-	driver.FindElement(By.Xpath("//input[@value='f']"));
+	  driver.FindElement(By.Xpath("//input[@value='f']"));
   
    driver.find_element(xpath: "//input[@value='f']")
    let driver = await new Builder().forBrowser('chrome').build();
 	const loc = await driver.findElement(By.xpath('//input[@value='f']'));
   
-
    val driver = ChromeDriver()
-	val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
-  

Relative Locators

Selenium 4 introduces Relative Locators (previously +

    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	  val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
+  

Utilizing Locators

The FindElement makes using locators a breeze! For most languages, all you need to do is utilize webdriver.common.by.By, however in others it’s as simple as setting a parameter in the FindElement function>

Move Code

    import org.openqa.selenium.By;
+    WebDriver driver = new ChromeDriver();
+	driver.findElement(By.className("information"));
+  
    from selenium.webdriver.common.by import By
+    driver = webdriver.Chrome()
+	driver.find_element(By.CLASS_NAME, "information")
+  
    var driver = new ChromeDriver();
+	driver.FindElement(By.ClassName("information"));
+  
    driver.find_element(class: 'information')
    let driver = await new Builder().forBrowser('chrome').build();
+	const loc = await driver.findElement(By.className('information'));
+  
+
    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	val loc: WebElement = driver.findElement(By.className("information"))
+  

Relative Locators

Selenium 4 introduces Relative Locators (previously called Friendly Locators). These locators are helpful when it is not easy to construct a locator for the desired element, but easy to describe spatially where the element is in relation to an element that does have an easily constructed locator.

How it works

Selenium uses the JavaScript function @@ -223,53 +245,53 @@ to determine the size and position of elements on the page, and can use this information to locate neighboring elements.

Relative locator methods can take as the argument for the point of origin, either a previously located element reference, or another locator. In these examples we’ll be using locators only, but you could swap the locator in the final method with an element object and it will work the same.

Let us consider the below example for understanding the relative locators.

Relative Locators

Available relative locators

Above

If the email text field element is not easily identifiable for some reason, but the password text field element is, -we can locate the text field element using the fact that it is an “input” element “above” the password element.

Move Code

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, -we can locate the text field element using the fact that it is an “input” element “below” the email element.

Move Code

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, -we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

Move Code

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, +we can locate the text field element using the fact that it is an “input” element “below” the email element.

Move Code

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, -we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

Move Code

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, +we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

Move Code

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to -identify an element that is at most 50px away from the provided locator. -One great use case for this is to work with a form element that doesn’t have an easily constructed locator, -but its associated input label element does.

Move Code

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, +we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

Move Code

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

Move Code

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to +identify an element that is at most 50px away from the provided locator. +One great use case for this is to work with a form element that doesn’t have an easily constructed locator, +but its associated input label element does.

Move Code

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))
Last modified June 23, 2024: Move an update locators examples for ruby (#1773)[deploy site] (c3745ec3784)

Development Partners

Selenium Level Sponsors

Support the Selenium Project

Learn more or view the full list of sponsors.

Learn more +Kotlin

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

Move Code

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

Development Partners

Selenium Level Sponsors

Support the Selenium Project

Learn more or view the full list of sponsors.

\ No newline at end of file diff --git a/downloads/_print/index.html b/downloads/_print/index.html index 57f518a0cfbc..5ca1f37ff9d4 100644 --- a/downloads/_print/index.html +++ b/downloads/_print/index.html @@ -52,7 +52,7 @@ Nightly

Release date: -August 20, 2024 +August 21, 2024

Release date: -August 20, 2024 +August 21, 2024

    import org.openqa.selenium.By;
+    WebDriver driver = new ChromeDriver();
+	driver.findElement(By.className("information"));
+  
    from selenium.webdriver.common.by import By
+    driver = webdriver.Chrome()
+	driver.find_element(By.CLASS_NAME, "information")
+  
    var driver = new ChromeDriver();
+	driver.FindElement(By.ClassName("information"));
+  
    driver.find_element(class: 'information')
    let driver = await new Builder().forBrowser('chrome').build();
+	const loc = await driver.findElement(By.className('information'));
+  
+
    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	val loc: WebElement = driver.findElement(By.className("information"))
+  

相対ロケーター

Selenium 4 introduces Relative Locators (previously called as Friendly Locators). These locators are helpful when it is not easy to construct a locator for the desired element, but easy to describe spatially where the element is in relation to an element that does have an easily constructed locator.

How it works

Selenium uses the JavaScript function @@ -2614,55 +2635,55 @@ to determine the size and position of elements on the page, and can use this information to locate neighboring elements.
find the relative elements.

Relative locator methods can take as the argument for the point of origin, either a previously located element reference, or another locator. In these examples we’ll be using locators only, but you could swap the locator in the final method with an element object and it will work the same.

Let us consider the below example for understanding the relative locators.

Relative Locators

Available relative locators

Above

If the email text field element is not easily identifiable for some reason, but the password text field element is, -we can locate the text field element using the fact that it is an “input” element “above” the password element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, -we can locate the text field element using the fact that it is an “input” element “below” the email element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, -we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, +we can locate the text field element using the fact that it is an “input” element “below” the email element.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, -we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, +we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to -identify an element that is at most 50px away from the provided locator. -One great use case for this is to work with a form element that doesn’t have an easily constructed locator, -but its associated input label element does.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, +we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to +identify an element that is at most 50px away from the provided locator. +One great use case for this is to work with a form element that doesn’t have an easily constructed locator, +but its associated input label element does.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

2.5.3 - Interacting with web elements

A high-level instruction set for manipulating form controls.

There are only 5 basic commands that can be executed on an element:

Additional validations

These methods are designed to closely emulate a user’s experience, so, +Kotlin

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

2.5.3 - Interacting with web elements

A high-level instruction set for manipulating form controls.

There are only 5 basic commands that can be executed on an element:

Additional validations

These methods are designed to closely emulate a user’s experience, so, unlike the Actions API, it attempts to perform two things before attempting the specified action.

  1. If it determines the element is outside the viewport, it scrolls the element into view, specifically @@ -12617,7 +12638,7 @@ いかなる個人または団体に対しても責任も責任も負わないものとします。 ここに含まれる情報の使用に関して、特許責任は一切負いません。

    帰属

    Thanks to:

    Selenium メイン Repository

    -5319 commits
    +5320 commits
    3352 commits
    @@ -12909,9 +12930,9 @@ 538 commits
    -217 commits
    +219 commits
    -153 commits
    +154 commits
    134 commits
    @@ -13115,7 +13136,7 @@ 232 commits
    -119 commits
    +121 commits
    114 commits
    @@ -13167,6 +13188,8 @@ 6 commits
    +6 commits
    + 6 commits
    6 commits
    @@ -13183,8 +13206,6 @@ 5 commits
    -5 commits
    - 5 commits
    5 commits
    @@ -13261,10 +13282,10 @@ 2 commits
    +2 commits
    + 2 commits
    -2 commits
    - 2 commits
    2 commits
    @@ -13283,6 +13304,8 @@ 2 commits
    +2 commits
    + 2 commits
    2 commits
    @@ -13303,8 +13326,6 @@ 2 commits
    -2 commits
    - 2 commits

    Previous Selenium Website

    417 commits
    diff --git a/ja/documentation/about/_print/index.html b/ja/documentation/about/_print/index.html index 83919d9ed965..c0931e916d3c 100644 --- a/ja/documentation/about/_print/index.html +++ b/ja/documentation/about/_print/index.html @@ -30,7 +30,7 @@ いかなる個人または団体に対しても責任も責任も負わないものとします。 ここに含まれる情報の使用に関して、特許責任は一切負いません。

    帰属

    Thanks to:

    Selenium メイン Repository

    -5319 commits
    +5320 commits
    3352 commits
    @@ -322,9 +322,9 @@ 538 commits
    -217 commits
    +219 commits
    -153 commits
    +154 commits
    134 commits
    @@ -528,7 +528,7 @@ 232 commits
    -119 commits
    +121 commits
    114 commits
    @@ -580,6 +580,8 @@ 6 commits
    +6 commits
    + 6 commits
    6 commits
    @@ -596,8 +598,6 @@ 5 commits
    -5 commits
    - 5 commits
    5 commits
    @@ -674,10 +674,10 @@ 2 commits
    +2 commits
    + 2 commits
    -2 commits
    - 2 commits
    2 commits
    @@ -696,6 +696,8 @@ 2 commits
    +2 commits
    + 2 commits
    2 commits
    @@ -716,8 +718,6 @@ 2 commits
    -2 commits
    - 2 commits

    Previous Selenium Website

    417 commits
    diff --git a/ja/documentation/about/copyright/index.html b/ja/documentation/about/copyright/index.html index c20467e3cbc8..4afa01fc0a51 100644 --- a/ja/documentation/about/copyright/index.html +++ b/ja/documentation/about/copyright/index.html @@ -25,7 +25,7 @@ いかなる個人または団体に対しても責任も責任も負わないものとします。 ここに含まれる情報の使用に関して、特許責任は一切負いません。

    帰属

    Thanks to:

    Selenium メイン Repository

    -5319 commits
    +5320 commits
    3352 commits
    @@ -317,9 +317,9 @@ 538 commits
    -217 commits
    +219 commits
    -153 commits
    +154 commits
    134 commits
    @@ -523,7 +523,7 @@ 232 commits
    -119 commits
    +121 commits
    114 commits
    @@ -575,6 +575,8 @@ 6 commits
    +6 commits
    + 6 commits
    6 commits
    @@ -591,8 +593,6 @@ 5 commits
    -5 commits
    - 5 commits
    5 commits
    @@ -669,10 +669,10 @@ 2 commits
    +2 commits
    + 2 commits
    -2 commits
    - 2 commits
    2 commits
    @@ -691,6 +691,8 @@ 2 commits
    +2 commits
    + 2 commits
    2 commits
    @@ -711,8 +713,6 @@ 2 commits
    -2 commits
    - 2 commits

    Previous Selenium Website

    417 commits
    diff --git a/ja/documentation/webdriver/_print/index.html b/ja/documentation/webdriver/_print/index.html index e861044ad5b2..6f239a8b592a 100644 --- a/ja/documentation/webdriver/_print/index.html +++ b/ja/documentation/webdriver/_print/index.html @@ -2475,7 +2475,28 @@
        val driver = ChromeDriver()
     	val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
    -  

    相対ロケーター

    Selenium 4 introduces Relative Locators (previously +

    Utilizing Locators

    The FindElement makes using locators a breeze! For most languages, all you need to do is utilize webdriver.common.by.By, however in others it’s as simple as setting a parameter in the FindElement function>

    Move Code

        import org.openqa.selenium.By;
    +    WebDriver driver = new ChromeDriver();
    +	driver.findElement(By.className("information"));
    +  
        from selenium.webdriver.common.by import By
    +    driver = webdriver.Chrome()
    +	driver.find_element(By.CLASS_NAME, "information")
    +  
        var driver = new ChromeDriver();
    +	driver.FindElement(By.ClassName("information"));
    +  
        driver.find_element(class: 'information')
        let driver = await new Builder().forBrowser('chrome').build();
    +	const loc = await driver.findElement(By.className('information'));
    +  
    +
        import org.openqa.selenium.By
    +    val driver = ChromeDriver()
    +	val loc: WebElement = driver.findElement(By.className("information"))
    +  

    相対ロケーター

    Selenium 4 introduces Relative Locators (previously called as Friendly Locators). These locators are helpful when it is not easy to construct a locator for the desired element, but easy to describe spatially where the element is in relation to an element that does have an easily constructed locator.

    How it works

    Selenium uses the JavaScript function @@ -2483,55 +2504,55 @@ to determine the size and position of elements on the page, and can use this information to locate neighboring elements.
    find the relative elements.

    Relative locator methods can take as the argument for the point of origin, either a previously located element reference, or another locator. In these examples we’ll be using locators only, but you could swap the locator in the final method with an element object and it will work the same.

    Let us consider the below example for understanding the relative locators.

    Relative Locators

    Available relative locators

    Above

    If the email text field element is not easily identifiable for some reason, but the password text field element is, -we can locate the text field element using the fact that it is an “input” element “above” the password element.

    By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
    email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
    var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
          driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
    let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
    val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

    Below

    If the password text field element is not easily identifiable for some reason, but the email text field element is, -we can locate the text field element using the fact that it is an “input” element “below” the email element.

    By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
    password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
    var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
          driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
    let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
    val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

    Left of

    If the cancel button is not easily identifiable for some reason, but the submit button element is, -we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

    By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
    email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
    var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
          driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
    let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
    val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

    Below

    If the password text field element is not easily identifiable for some reason, but the email text field element is, +we can locate the text field element using the fact that it is an “input” element “below” the email element.

    By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
    cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
    var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
          driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
    let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
    val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

    Right of

    If the submit button is not easily identifiable for some reason, but the cancel button element is, -we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

    By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
    password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
    var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
          driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
    let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
    val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

    Left of

    If the cancel button is not easily identifiable for some reason, but the submit button element is, +we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

    By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
    submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
    var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
          driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
    let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
    val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

    Near

    If the relative positioning is not obvious, or it varies based on window size, you can use the near method to -identify an element that is at most 50px away from the provided locator. -One great use case for this is to work with a form element that doesn’t have an easily constructed locator, -but its associated input label element does.

    By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
    cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
    var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
          driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
    let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
    val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

    Right of

    If the submit button is not easily identifiable for some reason, but the cancel button element is, +we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

    By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
    email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
    var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
          driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
    let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
    val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

    Chaining relative locators

    You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

    By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
    submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
    var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
          driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
    let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
    val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

    Near

    If the relative positioning is not obvious, or it varies based on window size, you can use the near method to +identify an element that is at most 50px away from the provided locator. +One great use case for this is to work with a form element that doesn’t have an easily constructed locator, +but its associated input label element does.

    By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
    submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
    var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
          driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
    let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
    val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

5.3 - Interacting with web elements

A high-level instruction set for manipulating form controls.

There are only 5 basic commands that can be executed on an element:

Additional validations

These methods are designed to closely emulate a user’s experience, so, +Kotlin

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

5.3 - Interacting with web elements

A high-level instruction set for manipulating form controls.

There are only 5 basic commands that can be executed on an element:

Additional validations

These methods are designed to closely emulate a user’s experience, so, unlike the Actions API, it attempts to perform two things before attempting the specified action.

  1. If it determines the element is outside the viewport, it scrolls the element into view, specifically diff --git a/ja/documentation/webdriver/elements/_print/index.html b/ja/documentation/webdriver/elements/_print/index.html index c3e9460d8411..934baecb36a4 100644 --- a/ja/documentation/webdriver/elements/_print/index.html +++ b/ja/documentation/webdriver/elements/_print/index.html @@ -250,7 +250,28 @@
    val driver = ChromeDriver()
 	val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
-  

相対ロケーター

Selenium 4 introduces Relative Locators (previously +

Utilizing Locators

The FindElement makes using locators a breeze! For most languages, all you need to do is utilize webdriver.common.by.By, however in others it’s as simple as setting a parameter in the FindElement function>

Move Code

    import org.openqa.selenium.By;
+    WebDriver driver = new ChromeDriver();
+	driver.findElement(By.className("information"));
+  
    from selenium.webdriver.common.by import By
+    driver = webdriver.Chrome()
+	driver.find_element(By.CLASS_NAME, "information")
+  
    var driver = new ChromeDriver();
+	driver.FindElement(By.ClassName("information"));
+  
    driver.find_element(class: 'information')
    let driver = await new Builder().forBrowser('chrome').build();
+	const loc = await driver.findElement(By.className('information'));
+  
+
    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	val loc: WebElement = driver.findElement(By.className("information"))
+  

相対ロケーター

Selenium 4 introduces Relative Locators (previously called as Friendly Locators). These locators are helpful when it is not easy to construct a locator for the desired element, but easy to describe spatially where the element is in relation to an element that does have an easily constructed locator.

How it works

Selenium uses the JavaScript function @@ -258,55 +279,55 @@ to determine the size and position of elements on the page, and can use this information to locate neighboring elements.
find the relative elements.

Relative locator methods can take as the argument for the point of origin, either a previously located element reference, or another locator. In these examples we’ll be using locators only, but you could swap the locator in the final method with an element object and it will work the same.

Let us consider the below example for understanding the relative locators.

Relative Locators

Available relative locators

Above

If the email text field element is not easily identifiable for some reason, but the password text field element is, -we can locate the text field element using the fact that it is an “input” element “above” the password element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, -we can locate the text field element using the fact that it is an “input” element “below” the email element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, -we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, +we can locate the text field element using the fact that it is an “input” element “below” the email element.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, -we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, +we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to -identify an element that is at most 50px away from the provided locator. -One great use case for this is to work with a form element that doesn’t have an easily constructed locator, -but its associated input label element does.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, +we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to +identify an element that is at most 50px away from the provided locator. +One great use case for this is to work with a form element that doesn’t have an easily constructed locator, +but its associated input label element does.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

3 - Interacting with web elements

A high-level instruction set for manipulating form controls.

There are only 5 basic commands that can be executed on an element:

Additional validations

These methods are designed to closely emulate a user’s experience, so, +Kotlin

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

3 - Interacting with web elements

A high-level instruction set for manipulating form controls.

There are only 5 basic commands that can be executed on an element:

Additional validations

These methods are designed to closely emulate a user’s experience, so, unlike the Actions API, it attempts to perform two things before attempting the specified action.

  1. If it determines the element is outside the viewport, it scrolls the element into view, specifically diff --git a/ja/documentation/webdriver/elements/locators/index.html b/ja/documentation/webdriver/elements/locators/index.html index 0498b925c1b5..b5067aeda86d 100644 --- a/ja/documentation/webdriver/elements/locators/index.html +++ b/ja/documentation/webdriver/elements/locators/index.html @@ -1,7 +1,7 @@ 要素を探す | Selenium

要素を探す

DOM内の1つ以上の特定の要素を識別する方法

ロケーターは、ページ上の要素を識別する方法です。 これは、検索要素 メソッドに渡される引数です。

検出方法とは別にロケーターを宣言するタイミングと理由など、 + セクション全体を印刷



要素を探す

DOM内の1つ以上の特定の要素を識別する方法

ロケーターは、ページ上の要素を識別する方法です。 これは、検索要素 メソッドに渡される引数です。

検出方法とは別にロケーターを宣言するタイミングと理由など、 ロケーターに関するヒントについては、 推奨されるテストプラクティス を確認してください。

要素選択の方法

WebDriverには標準のロケータが8種類あります。

ロケータ詳細
class nameclass名に値を含む要素を探す (複合クラス名は使えない)
css selectorCSSセレクタが一致する要素を探す
idid属性が一致する要素を探す
namename属性が一致する要素を探す
link texta要素のテキストが一致する要素を探す
partial link texta要素のテキストが部分一致する要素を探す
tag nameタグ名が一致する要素を探す
xpathXPathと一致する要素を探す

Creating Locators

To work on a web element using Selenium, we need to first locate it on the web page. Selenium provides us above mentioned ways, using which we can locate element on the @@ -214,7 +214,28 @@

    val driver = ChromeDriver()
 	val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
-  

相対ロケーター

Selenium 4 introduces Relative Locators (previously +

Utilizing Locators

The FindElement makes using locators a breeze! For most languages, all you need to do is utilize webdriver.common.by.By, however in others it’s as simple as setting a parameter in the FindElement function>

Move Code

    import org.openqa.selenium.By;
+    WebDriver driver = new ChromeDriver();
+	driver.findElement(By.className("information"));
+  
    from selenium.webdriver.common.by import By
+    driver = webdriver.Chrome()
+	driver.find_element(By.CLASS_NAME, "information")
+  
    var driver = new ChromeDriver();
+	driver.FindElement(By.ClassName("information"));
+  
    driver.find_element(class: 'information')
    let driver = await new Builder().forBrowser('chrome').build();
+	const loc = await driver.findElement(By.className('information'));
+  
+
    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	val loc: WebElement = driver.findElement(By.className("information"))
+  

相対ロケーター

Selenium 4 introduces Relative Locators (previously called as Friendly Locators). These locators are helpful when it is not easy to construct a locator for the desired element, but easy to describe spatially where the element is in relation to an element that does have an easily constructed locator.

How it works

Selenium uses the JavaScript function @@ -222,53 +243,53 @@ to determine the size and position of elements on the page, and can use this information to locate neighboring elements.
find the relative elements.

Relative locator methods can take as the argument for the point of origin, either a previously located element reference, or another locator. In these examples we’ll be using locators only, but you could swap the locator in the final method with an element object and it will work the same.

Let us consider the below example for understanding the relative locators.

Relative Locators

Available relative locators

Above

If the email text field element is not easily identifiable for some reason, but the password text field element is, -we can locate the text field element using the fact that it is an “input” element “above” the password element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, -we can locate the text field element using the fact that it is an “input” element “below” the email element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, -we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, +we can locate the text field element using the fact that it is an “input” element “below” the email element.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, -we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, +we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to -identify an element that is at most 50px away from the provided locator. -One great use case for this is to work with a form element that doesn’t have an easily constructed locator, -but its associated input label element does.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, +we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to +identify an element that is at most 50px away from the provided locator. +One great use case for this is to work with a form element that doesn’t have an easily constructed locator, +but its associated input label element does.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))
最終更新 June 23, 2024: Move an update locators examples for ruby (#1773)[deploy site] (c3745ec3784)

Development Partners

Selenium Level Sponsors

Support the Selenium Project

Learn more or view the full list of sponsors.

Learn more +Kotlin

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

Development Partners

Selenium Level Sponsors

Support the Selenium Project

Learn more or view the full list of sponsors.

\ No newline at end of file diff --git a/ja/index.xml b/ja/index.xml index 4bf46c69a67c..aec5e5f8ec1a 100644 --- a/ja/index.xml +++ b/ja/index.xml @@ -75,7 +75,7 @@ java -jar selenium-server-&lt;version&gt;.jar info sessionmap OpenTeleme java -jar selenium-server-&lt;version&gt;.jar info tracing SeleniumGrid コマンドを一覧表示する java -jar selenium-server-&lt;version&gt;.jar --config-help 使用可能なすべてのコマンドとそれぞれの説明が表示されます。 コンポーネントヘルプコマンド Selenium ロールの後に–help config オプションを渡して、コンポーネント固有の構成情報を取得します。 スタンドアロン java -jar selenium-server-&lt;version&gt;.jar standalone --help ハブ java -jar selenium-server-&lt;version&gt;.著作権と帰属https://www.selenium.dev/ja/documentation/about/copyright/Mon, 01 Jan 0001 00:00:00 +0000https://www.selenium.dev/ja/documentation/about/copyright/Page being translated from English to Japanese. Do you speak Japanese? Help us to translate it by sending us pull requests! Seleniumのドキュメント このドキュメントをできるだけ完全かつ正確にするためにあらゆる努力が払われましたが、 保証または適合性は暗示されていません。 提供される情報は「現状のまま」です。 著者および出版社は、本書に含まれる情報から生じる損失または損害に関して、 いかなる個人または団体に対しても責任も責任も負わないものとします。 ここに含まれる情報の使用に関して、特許責任は一切負いません。 -帰属 Thanks to: Selenium メイン Repository @shs96c 5319 commits @barancev 3352 commits @jimevans 2478 commits @titusfortner 1592 commits @jleyba 1464 commits @jarib 1299 commits @diemol 1235 commits @AutomatedTester 1223 commits @dfabulich 1175 commits @illicitonion 1162 commits @p0deje 652 commits @lukeis 599 commits @pujagani 504 commits @eranmes 473 commits @mdub 326 commits @bonigarcia 299 commits @andreastt 289 commits @krosenvold 225 commits @hugs 205 commits @symonk 203 commits @davehunt 200 commits @hbchai 191 commits @harsha509 191 commits @lmtierney 179 commits @joerg1985 164 commits @freynaud 138 commits @samitbadle 137 commits @nirvdrum 133 commits @sevaseva 115 commits @gigix 109 commits @juangj 108 commits @nvborisenko 106 commits @selenium-ci 99 commits @aslakhellesoy 94 commits @alex-savchuk 90 commits @dependabot[bot] 84 commits @andrashatvani 66 commits @ajayk 63 commits @twalpole 49 commits @asashour 48 commits @mikemelia 46 commits @tebeka 44 commits @luke-hill 42 commits @raju249 42 commits @santiycr 41 commits @valfirst 40 commits @renovate[bot] 39 commits @sandeepsuryaprasad 37 commits @mach6 36 commits @ddavison 32 commits @joshbruning 30 commits @TamsilAmani 29 commits @mikebroberts 28 commits @JohnChen0 27 commits @iampopovich 25 commits @krmahadevan 25 commits @alb-i986 22 commits @bret 20 commits @cgoldberg 20 commits @corevo 20 commits @Stuk 19 commits @rbri 16 commits @bwalderman 15 commits @VietND96 15 commits @aguspe 14 commits @asolntsev 14 commits @manuelsblanco 13 commits @bayandin 12 commits @carlosgcampos 12 commits @jayakumarc 12 commits @potapovDim 12 commits @43081j 11 commits @detro 10 commits @sbabcoc 10 commits @josephg 10 commits @RustyNail 9 commits @hoefling 9 commits @redsquirrel 9 commits @whimboo 9 commits @isaulv 9 commits @mdmintz 9 commits @mmerrell 8 commits @glibas 7 commits @SinghHrmn 7 commits @llaskin 7 commits @DrMarcII 7 commits @RevealOscar 7 commits @User253489 7 commits @dratler 7 commits @shucon 6 commits @nikolas 6 commits @lauromoura 6 commits @dima-groupon 6 commits @adiohana 5 commits @oddui 5 commits @seanpoulter 5 commits @nschonni 5 commits @JohanLorenzo 5 commits @jimvm 5 commits @jameshilliard 5 commits Selenium IDE @corevo 2445 commits @toddtarsi 396 commits @baimao8437 88 commits @coinzdude 57 commits @Jongkeun 51 commits @petermouse 36 commits @zavelevsky 34 commits @dependabot[bot] 29 commits @LinYunWen 28 commits @xdennisx 15 commits @AutomatedTester 15 commits @smildlzj 12 commits @raju249 12 commits @diemol 7 commits @matewilk 6 commits @manoj9788 3 commits @Rowdster 3 commits @fernandozw 3 commits @mattonem 3 commits @zewa666 3 commits @shs96c 3 commits @toshiya 2 commits @mrgamedev07 2 commits @Meir017 2 commits @lukeis 2 commits @giuliohome 2 commits @cclauss 2 commits @Angus3280 2 commits @peter-lyons-kehl 1 commits @newgenrpa 1 commits @bolasblack 1 commits @vivrichards600 1 commits @swes1117 1 commits @harsha509 1 commits @samitbadle 1 commits @sotayamashita 1 commits @p2635 1 commits @marknoble 1 commits @furkanakkurt1335 1 commits @dvd900 1 commits @cliftonHPE 1 commits @atkulp 1 commits @aplorenzen 1 commits @amitzur 1 commits @AlexGarrity 1 commits Docker Selenium @diemol 538 commits @VietND96 217 commits @selenium-ci 153 commits @ddavison 134 commits @mtscout6 53 commits @renovate[bot] 50 commits @kayabendroth 50 commits @dependabot[bot] 42 commits @elgalu 24 commits @luisfcorreia 15 commits @jamesmortensen 12 commits @WillAbides 8 commits @amardeep2006 7 commits @jsa34 7 commits @MacCracken 5 commits @marten-cz 5 commits @garagepoort 4 commits @metajiji 4 commits @Doofus100500 4 commits @manoj9788 4 commits @ZainabSalameh 4 commits @niQo 4 commits @testphreak 4 commits @chenrui333 4 commits @jeff-jk 3 commits @pabloFuente 3 commits @alexgibson 3 commits @tnguyen14 3 commits @abaldwin-op 3 commits @mtcolman 3 commits @Remi-p 3 commits @msvticket 3 commits @chuckg 2 commits @mhnaeem 2 commits @naveensrinivasan 2 commits @phensley 2 commits @anthonybaldwin 2 commits @ryneeverett 2 commits @wheleph 2 commits @Opvolger 2 commits @budtmo 2 commits @SurelyMario 2 commits @schmunk42 2 commits @kmala 2 commits @evertones 2 commits @baflQA 2 commits @davehunt 2 commits @ilpianista 2 commits @den-is 2 commits @therealdjryan 2 commits @adriangonciarz 2 commits @AutomationD 2 commits @maxmanuylov 2 commits @mathieu-pousse 2 commits @joaoluizjoaquim 2 commits @DrFaust92 2 commits @glibas 2 commits @efranken 2 commits @ehbello 2 commits @Earlopain 2 commits @victor-catalyst 1 commits @trungprivate 1 commits @VinodAnandan 1 commits @Trigtrig 1 commits @vv-p 1 commits @slhck 1 commits @wesmcouch 1 commits @torstenwalter 1 commits @cvakiitho 1 commits @williamlac 1 commits @schmetzyannick 1 commits @nefelim4ag 1 commits @tparikkaatmilliman 1 commits @ThomasMeschke 1 commits @graingert 1 commits @gitter-badger 1 commits @Thab310 1 commits @tadashi0713 1 commits @sylbn 1 commits @subanithak 1 commits @stigkj 1 commits @srguglielmo 1 commits @serlank 1 commits @simonardejr 1 commits @smccarthy-godaddy 1 commits @smccarthy 1 commits @sethuster 1 commits @StegSchreck 1 commits @scottturley 1 commits @mirkotschaeni 1 commits @mkrei 1 commits @neben 1 commits @neilnaveen 1 commits @nom3ad 1 commits @oleg-filiutsich 1 commits @other019 1 commits @ptriller1und1 1 commits @pujan14 1 commits @qxo 1 commits @rklec 1 commits Selenium Website &amp; Docs @harsha509 753 commits @diemol 746 commits @selenium-ci 323 commits @titusfortner 232 commits @renovate[bot] 119 commits @alaahong 114 commits @pujagani 74 commits @kzhirata 47 commits @bonigarcia 37 commits @boris779 32 commits @AutomatedTester 30 commits @pallavigitwork 28 commits @alenros 28 commits @AlexAndradeNet 25 commits @aguspe 25 commits @manoj9788 21 commits @dependabot[bot] 20 commits @jmartinezpoq 18 commits @ivanrodjr 17 commits @luisfcorreia 15 commits @shs96c 13 commits @github-actions[bot] 12 commits @sindhudiddi 12 commits @hiroksarker 10 commits @nwintop 8 commits @testbot206 7 commits @krmahadevan 7 commits @tetration 7 commits @connerT 6 commits @Greavox 6 commits @nvborisenko 6 commits @liushilive 6 commits @fufu930 6 commits @Catalin-Negru 5 commits @davieduardo94 5 commits @smilinrobin 5 commits @lvninety 5 commits @hyanx 5 commits @TamsilAmani 5 commits @shbenzer 5 commits @nainappa 5 commits @Dor-bl 5 commits @deining 4 commits @nevinaydin 4 commits @ant9112 4 commits @VietND96 4 commits @peter-kinzelman 4 commits @kathyrollo 4 commits @kjayachandra2000 4 commits @wcmcgee 4 commits @barancev 4 commits @angelovstanton 4 commits @Tolerblanc 3 commits @BlazerYoo 3 commits @twinstae 3 commits @cambiph 3 commits @TestOpsCloudchen 3 commits @takeyaqa 3 commits @raju249 3 commits @rajeevbarde 3 commits @Madh93 3 commits @mmerrell 3 commits @j3soon 3 commits @jasonren0403 3 commits @jamesmortensen 3 commits @jags14385 3 commits @effeix 3 commits @gnatcatcher-bg 3 commits @ArCiGo 3 commits @Crank4098 3 commits @Arc-Jung 3 commits @ilhanoztozlu 2 commits @eaccmk 2 commits @digitalvoice-nz 2 commits @YoshikiIto 2 commits @sridhar-5 2 commits @urig 2 commits @SparshKesari 2 commits @sangcnguyen 2 commits @Arpan3323 2 commits @coodjokergl 2 commits @sangheon4353 2 commits @selectorshubsanjay 2 commits @SripriyaPKulkarni 2 commits @GavinHaydy 2 commits @imba-tjd 2 commits @k19810703 2 commits @0420syj 2 commits @TheTestLynx 2 commits @beatfactor 2 commits @Afranioalves 2 commits @iambocai 2 commits @Bredda 2 commits @cjayswal 2 commits @bongosway 2 commits @SinghHrmn 2 commits @kapilyadav1204 2 commits @rahuljhakant 2 commits @natanportilho 2 commits @naeemakram 2 commits Previous Selenium Website @lukeis 417 commits @shs96c 87 commits @pgrandje 79 commits @barancev 63 commits @lightbody 59 commits @ajayk 40 commits @tarun3kumar 40 commits @ddavison 36 commits @davehunt 26 commits @manoj9788 24 commits @peter-lyons-kehl 22 commits @lmtierney 21 commits @samitbadle 21 commits @santiycr 19 commits @illicitonion 17 commits @pnewhook 14 commits @AutomatedTester 12 commits @rasmusbergpalm 11 commits @juangj 11 commits @lukeis-sfdc 10 commits @andreastt 7 commits @hugs 6 commits @corevo 5 commits @titusfortner 5 commits @PaulKC 5 commits @llaskin 5 commits @jimevans 5 commits @jarib 5 commits @diemol 3 commits @abhijain2618 2 commits @labkey-tchad 2 commits @paul-hammant 2 commits @mikemelia 2 commits @julianharty 2 commits @hazmeister 2 commits @eranmes 2 commits @darrincherry 2 commits @javabrett 2 commits @alex-savchuk 2 commits @oleksandr-lobunets 2 commits @asashour 2 commits @yasinguzel 1 commits @Vimal-N 1 commits @SteveDesmond-ca 1 commits @harrissAvalon 1 commits @smatei 1 commits @QuinnWilton 1 commits @roydekleijn 1 commits @rbri 1 commits @oifland 1 commits @ohadschn 1 commits @NickAb 1 commits @tobecrazy 1 commits @Zearin 1 commits @beckendorff 1 commits @daveOrleans 1 commits @androiddriver 1 commits @mauk81 1 commits @prab2112 1 commits @refactoror 1 commits @rogerdc 1 commits @tibord 1 commits @ygmarchi 1 commits @agabrys 1 commits @azawawi 1 commits @alb-i986 1 commits @hollingsworthd 1 commits @dylans 1 commits @EmidioStani 1 commits @FagnerMartinsBrack 1 commits @Xaeroxe 1 commits @JamesZoft 1 commits @jleyba 1 commits @JustAGuyTryingToCodeSomething 1 commits @kdamball 1 commits @laurinkeithdavis 1 commits @klamping 1 commits @krmahadevan 1 commits @krosenvold 1 commits @mmerrell 1 commits @grawk 1 commits @mcavigelli 1 commits @michaelwowro 1 commits @muralidharand 1 commits @meeroslaph 1 commits Previous Documentation Rewrite Project @andreastt 197 commits @selenium-ci 105 commits @diemol 54 commits @hazmeister 30 commits @santiycr 27 commits @AlexAndradeNet 25 commits @lukeis 21 commits @harsha509 17 commits @ddavison 16 commits @djangofan 12 commits @orieken 12 commits @manoj9788 12 commits @davehunt 12 commits @liushilive 8 commits @User253489 7 commits @shs96c 6 commits @mmerrell 6 commits @imba-tjd 6 commits @jimholmes 6 commits @vijay44 5 commits @cambiph 5 commits @NickOppersdorff 4 commits @rivlinp 4 commits @sheg 4 commits @bizob2828 4 commits @detro 3 commits @Ardesco 3 commits @TheTestLynx 3 commits @paul-barton 2 commits @ilhanoztozlu 2 commits @hoanluu 2 commits @sri85 2 commits @miekof 2 commits @palotas 2 commits @lmtierney 2 commits @Bredda 2 commits @boris779 2 commits @rakib-amin 1 commits @NRezek 1 commits @nikai3d 1 commits @OndraM 1 commits @sourabhkt 1 commits @whhone 1 commits @yarix 1 commits @ZbigniewZabost 1 commits @agmen 1 commits @hking-shutterfly 1 commits @jimevans 1 commits @948462448 1 commits @marilyn 1 commits @riccione 1 commits @tungla 1 commits @zeljkofilipin 1 commits @MilanMasek 1 commits @misiekofski 1 commits @michael-coleman 1 commits @MartinDelille 1 commits @austenjt 1 commits @nicegraham 1 commits @bongosway 1 commits @donhuvy 1 commits @dennybiasiolli 1 commits @chamiz 1 commits @bhardin 1 commits @abotalov 1 commits @AJ-72 1 commits @p0deje 1 commits @alenros 1 commits @adithyab94 1 commits Seleniumドキュメントプロジェクトで使用されるサードパーティソフトウェア Software Version License Hugo v0.要素を探すhttps://www.selenium.dev/ja/documentation/webdriver/elements/locators/Mon, 01 Jan 0001 00:00:00 +0000https://www.selenium.dev/ja/documentation/webdriver/elements/locators/ロケーターは、ページ上の要素を識別する方法です。 これは、検索要素 メソッドに渡される引数です。 +帰属 Thanks to: Selenium メイン Repository @shs96c 5320 commits @barancev 3352 commits @jimevans 2478 commits @titusfortner 1592 commits @jleyba 1464 commits @jarib 1299 commits @diemol 1235 commits @AutomatedTester 1223 commits @dfabulich 1175 commits @illicitonion 1162 commits @p0deje 652 commits @lukeis 599 commits @pujagani 504 commits @eranmes 473 commits @mdub 326 commits @bonigarcia 299 commits @andreastt 289 commits @krosenvold 225 commits @hugs 205 commits @symonk 203 commits @davehunt 200 commits @hbchai 191 commits @harsha509 191 commits @lmtierney 179 commits @joerg1985 164 commits @freynaud 138 commits @samitbadle 137 commits @nirvdrum 133 commits @sevaseva 115 commits @gigix 109 commits @juangj 108 commits @nvborisenko 106 commits @selenium-ci 99 commits @aslakhellesoy 94 commits @alex-savchuk 90 commits @dependabot[bot] 84 commits @andrashatvani 66 commits @ajayk 63 commits @twalpole 49 commits @asashour 48 commits @mikemelia 46 commits @tebeka 44 commits @luke-hill 42 commits @raju249 42 commits @santiycr 41 commits @valfirst 40 commits @renovate[bot] 39 commits @sandeepsuryaprasad 37 commits @mach6 36 commits @ddavison 32 commits @joshbruning 30 commits @TamsilAmani 29 commits @mikebroberts 28 commits @JohnChen0 27 commits @iampopovich 25 commits @krmahadevan 25 commits @alb-i986 22 commits @bret 20 commits @cgoldberg 20 commits @corevo 20 commits @Stuk 19 commits @rbri 16 commits @bwalderman 15 commits @VietND96 15 commits @aguspe 14 commits @asolntsev 14 commits @manuelsblanco 13 commits @bayandin 12 commits @carlosgcampos 12 commits @jayakumarc 12 commits @potapovDim 12 commits @43081j 11 commits @detro 10 commits @sbabcoc 10 commits @josephg 10 commits @RustyNail 9 commits @hoefling 9 commits @redsquirrel 9 commits @whimboo 9 commits @isaulv 9 commits @mdmintz 9 commits @mmerrell 8 commits @glibas 7 commits @SinghHrmn 7 commits @llaskin 7 commits @DrMarcII 7 commits @RevealOscar 7 commits @User253489 7 commits @dratler 7 commits @shucon 6 commits @nikolas 6 commits @lauromoura 6 commits @dima-groupon 6 commits @adiohana 5 commits @oddui 5 commits @seanpoulter 5 commits @nschonni 5 commits @JohanLorenzo 5 commits @jimvm 5 commits @jameshilliard 5 commits Selenium IDE @corevo 2445 commits @toddtarsi 396 commits @baimao8437 88 commits @coinzdude 57 commits @Jongkeun 51 commits @petermouse 36 commits @zavelevsky 34 commits @dependabot[bot] 29 commits @LinYunWen 28 commits @xdennisx 15 commits @AutomatedTester 15 commits @smildlzj 12 commits @raju249 12 commits @diemol 7 commits @matewilk 6 commits @manoj9788 3 commits @Rowdster 3 commits @fernandozw 3 commits @mattonem 3 commits @zewa666 3 commits @shs96c 3 commits @toshiya 2 commits @mrgamedev07 2 commits @Meir017 2 commits @lukeis 2 commits @giuliohome 2 commits @cclauss 2 commits @Angus3280 2 commits @peter-lyons-kehl 1 commits @newgenrpa 1 commits @bolasblack 1 commits @vivrichards600 1 commits @swes1117 1 commits @harsha509 1 commits @samitbadle 1 commits @sotayamashita 1 commits @p2635 1 commits @marknoble 1 commits @furkanakkurt1335 1 commits @dvd900 1 commits @cliftonHPE 1 commits @atkulp 1 commits @aplorenzen 1 commits @amitzur 1 commits @AlexGarrity 1 commits Docker Selenium @diemol 538 commits @VietND96 219 commits @selenium-ci 154 commits @ddavison 134 commits @mtscout6 53 commits @renovate[bot] 50 commits @kayabendroth 50 commits @dependabot[bot] 42 commits @elgalu 24 commits @luisfcorreia 15 commits @jamesmortensen 12 commits @WillAbides 8 commits @amardeep2006 7 commits @jsa34 7 commits @MacCracken 5 commits @marten-cz 5 commits @garagepoort 4 commits @metajiji 4 commits @Doofus100500 4 commits @manoj9788 4 commits @ZainabSalameh 4 commits @niQo 4 commits @testphreak 4 commits @chenrui333 4 commits @jeff-jk 3 commits @pabloFuente 3 commits @alexgibson 3 commits @tnguyen14 3 commits @abaldwin-op 3 commits @mtcolman 3 commits @Remi-p 3 commits @msvticket 3 commits @chuckg 2 commits @mhnaeem 2 commits @naveensrinivasan 2 commits @phensley 2 commits @anthonybaldwin 2 commits @ryneeverett 2 commits @wheleph 2 commits @Opvolger 2 commits @budtmo 2 commits @SurelyMario 2 commits @schmunk42 2 commits @kmala 2 commits @evertones 2 commits @baflQA 2 commits @davehunt 2 commits @ilpianista 2 commits @den-is 2 commits @therealdjryan 2 commits @adriangonciarz 2 commits @AutomationD 2 commits @maxmanuylov 2 commits @mathieu-pousse 2 commits @joaoluizjoaquim 2 commits @DrFaust92 2 commits @glibas 2 commits @efranken 2 commits @ehbello 2 commits @Earlopain 2 commits @victor-catalyst 1 commits @trungprivate 1 commits @VinodAnandan 1 commits @Trigtrig 1 commits @vv-p 1 commits @slhck 1 commits @wesmcouch 1 commits @torstenwalter 1 commits @cvakiitho 1 commits @williamlac 1 commits @schmetzyannick 1 commits @nefelim4ag 1 commits @tparikkaatmilliman 1 commits @ThomasMeschke 1 commits @graingert 1 commits @gitter-badger 1 commits @Thab310 1 commits @tadashi0713 1 commits @sylbn 1 commits @subanithak 1 commits @stigkj 1 commits @srguglielmo 1 commits @serlank 1 commits @simonardejr 1 commits @smccarthy-godaddy 1 commits @smccarthy 1 commits @sethuster 1 commits @StegSchreck 1 commits @scottturley 1 commits @mirkotschaeni 1 commits @mkrei 1 commits @neben 1 commits @neilnaveen 1 commits @nom3ad 1 commits @oleg-filiutsich 1 commits @other019 1 commits @ptriller1und1 1 commits @pujan14 1 commits @qxo 1 commits @rklec 1 commits Selenium Website &amp; Docs @harsha509 753 commits @diemol 746 commits @selenium-ci 323 commits @titusfortner 232 commits @renovate[bot] 121 commits @alaahong 114 commits @pujagani 74 commits @kzhirata 47 commits @bonigarcia 37 commits @boris779 32 commits @AutomatedTester 30 commits @pallavigitwork 28 commits @alenros 28 commits @AlexAndradeNet 25 commits @aguspe 25 commits @manoj9788 21 commits @dependabot[bot] 20 commits @jmartinezpoq 18 commits @ivanrodjr 17 commits @luisfcorreia 15 commits @shs96c 13 commits @github-actions[bot] 12 commits @sindhudiddi 12 commits @hiroksarker 10 commits @nwintop 8 commits @testbot206 7 commits @krmahadevan 7 commits @tetration 7 commits @connerT 6 commits @Greavox 6 commits @nvborisenko 6 commits @shbenzer 6 commits @liushilive 6 commits @fufu930 6 commits @Catalin-Negru 5 commits @davieduardo94 5 commits @smilinrobin 5 commits @lvninety 5 commits @hyanx 5 commits @TamsilAmani 5 commits @nainappa 5 commits @Dor-bl 5 commits @deining 4 commits @nevinaydin 4 commits @ant9112 4 commits @VietND96 4 commits @peter-kinzelman 4 commits @kathyrollo 4 commits @kjayachandra2000 4 commits @wcmcgee 4 commits @barancev 4 commits @angelovstanton 4 commits @Tolerblanc 3 commits @BlazerYoo 3 commits @twinstae 3 commits @cambiph 3 commits @TestOpsCloudchen 3 commits @takeyaqa 3 commits @raju249 3 commits @rajeevbarde 3 commits @Madh93 3 commits @mmerrell 3 commits @j3soon 3 commits @jasonren0403 3 commits @jamesmortensen 3 commits @jags14385 3 commits @effeix 3 commits @gnatcatcher-bg 3 commits @ArCiGo 3 commits @Crank4098 3 commits @Arc-Jung 3 commits @ilhanoztozlu 2 commits @eaccmk 2 commits @digitalvoice-nz 2 commits @YoshikiIto 2 commits @sridhar-5 2 commits @urig 2 commits @SparshKesari 2 commits @sbabcoc 2 commits @sangcnguyen 2 commits @coodjokergl 2 commits @sangheon4353 2 commits @selectorshubsanjay 2 commits @SripriyaPKulkarni 2 commits @GavinHaydy 2 commits @imba-tjd 2 commits @k19810703 2 commits @0420syj 2 commits @TheTestLynx 2 commits @Arpan3323 2 commits @beatfactor 2 commits @Afranioalves 2 commits @iambocai 2 commits @Bredda 2 commits @cjayswal 2 commits @bongosway 2 commits @SinghHrmn 2 commits @kapilyadav1204 2 commits @rahuljhakant 2 commits @natanportilho 2 commits Previous Selenium Website @lukeis 417 commits @shs96c 87 commits @pgrandje 79 commits @barancev 63 commits @lightbody 59 commits @ajayk 40 commits @tarun3kumar 40 commits @ddavison 36 commits @davehunt 26 commits @manoj9788 24 commits @peter-lyons-kehl 22 commits @lmtierney 21 commits @samitbadle 21 commits @santiycr 19 commits @illicitonion 17 commits @pnewhook 14 commits @AutomatedTester 12 commits @rasmusbergpalm 11 commits @juangj 11 commits @lukeis-sfdc 10 commits @andreastt 7 commits @hugs 6 commits @corevo 5 commits @titusfortner 5 commits @PaulKC 5 commits @llaskin 5 commits @jimevans 5 commits @jarib 5 commits @diemol 3 commits @abhijain2618 2 commits @labkey-tchad 2 commits @paul-hammant 2 commits @mikemelia 2 commits @julianharty 2 commits @hazmeister 2 commits @eranmes 2 commits @darrincherry 2 commits @javabrett 2 commits @alex-savchuk 2 commits @oleksandr-lobunets 2 commits @asashour 2 commits @yasinguzel 1 commits @Vimal-N 1 commits @SteveDesmond-ca 1 commits @harrissAvalon 1 commits @smatei 1 commits @QuinnWilton 1 commits @roydekleijn 1 commits @rbri 1 commits @oifland 1 commits @ohadschn 1 commits @NickAb 1 commits @tobecrazy 1 commits @Zearin 1 commits @beckendorff 1 commits @daveOrleans 1 commits @androiddriver 1 commits @mauk81 1 commits @prab2112 1 commits @refactoror 1 commits @rogerdc 1 commits @tibord 1 commits @ygmarchi 1 commits @agabrys 1 commits @azawawi 1 commits @alb-i986 1 commits @hollingsworthd 1 commits @dylans 1 commits @EmidioStani 1 commits @FagnerMartinsBrack 1 commits @Xaeroxe 1 commits @JamesZoft 1 commits @jleyba 1 commits @JustAGuyTryingToCodeSomething 1 commits @kdamball 1 commits @laurinkeithdavis 1 commits @klamping 1 commits @krmahadevan 1 commits @krosenvold 1 commits @mmerrell 1 commits @grawk 1 commits @mcavigelli 1 commits @michaelwowro 1 commits @muralidharand 1 commits @meeroslaph 1 commits Previous Documentation Rewrite Project @andreastt 197 commits @selenium-ci 105 commits @diemol 54 commits @hazmeister 30 commits @santiycr 27 commits @AlexAndradeNet 25 commits @lukeis 21 commits @harsha509 17 commits @ddavison 16 commits @djangofan 12 commits @orieken 12 commits @manoj9788 12 commits @davehunt 12 commits @liushilive 8 commits @User253489 7 commits @shs96c 6 commits @mmerrell 6 commits @imba-tjd 6 commits @jimholmes 6 commits @vijay44 5 commits @cambiph 5 commits @NickOppersdorff 4 commits @rivlinp 4 commits @sheg 4 commits @bizob2828 4 commits @detro 3 commits @Ardesco 3 commits @TheTestLynx 3 commits @paul-barton 2 commits @ilhanoztozlu 2 commits @hoanluu 2 commits @sri85 2 commits @miekof 2 commits @palotas 2 commits @lmtierney 2 commits @Bredda 2 commits @boris779 2 commits @rakib-amin 1 commits @NRezek 1 commits @nikai3d 1 commits @OndraM 1 commits @sourabhkt 1 commits @whhone 1 commits @yarix 1 commits @ZbigniewZabost 1 commits @agmen 1 commits @hking-shutterfly 1 commits @jimevans 1 commits @948462448 1 commits @marilyn 1 commits @riccione 1 commits @tungla 1 commits @zeljkofilipin 1 commits @MilanMasek 1 commits @misiekofski 1 commits @michael-coleman 1 commits @MartinDelille 1 commits @austenjt 1 commits @nicegraham 1 commits @bongosway 1 commits @donhuvy 1 commits @dennybiasiolli 1 commits @chamiz 1 commits @bhardin 1 commits @abotalov 1 commits @AJ-72 1 commits @p0deje 1 commits @alenros 1 commits @adithyab94 1 commits Seleniumドキュメントプロジェクトで使用されるサードパーティソフトウェア Software Version License Hugo v0.要素を探すhttps://www.selenium.dev/ja/documentation/webdriver/elements/locators/Mon, 01 Jan 0001 00:00:00 +0000https://www.selenium.dev/ja/documentation/webdriver/elements/locators/ロケーターは、ページ上の要素を識別する方法です。 これは、検索要素 メソッドに渡される引数です。 検出方法とは別にロケーターを宣言するタイミングと理由など、 ロケーターに関するヒントについては、 推奨されるテストプラクティス を確認してください。 要素選択の方法 WebDriverには標準のロケータが8種類あります。 ロケータ 詳細 class name class名に値を含む要素を探す (複合クラス名は使えない) css selector CSSセレクタが一致する要素を探す id id属性が一致する要素を探す name name属性が一致する要素を探す link text a要素のテキストが一致する要素を探す partial link text a要素のテキストが部分一致する要素を探す tag name タグ名が一致する要素を探す xpath XPathと一致する要素を探す Creating Locators To work on a web element using Selenium, we need to first locate it on the web page. Selenium provides us above mentioned ways, using which we can locate element on the page. To understand and create locator we will use the following HTML snippet.Selenium GridのCLI オプションhttps://www.selenium.dev/ja/documentation/grid/configuration/cli_options/Mon, 01 Jan 0001 00:00:00 +0000https://www.selenium.dev/ja/documentation/grid/configuration/cli_options/Grid の設定には、さまざまなセクションが用意されています。 各セクションには、コマンドライン引数で設定可能なオプションがあります。コマンドライン引数で設定できます。 diff --git a/ja/sitemap.xml b/ja/sitemap.xml index bd7a920a0344..a62d4a0d9c90 100644 --- a/ja/sitemap.xml +++ b/ja/sitemap.xml @@ -1 +1 @@ -https://www.selenium.dev/ja/documentation/webdriver/bidi/w3c/browsing_context/2024-08-04T20:33:33+05:30https://www.selenium.dev/ja/documentation/webdriver/bidi/w3c/input/2024-08-04T20:33:33+05:30https://www.selenium.dev/ja/documentation/test_practices/discouraged/captchas/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/support_features/expected_conditions/2023-11-17T04:17:19-06:00https://www.selenium.dev/ja/documentation/webdriver/elements/file_upload/2023-11-17T04:17:19-06:00https://www.selenium.dev/ja/documentation/webdriver/bidi/w3c/network/2024-08-04T20:33:33+05:30https://www.selenium.dev/ja/documentation/webdriver/bidi/w3c/script/2024-07-10T08:34:50-07:00https://www.selenium.dev/ja/documentation/overview/components/2022-10-13T23:36:06+09:00https://www.selenium.dev/ja/documentation/test_practices/design_strategies/2023-04-17T22:48:24+05:30https://www.selenium.dev/ja/documentation/test_practices/overview/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/interactions/navigation/2024-08-05T09:10:29+02:00https://www.selenium.dev/ja/documentation/grid/advanced_features/observability/2022-12-01T21:45:21+09:00https://www.selenium.dev/ja/documentation/overview/2024-02-06T13:33:24+00:00https://www.selenium.dev/ja/documentation/grid/configuration/help/2022-12-01T21:45:21+09:00https://www.selenium.dev/ja/documentation/about/copyright/2023-10-03T09:53:03+08:00https://www.selenium.dev/ja/documentation/webdriver/elements/locators/2024-06-23T13:55:34+02:00https://www.selenium.dev/ja/documentation/grid/configuration/cli_options/2024-04-23T12:32:53+00:00https://www.selenium.dev/ja/documentation/webdriver/troubleshooting/errors/2023-05-25T18:11:20-06:00https://www.selenium.dev/ja/documentation/grid/advanced_features/graphql_support/2022-01-24T18:46:50+05:30https://www.selenium.dev/ja/documentation/legacy/selenium_3/grid_3/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/grid/getting_started/2023-05-25T18:11:20-06:00https://www.selenium.dev/ja/documentation/legacy/selenium_ide/html_runner/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/webdriver/elements/interactions/2024-07-19T10:00:08+02:00https://www.selenium.dev/ja/documentation/ie_driver_server/internals/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/webdriver/interactions/alerts/2024-08-17T09:21:57+02:00https://www.selenium.dev/ja/documentation/webdriver/actions_api/keyboard/2024-08-04T14:23:15+05:30https://www.selenium.dev/ja/documentation/webdriver/support_features/listeners/2023-11-17T04:17:19-06:00https://www.selenium.dev/ja/documentation/webdriver/bidi/cdp/logging/2024-08-17T21:40:33+08:00https://www.selenium.dev/ja/documentation/legacy/selenium_2/upgrading/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/legacy/selenium_1/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/about/contributing/2023-11-22T13:11:12-06:00https://www.selenium.dev/ja/documentation/webdriver/2024-02-06T13:36:47+00:00https://www.selenium.dev/ja/documentation/webdriver/drivers/options/2024-08-19T05:43:24-04:00https://www.selenium.dev/ja/documentation/test_practices/testing_types/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/test_practices/discouraged/file_downloads/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/getting_started/install_library/2024-08-14T01:32:57-04:00https://www.selenium.dev/ja/documentation/webdriver/elements/finders/2024-08-19T13:15:06-04:00https://www.selenium.dev/ja/documentation/overview/details/2022-10-21T22:24:05+09:00https://www.selenium.dev/ja/documentation/webdriver/getting_started/2023-05-25T18:11:20-06:00https://www.selenium.dev/ja/documentation/grid/advanced_features/endpoints/2024-04-24T14:15:02+00:00https://www.selenium.dev/ja/documentation/webdriver/drivers/http_client/2024-05-05T17:53:16+02:00https://www.selenium.dev/ja/documentation/test_practices/discouraged/http_response_codes/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/selenium_manager/2024-08-19T10:20:03-04:00https://www.selenium.dev/ja/documentation/webdriver/drivers/service/2024-05-29T18:35:18+02:00https://www.selenium.dev/ja/documentation/grid/configuration/toml_options/2024-04-23T12:32:53+00:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/page_object_models/2024-07-09T17:31:26+05:30https://www.selenium.dev/ja/documentation/webdriver/drivers/2024-08-08T23:45:14-07:00https://www.selenium.dev/ja/documentation/webdriver/support_features/colors/2023-08-03T23:04:23-05:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/2021-12-23T18:11:02+09:00https://www.selenium.dev/ja/documentation/webdriver/browsers/chrome/2024-07-10T08:34:50-07:00https://www.selenium.dev/ja/documentation/grid/advanced_features/customize_node/2024-05-17T13:30:43-04:00https://www.selenium.dev/ja/documentation/webdriver/troubleshooting/errors/driver_location/2023-11-17T04:17:19-06:00https://www.selenium.dev/ja/documentation/test_practices/discouraged/gmail_email_and_facebook_logins/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/grid/2024-02-06T13:37:55+00:00https://www.selenium.dev/ja/documentation/webdriver/troubleshooting/logging/2024-01-24T01:16:53+03:00https://www.selenium.dev/ja/documentation/webdriver/actions_api/mouse/2024-08-04T13:48:45+05:30https://www.selenium.dev/ja/documentation/webdriver/bidi/cdp/network/2024-08-17T21:40:33+08:00https://www.selenium.dev/ja/documentation/legacy/selenium_2/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/grid/applicability/2022-12-01T21:45:21+09:00https://www.selenium.dev/ja/documentation/webdriver/interactions/cookies/2024-04-06T20:06:30+05:30https://www.selenium.dev/ja/documentation/test_practices/encouraged/domain_specific_language/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/browsers/2022-11-05T16:22:49+09:00https://www.selenium.dev/ja/documentation/webdriver/elements/information/2024-08-08T11:46:01+05:30https://www.selenium.dev/ja/documentation/legacy/selenium_3/grid_setup/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/webdriver/browsers/edge/2024-07-10T08:34:50-07:00https://www.selenium.dev/ja/documentation/grid/advanced_features/external_datastore/2023-06-27T20:27:08+05:30https://www.selenium.dev/ja/documentation/webdriver/actions_api/pen/2023-11-17T04:17:19-06:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/generating_application_state/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/test_practices/discouraged/test_dependency/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/support_features/select_lists/2023-11-17T04:17:19-06:00https://www.selenium.dev/ja/documentation/webdriver/browsers/firefox/2024-05-30T13:53:58+02:00https://www.selenium.dev/ja/documentation/webdriver/bidi/cdp/script/2024-08-17T21:40:33+08:00https://www.selenium.dev/ja/documentation/legacy/selenium_3/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/about/style/2023-11-22T17:00:07-06:00https://www.selenium.dev/ja/documentation/webdriver/support_features/thread_guard/2022-09-23T10:06:16-05:00https://www.selenium.dev/ja/documentation/webdriver/actions_api/wheel/2024-08-04T14:23:15+05:30https://www.selenium.dev/ja/documentation/legacy/selenium_3/grid_components/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/grid/components/2023-07-05T20:45:15+05:30https://www.selenium.dev/ja/documentation/test_practices/discouraged/performance_testing/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/interactions/frames/2022-12-12T15:17:34+01:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/mock_external_services/2021-12-23T18:11:02+09:00https://www.selenium.dev/ja/documentation/legacy/selenium_2/remote_server/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/webdriver/waits/2024-05-07T19:44:07+05:30https://www.selenium.dev/ja/documentation/test_practices/discouraged/link_spidering/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/improved_reporting/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/ie_driver_server/2022-01-23T23:14:22+05:30https://www.selenium.dev/ja/documentation/webdriver/browsers/internet_explorer/2024-06-19T14:08:20+02:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/locators/2022-10-19T20:17:01+09:00https://www.selenium.dev/ja/documentation/legacy/selenium_ide/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/webdriver/elements/2021-12-22T17:29:14+09:00https://www.selenium.dev/ja/documentation/webdriver/interactions/windows/2024-07-05T15:23:34+05:30https://www.selenium.dev/ja/documentation/grid/configuration/2022-12-01T21:45:21+09:00https://www.selenium.dev/ja/documentation/webdriver/getting_started/first_script/2024-08-17T11:16:15-04:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/avoid_sharing_state/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/test_practices/discouraged/two_factor_authentication/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/test_practices/discouraged/2021-12-23T18:11:02+09:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/test_independency/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/bidi/cdp/2024-08-17T21:40:33+08:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/consider_using_a_fluent_api/2023-05-17T19:23:53+10:00https://www.selenium.dev/ja/documentation/ide/2021-12-20T22:10:09+09:00https://www.selenium.dev/ja/documentation/webdriver/interactions/2024-08-05T09:10:29+02:00https://www.selenium.dev/ja/documentation/webdriver/drivers/remote_webdriver/2024-07-27T11:43:12+05:30https://www.selenium.dev/ja/documentation/webdriver/browsers/safari/2024-07-08T07:13:22+02:00https://www.selenium.dev/ja/documentation/webdriver/troubleshooting/upgrade_to_selenium_4/2024-04-29T06:34:50+02:00https://www.selenium.dev/ja/documentation/webdriver/getting_started/using_selenium/2024-08-19T13:07:19-04:00https://www.selenium.dev/ja/documentation/grid/architecture/2022-12-01T21:45:21+09:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/fresh_browser_per_test/2022-07-28T14:45:40+05:30https://www.selenium.dev/ja/documentation/webdriver/bidi/w3c/log/2024-07-10T08:34:50-07:00https://www.selenium.dev/ja/documentation/test_practices/2021-12-23T18:11:02+09:00https://www.selenium.dev/ja/documentation/grid/advanced_features/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/actions_api/2024-08-04T14:23:15+05:30https://www.selenium.dev/ja/documentation/legacy/2023-06-27T20:27:08+05:30https://www.selenium.dev/ja/documentation/webdriver/bidi/w3c/2024-07-10T08:34:50-07:00https://www.selenium.dev/ja/documentation/webdriver/interactions/virtual_authenticator/2024-05-30T17:43:45+07:00https://www.selenium.dev/ja/documentation/about/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/support_features/2022-09-23T10:06:16-05:00https://www.selenium.dev/ja/documentation/webdriver/troubleshooting/2023-01-03T15:59:19-06:00https://www.selenium.dev/ja/categories/https://www.selenium.dev/ja/2023-06-27T20:27:08+05:30https://www.selenium.dev/ja/tags/https://www.selenium.dev/ja/year/https://www.selenium.dev/ja/documentation/2023-11-17T04:17:19-06:00 \ No newline at end of file +https://www.selenium.dev/ja/documentation/webdriver/bidi/w3c/browsing_context/2024-08-04T20:33:33+05:30https://www.selenium.dev/ja/documentation/webdriver/bidi/w3c/input/2024-08-04T20:33:33+05:30https://www.selenium.dev/ja/documentation/test_practices/discouraged/captchas/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/support_features/expected_conditions/2023-11-17T04:17:19-06:00https://www.selenium.dev/ja/documentation/webdriver/elements/file_upload/2023-11-17T04:17:19-06:00https://www.selenium.dev/ja/documentation/webdriver/bidi/w3c/network/2024-08-04T20:33:33+05:30https://www.selenium.dev/ja/documentation/webdriver/bidi/w3c/script/2024-07-10T08:34:50-07:00https://www.selenium.dev/ja/documentation/overview/components/2022-10-13T23:36:06+09:00https://www.selenium.dev/ja/documentation/test_practices/design_strategies/2023-04-17T22:48:24+05:30https://www.selenium.dev/ja/documentation/test_practices/overview/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/interactions/navigation/2024-08-05T09:10:29+02:00https://www.selenium.dev/ja/documentation/grid/advanced_features/observability/2022-12-01T21:45:21+09:00https://www.selenium.dev/ja/documentation/overview/2024-02-06T13:33:24+00:00https://www.selenium.dev/ja/documentation/grid/configuration/help/2022-12-01T21:45:21+09:00https://www.selenium.dev/ja/documentation/about/copyright/2023-10-03T09:53:03+08:00https://www.selenium.dev/ja/documentation/webdriver/elements/locators/2024-08-22T04:22:37-04:00https://www.selenium.dev/ja/documentation/grid/configuration/cli_options/2024-04-23T12:32:53+00:00https://www.selenium.dev/ja/documentation/webdriver/troubleshooting/errors/2023-05-25T18:11:20-06:00https://www.selenium.dev/ja/documentation/grid/advanced_features/graphql_support/2022-01-24T18:46:50+05:30https://www.selenium.dev/ja/documentation/legacy/selenium_3/grid_3/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/grid/getting_started/2023-05-25T18:11:20-06:00https://www.selenium.dev/ja/documentation/legacy/selenium_ide/html_runner/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/webdriver/elements/interactions/2024-07-19T10:00:08+02:00https://www.selenium.dev/ja/documentation/ie_driver_server/internals/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/webdriver/interactions/alerts/2024-08-17T09:21:57+02:00https://www.selenium.dev/ja/documentation/webdriver/actions_api/keyboard/2024-08-04T14:23:15+05:30https://www.selenium.dev/ja/documentation/webdriver/support_features/listeners/2023-11-17T04:17:19-06:00https://www.selenium.dev/ja/documentation/webdriver/bidi/cdp/logging/2024-08-17T21:40:33+08:00https://www.selenium.dev/ja/documentation/legacy/selenium_2/upgrading/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/legacy/selenium_1/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/about/contributing/2023-11-22T13:11:12-06:00https://www.selenium.dev/ja/documentation/webdriver/2024-02-06T13:36:47+00:00https://www.selenium.dev/ja/documentation/webdriver/drivers/options/2024-08-19T05:43:24-04:00https://www.selenium.dev/ja/documentation/test_practices/testing_types/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/test_practices/discouraged/file_downloads/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/getting_started/install_library/2024-08-14T01:32:57-04:00https://www.selenium.dev/ja/documentation/webdriver/elements/finders/2024-08-19T13:15:06-04:00https://www.selenium.dev/ja/documentation/overview/details/2022-10-21T22:24:05+09:00https://www.selenium.dev/ja/documentation/webdriver/getting_started/2023-05-25T18:11:20-06:00https://www.selenium.dev/ja/documentation/grid/advanced_features/endpoints/2024-04-24T14:15:02+00:00https://www.selenium.dev/ja/documentation/webdriver/drivers/http_client/2024-05-05T17:53:16+02:00https://www.selenium.dev/ja/documentation/test_practices/discouraged/http_response_codes/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/selenium_manager/2024-08-19T10:20:03-04:00https://www.selenium.dev/ja/documentation/webdriver/drivers/service/2024-05-29T18:35:18+02:00https://www.selenium.dev/ja/documentation/grid/configuration/toml_options/2024-04-23T12:32:53+00:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/page_object_models/2024-07-09T17:31:26+05:30https://www.selenium.dev/ja/documentation/webdriver/drivers/2024-08-08T23:45:14-07:00https://www.selenium.dev/ja/documentation/webdriver/support_features/colors/2023-08-03T23:04:23-05:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/2021-12-23T18:11:02+09:00https://www.selenium.dev/ja/documentation/webdriver/browsers/chrome/2024-07-10T08:34:50-07:00https://www.selenium.dev/ja/documentation/grid/advanced_features/customize_node/2024-05-17T13:30:43-04:00https://www.selenium.dev/ja/documentation/webdriver/troubleshooting/errors/driver_location/2023-11-17T04:17:19-06:00https://www.selenium.dev/ja/documentation/test_practices/discouraged/gmail_email_and_facebook_logins/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/grid/2024-02-06T13:37:55+00:00https://www.selenium.dev/ja/documentation/webdriver/troubleshooting/logging/2024-01-24T01:16:53+03:00https://www.selenium.dev/ja/documentation/webdriver/actions_api/mouse/2024-08-04T13:48:45+05:30https://www.selenium.dev/ja/documentation/webdriver/bidi/cdp/network/2024-08-17T21:40:33+08:00https://www.selenium.dev/ja/documentation/legacy/selenium_2/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/grid/applicability/2022-12-01T21:45:21+09:00https://www.selenium.dev/ja/documentation/webdriver/interactions/cookies/2024-04-06T20:06:30+05:30https://www.selenium.dev/ja/documentation/test_practices/encouraged/domain_specific_language/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/browsers/2022-11-05T16:22:49+09:00https://www.selenium.dev/ja/documentation/webdriver/elements/information/2024-08-08T11:46:01+05:30https://www.selenium.dev/ja/documentation/legacy/selenium_3/grid_setup/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/webdriver/browsers/edge/2024-07-10T08:34:50-07:00https://www.selenium.dev/ja/documentation/grid/advanced_features/external_datastore/2023-06-27T20:27:08+05:30https://www.selenium.dev/ja/documentation/webdriver/actions_api/pen/2023-11-17T04:17:19-06:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/generating_application_state/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/test_practices/discouraged/test_dependency/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/support_features/select_lists/2023-11-17T04:17:19-06:00https://www.selenium.dev/ja/documentation/webdriver/browsers/firefox/2024-05-30T13:53:58+02:00https://www.selenium.dev/ja/documentation/webdriver/bidi/cdp/script/2024-08-17T21:40:33+08:00https://www.selenium.dev/ja/documentation/legacy/selenium_3/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/about/style/2023-11-22T17:00:07-06:00https://www.selenium.dev/ja/documentation/webdriver/support_features/thread_guard/2022-09-23T10:06:16-05:00https://www.selenium.dev/ja/documentation/webdriver/actions_api/wheel/2024-08-04T14:23:15+05:30https://www.selenium.dev/ja/documentation/legacy/selenium_3/grid_components/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/grid/components/2023-07-05T20:45:15+05:30https://www.selenium.dev/ja/documentation/test_practices/discouraged/performance_testing/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/interactions/frames/2022-12-12T15:17:34+01:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/mock_external_services/2021-12-23T18:11:02+09:00https://www.selenium.dev/ja/documentation/legacy/selenium_2/remote_server/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/webdriver/waits/2024-05-07T19:44:07+05:30https://www.selenium.dev/ja/documentation/test_practices/discouraged/link_spidering/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/improved_reporting/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/ie_driver_server/2022-01-23T23:14:22+05:30https://www.selenium.dev/ja/documentation/webdriver/browsers/internet_explorer/2024-06-19T14:08:20+02:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/locators/2022-10-19T20:17:01+09:00https://www.selenium.dev/ja/documentation/legacy/selenium_ide/2022-01-10T05:07:37-06:00https://www.selenium.dev/ja/documentation/webdriver/elements/2021-12-22T17:29:14+09:00https://www.selenium.dev/ja/documentation/webdriver/interactions/windows/2024-07-05T15:23:34+05:30https://www.selenium.dev/ja/documentation/grid/configuration/2022-12-01T21:45:21+09:00https://www.selenium.dev/ja/documentation/webdriver/getting_started/first_script/2024-08-17T11:16:15-04:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/avoid_sharing_state/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/test_practices/discouraged/two_factor_authentication/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/test_practices/discouraged/2021-12-23T18:11:02+09:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/test_independency/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/bidi/cdp/2024-08-17T21:40:33+08:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/consider_using_a_fluent_api/2023-05-17T19:23:53+10:00https://www.selenium.dev/ja/documentation/ide/2021-12-20T22:10:09+09:00https://www.selenium.dev/ja/documentation/webdriver/interactions/2024-08-05T09:10:29+02:00https://www.selenium.dev/ja/documentation/webdriver/drivers/remote_webdriver/2024-07-27T11:43:12+05:30https://www.selenium.dev/ja/documentation/webdriver/browsers/safari/2024-07-08T07:13:22+02:00https://www.selenium.dev/ja/documentation/webdriver/troubleshooting/upgrade_to_selenium_4/2024-04-29T06:34:50+02:00https://www.selenium.dev/ja/documentation/webdriver/getting_started/using_selenium/2024-08-19T13:07:19-04:00https://www.selenium.dev/ja/documentation/grid/architecture/2022-12-01T21:45:21+09:00https://www.selenium.dev/ja/documentation/test_practices/encouraged/fresh_browser_per_test/2022-07-28T14:45:40+05:30https://www.selenium.dev/ja/documentation/webdriver/bidi/w3c/log/2024-07-10T08:34:50-07:00https://www.selenium.dev/ja/documentation/test_practices/2021-12-23T18:11:02+09:00https://www.selenium.dev/ja/documentation/grid/advanced_features/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/actions_api/2024-08-04T14:23:15+05:30https://www.selenium.dev/ja/documentation/legacy/2023-06-27T20:27:08+05:30https://www.selenium.dev/ja/documentation/webdriver/bidi/w3c/2024-07-10T08:34:50-07:00https://www.selenium.dev/ja/documentation/webdriver/interactions/virtual_authenticator/2024-05-30T17:43:45+07:00https://www.selenium.dev/ja/documentation/about/2021-12-07T06:38:55-06:00https://www.selenium.dev/ja/documentation/webdriver/support_features/2022-09-23T10:06:16-05:00https://www.selenium.dev/ja/documentation/webdriver/troubleshooting/2023-01-03T15:59:19-06:00https://www.selenium.dev/ja/categories/https://www.selenium.dev/ja/2023-06-27T20:27:08+05:30https://www.selenium.dev/ja/tags/https://www.selenium.dev/ja/year/https://www.selenium.dev/ja/documentation/2023-11-17T04:17:19-06:00 \ No newline at end of file diff --git a/pt-br/documentation/_print/index.html b/pt-br/documentation/_print/index.html index 8947a38f7c8e..133201fa226d 100644 --- a/pt-br/documentation/_print/index.html +++ b/pt-br/documentation/_print/index.html @@ -3866,7 +3866,28 @@
    val driver = ChromeDriver()
 	val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
-  

Relative Locators

Selenium 4 introduces Relative Locators (previously +

Utilizing Locators

The FindElement makes using locators a breeze! For most languages, all you need to do is utilize webdriver.common.by.By, however in others it’s as simple as setting a parameter in the FindElement function>

Move Code

    import org.openqa.selenium.By;
+    WebDriver driver = new ChromeDriver();
+	driver.findElement(By.className("information"));
+  
    from selenium.webdriver.common.by import By
+    driver = webdriver.Chrome()
+	driver.find_element(By.CLASS_NAME, "information")
+  
    var driver = new ChromeDriver();
+	driver.FindElement(By.ClassName("information"));
+  
    driver.find_element(class: 'information')
    let driver = await new Builder().forBrowser('chrome').build();
+	const loc = await driver.findElement(By.className('information'));
+  
+
    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	val loc: WebElement = driver.findElement(By.className("information"))
+  

Relative Locators

Selenium 4 introduces Relative Locators (previously called as Friendly Locators). These locators are helpful when it is not easy to construct a locator for the desired element, but easy to describe spatially where the element is in relation to an element that does have an easily constructed locator.

How it works

Selenium uses the JavaScript function @@ -3874,55 +3895,55 @@ to determine the size and position of elements on the page, and can use this information to locate neighboring elements.
find the relative elements.

Relative locator methods can take as the argument for the point of origin, either a previously located element reference, or another locator. In these examples we’ll be using locators only, but you could swap the locator in the final method with an element object and it will work the same.

Let us consider the below example for understanding the relative locators.

Relative Locators

Available relative locators

Above

If the email text field element is not easily identifiable for some reason, but the password text field element is, -we can locate the text field element using the fact that it is an “input” element “above” the password element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, -we can locate the text field element using the fact that it is an “input” element “below” the email element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, -we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, +we can locate the text field element using the fact that it is an “input” element “below” the email element.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, -we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, +we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to -identify an element that is at most 50px away from the provided locator. -One great use case for this is to work with a form element that doesn’t have an easily constructed locator, -but its associated input label element does.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, +we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to +identify an element that is at most 50px away from the provided locator. +One great use case for this is to work with a form element that doesn’t have an easily constructed locator, +but its associated input label element does.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

2.6 - Chrome DevTools Protocol

Examples of working with Chrome DevTools Protocol in Selenium. CDP support is temporary until WebDriver BiDi has been implemented.

+Kotlin

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

2.6 - Chrome DevTools Protocol

Examples of working with Chrome DevTools Protocol in Selenium. CDP support is temporary until WebDriver BiDi has been implemented.

Page being translated from English to Japanese. Do you speak Japanese? Help us to translate it by sending us pull requests!

Many browsers provide “DevTools” – a set of tools that are integrated with the browser that @@ -13450,7 +13471,7 @@ das informações contidas neste livro. Nenhuma responsabilidade de patente é assumida com relação ao uso das informações aqui contidas.

Atribuições

Agradecimentos:

Selenium Main Repository

-5319 commits
+5320 commits
3352 commits
@@ -13742,9 +13763,9 @@ 538 commits
-217 commits
+219 commits
-153 commits
+154 commits
134 commits
@@ -13948,7 +13969,7 @@ 232 commits
-119 commits
+121 commits
114 commits
@@ -14000,6 +14021,8 @@ 6 commits
+6 commits
+ 6 commits
6 commits
@@ -14016,8 +14039,6 @@ 5 commits
-5 commits
- 5 commits
5 commits
@@ -14094,10 +14115,10 @@ 2 commits
+2 commits
+ 2 commits
-2 commits
- 2 commits
2 commits
@@ -14116,6 +14137,8 @@ 2 commits
+2 commits
+ 2 commits
2 commits
@@ -14136,8 +14159,6 @@ 2 commits
-2 commits
- 2 commits

Website Selenium Anterior

417 commits
diff --git a/pt-br/documentation/about/_print/index.html b/pt-br/documentation/about/_print/index.html index 56cf2c553e16..ddaf736abbbe 100644 --- a/pt-br/documentation/about/_print/index.html +++ b/pt-br/documentation/about/_print/index.html @@ -35,7 +35,7 @@ das informações contidas neste livro. Nenhuma responsabilidade de patente é assumida com relação ao uso das informações aqui contidas.

Atribuições

Agradecimentos:

Selenium Main Repository

-5319 commits
+5320 commits
3352 commits
@@ -327,9 +327,9 @@ 538 commits
-217 commits
+219 commits
-153 commits
+154 commits
134 commits
@@ -533,7 +533,7 @@ 232 commits
-119 commits
+121 commits
114 commits
@@ -585,6 +585,8 @@ 6 commits
+6 commits
+ 6 commits
6 commits
@@ -601,8 +603,6 @@ 5 commits
-5 commits
- 5 commits
5 commits
@@ -679,10 +679,10 @@ 2 commits
+2 commits
+ 2 commits
-2 commits
- 2 commits
2 commits
@@ -701,6 +701,8 @@ 2 commits
+2 commits
+ 2 commits
2 commits
@@ -721,8 +723,6 @@ 2 commits
-2 commits
- 2 commits

Website Selenium Anterior

417 commits
diff --git a/pt-br/documentation/about/copyright/index.html b/pt-br/documentation/about/copyright/index.html index 6a4babaf1963..2f5006a7e806 100644 --- a/pt-br/documentation/about/copyright/index.html +++ b/pt-br/documentation/about/copyright/index.html @@ -22,7 +22,7 @@ das informações contidas neste livro. Nenhuma responsabilidade de patente é assumida com relação ao uso das informações aqui contidas.

Atribuições

Agradecimentos:

Selenium Main Repository

-5319 commits
+5320 commits
3352 commits
@@ -314,9 +314,9 @@ 538 commits
-217 commits
+219 commits
-153 commits
+154 commits
134 commits
@@ -520,7 +520,7 @@ 232 commits
-119 commits
+121 commits
114 commits
@@ -572,6 +572,8 @@ 6 commits
+6 commits
+ 6 commits
6 commits
@@ -588,8 +590,6 @@ 5 commits
-5 commits
- 5 commits
5 commits
@@ -666,10 +666,10 @@ 2 commits
+2 commits
+ 2 commits
-2 commits
- 2 commits
2 commits
@@ -688,6 +688,8 @@ 2 commits
+2 commits
+ 2 commits
2 commits
@@ -708,8 +710,6 @@ 2 commits
-2 commits
- 2 commits

Website Selenium Anterior

417 commits
diff --git a/pt-br/documentation/webdriver/_print/index.html b/pt-br/documentation/webdriver/_print/index.html index 858081798757..04d6319c3197 100644 --- a/pt-br/documentation/webdriver/_print/index.html +++ b/pt-br/documentation/webdriver/_print/index.html @@ -3669,7 +3669,28 @@
    val driver = ChromeDriver()
 	val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
-  

Relative Locators

Selenium 4 introduces Relative Locators (previously +

Utilizing Locators

The FindElement makes using locators a breeze! For most languages, all you need to do is utilize webdriver.common.by.By, however in others it’s as simple as setting a parameter in the FindElement function>

Move Code

    import org.openqa.selenium.By;
+    WebDriver driver = new ChromeDriver();
+	driver.findElement(By.className("information"));
+  
    from selenium.webdriver.common.by import By
+    driver = webdriver.Chrome()
+	driver.find_element(By.CLASS_NAME, "information")
+  
    var driver = new ChromeDriver();
+	driver.FindElement(By.ClassName("information"));
+  
    driver.find_element(class: 'information')
    let driver = await new Builder().forBrowser('chrome').build();
+	const loc = await driver.findElement(By.className('information'));
+  
+
    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	val loc: WebElement = driver.findElement(By.className("information"))
+  

Relative Locators

Selenium 4 introduces Relative Locators (previously called as Friendly Locators). These locators are helpful when it is not easy to construct a locator for the desired element, but easy to describe spatially where the element is in relation to an element that does have an easily constructed locator.

How it works

Selenium uses the JavaScript function @@ -3677,55 +3698,55 @@ to determine the size and position of elements on the page, and can use this information to locate neighboring elements.
find the relative elements.

Relative locator methods can take as the argument for the point of origin, either a previously located element reference, or another locator. In these examples we’ll be using locators only, but you could swap the locator in the final method with an element object and it will work the same.

Let us consider the below example for understanding the relative locators.

Relative Locators

Available relative locators

Above

If the email text field element is not easily identifiable for some reason, but the password text field element is, -we can locate the text field element using the fact that it is an “input” element “above” the password element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, -we can locate the text field element using the fact that it is an “input” element “below” the email element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, -we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, +we can locate the text field element using the fact that it is an “input” element “below” the email element.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, -we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, +we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to -identify an element that is at most 50px away from the provided locator. -One great use case for this is to work with a form element that doesn’t have an easily constructed locator, -but its associated input label element does.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, +we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to +identify an element that is at most 50px away from the provided locator. +One great use case for this is to work with a form element that doesn’t have an easily constructed locator, +but its associated input label element does.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

6 - Chrome DevTools Protocol

Examples of working with Chrome DevTools Protocol in Selenium. CDP support is temporary until WebDriver BiDi has been implemented.

+Kotlin

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

6 - Chrome DevTools Protocol

Examples of working with Chrome DevTools Protocol in Selenium. CDP support is temporary until WebDriver BiDi has been implemented.

Page being translated from English to Japanese. Do you speak Japanese? Help us to translate it by sending us pull requests!

Many browsers provide “DevTools” – a set of tools that are integrated with the browser that diff --git a/pt-br/documentation/webdriver/elements/_print/index.html b/pt-br/documentation/webdriver/elements/_print/index.html index 01f4fd31f269..0eded624d735 100644 --- a/pt-br/documentation/webdriver/elements/_print/index.html +++ b/pt-br/documentation/webdriver/elements/_print/index.html @@ -1397,7 +1397,28 @@

    val driver = ChromeDriver()
 	val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
-  

Relative Locators

Selenium 4 introduces Relative Locators (previously +

Utilizing Locators

The FindElement makes using locators a breeze! For most languages, all you need to do is utilize webdriver.common.by.By, however in others it’s as simple as setting a parameter in the FindElement function>

Move Code

    import org.openqa.selenium.By;
+    WebDriver driver = new ChromeDriver();
+	driver.findElement(By.className("information"));
+  
    from selenium.webdriver.common.by import By
+    driver = webdriver.Chrome()
+	driver.find_element(By.CLASS_NAME, "information")
+  
    var driver = new ChromeDriver();
+	driver.FindElement(By.ClassName("information"));
+  
    driver.find_element(class: 'information')
    let driver = await new Builder().forBrowser('chrome').build();
+	const loc = await driver.findElement(By.className('information'));
+  
+
    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	val loc: WebElement = driver.findElement(By.className("information"))
+  

Relative Locators

Selenium 4 introduces Relative Locators (previously called as Friendly Locators). These locators are helpful when it is not easy to construct a locator for the desired element, but easy to describe spatially where the element is in relation to an element that does have an easily constructed locator.

How it works

Selenium uses the JavaScript function @@ -1405,53 +1426,53 @@ to determine the size and position of elements on the page, and can use this information to locate neighboring elements.
find the relative elements.

Relative locator methods can take as the argument for the point of origin, either a previously located element reference, or another locator. In these examples we’ll be using locators only, but you could swap the locator in the final method with an element object and it will work the same.

Let us consider the below example for understanding the relative locators.

Relative Locators

Available relative locators

Above

If the email text field element is not easily identifiable for some reason, but the password text field element is, -we can locate the text field element using the fact that it is an “input” element “above” the password element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, -we can locate the text field element using the fact that it is an “input” element “below” the email element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, -we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, +we can locate the text field element using the fact that it is an “input” element “below” the email element.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, -we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, +we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to -identify an element that is at most 50px away from the provided locator. -One great use case for this is to work with a form element that doesn’t have an easily constructed locator, -but its associated input label element does.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, +we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to +identify an element that is at most 50px away from the provided locator. +One great use case for this is to work with a form element that doesn’t have an easily constructed locator, +but its associated input label element does.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

Development Partners

Selenium Level Sponsors

Support the Selenium Project

Learn more or view the full list of sponsors.

Learn more +Kotlin

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

Development Partners

Selenium Level Sponsors

Support the Selenium Project

Learn more or view the full list of sponsors.

\ No newline at end of file diff --git a/pt-br/documentation/webdriver/elements/locators/index.html b/pt-br/documentation/webdriver/elements/locators/index.html index 8e39d5ed623b..5b3a3dedbed3 100644 --- a/pt-br/documentation/webdriver/elements/locators/index.html +++ b/pt-br/documentation/webdriver/elements/locators/index.html @@ -1,7 +1,7 @@ Localizando elementos | Selenium

Localizando elementos

Formas de identificar um ou mais elementos no DOM.

Um localizador é uma forma de identificar elementos numa página. São os argumentos passados aos métodos + Print entire section



Localizando elementos

Formas de identificar um ou mais elementos no DOM.

Um localizador é uma forma de identificar elementos numa página. São os argumentos passados aos métodos Finders .

Visite os nossas directrizes e recomendações para dicas sobre locators, incluindo quais usar e quando, e também porque é que deve declarar localizadores separadamente dos finders.

Estratégias de seleção de elemento

Existem oito estratégias diferentes de localização de elementos embutidas no WebDriver:

LocalizadorDescrição
class nameLocaliza elementos cujo nome de classe contém o valor de pesquisa (nomes de classes compostas não são permitidos)
css selectorLocaliza elementos que correspondem a um seletor CSS
idLocaliza elementos cujo atributo de ID corresponde ao valor de pesquisa
nameLocaliza elementos cujo atributo NAME corresponde ao valor de pesquisa
link textLocaliza elementos âncora cujo texto visível corresponde ao valor de pesquisa
partial link textLocaliza elementos âncora cujo texto visível contém o valor da pesquisa. Se vários elementos forem correspondentes, apenas o primeiro será selecionado.
tag nameLocaliza elementos cujo nome de tag corresponde ao valor de pesquisa
xpathLocaliza elementos que correspondem a uma expressão XPath

Creating Locators

To work on a web element using Selenium, we need to first locate it on the web page. @@ -215,7 +215,28 @@

    val driver = ChromeDriver()
 	val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
-  

Relative Locators

Selenium 4 introduces Relative Locators (previously +

Utilizing Locators

The FindElement makes using locators a breeze! For most languages, all you need to do is utilize webdriver.common.by.By, however in others it’s as simple as setting a parameter in the FindElement function>

Move Code

    import org.openqa.selenium.By;
+    WebDriver driver = new ChromeDriver();
+	driver.findElement(By.className("information"));
+  
    from selenium.webdriver.common.by import By
+    driver = webdriver.Chrome()
+	driver.find_element(By.CLASS_NAME, "information")
+  
    var driver = new ChromeDriver();
+	driver.FindElement(By.ClassName("information"));
+  
    driver.find_element(class: 'information')
    let driver = await new Builder().forBrowser('chrome').build();
+	const loc = await driver.findElement(By.className('information'));
+  
+
    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	val loc: WebElement = driver.findElement(By.className("information"))
+  

Relative Locators

Selenium 4 introduces Relative Locators (previously called as Friendly Locators). These locators are helpful when it is not easy to construct a locator for the desired element, but easy to describe spatially where the element is in relation to an element that does have an easily constructed locator.

How it works

Selenium uses the JavaScript function @@ -223,53 +244,53 @@ to determine the size and position of elements on the page, and can use this information to locate neighboring elements.
find the relative elements.

Relative locator methods can take as the argument for the point of origin, either a previously located element reference, or another locator. In these examples we’ll be using locators only, but you could swap the locator in the final method with an element object and it will work the same.

Let us consider the below example for understanding the relative locators.

Relative Locators

Available relative locators

Above

If the email text field element is not easily identifiable for some reason, but the password text field element is, -we can locate the text field element using the fact that it is an “input” element “above” the password element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, -we can locate the text field element using the fact that it is an “input” element “below” the email element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, -we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, +we can locate the text field element using the fact that it is an “input” element “below” the email element.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, -we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, +we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to -identify an element that is at most 50px away from the provided locator. -One great use case for this is to work with a form element that doesn’t have an easily constructed locator, -but its associated input label element does.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, +we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to +identify an element that is at most 50px away from the provided locator. +One great use case for this is to work with a form element that doesn’t have an easily constructed locator, +but its associated input label element does.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

Development Partners

Selenium Level Sponsors

Support the Selenium Project

Learn more or view the full list of sponsors.

Learn more +Kotlin

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))
Última modificação August 22, 2024: added locator section for Bug #1393 (#1880) (7ba611eab40)

Development Partners

Selenium Level Sponsors

Support the Selenium Project

Learn more or view the full list of sponsors.

\ No newline at end of file diff --git a/pt-br/sitemap.xml b/pt-br/sitemap.xml index 3115b637e53e..7184f749cc6b 100644 --- a/pt-br/sitemap.xml +++ b/pt-br/sitemap.xml @@ -1 +1 @@ -https://www.selenium.dev/pt-br/documentation/grid/configuration/help/2022-11-17T14:56:19+00:00https://www.selenium.dev/pt-br/documentation/webdriver/bidi/w3c/browsing_context/2024-08-04T20:33:33+05:30https://www.selenium.dev/pt-br/documentation/webdriver/bidi/w3c/input/2024-08-04T20:33:33+05:30https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/captchas/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/test_practices/design_strategies/2023-04-17T22:48:24+05:30https://www.selenium.dev/pt-br/documentation/about/copyright/2023-10-03T09:53:03+08:00https://www.selenium.dev/pt-br/documentation/overview/components/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/elements/file_upload/2023-11-17T04:17:19-06:00https://www.selenium.dev/pt-br/documentation/webdriver/interactions/navigation/2024-08-05T09:10:29+02:00https://www.selenium.dev/pt-br/documentation/webdriver/bidi/w3c/network/2024-08-04T20:33:33+05:30https://www.selenium.dev/pt-br/documentation/grid/advanced_features/observability/2023-10-24T23:55:35+01:00https://www.selenium.dev/pt-br/documentation/overview/2024-02-06T13:33:24+00:00https://www.selenium.dev/pt-br/documentation/webdriver/bidi/w3c/script/2024-07-10T08:34:50-07:00https://www.selenium.dev/pt-br/documentation/webdriver/interactions/alerts/2024-08-17T09:21:57+02:00https://www.selenium.dev/pt-br/documentation/webdriver/getting_started/2023-05-25T18:11:20-06:00https://www.selenium.dev/pt-br/documentation/grid/getting_started/2023-05-25T18:11:20-06:00https://www.selenium.dev/pt-br/documentation/about/contributing/2023-11-22T13:11:12-06:00https://www.selenium.dev/pt-br/documentation/overview/details/2022-11-15T12:05:40+00:00https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/file_downloads/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/troubleshooting/errors/2023-05-25T18:11:20-06:00https://www.selenium.dev/pt-br/documentation/webdriver/elements/finders/2024-08-19T13:15:06-04:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_3/grid_3/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_ide/html_runner/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/webdriver/getting_started/install_library/2024-08-14T01:32:57-04:00https://www.selenium.dev/pt-br/documentation/webdriver/elements/interactions/2024-07-19T10:00:08+02:00https://www.selenium.dev/pt-br/documentation/ie_driver_server/internals/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/webdriver/support_features/listeners/2023-11-17T04:17:19-06:00https://www.selenium.dev/pt-br/documentation/webdriver/bidi/cdp/logging/2024-08-17T21:40:33+08:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_2/upgrading/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/grid/configuration/cli_options/2024-04-23T12:32:53+00:00https://www.selenium.dev/pt-br/documentation/webdriver/drivers/options/2024-08-19T05:43:24-04:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_1/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/test_practices/overview/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/grid/advanced_features/graphql_support/2022-01-24T18:46:50+05:30https://www.selenium.dev/pt-br/documentation/webdriver/actions_api/keyboard/2024-08-04T14:23:15+05:30https://www.selenium.dev/pt-br/documentation/test_practices/testing_types/2023-10-25T04:28:40+05:30https://www.selenium.dev/pt-br/documentation/webdriver/2024-03-29T20:25:04+05:30https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/http_response_codes/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/drivers/2024-08-08T23:45:14-07:00https://www.selenium.dev/pt-br/documentation/webdriver/drivers/http_client/2024-05-05T17:53:16+02:00https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/page_object_models/2023-07-20T04:44:31-03:00https://www.selenium.dev/pt-br/documentation/grid/advanced_features/endpoints/2024-04-24T14:15:02+00:00https://www.selenium.dev/pt-br/documentation/selenium_manager/2024-08-19T10:20:03-04:00https://www.selenium.dev/pt-br/documentation/webdriver/drivers/service/2024-05-29T18:35:18+02:00https://www.selenium.dev/pt-br/documentation/grid/configuration/toml_options/2024-04-23T12:32:53+00:00https://www.selenium.dev/pt-br/documentation/webdriver/support_features/colors/2023-08-03T23:04:23-05:00https://www.selenium.dev/pt-br/documentation/webdriver/browsers/chrome/2024-07-10T08:34:50-07:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_3/grid_setup/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/webdriver/troubleshooting/errors/driver_location/2023-11-17T04:17:19-06:00https://www.selenium.dev/pt-br/documentation/grid/2024-02-06T13:37:55+00:00https://www.selenium.dev/pt-br/documentation/webdriver/elements/information/2024-08-08T11:46:01+05:30https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/domain_specific_language/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/elements/locators/2024-06-23T13:55:34+02:00https://www.selenium.dev/pt-br/documentation/webdriver/troubleshooting/logging/2024-01-24T01:16:53+03:00https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/gmail_email_and_facebook_logins/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/actions_api/mouse/2024-08-04T13:48:45+05:30https://www.selenium.dev/pt-br/documentation/webdriver/browsers/2022-11-03T09:08:46+00:00https://www.selenium.dev/pt-br/documentation/webdriver/bidi/cdp/network/2024-08-17T21:40:33+08:00https://www.selenium.dev/pt-br/documentation/grid/advanced_features/customize_node/2024-05-17T13:30:43-04:00https://www.selenium.dev/pt-br/documentation/grid/applicability/2022-11-15T15:53:55+00:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_2/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/webdriver/interactions/cookies/2024-04-06T20:06:30+05:30https://www.selenium.dev/pt-br/documentation/webdriver/actions_api/pen/2023-11-17T04:17:19-06:00https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/test_dependency/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/browsers/edge/2024-07-10T08:34:50-07:00https://www.selenium.dev/pt-br/documentation/grid/advanced_features/external_datastore/2023-06-27T20:27:08+05:30https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/generating_application_state/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/grid/components/2023-07-05T20:45:15+05:30https://www.selenium.dev/pt-br/documentation/webdriver/waits/2024-05-07T19:44:07+05:30https://www.selenium.dev/pt-br/documentation/webdriver/browsers/firefox/2024-05-30T13:53:58+02:00https://www.selenium.dev/pt-br/documentation/webdriver/interactions/frames/2022-12-12T15:17:34+01:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_3/grid_components/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/webdriver/actions_api/wheel/2024-08-04T14:23:15+05:30https://www.selenium.dev/pt-br/documentation/webdriver/bidi/cdp/script/2024-08-17T21:40:33+08:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_3/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_2/remote_server/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/mock_external_services/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/about/style/2023-11-22T17:00:07-06:00https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/performance_testing/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/support_features/thread_guard/2022-09-23T10:06:16-05:00https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/2022-11-14T16:09:47+00:00https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/link_spidering/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/improved_reporting/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/two_factor_authentication/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/grid/configuration/2022-11-17T14:56:19+00:00https://www.selenium.dev/pt-br/documentation/webdriver/elements/2023-04-04T19:09:53+01:00https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/avoid_sharing_state/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/browsers/internet_explorer/2024-06-19T14:08:20+02:00https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/locators/2022-02-10T18:17:05+08:00https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/2022-11-14T16:09:47+00:00https://www.selenium.dev/pt-br/documentation/webdriver/getting_started/first_script/2024-08-17T11:16:15-04:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_ide/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/ie_driver_server/2023-10-24T23:55:35+01:00https://www.selenium.dev/pt-br/documentation/webdriver/interactions/windows/2024-07-05T15:23:34+05:30https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/test_independency/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/grid/architecture/2022-12-01T21:25:10+00:00https://www.selenium.dev/pt-br/documentation/webdriver/bidi/cdp/2024-08-17T21:40:33+08:00https://www.selenium.dev/pt-br/documentation/webdriver/troubleshooting/upgrade_to_selenium_4/2024-04-29T06:34:50+02:00https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/consider_using_a_fluent_api/2023-05-17T19:23:53+10:00https://www.selenium.dev/pt-br/documentation/ide/2022-11-10T08:57:29+00:00https://www.selenium.dev/pt-br/documentation/webdriver/interactions/2024-08-05T09:10:29+02:00https://www.selenium.dev/pt-br/documentation/webdriver/drivers/remote_webdriver/2024-07-27T11:43:12+05:30https://www.selenium.dev/pt-br/documentation/webdriver/browsers/safari/2024-07-08T07:13:22+02:00https://www.selenium.dev/pt-br/documentation/webdriver/support_features/select_lists/2023-11-17T04:17:19-06:00https://www.selenium.dev/pt-br/documentation/webdriver/getting_started/using_selenium/2024-08-19T13:07:19-04:00https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/fresh_browser_per_test/2022-07-28T14:45:40+05:30https://www.selenium.dev/pt-br/documentation/webdriver/bidi/w3c/log/2024-07-10T08:34:50-07:00https://www.selenium.dev/pt-br/documentation/grid/advanced_features/2023-10-24T23:55:35+01:00https://www.selenium.dev/pt-br/documentation/test_practices/2022-11-14T16:09:47+00:00https://www.selenium.dev/pt-br/documentation/webdriver/actions_api/2024-08-04T14:23:15+05:30https://www.selenium.dev/pt-br/documentation/legacy/2023-06-27T20:27:08+05:30https://www.selenium.dev/pt-br/documentation/webdriver/bidi/w3c/2024-07-10T08:34:50-07:00https://www.selenium.dev/pt-br/documentation/about/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/interactions/virtual_authenticator/2024-05-30T17:43:45+07:00https://www.selenium.dev/pt-br/documentation/webdriver/support_features/2023-10-25T10:47:57+01:00https://www.selenium.dev/pt-br/documentation/webdriver/troubleshooting/2023-01-03T15:59:19-06:00https://www.selenium.dev/pt-br/documentation/webdriver/support_features/expected_conditions/2023-11-17T04:17:19-06:00https://www.selenium.dev/pt-br/categories/https://www.selenium.dev/pt-br/documentation/2023-11-17T04:17:19-06:00https://www.selenium.dev/pt-br/2023-06-27T20:27:08+05:30https://www.selenium.dev/pt-br/tags/https://www.selenium.dev/pt-br/year/ \ No newline at end of file +https://www.selenium.dev/pt-br/documentation/grid/configuration/help/2022-11-17T14:56:19+00:00https://www.selenium.dev/pt-br/documentation/webdriver/bidi/w3c/browsing_context/2024-08-04T20:33:33+05:30https://www.selenium.dev/pt-br/documentation/webdriver/bidi/w3c/input/2024-08-04T20:33:33+05:30https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/captchas/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/test_practices/design_strategies/2023-04-17T22:48:24+05:30https://www.selenium.dev/pt-br/documentation/about/copyright/2023-10-03T09:53:03+08:00https://www.selenium.dev/pt-br/documentation/overview/components/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/elements/file_upload/2023-11-17T04:17:19-06:00https://www.selenium.dev/pt-br/documentation/webdriver/interactions/navigation/2024-08-05T09:10:29+02:00https://www.selenium.dev/pt-br/documentation/webdriver/bidi/w3c/network/2024-08-04T20:33:33+05:30https://www.selenium.dev/pt-br/documentation/grid/advanced_features/observability/2023-10-24T23:55:35+01:00https://www.selenium.dev/pt-br/documentation/overview/2024-02-06T13:33:24+00:00https://www.selenium.dev/pt-br/documentation/webdriver/bidi/w3c/script/2024-07-10T08:34:50-07:00https://www.selenium.dev/pt-br/documentation/webdriver/interactions/alerts/2024-08-17T09:21:57+02:00https://www.selenium.dev/pt-br/documentation/webdriver/getting_started/2023-05-25T18:11:20-06:00https://www.selenium.dev/pt-br/documentation/grid/getting_started/2023-05-25T18:11:20-06:00https://www.selenium.dev/pt-br/documentation/about/contributing/2023-11-22T13:11:12-06:00https://www.selenium.dev/pt-br/documentation/overview/details/2022-11-15T12:05:40+00:00https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/file_downloads/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/troubleshooting/errors/2023-05-25T18:11:20-06:00https://www.selenium.dev/pt-br/documentation/webdriver/elements/finders/2024-08-19T13:15:06-04:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_3/grid_3/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_ide/html_runner/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/webdriver/getting_started/install_library/2024-08-14T01:32:57-04:00https://www.selenium.dev/pt-br/documentation/webdriver/elements/interactions/2024-07-19T10:00:08+02:00https://www.selenium.dev/pt-br/documentation/ie_driver_server/internals/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/webdriver/support_features/listeners/2023-11-17T04:17:19-06:00https://www.selenium.dev/pt-br/documentation/webdriver/bidi/cdp/logging/2024-08-17T21:40:33+08:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_2/upgrading/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/grid/configuration/cli_options/2024-04-23T12:32:53+00:00https://www.selenium.dev/pt-br/documentation/webdriver/drivers/options/2024-08-19T05:43:24-04:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_1/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/test_practices/overview/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/grid/advanced_features/graphql_support/2022-01-24T18:46:50+05:30https://www.selenium.dev/pt-br/documentation/webdriver/actions_api/keyboard/2024-08-04T14:23:15+05:30https://www.selenium.dev/pt-br/documentation/test_practices/testing_types/2023-10-25T04:28:40+05:30https://www.selenium.dev/pt-br/documentation/webdriver/2024-03-29T20:25:04+05:30https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/http_response_codes/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/drivers/2024-08-08T23:45:14-07:00https://www.selenium.dev/pt-br/documentation/webdriver/drivers/http_client/2024-05-05T17:53:16+02:00https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/page_object_models/2023-07-20T04:44:31-03:00https://www.selenium.dev/pt-br/documentation/grid/advanced_features/endpoints/2024-04-24T14:15:02+00:00https://www.selenium.dev/pt-br/documentation/selenium_manager/2024-08-19T10:20:03-04:00https://www.selenium.dev/pt-br/documentation/webdriver/drivers/service/2024-05-29T18:35:18+02:00https://www.selenium.dev/pt-br/documentation/grid/configuration/toml_options/2024-04-23T12:32:53+00:00https://www.selenium.dev/pt-br/documentation/webdriver/support_features/colors/2023-08-03T23:04:23-05:00https://www.selenium.dev/pt-br/documentation/webdriver/browsers/chrome/2024-07-10T08:34:50-07:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_3/grid_setup/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/webdriver/troubleshooting/errors/driver_location/2023-11-17T04:17:19-06:00https://www.selenium.dev/pt-br/documentation/grid/2024-02-06T13:37:55+00:00https://www.selenium.dev/pt-br/documentation/webdriver/elements/information/2024-08-08T11:46:01+05:30https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/domain_specific_language/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/elements/locators/2024-08-22T04:22:37-04:00https://www.selenium.dev/pt-br/documentation/webdriver/troubleshooting/logging/2024-01-24T01:16:53+03:00https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/gmail_email_and_facebook_logins/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/actions_api/mouse/2024-08-04T13:48:45+05:30https://www.selenium.dev/pt-br/documentation/webdriver/browsers/2022-11-03T09:08:46+00:00https://www.selenium.dev/pt-br/documentation/webdriver/bidi/cdp/network/2024-08-17T21:40:33+08:00https://www.selenium.dev/pt-br/documentation/grid/advanced_features/customize_node/2024-05-17T13:30:43-04:00https://www.selenium.dev/pt-br/documentation/grid/applicability/2022-11-15T15:53:55+00:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_2/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/webdriver/interactions/cookies/2024-04-06T20:06:30+05:30https://www.selenium.dev/pt-br/documentation/webdriver/actions_api/pen/2023-11-17T04:17:19-06:00https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/test_dependency/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/browsers/edge/2024-07-10T08:34:50-07:00https://www.selenium.dev/pt-br/documentation/grid/advanced_features/external_datastore/2023-06-27T20:27:08+05:30https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/generating_application_state/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/grid/components/2023-07-05T20:45:15+05:30https://www.selenium.dev/pt-br/documentation/webdriver/waits/2024-05-07T19:44:07+05:30https://www.selenium.dev/pt-br/documentation/webdriver/browsers/firefox/2024-05-30T13:53:58+02:00https://www.selenium.dev/pt-br/documentation/webdriver/interactions/frames/2022-12-12T15:17:34+01:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_3/grid_components/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/webdriver/actions_api/wheel/2024-08-04T14:23:15+05:30https://www.selenium.dev/pt-br/documentation/webdriver/bidi/cdp/script/2024-08-17T21:40:33+08:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_3/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_2/remote_server/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/mock_external_services/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/about/style/2023-11-22T17:00:07-06:00https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/performance_testing/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/support_features/thread_guard/2022-09-23T10:06:16-05:00https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/2022-11-14T16:09:47+00:00https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/link_spidering/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/improved_reporting/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/two_factor_authentication/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/grid/configuration/2022-11-17T14:56:19+00:00https://www.selenium.dev/pt-br/documentation/webdriver/elements/2023-04-04T19:09:53+01:00https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/avoid_sharing_state/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/browsers/internet_explorer/2024-06-19T14:08:20+02:00https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/locators/2022-02-10T18:17:05+08:00https://www.selenium.dev/pt-br/documentation/test_practices/discouraged/2022-11-14T16:09:47+00:00https://www.selenium.dev/pt-br/documentation/webdriver/getting_started/first_script/2024-08-17T11:16:15-04:00https://www.selenium.dev/pt-br/documentation/legacy/selenium_ide/2022-01-10T05:07:37-06:00https://www.selenium.dev/pt-br/documentation/ie_driver_server/2023-10-24T23:55:35+01:00https://www.selenium.dev/pt-br/documentation/webdriver/interactions/windows/2024-07-05T15:23:34+05:30https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/test_independency/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/grid/architecture/2022-12-01T21:25:10+00:00https://www.selenium.dev/pt-br/documentation/webdriver/bidi/cdp/2024-08-17T21:40:33+08:00https://www.selenium.dev/pt-br/documentation/webdriver/troubleshooting/upgrade_to_selenium_4/2024-04-29T06:34:50+02:00https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/consider_using_a_fluent_api/2023-05-17T19:23:53+10:00https://www.selenium.dev/pt-br/documentation/ide/2022-11-10T08:57:29+00:00https://www.selenium.dev/pt-br/documentation/webdriver/interactions/2024-08-05T09:10:29+02:00https://www.selenium.dev/pt-br/documentation/webdriver/drivers/remote_webdriver/2024-07-27T11:43:12+05:30https://www.selenium.dev/pt-br/documentation/webdriver/browsers/safari/2024-07-08T07:13:22+02:00https://www.selenium.dev/pt-br/documentation/webdriver/support_features/select_lists/2023-11-17T04:17:19-06:00https://www.selenium.dev/pt-br/documentation/webdriver/getting_started/using_selenium/2024-08-19T13:07:19-04:00https://www.selenium.dev/pt-br/documentation/test_practices/encouraged/fresh_browser_per_test/2022-07-28T14:45:40+05:30https://www.selenium.dev/pt-br/documentation/webdriver/bidi/w3c/log/2024-07-10T08:34:50-07:00https://www.selenium.dev/pt-br/documentation/grid/advanced_features/2023-10-24T23:55:35+01:00https://www.selenium.dev/pt-br/documentation/test_practices/2022-11-14T16:09:47+00:00https://www.selenium.dev/pt-br/documentation/webdriver/actions_api/2024-08-04T14:23:15+05:30https://www.selenium.dev/pt-br/documentation/legacy/2023-06-27T20:27:08+05:30https://www.selenium.dev/pt-br/documentation/webdriver/bidi/w3c/2024-07-10T08:34:50-07:00https://www.selenium.dev/pt-br/documentation/about/2021-12-07T06:38:55-06:00https://www.selenium.dev/pt-br/documentation/webdriver/interactions/virtual_authenticator/2024-05-30T17:43:45+07:00https://www.selenium.dev/pt-br/documentation/webdriver/support_features/2023-10-25T10:47:57+01:00https://www.selenium.dev/pt-br/documentation/webdriver/troubleshooting/2023-01-03T15:59:19-06:00https://www.selenium.dev/pt-br/documentation/webdriver/support_features/expected_conditions/2023-11-17T04:17:19-06:00https://www.selenium.dev/pt-br/categories/https://www.selenium.dev/pt-br/documentation/2023-11-17T04:17:19-06:00https://www.selenium.dev/pt-br/2023-06-27T20:27:08+05:30https://www.selenium.dev/pt-br/tags/https://www.selenium.dev/pt-br/year/ \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index ede748438a51..7259ebdf1ee5 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1 +1 @@ -https://www.selenium.dev/en/sitemap.xml2024-08-21T00:14:11-07:00https://www.selenium.dev/pt-br/sitemap.xml2024-08-19T13:15:06-04:00https://www.selenium.dev/zh-cn/sitemap.xml2024-08-19T13:15:06-04:00https://www.selenium.dev/ja/sitemap.xml2024-08-19T13:15:06-04:00https://www.selenium.dev/other/sitemap.xml2023-06-27T20:27:08+05:30 \ No newline at end of file +https://www.selenium.dev/en/sitemap.xml2024-08-22T04:22:37-04:00https://www.selenium.dev/pt-br/sitemap.xml2024-08-22T04:22:37-04:00https://www.selenium.dev/zh-cn/sitemap.xml2024-08-22T04:22:37-04:00https://www.selenium.dev/ja/sitemap.xml2024-08-22T04:22:37-04:00https://www.selenium.dev/other/sitemap.xml2023-06-27T20:27:08+05:30 \ No newline at end of file diff --git a/zh-cn/documentation/_print/index.html b/zh-cn/documentation/_print/index.html index 24c8bd281bf8..42443b479173 100644 --- a/zh-cn/documentation/_print/index.html +++ b/zh-cn/documentation/_print/index.html @@ -3173,7 +3173,28 @@
    val driver = ChromeDriver()
 	val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
-  

Relative Locators

Selenium 4 introduces Relative Locators (previously +

Utilizing Locators

The FindElement makes using locators a breeze! For most languages, all you need to do is utilize webdriver.common.by.By, however in others it’s as simple as setting a parameter in the FindElement function>

Move Code

    import org.openqa.selenium.By;
+    WebDriver driver = new ChromeDriver();
+	driver.findElement(By.className("information"));
+  
    from selenium.webdriver.common.by import By
+    driver = webdriver.Chrome()
+	driver.find_element(By.CLASS_NAME, "information")
+  
    var driver = new ChromeDriver();
+	driver.FindElement(By.ClassName("information"));
+  
    driver.find_element(class: 'information')
    let driver = await new Builder().forBrowser('chrome').build();
+	const loc = await driver.findElement(By.className('information'));
+  
+
    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	val loc: WebElement = driver.findElement(By.className("information"))
+  

Relative Locators

Selenium 4 introduces Relative Locators (previously called as Friendly Locators). These locators are helpful when it is not easy to construct a locator for the desired element, but easy to describe spatially where the element is in relation to an element that does have an easily constructed locator.

How it works

Selenium uses the JavaScript function @@ -3181,55 +3202,55 @@ to determine the size and position of elements on the page, and can use this information to locate neighboring elements.
find the relative elements.

Relative locator methods can take as the argument for the point of origin, either a previously located element reference, or another locator. In these examples we’ll be using locators only, but you could swap the locator in the final method with an element object and it will work the same.

Let us consider the below example for understanding the relative locators.

Relative Locators

Available relative locators

Above

If the email text field element is not easily identifiable for some reason, but the password text field element is, -we can locate the text field element using the fact that it is an “input” element “above” the password element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, -we can locate the text field element using the fact that it is an “input” element “below” the email element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, -we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, +we can locate the text field element using the fact that it is an “input” element “below” the email element.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, -we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, +we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to -identify an element that is at most 50px away from the provided locator. -One great use case for this is to work with a form element that doesn’t have an easily constructed locator, -but its associated input label element does.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, +we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to +identify an element that is at most 50px away from the provided locator. +One great use case for this is to work with a form element that doesn’t have an easily constructed locator, +but its associated input label element does.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

2.5.5 - 关于网络元素的信息

元素相关的知识.

您可以查询有关特定元素的许多详细信息。

是否显示

此方法用于检查连接的元素是否正确显示在网页上. 返回一个 Boolean 值, +Kotlin

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

2.5.5 - 关于网络元素的信息

元素相关的知识.

您可以查询有关特定元素的许多详细信息。

是否显示

此方法用于检查连接的元素是否正确显示在网页上. 返回一个 Boolean 值, 如果连接的元素显示在当前的浏览器上下文中,则为True,否则返回false。

此功能于W3C规范中提及, 但由于无法覆盖所有潜在条件而无法定义。 因此,Selenium不能期望驱动程序直接实现这种功能,现在依赖于直接执行大量JavaScript函数。 @@ -13329,7 +13350,7 @@ 若本文档所含信息引起的任何损失或损害, 作者和出版者对所有个人或实体均不承担任何责任. 不承担任何与使用本文信息相关的专利责任.

归属

感谢:

Selenium Main Repository

-5319 commits
+5320 commits
3352 commits
@@ -13621,9 +13642,9 @@ 538 commits
-217 commits
+219 commits
-153 commits
+154 commits
134 commits
@@ -13827,7 +13848,7 @@ 232 commits
-119 commits
+121 commits
114 commits
@@ -13879,6 +13900,8 @@ 6 commits
+6 commits
+ 6 commits
6 commits
@@ -13895,8 +13918,6 @@ 5 commits
-5 commits
- 5 commits
5 commits
@@ -13973,10 +13994,10 @@ 2 commits
+2 commits
+ 2 commits
-2 commits
- 2 commits
2 commits
@@ -13995,6 +14016,8 @@ 2 commits
+2 commits
+ 2 commits
2 commits
@@ -14015,8 +14038,6 @@ 2 commits
-2 commits
- 2 commits

Previous Selenium Website

417 commits
diff --git a/zh-cn/documentation/about/_print/index.html b/zh-cn/documentation/about/_print/index.html index 92afdca84b3e..bd39d41d2e44 100644 --- a/zh-cn/documentation/about/_print/index.html +++ b/zh-cn/documentation/about/_print/index.html @@ -26,7 +26,7 @@ 若本文档所含信息引起的任何损失或损害, 作者和出版者对所有个人或实体均不承担任何责任. 不承担任何与使用本文信息相关的专利责任.

归属

感谢:

Selenium Main Repository

-5319 commits
+5320 commits
3352 commits
@@ -318,9 +318,9 @@ 538 commits
-217 commits
+219 commits
-153 commits
+154 commits
134 commits
@@ -524,7 +524,7 @@ 232 commits
-119 commits
+121 commits
114 commits
@@ -576,6 +576,8 @@ 6 commits
+6 commits
+ 6 commits
6 commits
@@ -592,8 +594,6 @@ 5 commits
-5 commits
- 5 commits
5 commits
@@ -670,10 +670,10 @@ 2 commits
+2 commits
+ 2 commits
-2 commits
- 2 commits
2 commits
@@ -692,6 +692,8 @@ 2 commits
+2 commits
+ 2 commits
2 commits
@@ -712,8 +714,6 @@ 2 commits
-2 commits
- 2 commits

Previous Selenium Website

417 commits
diff --git a/zh-cn/documentation/about/copyright/index.html b/zh-cn/documentation/about/copyright/index.html index 59097e5ba52c..1a0b39c61717 100644 --- a/zh-cn/documentation/about/copyright/index.html +++ b/zh-cn/documentation/about/copyright/index.html @@ -20,7 +20,7 @@ 若本文档所含信息引起的任何损失或损害, 作者和出版者对所有个人或实体均不承担任何责任. 不承担任何与使用本文信息相关的专利责任.

归属

感谢:

Selenium Main Repository

-5319 commits
+5320 commits
3352 commits
@@ -312,9 +312,9 @@ 538 commits
-217 commits
+219 commits
-153 commits
+154 commits
134 commits
@@ -518,7 +518,7 @@ 232 commits
-119 commits
+121 commits
114 commits
@@ -570,6 +570,8 @@ 6 commits
+6 commits
+ 6 commits
6 commits
@@ -586,8 +588,6 @@ 5 commits
-5 commits
- 5 commits
5 commits
@@ -664,10 +664,10 @@ 2 commits
+2 commits
+ 2 commits
-2 commits
- 2 commits
2 commits
@@ -686,6 +686,8 @@ 2 commits
+2 commits
+ 2 commits
2 commits
@@ -706,8 +708,6 @@ 2 commits
-2 commits
- 2 commits

Previous Selenium Website

417 commits
diff --git a/zh-cn/documentation/webdriver/_print/index.html b/zh-cn/documentation/webdriver/_print/index.html index fc7f84a891bc..ad945aa8ab64 100644 --- a/zh-cn/documentation/webdriver/_print/index.html +++ b/zh-cn/documentation/webdriver/_print/index.html @@ -3024,7 +3024,28 @@
    val driver = ChromeDriver()
 	val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
-  

Relative Locators

Selenium 4 introduces Relative Locators (previously +

Utilizing Locators

The FindElement makes using locators a breeze! For most languages, all you need to do is utilize webdriver.common.by.By, however in others it’s as simple as setting a parameter in the FindElement function>

Move Code

    import org.openqa.selenium.By;
+    WebDriver driver = new ChromeDriver();
+	driver.findElement(By.className("information"));
+  
    from selenium.webdriver.common.by import By
+    driver = webdriver.Chrome()
+	driver.find_element(By.CLASS_NAME, "information")
+  
    var driver = new ChromeDriver();
+	driver.FindElement(By.ClassName("information"));
+  
    driver.find_element(class: 'information')
    let driver = await new Builder().forBrowser('chrome').build();
+	const loc = await driver.findElement(By.className('information'));
+  
+
    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	val loc: WebElement = driver.findElement(By.className("information"))
+  

Relative Locators

Selenium 4 introduces Relative Locators (previously called as Friendly Locators). These locators are helpful when it is not easy to construct a locator for the desired element, but easy to describe spatially where the element is in relation to an element that does have an easily constructed locator.

How it works

Selenium uses the JavaScript function @@ -3032,55 +3053,55 @@ to determine the size and position of elements on the page, and can use this information to locate neighboring elements.
find the relative elements.

Relative locator methods can take as the argument for the point of origin, either a previously located element reference, or another locator. In these examples we’ll be using locators only, but you could swap the locator in the final method with an element object and it will work the same.

Let us consider the below example for understanding the relative locators.

Relative Locators

Available relative locators

Above

If the email text field element is not easily identifiable for some reason, but the password text field element is, -we can locate the text field element using the fact that it is an “input” element “above” the password element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, -we can locate the text field element using the fact that it is an “input” element “below” the email element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, -we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, +we can locate the text field element using the fact that it is an “input” element “below” the email element.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, -we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, +we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to -identify an element that is at most 50px away from the provided locator. -One great use case for this is to work with a form element that doesn’t have an easily constructed locator, -but its associated input label element does.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, +we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to +identify an element that is at most 50px away from the provided locator. +One great use case for this is to work with a form element that doesn’t have an easily constructed locator, +but its associated input label element does.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

5.5 - 关于网络元素的信息

元素相关的知识.

您可以查询有关特定元素的许多详细信息。

是否显示

此方法用于检查连接的元素是否正确显示在网页上. 返回一个 Boolean 值, +Kotlin

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

5.5 - 关于网络元素的信息

元素相关的知识.

您可以查询有关特定元素的许多详细信息。

是否显示

此方法用于检查连接的元素是否正确显示在网页上. 返回一个 Boolean 值, 如果连接的元素显示在当前的浏览器上下文中,则为True,否则返回false。

此功能于W3C规范中提及, 但由于无法覆盖所有潜在条件而无法定义。 因此,Selenium不能期望驱动程序直接实现这种功能,现在依赖于直接执行大量JavaScript函数。 diff --git a/zh-cn/documentation/webdriver/elements/_print/index.html b/zh-cn/documentation/webdriver/elements/_print/index.html index fd422b64e067..6e37711c4282 100644 --- a/zh-cn/documentation/webdriver/elements/_print/index.html +++ b/zh-cn/documentation/webdriver/elements/_print/index.html @@ -761,7 +761,28 @@

    val driver = ChromeDriver()
 	val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
-  

Relative Locators

Selenium 4 introduces Relative Locators (previously +

Utilizing Locators

The FindElement makes using locators a breeze! For most languages, all you need to do is utilize webdriver.common.by.By, however in others it’s as simple as setting a parameter in the FindElement function>

Move Code

    import org.openqa.selenium.By;
+    WebDriver driver = new ChromeDriver();
+	driver.findElement(By.className("information"));
+  
    from selenium.webdriver.common.by import By
+    driver = webdriver.Chrome()
+	driver.find_element(By.CLASS_NAME, "information")
+  
    var driver = new ChromeDriver();
+	driver.FindElement(By.ClassName("information"));
+  
    driver.find_element(class: 'information')
    let driver = await new Builder().forBrowser('chrome').build();
+	const loc = await driver.findElement(By.className('information'));
+  
+
    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	val loc: WebElement = driver.findElement(By.className("information"))
+  

Relative Locators

Selenium 4 introduces Relative Locators (previously called as Friendly Locators). These locators are helpful when it is not easy to construct a locator for the desired element, but easy to describe spatially where the element is in relation to an element that does have an easily constructed locator.

How it works

Selenium uses the JavaScript function @@ -769,55 +790,55 @@ to determine the size and position of elements on the page, and can use this information to locate neighboring elements.
find the relative elements.

Relative locator methods can take as the argument for the point of origin, either a previously located element reference, or another locator. In these examples we’ll be using locators only, but you could swap the locator in the final method with an element object and it will work the same.

Let us consider the below example for understanding the relative locators.

Relative Locators

Available relative locators

Above

If the email text field element is not easily identifiable for some reason, but the password text field element is, -we can locate the text field element using the fact that it is an “input” element “above” the password element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, -we can locate the text field element using the fact that it is an “input” element “below” the email element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, -we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, +we can locate the text field element using the fact that it is an “input” element “below” the email element.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, -we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, +we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to -identify an element that is at most 50px away from the provided locator. -One great use case for this is to work with a form element that doesn’t have an easily constructed locator, -but its associated input label element does.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, +we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to +identify an element that is at most 50px away from the provided locator. +One great use case for this is to work with a form element that doesn’t have an easily constructed locator, +but its associated input label element does.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

5 - 关于网络元素的信息

元素相关的知识.

您可以查询有关特定元素的许多详细信息。

是否显示

此方法用于检查连接的元素是否正确显示在网页上. 返回一个 Boolean 值, +Kotlin

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

5 - 关于网络元素的信息

元素相关的知识.

您可以查询有关特定元素的许多详细信息。

是否显示

此方法用于检查连接的元素是否正确显示在网页上. 返回一个 Boolean 值, 如果连接的元素显示在当前的浏览器上下文中,则为True,否则返回false。

此功能于W3C规范中提及, 但由于无法覆盖所有潜在条件而无法定义。 因此,Selenium不能期望驱动程序直接实现这种功能,现在依赖于直接执行大量JavaScript函数。 diff --git a/zh-cn/documentation/webdriver/elements/locators/index.html b/zh-cn/documentation/webdriver/elements/locators/index.html index 248cbadc33fd..240ae136a40a 100644 --- a/zh-cn/documentation/webdriver/elements/locators/index.html +++ b/zh-cn/documentation/webdriver/elements/locators/index.html @@ -1,7 +1,7 @@ 定位策略 | Selenium

定位策略

在DOM中标识一个或多个特定元素的方法.

定位器是在页面上标识元素的一种方法。它是传送给 + 整节打印



定位策略

在DOM中标识一个或多个特定元素的方法.

定位器是在页面上标识元素的一种方法。它是传送给 查找元素 方法的参数。

查看 鼓励测试练习 寻找 定位器的小技巧, 包含在查找方法中,不同时间,不同原因下,单独声明的定位器的使用方法。

元素选择策略

在 WebDriver 中有 8 种不同的内置元素定位策略:

定位器 Locator描述
class name定位class属性与搜索值匹配的元素(不允许使用复合类名)
css selector定位 CSS 选择器匹配的元素
id定位 id 属性与搜索值匹配的元素
name定位 name 属性与搜索值匹配的元素
link text定位link text可视文本与搜索值完全匹配的锚元素
partial link text定位link text可视文本部分与搜索值部分匹配的锚点元素。如果匹配多个元素,则只选择第一个元素。
tag name定位标签名称与搜索值匹配的元素
xpath定位与 XPath 表达式匹配的元素

Creating Locators

To work on a web element using Selenium, we need to first locate it on the web page. Selenium provides us above mentioned ways, using which we can locate element on the @@ -214,7 +214,28 @@

    val driver = ChromeDriver()
 	val loc: WebElement = driver.findElement(By.xpath('//input[@value='f']'))
-  

Relative Locators

Selenium 4 introduces Relative Locators (previously +

Utilizing Locators

The FindElement makes using locators a breeze! For most languages, all you need to do is utilize webdriver.common.by.By, however in others it’s as simple as setting a parameter in the FindElement function>

Move Code

    import org.openqa.selenium.By;
+    WebDriver driver = new ChromeDriver();
+	driver.findElement(By.className("information"));
+  
    from selenium.webdriver.common.by import By
+    driver = webdriver.Chrome()
+	driver.find_element(By.CLASS_NAME, "information")
+  
    var driver = new ChromeDriver();
+	driver.FindElement(By.ClassName("information"));
+  
    driver.find_element(class: 'information')
    let driver = await new Builder().forBrowser('chrome').build();
+	const loc = await driver.findElement(By.className('information'));
+  
+
    import org.openqa.selenium.By
+    val driver = ChromeDriver()
+	val loc: WebElement = driver.findElement(By.className("information"))
+  

Relative Locators

Selenium 4 introduces Relative Locators (previously called as Friendly Locators). These locators are helpful when it is not easy to construct a locator for the desired element, but easy to describe spatially where the element is in relation to an element that does have an easily constructed locator.

How it works

Selenium uses the JavaScript function @@ -222,53 +243,53 @@ to determine the size and position of elements on the page, and can use this information to locate neighboring elements.
find the relative elements.

Relative locator methods can take as the argument for the point of origin, either a previously located element reference, or another locator. In these examples we’ll be using locators only, but you could swap the locator in the final method with an element object and it will work the same.

Let us consider the below example for understanding the relative locators.

Relative Locators

Available relative locators

Above

If the email text field element is not easily identifiable for some reason, but the password text field element is, -we can locate the text field element using the fact that it is an “input” element “above” the password element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, -we can locate the text field element using the fact that it is an “input” element “below” the email element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, -we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
email_locator = locate_with(By.TAG_NAME, "input").above({By.ID: "password"})
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
      driver.find_element({relative: {tag_name: 'input', above: {id: 'password'}}})
let emailLocator = locateWith(By.tagName('input')).above(By.id('password'));
val emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"))

Below

If the password text field element is not easily identifiable for some reason, but the email text field element is, +we can locate the text field element using the fact that it is an “input” element “below” the email element.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, -we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
password_locator = locate_with(By.TAG_NAME, "input").below({By.ID: "email"})
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
      driver.find_element({relative: {tag_name: 'input', below: {id: 'email'}}})
let passwordLocator = locateWith(By.tagName('input')).below(By.id('email'));
val passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"))

Left of

If the cancel button is not easily identifiable for some reason, but the submit button element is, +we can locate the cancel button element using the fact that it is a “button” element to the “left of” the submit element.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to -identify an element that is at most 50px away from the provided locator. -One great use case for this is to work with a form element that doesn’t have an easily constructed locator, -but its associated input label element does.

By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
cancel_locator = locate_with(By.TAG_NAME, "button").to_left_of({By.ID: "submit"})
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
      driver.find_element({relative: {tag_name: 'button', left: {id: 'submit'}}})
let cancelLocator = locateWith(By.tagName('button')).toLeftOf(By.id('submit'));
val cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"))

Right of

If the submit button is not easily identifiable for some reason, but the cancel button element is, +we can locate the submit button element using the fact that it is a “button” element “to the right of” the cancel element.

By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
email_locator = locate_with(By.TAG_NAME, "input").near({By.ID: "lbl-email"})
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
      driver.find_element({relative: {tag_name: 'input', near: {id: 'lbl-email'}}})
let emailLocator = locateWith(By.tagName('input')).near(By.id('lbl-email'));
val emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"))

Near

If the relative positioning is not obvious, or it varies based on window size, you can use the near method to +identify an element that is at most 50px away from the provided locator. +One great use case for this is to work with a form element that doesn’t have an easily constructed locator, +but its associated input label element does.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

Development Partners

Selenium Level Sponsors

Support the Selenium Project

Learn more or view the full list of sponsors.

Learn more +Kotlin

Chaining relative locators

You can also chain locators if needed. Sometimes the element is most easily identified as being both above/below one element and right/left of another.

By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
submit_locator = locate_with(By.TAG_NAME, "button").below({By.ID: "email"}).to_right_of({By.ID: "cancel"})
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));
      driver.find_element({relative: {tag_name: 'button', below: {id: 'email'}, right: {id: 'cancel'}}})
let submitLocator = locateWith(By.tagName('button')).below(By.id('email')).toRightOf(By.id('cancel'));
val submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"))

Development Partners

Selenium Level Sponsors

Support the Selenium Project

Learn more or view the full list of sponsors.

\ No newline at end of file diff --git a/zh-cn/index.xml b/zh-cn/index.xml index 0a716de5ba7b..ef6610c49781 100644 --- a/zh-cn/index.xml +++ b/zh-cn/index.xml @@ -13,7 +13,7 @@ Selenium v4.18 const intercept = await network.addIntercept(new AddInterceptParameters(InterceptPhase.BEFORE_REQUEST_SENT)) View full example on GitHub Add Example
Scripthttps://www.selenium.dev/zh-cn/documentation/webdriver/bidi/w3c/script/Mon, 01 Jan 0001 00:00:00 +0000https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/w3c/script/Page being translated from English to Chinese. Do you speak Chinese? Help us to translate it by sending us pull requests! Commands This section contains the APIs related to script commands. Call function in a browsing context Java Ruby JavaScript Kotlin Selenium v4.15 try (Script script = new Script(id, driver)) { List&lt;LocalValue&gt; arguments = new ArrayList&lt;&gt;(); arguments.add(PrimitiveProtocolValue.numberValue(22)); Map&lt;Object, LocalValue&gt; value = new HashMap&lt;&gt;(); value.put(&#34;some_property&#34;, LocalValue.numberValue(42)); LocalValue thisParameter = LocalValue.objectValue(value); arguments.版权和归属https://www.selenium.dev/zh-cn/documentation/about/copyright/Mon, 01 Jan 0001 00:00:00 +0000https://www.selenium.dev/zh-cn/documentation/about/copyright/Selenium文档 我们已尽一切努力使本文档尽可能完整和准确, 但难以保证一定适用. 信息提供是基于“as-is”的. 若本文档所含信息引起的任何损失或损害, 作者和出版者对所有个人或实体均不承担任何责任. 不承担任何与使用本文信息相关的专利责任. -归属 感谢: Selenium Main Repository @shs96c 5319 commits @barancev 3352 commits @jimevans 2478 commits @titusfortner 1592 commits @jleyba 1464 commits @jarib 1299 commits @diemol 1235 commits @AutomatedTester 1223 commits @dfabulich 1175 commits @illicitonion 1162 commits @p0deje 652 commits @lukeis 599 commits @pujagani 504 commits @eranmes 473 commits @mdub 326 commits @bonigarcia 299 commits @andreastt 289 commits @krosenvold 225 commits @hugs 205 commits @symonk 203 commits @davehunt 200 commits @hbchai 191 commits @harsha509 191 commits @lmtierney 179 commits @joerg1985 164 commits @freynaud 138 commits @samitbadle 137 commits @nirvdrum 133 commits @sevaseva 115 commits @gigix 109 commits @juangj 108 commits @nvborisenko 106 commits @selenium-ci 99 commits @aslakhellesoy 94 commits @alex-savchuk 90 commits @dependabot[bot] 84 commits @andrashatvani 66 commits @ajayk 63 commits @twalpole 49 commits @asashour 48 commits @mikemelia 46 commits @tebeka 44 commits @luke-hill 42 commits @raju249 42 commits @santiycr 41 commits @valfirst 40 commits @renovate[bot] 39 commits @sandeepsuryaprasad 37 commits @mach6 36 commits @ddavison 32 commits @joshbruning 30 commits @TamsilAmani 29 commits @mikebroberts 28 commits @JohnChen0 27 commits @iampopovich 25 commits @krmahadevan 25 commits @alb-i986 22 commits @bret 20 commits @cgoldberg 20 commits @corevo 20 commits @Stuk 19 commits @rbri 16 commits @bwalderman 15 commits @VietND96 15 commits @aguspe 14 commits @asolntsev 14 commits @manuelsblanco 13 commits @bayandin 12 commits @carlosgcampos 12 commits @jayakumarc 12 commits @potapovDim 12 commits @43081j 11 commits @detro 10 commits @sbabcoc 10 commits @josephg 10 commits @RustyNail 9 commits @hoefling 9 commits @redsquirrel 9 commits @whimboo 9 commits @isaulv 9 commits @mdmintz 9 commits @mmerrell 8 commits @glibas 7 commits @SinghHrmn 7 commits @llaskin 7 commits @DrMarcII 7 commits @RevealOscar 7 commits @User253489 7 commits @dratler 7 commits @shucon 6 commits @nikolas 6 commits @lauromoura 6 commits @dima-groupon 6 commits @adiohana 5 commits @oddui 5 commits @seanpoulter 5 commits @nschonni 5 commits @JohanLorenzo 5 commits @jimvm 5 commits @jameshilliard 5 commits Selenium IDE @corevo 2445 commits @toddtarsi 396 commits @baimao8437 88 commits @coinzdude 57 commits @Jongkeun 51 commits @petermouse 36 commits @zavelevsky 34 commits @dependabot[bot] 29 commits @LinYunWen 28 commits @xdennisx 15 commits @AutomatedTester 15 commits @smildlzj 12 commits @raju249 12 commits @diemol 7 commits @matewilk 6 commits @manoj9788 3 commits @Rowdster 3 commits @fernandozw 3 commits @mattonem 3 commits @zewa666 3 commits @shs96c 3 commits @toshiya 2 commits @mrgamedev07 2 commits @Meir017 2 commits @lukeis 2 commits @giuliohome 2 commits @cclauss 2 commits @Angus3280 2 commits @peter-lyons-kehl 1 commits @newgenrpa 1 commits @bolasblack 1 commits @vivrichards600 1 commits @swes1117 1 commits @harsha509 1 commits @samitbadle 1 commits @sotayamashita 1 commits @p2635 1 commits @marknoble 1 commits @furkanakkurt1335 1 commits @dvd900 1 commits @cliftonHPE 1 commits @atkulp 1 commits @aplorenzen 1 commits @amitzur 1 commits @AlexGarrity 1 commits Docker Selenium @diemol 538 commits @VietND96 217 commits @selenium-ci 153 commits @ddavison 134 commits @mtscout6 53 commits @renovate[bot] 50 commits @kayabendroth 50 commits @dependabot[bot] 42 commits @elgalu 24 commits @luisfcorreia 15 commits @jamesmortensen 12 commits @WillAbides 8 commits @amardeep2006 7 commits @jsa34 7 commits @MacCracken 5 commits @marten-cz 5 commits @garagepoort 4 commits @metajiji 4 commits @Doofus100500 4 commits @manoj9788 4 commits @ZainabSalameh 4 commits @niQo 4 commits @testphreak 4 commits @chenrui333 4 commits @jeff-jk 3 commits @pabloFuente 3 commits @alexgibson 3 commits @tnguyen14 3 commits @abaldwin-op 3 commits @mtcolman 3 commits @Remi-p 3 commits @msvticket 3 commits @chuckg 2 commits @mhnaeem 2 commits @naveensrinivasan 2 commits @phensley 2 commits @anthonybaldwin 2 commits @ryneeverett 2 commits @wheleph 2 commits @Opvolger 2 commits @budtmo 2 commits @SurelyMario 2 commits @schmunk42 2 commits @kmala 2 commits @evertones 2 commits @baflQA 2 commits @davehunt 2 commits @ilpianista 2 commits @den-is 2 commits @therealdjryan 2 commits @adriangonciarz 2 commits @AutomationD 2 commits @maxmanuylov 2 commits @mathieu-pousse 2 commits @joaoluizjoaquim 2 commits @DrFaust92 2 commits @glibas 2 commits @efranken 2 commits @ehbello 2 commits @Earlopain 2 commits @victor-catalyst 1 commits @trungprivate 1 commits @VinodAnandan 1 commits @Trigtrig 1 commits @vv-p 1 commits @slhck 1 commits @wesmcouch 1 commits @torstenwalter 1 commits @cvakiitho 1 commits @williamlac 1 commits @schmetzyannick 1 commits @nefelim4ag 1 commits @tparikkaatmilliman 1 commits @ThomasMeschke 1 commits @graingert 1 commits @gitter-badger 1 commits @Thab310 1 commits @tadashi0713 1 commits @sylbn 1 commits @subanithak 1 commits @stigkj 1 commits @srguglielmo 1 commits @serlank 1 commits @simonardejr 1 commits @smccarthy-godaddy 1 commits @smccarthy 1 commits @sethuster 1 commits @StegSchreck 1 commits @scottturley 1 commits @mirkotschaeni 1 commits @mkrei 1 commits @neben 1 commits @neilnaveen 1 commits @nom3ad 1 commits @oleg-filiutsich 1 commits @other019 1 commits @ptriller1und1 1 commits @pujan14 1 commits @qxo 1 commits @rklec 1 commits Selenium Website &amp; Docs @harsha509 753 commits @diemol 746 commits @selenium-ci 323 commits @titusfortner 232 commits @renovate[bot] 119 commits @alaahong 114 commits @pujagani 74 commits @kzhirata 47 commits @bonigarcia 37 commits @boris779 32 commits @AutomatedTester 30 commits @pallavigitwork 28 commits @alenros 28 commits @AlexAndradeNet 25 commits @aguspe 25 commits @manoj9788 21 commits @dependabot[bot] 20 commits @jmartinezpoq 18 commits @ivanrodjr 17 commits @luisfcorreia 15 commits @shs96c 13 commits @github-actions[bot] 12 commits @sindhudiddi 12 commits @hiroksarker 10 commits @nwintop 8 commits @testbot206 7 commits @krmahadevan 7 commits @tetration 7 commits @connerT 6 commits @Greavox 6 commits @nvborisenko 6 commits @liushilive 6 commits @fufu930 6 commits @Catalin-Negru 5 commits @davieduardo94 5 commits @smilinrobin 5 commits @lvninety 5 commits @hyanx 5 commits @TamsilAmani 5 commits @shbenzer 5 commits @nainappa 5 commits @Dor-bl 5 commits @deining 4 commits @nevinaydin 4 commits @ant9112 4 commits @VietND96 4 commits @peter-kinzelman 4 commits @kathyrollo 4 commits @kjayachandra2000 4 commits @wcmcgee 4 commits @barancev 4 commits @angelovstanton 4 commits @Tolerblanc 3 commits @BlazerYoo 3 commits @twinstae 3 commits @cambiph 3 commits @TestOpsCloudchen 3 commits @takeyaqa 3 commits @raju249 3 commits @rajeevbarde 3 commits @Madh93 3 commits @mmerrell 3 commits @j3soon 3 commits @jasonren0403 3 commits @jamesmortensen 3 commits @jags14385 3 commits @effeix 3 commits @gnatcatcher-bg 3 commits @ArCiGo 3 commits @Crank4098 3 commits @Arc-Jung 3 commits @ilhanoztozlu 2 commits @eaccmk 2 commits @digitalvoice-nz 2 commits @YoshikiIto 2 commits @sridhar-5 2 commits @urig 2 commits @SparshKesari 2 commits @sangcnguyen 2 commits @Arpan3323 2 commits @coodjokergl 2 commits @sangheon4353 2 commits @selectorshubsanjay 2 commits @SripriyaPKulkarni 2 commits @GavinHaydy 2 commits @imba-tjd 2 commits @k19810703 2 commits @0420syj 2 commits @TheTestLynx 2 commits @beatfactor 2 commits @Afranioalves 2 commits @iambocai 2 commits @Bredda 2 commits @cjayswal 2 commits @bongosway 2 commits @SinghHrmn 2 commits @kapilyadav1204 2 commits @rahuljhakant 2 commits @natanportilho 2 commits @naeemakram 2 commits Previous Selenium Website @lukeis 417 commits @shs96c 87 commits @pgrandje 79 commits @barancev 63 commits @lightbody 59 commits @ajayk 40 commits @tarun3kumar 40 commits @ddavison 36 commits @davehunt 26 commits @manoj9788 24 commits @peter-lyons-kehl 22 commits @lmtierney 21 commits @samitbadle 21 commits @santiycr 19 commits @illicitonion 17 commits @pnewhook 14 commits @AutomatedTester 12 commits @rasmusbergpalm 11 commits @juangj 11 commits @lukeis-sfdc 10 commits @andreastt 7 commits @hugs 6 commits @corevo 5 commits @titusfortner 5 commits @PaulKC 5 commits @llaskin 5 commits @jimevans 5 commits @jarib 5 commits @diemol 3 commits @abhijain2618 2 commits @labkey-tchad 2 commits @paul-hammant 2 commits @mikemelia 2 commits @julianharty 2 commits @hazmeister 2 commits @eranmes 2 commits @darrincherry 2 commits @javabrett 2 commits @alex-savchuk 2 commits @oleksandr-lobunets 2 commits @asashour 2 commits @yasinguzel 1 commits @Vimal-N 1 commits @SteveDesmond-ca 1 commits @harrissAvalon 1 commits @smatei 1 commits @QuinnWilton 1 commits @roydekleijn 1 commits @rbri 1 commits @oifland 1 commits @ohadschn 1 commits @NickAb 1 commits @tobecrazy 1 commits @Zearin 1 commits @beckendorff 1 commits @daveOrleans 1 commits @androiddriver 1 commits @mauk81 1 commits @prab2112 1 commits @refactoror 1 commits @rogerdc 1 commits @tibord 1 commits @ygmarchi 1 commits @agabrys 1 commits @azawawi 1 commits @alb-i986 1 commits @hollingsworthd 1 commits @dylans 1 commits @EmidioStani 1 commits @FagnerMartinsBrack 1 commits @Xaeroxe 1 commits @JamesZoft 1 commits @jleyba 1 commits @JustAGuyTryingToCodeSomething 1 commits @kdamball 1 commits @laurinkeithdavis 1 commits @klamping 1 commits @krmahadevan 1 commits @krosenvold 1 commits @mmerrell 1 commits @grawk 1 commits @mcavigelli 1 commits @michaelwowro 1 commits @muralidharand 1 commits @meeroslaph 1 commits Previous Documentation Rewrite Project @andreastt 197 commits @selenium-ci 105 commits @diemol 54 commits @hazmeister 30 commits @santiycr 27 commits @AlexAndradeNet 25 commits @lukeis 21 commits @harsha509 17 commits @ddavison 16 commits @djangofan 12 commits @orieken 12 commits @manoj9788 12 commits @davehunt 12 commits @liushilive 8 commits @User253489 7 commits @shs96c 6 commits @mmerrell 6 commits @imba-tjd 6 commits @jimholmes 6 commits @vijay44 5 commits @cambiph 5 commits @NickOppersdorff 4 commits @rivlinp 4 commits @sheg 4 commits @bizob2828 4 commits @detro 3 commits @Ardesco 3 commits @TheTestLynx 3 commits @paul-barton 2 commits @ilhanoztozlu 2 commits @hoanluu 2 commits @sri85 2 commits @miekof 2 commits @palotas 2 commits @lmtierney 2 commits @Bredda 2 commits @boris779 2 commits @rakib-amin 1 commits @NRezek 1 commits @nikai3d 1 commits @OndraM 1 commits @sourabhkt 1 commits @whhone 1 commits @yarix 1 commits @ZbigniewZabost 1 commits @agmen 1 commits @hking-shutterfly 1 commits @jimevans 1 commits @948462448 1 commits @marilyn 1 commits @riccione 1 commits @tungla 1 commits @zeljkofilipin 1 commits @MilanMasek 1 commits @misiekofski 1 commits @michael-coleman 1 commits @MartinDelille 1 commits @austenjt 1 commits @nicegraham 1 commits @bongosway 1 commits @donhuvy 1 commits @dennybiasiolli 1 commits @chamiz 1 commits @bhardin 1 commits @abotalov 1 commits @AJ-72 1 commits @p0deje 1 commits @alenros 1 commits @adithyab94 1 commits Selenium文档项目使用的第三方软件: 软件 版本 许可 Hugo v0.配置帮助https://www.selenium.dev/zh-cn/documentation/grid/configuration/help/Mon, 01 Jan 0001 00:00:00 +0000https://www.selenium.dev/zh-cn/documentation/grid/configuration/help/Help命令显示基于当前代码实现的信息. 因此, 如果文档没有更新, 它将提供准确的信息. 这是了解任何新版本Grid4配置的最便捷方法. +归属 感谢: Selenium Main Repository @shs96c 5320 commits @barancev 3352 commits @jimevans 2478 commits @titusfortner 1592 commits @jleyba 1464 commits @jarib 1299 commits @diemol 1235 commits @AutomatedTester 1223 commits @dfabulich 1175 commits @illicitonion 1162 commits @p0deje 652 commits @lukeis 599 commits @pujagani 504 commits @eranmes 473 commits @mdub 326 commits @bonigarcia 299 commits @andreastt 289 commits @krosenvold 225 commits @hugs 205 commits @symonk 203 commits @davehunt 200 commits @hbchai 191 commits @harsha509 191 commits @lmtierney 179 commits @joerg1985 164 commits @freynaud 138 commits @samitbadle 137 commits @nirvdrum 133 commits @sevaseva 115 commits @gigix 109 commits @juangj 108 commits @nvborisenko 106 commits @selenium-ci 99 commits @aslakhellesoy 94 commits @alex-savchuk 90 commits @dependabot[bot] 84 commits @andrashatvani 66 commits @ajayk 63 commits @twalpole 49 commits @asashour 48 commits @mikemelia 46 commits @tebeka 44 commits @luke-hill 42 commits @raju249 42 commits @santiycr 41 commits @valfirst 40 commits @renovate[bot] 39 commits @sandeepsuryaprasad 37 commits @mach6 36 commits @ddavison 32 commits @joshbruning 30 commits @TamsilAmani 29 commits @mikebroberts 28 commits @JohnChen0 27 commits @iampopovich 25 commits @krmahadevan 25 commits @alb-i986 22 commits @bret 20 commits @cgoldberg 20 commits @corevo 20 commits @Stuk 19 commits @rbri 16 commits @bwalderman 15 commits @VietND96 15 commits @aguspe 14 commits @asolntsev 14 commits @manuelsblanco 13 commits @bayandin 12 commits @carlosgcampos 12 commits @jayakumarc 12 commits @potapovDim 12 commits @43081j 11 commits @detro 10 commits @sbabcoc 10 commits @josephg 10 commits @RustyNail 9 commits @hoefling 9 commits @redsquirrel 9 commits @whimboo 9 commits @isaulv 9 commits @mdmintz 9 commits @mmerrell 8 commits @glibas 7 commits @SinghHrmn 7 commits @llaskin 7 commits @DrMarcII 7 commits @RevealOscar 7 commits @User253489 7 commits @dratler 7 commits @shucon 6 commits @nikolas 6 commits @lauromoura 6 commits @dima-groupon 6 commits @adiohana 5 commits @oddui 5 commits @seanpoulter 5 commits @nschonni 5 commits @JohanLorenzo 5 commits @jimvm 5 commits @jameshilliard 5 commits Selenium IDE @corevo 2445 commits @toddtarsi 396 commits @baimao8437 88 commits @coinzdude 57 commits @Jongkeun 51 commits @petermouse 36 commits @zavelevsky 34 commits @dependabot[bot] 29 commits @LinYunWen 28 commits @xdennisx 15 commits @AutomatedTester 15 commits @smildlzj 12 commits @raju249 12 commits @diemol 7 commits @matewilk 6 commits @manoj9788 3 commits @Rowdster 3 commits @fernandozw 3 commits @mattonem 3 commits @zewa666 3 commits @shs96c 3 commits @toshiya 2 commits @mrgamedev07 2 commits @Meir017 2 commits @lukeis 2 commits @giuliohome 2 commits @cclauss 2 commits @Angus3280 2 commits @peter-lyons-kehl 1 commits @newgenrpa 1 commits @bolasblack 1 commits @vivrichards600 1 commits @swes1117 1 commits @harsha509 1 commits @samitbadle 1 commits @sotayamashita 1 commits @p2635 1 commits @marknoble 1 commits @furkanakkurt1335 1 commits @dvd900 1 commits @cliftonHPE 1 commits @atkulp 1 commits @aplorenzen 1 commits @amitzur 1 commits @AlexGarrity 1 commits Docker Selenium @diemol 538 commits @VietND96 219 commits @selenium-ci 154 commits @ddavison 134 commits @mtscout6 53 commits @renovate[bot] 50 commits @kayabendroth 50 commits @dependabot[bot] 42 commits @elgalu 24 commits @luisfcorreia 15 commits @jamesmortensen 12 commits @WillAbides 8 commits @amardeep2006 7 commits @jsa34 7 commits @MacCracken 5 commits @marten-cz 5 commits @garagepoort 4 commits @metajiji 4 commits @Doofus100500 4 commits @manoj9788 4 commits @ZainabSalameh 4 commits @niQo 4 commits @testphreak 4 commits @chenrui333 4 commits @jeff-jk 3 commits @pabloFuente 3 commits @alexgibson 3 commits @tnguyen14 3 commits @abaldwin-op 3 commits @mtcolman 3 commits @Remi-p 3 commits @msvticket 3 commits @chuckg 2 commits @mhnaeem 2 commits @naveensrinivasan 2 commits @phensley 2 commits @anthonybaldwin 2 commits @ryneeverett 2 commits @wheleph 2 commits @Opvolger 2 commits @budtmo 2 commits @SurelyMario 2 commits @schmunk42 2 commits @kmala 2 commits @evertones 2 commits @baflQA 2 commits @davehunt 2 commits @ilpianista 2 commits @den-is 2 commits @therealdjryan 2 commits @adriangonciarz 2 commits @AutomationD 2 commits @maxmanuylov 2 commits @mathieu-pousse 2 commits @joaoluizjoaquim 2 commits @DrFaust92 2 commits @glibas 2 commits @efranken 2 commits @ehbello 2 commits @Earlopain 2 commits @victor-catalyst 1 commits @trungprivate 1 commits @VinodAnandan 1 commits @Trigtrig 1 commits @vv-p 1 commits @slhck 1 commits @wesmcouch 1 commits @torstenwalter 1 commits @cvakiitho 1 commits @williamlac 1 commits @schmetzyannick 1 commits @nefelim4ag 1 commits @tparikkaatmilliman 1 commits @ThomasMeschke 1 commits @graingert 1 commits @gitter-badger 1 commits @Thab310 1 commits @tadashi0713 1 commits @sylbn 1 commits @subanithak 1 commits @stigkj 1 commits @srguglielmo 1 commits @serlank 1 commits @simonardejr 1 commits @smccarthy-godaddy 1 commits @smccarthy 1 commits @sethuster 1 commits @StegSchreck 1 commits @scottturley 1 commits @mirkotschaeni 1 commits @mkrei 1 commits @neben 1 commits @neilnaveen 1 commits @nom3ad 1 commits @oleg-filiutsich 1 commits @other019 1 commits @ptriller1und1 1 commits @pujan14 1 commits @qxo 1 commits @rklec 1 commits Selenium Website &amp; Docs @harsha509 753 commits @diemol 746 commits @selenium-ci 323 commits @titusfortner 232 commits @renovate[bot] 121 commits @alaahong 114 commits @pujagani 74 commits @kzhirata 47 commits @bonigarcia 37 commits @boris779 32 commits @AutomatedTester 30 commits @pallavigitwork 28 commits @alenros 28 commits @AlexAndradeNet 25 commits @aguspe 25 commits @manoj9788 21 commits @dependabot[bot] 20 commits @jmartinezpoq 18 commits @ivanrodjr 17 commits @luisfcorreia 15 commits @shs96c 13 commits @github-actions[bot] 12 commits @sindhudiddi 12 commits @hiroksarker 10 commits @nwintop 8 commits @testbot206 7 commits @krmahadevan 7 commits @tetration 7 commits @connerT 6 commits @Greavox 6 commits @nvborisenko 6 commits @shbenzer 6 commits @liushilive 6 commits @fufu930 6 commits @Catalin-Negru 5 commits @davieduardo94 5 commits @smilinrobin 5 commits @lvninety 5 commits @hyanx 5 commits @TamsilAmani 5 commits @nainappa 5 commits @Dor-bl 5 commits @deining 4 commits @nevinaydin 4 commits @ant9112 4 commits @VietND96 4 commits @peter-kinzelman 4 commits @kathyrollo 4 commits @kjayachandra2000 4 commits @wcmcgee 4 commits @barancev 4 commits @angelovstanton 4 commits @Tolerblanc 3 commits @BlazerYoo 3 commits @twinstae 3 commits @cambiph 3 commits @TestOpsCloudchen 3 commits @takeyaqa 3 commits @raju249 3 commits @rajeevbarde 3 commits @Madh93 3 commits @mmerrell 3 commits @j3soon 3 commits @jasonren0403 3 commits @jamesmortensen 3 commits @jags14385 3 commits @effeix 3 commits @gnatcatcher-bg 3 commits @ArCiGo 3 commits @Crank4098 3 commits @Arc-Jung 3 commits @ilhanoztozlu 2 commits @eaccmk 2 commits @digitalvoice-nz 2 commits @YoshikiIto 2 commits @sridhar-5 2 commits @urig 2 commits @SparshKesari 2 commits @sbabcoc 2 commits @sangcnguyen 2 commits @coodjokergl 2 commits @sangheon4353 2 commits @selectorshubsanjay 2 commits @SripriyaPKulkarni 2 commits @GavinHaydy 2 commits @imba-tjd 2 commits @k19810703 2 commits @0420syj 2 commits @TheTestLynx 2 commits @Arpan3323 2 commits @beatfactor 2 commits @Afranioalves 2 commits @iambocai 2 commits @Bredda 2 commits @cjayswal 2 commits @bongosway 2 commits @SinghHrmn 2 commits @kapilyadav1204 2 commits @rahuljhakant 2 commits @natanportilho 2 commits Previous Selenium Website @lukeis 417 commits @shs96c 87 commits @pgrandje 79 commits @barancev 63 commits @lightbody 59 commits @ajayk 40 commits @tarun3kumar 40 commits @ddavison 36 commits @davehunt 26 commits @manoj9788 24 commits @peter-lyons-kehl 22 commits @lmtierney 21 commits @samitbadle 21 commits @santiycr 19 commits @illicitonion 17 commits @pnewhook 14 commits @AutomatedTester 12 commits @rasmusbergpalm 11 commits @juangj 11 commits @lukeis-sfdc 10 commits @andreastt 7 commits @hugs 6 commits @corevo 5 commits @titusfortner 5 commits @PaulKC 5 commits @llaskin 5 commits @jimevans 5 commits @jarib 5 commits @diemol 3 commits @abhijain2618 2 commits @labkey-tchad 2 commits @paul-hammant 2 commits @mikemelia 2 commits @julianharty 2 commits @hazmeister 2 commits @eranmes 2 commits @darrincherry 2 commits @javabrett 2 commits @alex-savchuk 2 commits @oleksandr-lobunets 2 commits @asashour 2 commits @yasinguzel 1 commits @Vimal-N 1 commits @SteveDesmond-ca 1 commits @harrissAvalon 1 commits @smatei 1 commits @QuinnWilton 1 commits @roydekleijn 1 commits @rbri 1 commits @oifland 1 commits @ohadschn 1 commits @NickAb 1 commits @tobecrazy 1 commits @Zearin 1 commits @beckendorff 1 commits @daveOrleans 1 commits @androiddriver 1 commits @mauk81 1 commits @prab2112 1 commits @refactoror 1 commits @rogerdc 1 commits @tibord 1 commits @ygmarchi 1 commits @agabrys 1 commits @azawawi 1 commits @alb-i986 1 commits @hollingsworthd 1 commits @dylans 1 commits @EmidioStani 1 commits @FagnerMartinsBrack 1 commits @Xaeroxe 1 commits @JamesZoft 1 commits @jleyba 1 commits @JustAGuyTryingToCodeSomething 1 commits @kdamball 1 commits @laurinkeithdavis 1 commits @klamping 1 commits @krmahadevan 1 commits @krosenvold 1 commits @mmerrell 1 commits @grawk 1 commits @mcavigelli 1 commits @michaelwowro 1 commits @muralidharand 1 commits @meeroslaph 1 commits Previous Documentation Rewrite Project @andreastt 197 commits @selenium-ci 105 commits @diemol 54 commits @hazmeister 30 commits @santiycr 27 commits @AlexAndradeNet 25 commits @lukeis 21 commits @harsha509 17 commits @ddavison 16 commits @djangofan 12 commits @orieken 12 commits @manoj9788 12 commits @davehunt 12 commits @liushilive 8 commits @User253489 7 commits @shs96c 6 commits @mmerrell 6 commits @imba-tjd 6 commits @jimholmes 6 commits @vijay44 5 commits @cambiph 5 commits @NickOppersdorff 4 commits @rivlinp 4 commits @sheg 4 commits @bizob2828 4 commits @detro 3 commits @Ardesco 3 commits @TheTestLynx 3 commits @paul-barton 2 commits @ilhanoztozlu 2 commits @hoanluu 2 commits @sri85 2 commits @miekof 2 commits @palotas 2 commits @lmtierney 2 commits @Bredda 2 commits @boris779 2 commits @rakib-amin 1 commits @NRezek 1 commits @nikai3d 1 commits @OndraM 1 commits @sourabhkt 1 commits @whhone 1 commits @yarix 1 commits @ZbigniewZabost 1 commits @agmen 1 commits @hking-shutterfly 1 commits @jimevans 1 commits @948462448 1 commits @marilyn 1 commits @riccione 1 commits @tungla 1 commits @zeljkofilipin 1 commits @MilanMasek 1 commits @misiekofski 1 commits @michael-coleman 1 commits @MartinDelille 1 commits @austenjt 1 commits @nicegraham 1 commits @bongosway 1 commits @donhuvy 1 commits @dennybiasiolli 1 commits @chamiz 1 commits @bhardin 1 commits @abotalov 1 commits @AJ-72 1 commits @p0deje 1 commits @alenros 1 commits @adithyab94 1 commits Selenium文档项目使用的第三方软件: 软件 版本 许可 Hugo v0.配置帮助https://www.selenium.dev/zh-cn/documentation/grid/configuration/help/Mon, 01 Jan 0001 00:00:00 +0000https://www.selenium.dev/zh-cn/documentation/grid/configuration/help/Help命令显示基于当前代码实现的信息. 因此, 如果文档没有更新, 它将提供准确的信息. 这是了解任何新版本Grid4配置的最便捷方法. 信息命令 Info命令提供以下主题的详细文档: 配置Selenium 安全 会话表配置 追踪 配置帮助 通过运行以下命令快速获取配置帮助: java -jar selenium-server-&lt;version&gt;.jar info config 安全 获取构建网格服务器的详细信息, 用于安全通信和节点注册. diff --git a/zh-cn/sitemap.xml b/zh-cn/sitemap.xml index 171801720d22..d70029bd5c70 100644 --- a/zh-cn/sitemap.xml +++ b/zh-cn/sitemap.xml @@ -1 +1 @@ -https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/w3c/browsing_context/2024-08-04T20:33:33+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/w3c/input/2024-08-04T20:33:33+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/w3c/network/2024-08-04T20:33:33+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/w3c/script/2024-07-10T08:34:50-07:00https://www.selenium.dev/zh-cn/documentation/about/copyright/2023-10-03T09:53:03+08:00https://www.selenium.dev/zh-cn/documentation/grid/configuration/help/2021-12-14T22:58:16+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/interactions/navigation/2024-08-05T09:10:29+02:00https://www.selenium.dev/zh-cn/documentation/overview/2024-02-06T13:33:24+00:00https://www.selenium.dev/zh-cn/documentation/test_practices/overview/2021-12-14T22:58:16+08:00https://www.selenium.dev/zh-cn/documentation/grid/advanced_features/observability/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/documentation/overview/components/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/support_features/expected_conditions/2024-07-02T21:59:35+08:00https://www.selenium.dev/zh-cn/documentation/test_practices/design_strategies/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/elements/file_upload/2023-11-17T04:17:19-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/captchas/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/grid/configuration/cli_options/2024-04-23T12:32:53+00:00https://www.selenium.dev/zh-cn/documentation/grid/advanced_features/graphql_support/2022-01-24T18:46:50+05:30https://www.selenium.dev/zh-cn/documentation/legacy/selenium_ide/html_runner/2022-01-10T05:07:37-06:00https://www.selenium.dev/zh-cn/documentation/ie_driver_server/internals/2022-01-10T05:07:37-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/cdp/logging/2024-08-17T21:40:33+08:00https://www.selenium.dev/zh-cn/documentation/legacy/selenium_1/2022-05-01T22:40:02+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/2024-03-29T20:25:04+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/getting_started/install_library/2024-08-14T01:32:57-04:00https://www.selenium.dev/zh-cn/documentation/test_practices/testing_types/2021-12-14T22:58:16+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/elements/finders/2024-08-19T13:15:06-04:00https://www.selenium.dev/zh-cn/documentation/legacy/selenium_2/upgrading/2022-01-10T05:07:37-06:00https://www.selenium.dev/zh-cn/documentation/legacy/selenium_3/grid_3/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/support_features/listeners/2023-11-17T04:17:19-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/actions_api/keyboard/2024-08-04T14:23:15+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/elements/interactions/2024-07-19T10:00:08+02:00https://www.selenium.dev/zh-cn/documentation/webdriver/interactions/alerts/2024-08-17T09:21:57+02:00https://www.selenium.dev/zh-cn/documentation/grid/getting_started/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/getting_started/2024-06-21T23:11:55+08:00https://www.selenium.dev/zh-cn/documentation/overview/details/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/about/contributing/2023-11-22T13:11:12-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/file_downloads/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/drivers/options/2024-08-19T05:43:24-04:00https://www.selenium.dev/zh-cn/documentation/webdriver/troubleshooting/errors/2023-05-25T18:11:20-06:00https://www.selenium.dev/zh-cn/documentation/grid/advanced_features/endpoints/2024-04-24T14:15:02+00:00https://www.selenium.dev/zh-cn/documentation/webdriver/drivers/http_client/2024-05-05T17:53:16+02:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/http_response_codes/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/page_object_models/2024-07-09T17:31:26+05:30https://www.selenium.dev/zh-cn/documentation/selenium_manager/2024-08-19T10:20:03-04:00https://www.selenium.dev/zh-cn/documentation/grid/configuration/toml_options/2024-04-23T12:32:53+00:00https://www.selenium.dev/zh-cn/documentation/webdriver/drivers/service/2024-06-30T12:57:10+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/drivers/2024-08-08T23:45:14-07:00https://www.selenium.dev/zh-cn/documentation/webdriver/support_features/colors/2023-08-03T23:04:23-05:00https://www.selenium.dev/zh-cn/documentation/webdriver/browsers/chrome/2024-08-17T21:27:32+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/interactions/cookies/2024-04-06T20:06:30+05:30https://www.selenium.dev/zh-cn/documentation/grid/advanced_features/customize_node/2024-05-17T13:30:43-04:00https://www.selenium.dev/zh-cn/documentation/webdriver/troubleshooting/errors/driver_location/2023-11-17T04:17:19-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/gmail_email_and_facebook_logins/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/grid/2024-02-06T13:37:55+00:00https://www.selenium.dev/zh-cn/documentation/webdriver/actions_api/mouse/2024-08-04T13:48:45+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/cdp/network/2024-08-17T21:40:33+08:00https://www.selenium.dev/zh-cn/documentation/legacy/selenium_2/2022-05-01T22:40:02+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/elements/locators/2024-06-23T13:55:34+02:00https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/domain_specific_language/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/browsers/2022-10-13T22:55:00+08:00https://www.selenium.dev/zh-cn/documentation/legacy/selenium_3/grid_setup/2022-01-10T05:07:37-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/troubleshooting/logging/2024-01-24T01:16:53+03:00https://www.selenium.dev/zh-cn/documentation/grid/applicability/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/elements/information/2024-08-08T11:46:01+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/browsers/edge/2024-07-10T08:34:50-07:00https://www.selenium.dev/zh-cn/documentation/grid/advanced_features/external_datastore/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/actions_api/pen/2023-11-17T04:17:19-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/test_dependency/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/generating_application_state/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/browsers/firefox/2024-05-30T13:53:58+02:00https://www.selenium.dev/zh-cn/documentation/webdriver/interactions/frames/2022-12-12T15:17:34+01:00https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/cdp/script/2024-08-17T21:40:33+08:00https://www.selenium.dev/zh-cn/documentation/legacy/selenium_3/2022-05-01T22:40:02+08:00https://www.selenium.dev/zh-cn/documentation/about/style/2023-11-22T17:00:07-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/actions_api/wheel/2024-08-04T14:23:15+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/waits/2024-05-07T19:44:07+05:30https://www.selenium.dev/zh-cn/documentation/legacy/selenium_3/grid_components/2022-01-10T05:07:37-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/mock_external_services/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/support_features/thread_guard/2022-09-23T10:06:16-05:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/performance_testing/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/legacy/selenium_2/remote_server/2022-01-10T05:07:37-06:00https://www.selenium.dev/zh-cn/documentation/grid/components/2023-07-05T20:45:15+05:30https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/improved_reporting/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/link_spidering/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/ie_driver_server/2022-01-23T23:14:22+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/browsers/internet_explorer/2024-06-19T14:08:20+02:00https://www.selenium.dev/zh-cn/documentation/legacy/selenium_ide/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/avoid_sharing_state/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/interactions/windows/2024-07-05T15:23:34+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/getting_started/first_script/2024-08-17T11:16:15-04:00https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/locators/2022-02-10T18:17:05+08:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/2021-12-14T22:58:16+08:00https://www.selenium.dev/zh-cn/documentation/grid/configuration/2021-12-14T22:58:16+08:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/two_factor_authentication/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/elements/2022-01-16T15:40:01+08:00https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/test_independency/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/cdp/2024-08-17T21:40:33+08:00https://www.selenium.dev/zh-cn/documentation/grid/architecture/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/documentation/ide/2022-01-04T00:07:43+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/browsers/safari/2024-07-08T07:13:22+02:00https://www.selenium.dev/zh-cn/documentation/webdriver/interactions/2024-08-05T09:10:29+02:00https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/consider_using_a_fluent_api/2023-05-17T19:23:53+10:00https://www.selenium.dev/zh-cn/documentation/webdriver/troubleshooting/upgrade_to_selenium_4/2024-04-29T06:34:50+02:00https://www.selenium.dev/zh-cn/documentation/webdriver/getting_started/using_selenium/2024-08-19T13:07:19-04:00https://www.selenium.dev/zh-cn/documentation/webdriver/support_features/select_lists/2023-11-17T04:17:19-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/drivers/remote_webdriver/2024-07-27T11:43:12+05:30https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/fresh_browser_per_test/2022-11-20T14:38:06+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/w3c/log/2024-07-10T08:34:50-07:00https://www.selenium.dev/zh-cn/documentation/grid/advanced_features/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/2021-12-14T22:58:16+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/actions_api/2024-08-04T14:23:15+05:30https://www.selenium.dev/zh-cn/documentation/legacy/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/w3c/2024-07-10T08:34:50-07:00https://www.selenium.dev/zh-cn/documentation/about/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/interactions/virtual_authenticator/2024-05-30T17:43:45+07:00https://www.selenium.dev/zh-cn/documentation/webdriver/support_features/2022-10-02T13:11:35+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/troubleshooting/2023-10-02T17:45:39+08:00https://www.selenium.dev/zh-cn/categories/https://www.selenium.dev/zh-cn/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/tags/https://www.selenium.dev/zh-cn/year/https://www.selenium.dev/zh-cn/documentation/2023-11-17T04:17:19-06:00 \ No newline at end of file +https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/w3c/browsing_context/2024-08-04T20:33:33+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/w3c/input/2024-08-04T20:33:33+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/w3c/network/2024-08-04T20:33:33+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/w3c/script/2024-07-10T08:34:50-07:00https://www.selenium.dev/zh-cn/documentation/about/copyright/2023-10-03T09:53:03+08:00https://www.selenium.dev/zh-cn/documentation/grid/configuration/help/2021-12-14T22:58:16+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/interactions/navigation/2024-08-05T09:10:29+02:00https://www.selenium.dev/zh-cn/documentation/overview/2024-02-06T13:33:24+00:00https://www.selenium.dev/zh-cn/documentation/test_practices/overview/2021-12-14T22:58:16+08:00https://www.selenium.dev/zh-cn/documentation/grid/advanced_features/observability/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/documentation/overview/components/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/support_features/expected_conditions/2024-07-02T21:59:35+08:00https://www.selenium.dev/zh-cn/documentation/test_practices/design_strategies/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/elements/file_upload/2023-11-17T04:17:19-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/captchas/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/grid/configuration/cli_options/2024-04-23T12:32:53+00:00https://www.selenium.dev/zh-cn/documentation/grid/advanced_features/graphql_support/2022-01-24T18:46:50+05:30https://www.selenium.dev/zh-cn/documentation/legacy/selenium_ide/html_runner/2022-01-10T05:07:37-06:00https://www.selenium.dev/zh-cn/documentation/ie_driver_server/internals/2022-01-10T05:07:37-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/cdp/logging/2024-08-17T21:40:33+08:00https://www.selenium.dev/zh-cn/documentation/legacy/selenium_1/2022-05-01T22:40:02+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/2024-03-29T20:25:04+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/getting_started/install_library/2024-08-14T01:32:57-04:00https://www.selenium.dev/zh-cn/documentation/test_practices/testing_types/2021-12-14T22:58:16+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/elements/finders/2024-08-19T13:15:06-04:00https://www.selenium.dev/zh-cn/documentation/legacy/selenium_2/upgrading/2022-01-10T05:07:37-06:00https://www.selenium.dev/zh-cn/documentation/legacy/selenium_3/grid_3/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/support_features/listeners/2023-11-17T04:17:19-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/actions_api/keyboard/2024-08-04T14:23:15+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/elements/interactions/2024-07-19T10:00:08+02:00https://www.selenium.dev/zh-cn/documentation/webdriver/interactions/alerts/2024-08-17T09:21:57+02:00https://www.selenium.dev/zh-cn/documentation/grid/getting_started/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/getting_started/2024-06-21T23:11:55+08:00https://www.selenium.dev/zh-cn/documentation/overview/details/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/about/contributing/2023-11-22T13:11:12-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/file_downloads/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/drivers/options/2024-08-19T05:43:24-04:00https://www.selenium.dev/zh-cn/documentation/webdriver/troubleshooting/errors/2023-05-25T18:11:20-06:00https://www.selenium.dev/zh-cn/documentation/grid/advanced_features/endpoints/2024-04-24T14:15:02+00:00https://www.selenium.dev/zh-cn/documentation/webdriver/drivers/http_client/2024-05-05T17:53:16+02:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/http_response_codes/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/page_object_models/2024-07-09T17:31:26+05:30https://www.selenium.dev/zh-cn/documentation/selenium_manager/2024-08-19T10:20:03-04:00https://www.selenium.dev/zh-cn/documentation/grid/configuration/toml_options/2024-04-23T12:32:53+00:00https://www.selenium.dev/zh-cn/documentation/webdriver/drivers/service/2024-06-30T12:57:10+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/drivers/2024-08-08T23:45:14-07:00https://www.selenium.dev/zh-cn/documentation/webdriver/support_features/colors/2023-08-03T23:04:23-05:00https://www.selenium.dev/zh-cn/documentation/webdriver/browsers/chrome/2024-08-17T21:27:32+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/interactions/cookies/2024-04-06T20:06:30+05:30https://www.selenium.dev/zh-cn/documentation/grid/advanced_features/customize_node/2024-05-17T13:30:43-04:00https://www.selenium.dev/zh-cn/documentation/webdriver/troubleshooting/errors/driver_location/2023-11-17T04:17:19-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/gmail_email_and_facebook_logins/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/grid/2024-02-06T13:37:55+00:00https://www.selenium.dev/zh-cn/documentation/webdriver/actions_api/mouse/2024-08-04T13:48:45+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/cdp/network/2024-08-17T21:40:33+08:00https://www.selenium.dev/zh-cn/documentation/legacy/selenium_2/2022-05-01T22:40:02+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/elements/locators/2024-08-22T04:22:37-04:00https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/domain_specific_language/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/browsers/2022-10-13T22:55:00+08:00https://www.selenium.dev/zh-cn/documentation/legacy/selenium_3/grid_setup/2022-01-10T05:07:37-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/troubleshooting/logging/2024-01-24T01:16:53+03:00https://www.selenium.dev/zh-cn/documentation/grid/applicability/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/elements/information/2024-08-08T11:46:01+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/browsers/edge/2024-07-10T08:34:50-07:00https://www.selenium.dev/zh-cn/documentation/grid/advanced_features/external_datastore/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/actions_api/pen/2023-11-17T04:17:19-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/test_dependency/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/generating_application_state/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/browsers/firefox/2024-05-30T13:53:58+02:00https://www.selenium.dev/zh-cn/documentation/webdriver/interactions/frames/2022-12-12T15:17:34+01:00https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/cdp/script/2024-08-17T21:40:33+08:00https://www.selenium.dev/zh-cn/documentation/legacy/selenium_3/2022-05-01T22:40:02+08:00https://www.selenium.dev/zh-cn/documentation/about/style/2023-11-22T17:00:07-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/actions_api/wheel/2024-08-04T14:23:15+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/waits/2024-05-07T19:44:07+05:30https://www.selenium.dev/zh-cn/documentation/legacy/selenium_3/grid_components/2022-01-10T05:07:37-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/mock_external_services/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/support_features/thread_guard/2022-09-23T10:06:16-05:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/performance_testing/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/legacy/selenium_2/remote_server/2022-01-10T05:07:37-06:00https://www.selenium.dev/zh-cn/documentation/grid/components/2023-07-05T20:45:15+05:30https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/improved_reporting/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/link_spidering/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/ie_driver_server/2022-01-23T23:14:22+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/browsers/internet_explorer/2024-06-19T14:08:20+02:00https://www.selenium.dev/zh-cn/documentation/legacy/selenium_ide/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/avoid_sharing_state/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/interactions/windows/2024-07-05T15:23:34+05:30https://www.selenium.dev/zh-cn/documentation/webdriver/getting_started/first_script/2024-08-17T11:16:15-04:00https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/locators/2022-02-10T18:17:05+08:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/2021-12-14T22:58:16+08:00https://www.selenium.dev/zh-cn/documentation/grid/configuration/2021-12-14T22:58:16+08:00https://www.selenium.dev/zh-cn/documentation/test_practices/discouraged/two_factor_authentication/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/elements/2022-01-16T15:40:01+08:00https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/test_independency/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/cdp/2024-08-17T21:40:33+08:00https://www.selenium.dev/zh-cn/documentation/grid/architecture/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/documentation/ide/2022-01-04T00:07:43+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/browsers/safari/2024-07-08T07:13:22+02:00https://www.selenium.dev/zh-cn/documentation/webdriver/interactions/2024-08-05T09:10:29+02:00https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/consider_using_a_fluent_api/2023-05-17T19:23:53+10:00https://www.selenium.dev/zh-cn/documentation/webdriver/troubleshooting/upgrade_to_selenium_4/2024-04-29T06:34:50+02:00https://www.selenium.dev/zh-cn/documentation/webdriver/getting_started/using_selenium/2024-08-19T13:07:19-04:00https://www.selenium.dev/zh-cn/documentation/webdriver/support_features/select_lists/2023-11-17T04:17:19-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/drivers/remote_webdriver/2024-07-27T11:43:12+05:30https://www.selenium.dev/zh-cn/documentation/test_practices/encouraged/fresh_browser_per_test/2022-11-20T14:38:06+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/w3c/log/2024-07-10T08:34:50-07:00https://www.selenium.dev/zh-cn/documentation/grid/advanced_features/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/test_practices/2021-12-14T22:58:16+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/actions_api/2024-08-04T14:23:15+05:30https://www.selenium.dev/zh-cn/documentation/legacy/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/bidi/w3c/2024-07-10T08:34:50-07:00https://www.selenium.dev/zh-cn/documentation/about/2021-12-07T06:38:55-06:00https://www.selenium.dev/zh-cn/documentation/webdriver/interactions/virtual_authenticator/2024-05-30T17:43:45+07:00https://www.selenium.dev/zh-cn/documentation/webdriver/support_features/2022-10-02T13:11:35+08:00https://www.selenium.dev/zh-cn/documentation/webdriver/troubleshooting/2023-10-02T17:45:39+08:00https://www.selenium.dev/zh-cn/categories/https://www.selenium.dev/zh-cn/2023-06-27T20:27:08+05:30https://www.selenium.dev/zh-cn/tags/https://www.selenium.dev/zh-cn/year/https://www.selenium.dev/zh-cn/documentation/2023-11-17T04:17:19-06:00 \ No newline at end of file