Skip to content

Commit be99df5

Browse files
authored
Merge branch 'trunk' into patch-1
2 parents 3830f9b + 08907af commit be99df5

File tree

17 files changed

+178
-48
lines changed

17 files changed

+178
-48
lines changed

examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
11
package dev.selenium.elements;
22
import org.openqa.selenium.By;
3+
import org.openqa.selenium.support.pagefactory.ByAll;
34
import org.openqa.selenium.support.pagefactory.ByChained;
45
import dev.selenium.BaseTest;
6+
import java.util.List;
7+
58
import org.openqa.selenium.WebDriver;
69
import org.openqa.selenium.WebElement;
710
import org.openqa.selenium.chrome.ChromeDriver;
811

912
public class LocatorsTest extends BaseTest {
1013

14+
15+
public void ByAllTest() {
16+
// Create instance of ChromeDriver
17+
WebDriver driver = new ChromeDriver();
18+
// Navigate to Url
19+
driver.get("https://www.selenium.dev/selenium/web/login.html");
20+
21+
// get both logins
22+
By example = new ByAll(By.id("password-field"), By.id("username-field"));
23+
List<WebElement> login_inputs = driver.findElements(example);
24+
25+
//send them both input
26+
login_inputs.get(0).sendKeys("username");
27+
login_inputs.get(1).sendKeys("password");
28+
}
29+
1130
public String ByChainedTest() {
1231
// Create instance of ChromeDriver
1332
WebDriver driver = new ChromeDriver();

examples/javascript/package-lock.json

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/javascript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"license": "Apache-2.0",
99
"dependencies": {
1010
"assert": "2.1.0",
11-
"selenium-webdriver": "4.24.0"
11+
"selenium-webdriver": "4.24.1"
1212
},
1313
"devDependencies": {
1414
"mocha": "10.7.3"

website_and_docs/content/documentation/webdriver/elements/locators.en.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,12 +370,39 @@ others it's as simple as setting a parameter in the FindElement function
370370

371371
### ByChained
372372

373-
The `ByChained` class enables you to _chain_ two By locators together. For example, instead of having to locate a parent element, and then a child element of that parent, you can instead combine those two `FindElement` functions into one.
373+
The `ByChained` class enables you to _chain_ two By locators together. For example, instead of having to locate a parent element,
374+
and then a child element of that parent, you can instead combine those two `FindElement()` functions into one.
374375

375376
{{< tabpane langEqualsHeader=true >}}
376-
{{< badge-examples >}}
377-
{{< tab header="Java" >}}
378-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#17-19" >}}
377+
{{< tab header="Java" text=true >}}
378+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#L37-L38">}}
379+
{{< /tab >}}
380+
{{< tab header="Python" text=true >}}
381+
{{< badge-code >}}
382+
{{< /tab >}}
383+
{{< tab header="CSharp" text=true >}}
384+
{{< badge-code >}}
385+
{{< /tab >}}
386+
{{< tab header="Ruby" text=true >}}
387+
{{< badge-code >}}
388+
{{< /tab >}}
389+
{{< tab header="JavaScript" text=true >}}
390+
{{< badge-code >}}
391+
{{< /tab >}}
392+
{{< tab header="Kotlin" text=true >}}
393+
{{< badge-code >}}
394+
{{< /tab >}}
395+
{{< /tabpane >}}
396+
397+
### ByAll
398+
399+
The `ByAll` class enables you to utilize two By locators at once, finding elements that mach _either_ of your By locators.
400+
For example, instead of having to utilize two `FindElement()` functions to find the username and password input fields
401+
seperately, you can instead find them together in one clean `FindElements()`
402+
403+
{{< tabpane langEqualsHeader=true >}}
404+
{{< tab header="Java" text=true >}}
405+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#L22-L23">}}
379406
{{< /tab >}}
380407
{{< tab header="Python" text=true >}}
381408
{{< badge-code >}}

website_and_docs/content/documentation/webdriver/elements/locators.ja.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,40 @@ others it's as simple as setting a parameter in the FindElement function
360360

361361
### ByChained
362362

363-
The `ByChained` class enables you to _chain_ two By locators together. For example, instead of having to locate a parent element, and then a child element of that parent, you can instead combine those two `FindElement` functions into one.
363+
The `ByChained` class enables you to _chain_ two By locators together. For example, instead of having to
364+
locate a parent element, and then a child element of that parent, you can instead combine those two `FindElement`
365+
functions into one.
364366

365367
{{< tabpane langEqualsHeader=true >}}
366-
{{< badge-examples >}}
367-
{{< tab header="Java" >}}
368-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#17-19" >}}
368+
{{< tab header="Java" text=true >}}
369+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#L37-L38" >}}
370+
{{< /tab >}}
371+
{{< tab header="Python" text=true >}}
372+
{{< badge-code >}}
373+
{{< /tab >}}
374+
{{< tab header="CSharp" text=true >}}
375+
{{< badge-code >}}
376+
{{< /tab >}}
377+
{{< tab header="Ruby" text=true >}}
378+
{{< badge-code >}}
379+
{{< /tab >}}
380+
{{< tab header="JavaScript" text=true >}}
381+
{{< badge-code >}}
382+
{{< /tab >}}
383+
{{< tab header="Kotlin" text=true >}}
384+
{{< badge-code >}}
385+
{{< /tab >}}
386+
{{< /tabpane >}}
387+
388+
### ByAll
389+
390+
The `ByAll` class enables you to utilize two By locators at once, finding elements that mach _either_ of your By locators.
391+
For example, instead of having to utilize two `FindElement()` functions to find the username and password input fields seperately,
392+
you can instead find them together in one clean `FindElements()`
393+
394+
{{< tabpane langEqualsHeader=true >}}
395+
{{< tab header="Java" text=true >}}
396+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#L22-L23">}}
369397
{{< /tab >}}
370398
{{< tab header="Python" text=true >}}
371399
{{< badge-code >}}

website_and_docs/content/documentation/webdriver/elements/locators.pt-br.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,12 +363,40 @@ others it's as simple as setting a parameter in the FindElement function
363363

364364
### ByChained
365365

366-
The `ByChained` class enables you to _chain_ two By locators together. For example, instead of having to locate a parent element, and then a child element of that parent, you can instead combine those two `FindElement` functions into one.
366+
The `ByChained` class enables you to _chain_ two By locators together. For example, instead of
367+
having to locate a parent element, and then a child element of that parent, you can instead
368+
combine those two `FindElement` functions into one.
367369

368370
{{< tabpane langEqualsHeader=true >}}
369-
{{< badge-examples >}}
370-
{{< tab header="Java" >}}
371-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#17-19" >}}
371+
{{< tab header="Java" text=true >}}
372+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#L37-L38" >}}
373+
{{< /tab >}}
374+
{{< tab header="Python" text=true >}}
375+
{{< badge-code >}}
376+
{{< /tab >}}
377+
{{< tab header="CSharp" text=true >}}
378+
{{< badge-code >}}
379+
{{< /tab >}}
380+
{{< tab header="Ruby" text=true >}}
381+
{{< badge-code >}}
382+
{{< /tab >}}
383+
{{< tab header="JavaScript" text=true >}}
384+
{{< badge-code >}}
385+
{{< /tab >}}
386+
{{< tab header="Kotlin" text=true >}}
387+
{{< badge-code >}}
388+
{{< /tab >}}
389+
{{< /tabpane >}}
390+
391+
### ByAll
392+
393+
The `ByAll` class enables you to utilize two By locators at once, finding elements that mach _either_ of your By locators.
394+
For example, instead of having to utilize two `FindElement()` functions to find the username and password input fields
395+
seperately, you can instead find them together in one clean `FindElements()`
396+
397+
{{< tabpane langEqualsHeader=true >}}
398+
{{< tab header="Java" text=true >}}
399+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#L22-L23">}}
372400
{{< /tab >}}
373401
{{< tab header="Python" text=true >}}
374402
{{< badge-code >}}

website_and_docs/content/documentation/webdriver/elements/locators.zh-cn.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,12 +363,40 @@ others it's as simple as setting a parameter in the FindElement function
363363

364364
### ByChained
365365

366-
The `ByChained` class enables you to _chain_ two By locators together. For example, instead of having to locate a parent element, and then a child element of that parent, you can instead combine those two `FindElement` functions into one.
366+
The `ByChained` class enables you to _chain_ two By locators together. For example,
367+
instead of having to locate a parent element, and then a child element of that parent,
368+
you can instead combine those two `FindElement` functions into one.
367369

368370
{{< tabpane langEqualsHeader=true >}}
369-
{{< badge-examples >}}
370-
{{< tab header="Java" >}}
371-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#17-19" >}}
371+
{{< tab header="Java" text=true >}}
372+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#L37-L38" >}}
373+
{{< /tab >}}
374+
{{< tab header="Python" text=true >}}
375+
{{< badge-code >}}
376+
{{< /tab >}}
377+
{{< tab header="CSharp" text=true >}}
378+
{{< badge-code >}}
379+
{{< /tab >}}
380+
{{< tab header="Ruby" text=true >}}
381+
{{< badge-code >}}
382+
{{< /tab >}}
383+
{{< tab header="JavaScript" text=true >}}
384+
{{< badge-code >}}
385+
{{< /tab >}}
386+
{{< tab header="Kotlin" text=true >}}
387+
{{< badge-code >}}
388+
{{< /tab >}}
389+
{{< /tabpane >}}
390+
391+
### ByAll
392+
393+
The `ByAll` class enables you to utilize two By locators at once, finding elements that mach _either_ of your By locators.
394+
For example, instead of having to utilize two `FindElement()` functions to find the username and password input fields
395+
seperately, you can instead find them together in one clean `FindElements()`
396+
397+
{{< tabpane langEqualsHeader=true >}}
398+
{{< tab header="Java" text=true >}}
399+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#L22-L23">}}
372400
{{< /tab >}}
373401
{{< tab header="Python" text=true >}}
374402
{{< badge-code >}}

website_and_docs/layouts/partials/selenium-clients-and-webdriver-bindings.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ <h2 id="bindings" class="card-title">Selenium Clients and WebDriver Language Bin
139139
<p class="card-text m-0 pb-1">
140140
Stable:
141141
<a href="https://npmjs.org/package/selenium-webdriver" class="card-link">
142-
4.24.0 (August 28, 2024)
142+
4.24.1 (September 16, 2024)
143143
</a>
144144
</p>
145145
<p class="card-text m-0 pb-1">

website_and_docs/package-lock.json

Lines changed: 22 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-2.44 KB
Loading

0 commit comments

Comments
 (0)