Skip to content

Commit bcf7a53

Browse files
authored
Merge branch 'trunk' into trunk
2 parents 58f6922 + 268f397 commit bcf7a53

File tree

14 files changed

+83
-56
lines changed

14 files changed

+83
-56
lines changed

.github/workflows/java-examples.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
uses: actions/setup-java@v3
3838
with:
3939
distribution: 'temurin'
40-
java-version: 8
40+
java-version: 11
4141
- name: Run Tests
4242
uses: nick-invision/[email protected]
4343
with:

examples/java/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
<dependency>
2323
<groupId>org.seleniumhq.selenium</groupId>
2424
<artifactId>selenium-java</artifactId>
25-
<version>4.8.3</version>
25+
<version>4.9.0</version>
2626
</dependency>
2727
<dependency>
2828
<groupId>org.seleniumhq.selenium</groupId>
2929
<artifactId>selenium-grid</artifactId>
30-
<version>4.8.3</version>
30+
<version>4.9.0</version>
3131
</dependency>
3232
<dependency>
3333
<groupId>org.slf4j</groupId>

examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java renamed to examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemoteWebdriverTest.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,16 @@
3939
import static org.openqa.selenium.devtools.events.CdpEventTypes.domMutation;
4040
import static org.openqa.selenium.remote.http.Contents.utf8String;
4141

42-
public class BidiApiRemotewebdriverTest {
43-
44-
private static URL gridUrl;
42+
public class BidiApiRemoteWebdriverTest {
4543

4644
private WebDriver driver;
4745

4846
@BeforeEach
4947
public void setup() throws MalformedURLException {
5048
int port = PortProber.findFreePort();
51-
Main.main(new String[] { "standalone", "--port", String.valueOf(port) });
49+
Main.main(new String[] { "standalone", "--port", String.valueOf(port), "--selenium-manager", "true" });
5250

53-
gridUrl = new URL(String.format("http://localhost:%d/", port));
51+
URL gridUrl = new URL(String.format("http://localhost:%d/", port));
5452
ChromeOptions options = new ChromeOptions();
5553
driver = new RemoteWebDriver(gridUrl, options);
5654
}
@@ -189,7 +187,7 @@ public void testNetworkInterceptor() {
189187
DevTools devTools = ((HasDevTools) driver).getDevTools();
190188
devTools.createSession();
191189

192-
try (NetworkInterceptor interceptor = new NetworkInterceptor(
190+
try (NetworkInterceptor ignore = new NetworkInterceptor(
193191
driver,
194192
Route.matching(req -> req.getUri().contains("google"))
195193
.to(() -> req -> new HttpResponse()

examples/kotlin/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
2121

2222
<java.version>1.8</java.version>
23-
<selenium.version>4.8.3</selenium.version>
23+
<selenium.version>4.9.0</selenium.version>
2424

2525
<maven.compiler.target>${java.version}</maven.compiler.target>
2626
<maven.compiler.source>${java.version}</maven.compiler.source>

examples/python/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
selenium==4.8.2
1+
selenium==4.9.0
22
pytest
33
flake8
44
webdriver_manager==3.8.3

website_and_docs/content/blog/2023/InvalidSelectorException_is_changing.md

-36
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: "InvalidSelectorException has changed"
3+
linkTitle: "InvalidSelectorException has changed"
4+
date: 2023-04-21
5+
tags: ["webdriver", "java", "dotnet", "exceptions"]
6+
categories: ["general"]
7+
author: Mohab Mohie ([MohabMohie](https://github.com/MohabMohie/MohabMohie))
8+
description: >
9+
⚠️ `InvalidSelectorException` now extends from `WebDriverException`
10+
---
11+
12+
Before Selenium 4.8.2 in Java and C#, when an invalid locator was used to identify an element, the resulting behavior would be
13+
inconsistent in our bindings.
14+
15+
For example, let's check the following code:
16+
17+
```java
18+
ArrayList<Class<? extends Exception>> expectedExceptions = new ArrayList<>();
19+
expectedExceptions.add(org.openqa.selenium.NoSuchElementException.class);
20+
expectedExceptions.add(org.openqa.selenium.StaleElementReferenceException.class);
21+
expectedExceptions.add(org.openqa.selenium.ElementNotInteractableException.class);
22+
expectedExceptions.add(org.openqa.selenium.InvalidElementStateException.class);
23+
24+
return new FluentWait<>(driver)
25+
.withTimeout(Duration.ofMillis(ELEMENT_IDENTIFICATION_TIMEOUT))
26+
.pollingEvery(Duration.ofMillis(ELEMENT_IDENTIFICATION_POLLING_DELAY))
27+
.ignoreAll(expectedExceptions)
28+
.until(nestedDriver -> {
29+
nestedDriver.findElement(By.xpath("invalid-xpath")).click;
30+
});
31+
```
32+
33+
The expected result *before this change* would be that the driver waits until the timeout expires and then throw an `InvalidSelectorException`.
34+
35+
This doesn't make much sense because a broken/invalid selector would never fix itself, and hence should throw immediately.
36+
37+
This was discussed and agreed during the [TLC meeting on August 17, 2022](https://www.selenium.dev/meetings/2022/tlc-08-17/#proposals),
38+
and implemented through the pull request [11727](https://github.com/SeleniumHQ/selenium/pull/11727) and the following
39+
[commit](https://github.com/SeleniumHQ/selenium/commit/f28144eb72ae1df18f267a5250db6b9b41dc1fdc).
40+
41+
With the changes mentioned above, an invalid selector will throw an `InvalidSelectorException` immediately.
42+
43+
Please note that this may have an impact on backwards compatibility if you are not expecting this exception to be thrown while
44+
handling invalid locators.
45+
46+
Stay tuned for updates by following [SeleniumHQ](https://twitter.com/seleniumhq)!
47+
48+
Happy testing!
49+

website_and_docs/content/blog/2023/selenium-4-9-0-released.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ Links to everything can be found on our [downloads page][downloads].
1717

1818
* Chrome DevTools support is now: v110, v111, and v112 (Firefox still uses v85 for all versions)
1919
* Maven BOM for the Java bindings.
20-
* Remote file downloads are now possible through Selenium Grid.
20+
* Remote file downloads are [now possible through Selenium Grid](/documentation/grid/configuration/cli_options/#enabling-managed-downloads-by-the-node).
2121
* First steps taken to phase out CDP in Firefox and replace it with the BiDi implementation.
22-
* `InvalidSelectorException` now extends `WebDriverException` instead of `NoSuchElementException`.
22+
* `InvalidSelectorException` [now extends `WebDriverException` instead of `NoSuchElementException`](/blog/2023/invalid-selector-exception-has-changed/).
2323
* Selenium Manager uses information set in the browser options to get the correct browser driver.
24-
* A sub-path can be set in Selenium Grid to have a custom Grid url.
24+
* A [sub-path](/documentation/grid/configuration/cli_options/#router) can be set in Selenium Grid to have a custom Grid url.
25+
* Complete removal of [Json Wire Protocol support in Java and Grid](https://www.selenium.dev/blog/2022/legacy-protocol-support/).
2526

2627

2728
### Contributors

website_and_docs/content/documentation/grid/configuration/cli_options.en.md

+1
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ pull request updating this page.
243243
|---|---|---|---|
244244
| `--password` | string | `myStrongPassword` | Password clients must use to connect to the server. Both this and the username need to be set in order to be used. |
245245
| `--username` | string | `admin` | User name clients must use to connect to the server. Both this and the password need to be set in order to be used. |
246+
| `--sub-path` | string | `my_company/selenium_grid` | A sub-path that should be considered for all user facing routes on the Hub/Router/Standalone. |
246247

247248

248249
### Server

website_and_docs/content/documentation/grid/configuration/cli_options.ja.md

+1
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ Grid の設定には、さまざまなセクションが用意されています
242242
| ------------ | ------ | ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
243243
| `--password` | string | `myStrongPassword` | クライアントがサーバーに接続する際に使用するパスワード。このパスワードとユーザー名の両方が設定されていないと使用できません。 |
244244
| `--username` | string | `admin` | クライアントがサーバーに接続する際に使用するユーザー名。このユーザー名とパスワードの両方が設定されていないと使用できません。 |
245+
| `--sub-path` | string | `my_company/selenium_grid` | A sub-path that should be considered for all user facing routes on the Hub/Router/Standalone. |
245246

246247
### Server
247248

website_and_docs/content/documentation/grid/configuration/cli_options.pt-br.md

+1
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ e esteja à vontade para nos enviar um pull request com alterações a esta pág
246246
|---|---|---|---|
247247
| `--password` | string | `myStrongPassword` | Password clients must use to connect to the server. Both this and the username need to be set in order to be used. |
248248
| `--username` | string | `admin` | User name clients must use to connect to the server. Both this and the password need to be set in order to be used. |
249+
| `--sub-path` | string | `my_company/selenium_grid` | A sub-path that should be considered for all user facing routes on the Hub/Router/Standalone. |
249250

250251

251252
### Server

website_and_docs/content/documentation/grid/configuration/cli_options.zh-cn.md

+1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ pull request updating this page.
252252
|---|---|---|---|
253253
| `--password` | string | `myStrongPassword` | Password clients must use to connect to the server. Both this and the username need to be set in order to be used. |
254254
| `--username` | string | `admin` | User name clients must use to connect to the server. Both this and the password need to be set in order to be used. |
255+
| `--sub-path` | string | `my_company/selenium_grid` | A sub-path that should be considered for all user facing routes on the Hub/Router/Standalone. |
255256

256257

257258
### Server

website_and_docs/content/ecosystem/_index.html

+11
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,17 @@ <h2 class="card-title" id="frameworks">Frameworks</h2>
454454
<td>Java</td>
455455
<td>Mohab Mohie</td>
456456
</tr>
457+
<tr>
458+
<th scope="row">
459+
<p>
460+
<a href="https://github.com/vaadin/testbench">
461+
TestBench
462+
</a>
463+
</p>
464+
</th>
465+
<td>Java</td>
466+
<td>Vaadin</td>
467+
</tr>
457468
</tbody>
458469
</table>
459470
</div>

website_and_docs/package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)