Skip to content

Commit 30e2a64

Browse files
authored
Merge branch 'trunk' into renovate/kotlin-monorepo
2 parents db2796c + 3ff36f0 commit 30e2a64

File tree

79 files changed

+987
-458
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+987
-458
lines changed

Diff for: .github/workflows/js-examples.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ jobs:
8282
if: matrix.release == 'stable'
8383
uses: actions/setup-node@v4
8484
with:
85-
node-version: '18.x'
85+
node-version: '22.x'
8686
- name: Setup Node Nightly
8787
if: matrix.release == 'nightly'
8888
uses: actions/setup-node@v4
8989
with:
90-
node-version: '18.x'
90+
node-version: '22.x'
9191
registry-url: 'https://npm.pkg.github.com'
9292
- name: Use Nightly package.json in Ubuntu/macOS
9393
if: matrix.release == 'nightly' && matrix.os != 'windows'

Diff for: .github/workflows/python-examples.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
include:
2929
- os: ubuntu
3030
release: stable
31-
python: '3.8'
31+
python: '3.9'
3232
- os: ubuntu
3333
release: nightly
3434
python: '3.11'

Diff for: LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
same "printed page" as the copyright notice for easier
188188
identification within third-party archives.
189189

190-
Copyright 2024 Software Freedom Conservancy (SFC)
190+
Copyright 2025 Software Freedom Conservancy (SFC)
191191

192192
Licensed under the Apache License, Version 2.0 (the "License");
193193
you may not use this file except in compliance with the License.

Diff for: README.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
[![GitHub Actions](https://github.com/seleniumhq/seleniumhq.github.io/workflows/Publish%20Selenium%20Site/badge.svg)](https://github.com/SeleniumHQ/seleniumhq.github.io/actions?query=workflow%3A%22Publish+Selenium+Site%22)
2+
[![Run Java examples](https://github.com/SeleniumHQ/seleniumhq.github.io/actions/workflows/java-examples.yml/badge.svg)](https://github.com/SeleniumHQ/seleniumhq.github.io/actions/workflows/java-examples.yml)
3+
[![Run Kotlin examples](https://github.com/SeleniumHQ/seleniumhq.github.io/actions/workflows/kotlin-examples.yml/badge.svg)](https://github.com/SeleniumHQ/seleniumhq.github.io/actions/workflows/kotlin-examples.yml)
4+
[![Run Python examples](https://github.com/SeleniumHQ/seleniumhq.github.io/actions/workflows/python-examples.yml/badge.svg)](https://github.com/SeleniumHQ/seleniumhq.github.io/actions/workflows/python-examples.yml)
5+
[![Run JavaScript examples](https://github.com/SeleniumHQ/seleniumhq.github.io/actions/workflows/js-examples.yml/badge.svg)](https://github.com/SeleniumHQ/seleniumhq.github.io/actions/workflows/js-examples.yml)
6+
[![Run Ruby examples](https://github.com/SeleniumHQ/seleniumhq.github.io/actions/workflows/ruby-examples.yml/badge.svg)](https://github.com/SeleniumHQ/seleniumhq.github.io/actions/workflows/ruby-examples.yml)
7+
[![Run DotNet examples](https://github.com/SeleniumHQ/seleniumhq.github.io/actions/workflows/dotnet-examples.yml/badge.svg)](https://github.com/SeleniumHQ/seleniumhq.github.io/actions/workflows/dotnet-examples.yml)
28

39
<a href="https://selenium.dev"><img src="https://selenium.dev/images/selenium_logo_square_green.png" width="200" alt="Selenium"/></a>
410

Diff for: examples/dotnet/SeleniumDocs/BaseTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class BaseTest
1717
protected IWebDriver driver;
1818
protected Uri GridUrl;
1919
private Process _webserverProcess;
20-
private const string ServerJarName = "selenium-server-4.27.0.jar";
20+
private const string ServerJarName = "selenium-server-4.28.1.jar";
2121
private static readonly string BaseDirectory = AppContext.BaseDirectory;
2222
private const string RelativePathToGrid = "../../../../../";
2323
private readonly string _examplesDirectory = Path.GetFullPath(Path.Combine(BaseDirectory, RelativePathToGrid));

Diff for: examples/dotnet/SeleniumDocs/SeleniumDocs.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.7.1" />
1111
<PackageReference Include="MSTest.TestAdapter" Version="3.6.0" />
1212
<PackageReference Include="MSTest.TestFramework" Version="3.6.0" />
13-
<PackageReference Include="Selenium.Support" Version="4.27.0" />
14-
<PackageReference Include="Selenium.WebDriver" Version="4.27.0" />
13+
<PackageReference Include="Selenium.Support" Version="4.28.0" />
14+
<PackageReference Include="Selenium.WebDriver" Version="4.28.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

Diff for: examples/java/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repositories {
1010
}
1111

1212
dependencies {
13-
testImplementation 'org.seleniumhq.selenium:selenium-java:4.27.0'
13+
testImplementation 'org.seleniumhq.selenium:selenium-java:4.28.1'
1414
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.11.4'
1515
}
1616

Diff for: examples/java/pom.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<maven.compiler.source>17</maven.compiler.source>
1414
<maven.compiler.target>17</maven.compiler.target>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16-
<selenium.version>4.27.0</selenium.version>
16+
<selenium.version>4.28.1</selenium.version>
1717
</properties>
1818

1919
<repositories>
@@ -66,6 +66,7 @@
6666
junit.jupiter.execution.parallel.config.fixed.max-pool-size = ${surefire.parallel}
6767
</configurationParameters>
6868
</properties>
69+
<rerunFailingTestsCount>3</rerunFailingTestsCount>
6970
</configuration>
7071
</plugin>
7172
</plugins>

Diff for: examples/java/src/test/java/dev/selenium/BaseTest.java

+13
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.openqa.selenium.WebElement;
1717
import org.openqa.selenium.chrome.ChromeDriver;
1818
import org.openqa.selenium.chrome.ChromeOptions;
19+
import org.openqa.selenium.edge.EdgeOptions;
1920
import org.openqa.selenium.firefox.FirefoxDriver;
2021
import org.openqa.selenium.firefox.FirefoxOptions;
2122
import org.openqa.selenium.grid.Main;
@@ -57,6 +58,18 @@ protected ChromeDriver startChromeDriver(ChromeOptions options) {
5758
return (ChromeDriver) driver;
5859
}
5960

61+
protected static ChromeOptions getDefaultChromeOptions() {
62+
ChromeOptions options = new ChromeOptions();
63+
options.addArguments("--no-sandbox");
64+
return options;
65+
}
66+
67+
protected static EdgeOptions getDefaultEdgeOptions() {
68+
EdgeOptions options = new EdgeOptions();
69+
options.addArguments("--no-sandbox");
70+
return options;
71+
}
72+
6073
protected File getTempDirectory(String prefix) {
6174
File tempDirectory = null;
6275
try {

Diff for: examples/java/src/test/java/dev/selenium/bidi/cdp/CdpApiTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class CdpApiTest extends BaseTest {
2626

2727
@BeforeEach
2828
public void createSession() {
29-
ChromeOptions options = new ChromeOptions();
29+
ChromeOptions options = getDefaultChromeOptions();
3030
options.setBrowserVersion("131");
3131
driver = new ChromeDriver(options);
3232
wait = new WebDriverWait(driver, Duration.ofSeconds(10));

Diff for: examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ public void clearProperties() {
3434

3535
@Test
3636
public void basicOptions() {
37-
ChromeOptions options = new ChromeOptions();
37+
ChromeOptions options = getDefaultChromeOptions();
3838
driver = new ChromeDriver(options);
3939
}
4040

4141
@Test
4242
public void arguments() {
43-
ChromeOptions options = new ChromeOptions();
43+
ChromeOptions options = getDefaultChromeOptions();
4444

4545
options.addArguments("--start-maximized");
4646

@@ -49,7 +49,7 @@ public void arguments() {
4949

5050
@Test
5151
public void setBrowserLocation() {
52-
ChromeOptions options = new ChromeOptions();
52+
ChromeOptions options = getDefaultChromeOptions();
5353

5454
options.setBinary(getChromeLocation());
5555

@@ -58,7 +58,7 @@ public void setBrowserLocation() {
5858

5959
@Test
6060
public void extensionOptions() {
61-
ChromeOptions options = new ChromeOptions();
61+
ChromeOptions options = getDefaultChromeOptions();
6262
Path path = Paths.get("src/test/resources/extensions/webextensions-selenium-example.crx");
6363
File extensionFilePath = new File(path.toUri());
6464

@@ -73,7 +73,7 @@ public void extensionOptions() {
7373

7474
@Test
7575
public void excludeSwitches() {
76-
ChromeOptions options = new ChromeOptions();
76+
ChromeOptions options = getDefaultChromeOptions();
7777

7878
options.setExperimentalOption("excludeSwitches", List.of("disable-popup-blocking"));
7979

@@ -82,7 +82,7 @@ public void excludeSwitches() {
8282

8383
@Test
8484
public void loggingPreferences() {
85-
ChromeOptions options = new ChromeOptions();
85+
ChromeOptions options = getDefaultChromeOptions();
8686
LoggingPreferences logPrefs = new LoggingPreferences();
8787
logPrefs.enable(LogType.PERFORMANCE, Level.ALL);
8888
options.setCapability(ChromeOptions.LOGGING_PREFS, logPrefs);
@@ -175,7 +175,7 @@ public void disableBuildChecks() throws IOException {
175175
}
176176

177177
private File getChromeLocation() {
178-
ChromeOptions options = new ChromeOptions();
178+
ChromeOptions options = getDefaultChromeOptions();
179179
options.setBrowserVersion("stable");
180180
DriverFinder finder = new DriverFinder(ChromeDriverService.createDefaultService(), options);
181181
return new File(finder.getBrowserPath());

Diff for: examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ public void clearProperties() {
3535

3636
@Test
3737
public void basicOptions() {
38-
EdgeOptions options = new EdgeOptions();
38+
EdgeOptions options = getDefaultEdgeOptions();
3939
driver = new EdgeDriver(options);
4040
}
4141

4242
@Test
4343
public void arguments() {
44-
EdgeOptions options = new EdgeOptions();
44+
EdgeOptions options = getDefaultEdgeOptions();
4545

4646
options.addArguments("--start-maximized");
4747

@@ -50,7 +50,7 @@ public void arguments() {
5050

5151
@Test
5252
public void setBrowserLocation() {
53-
EdgeOptions options = new EdgeOptions();
53+
EdgeOptions options = getDefaultEdgeOptions();
5454

5555
options.setBinary(getEdgeLocation());
5656

@@ -59,7 +59,7 @@ public void setBrowserLocation() {
5959

6060
@Test
6161
public void extensionOptions() {
62-
EdgeOptions options = new EdgeOptions();
62+
EdgeOptions options = getDefaultEdgeOptions();
6363
Path path = Paths.get("src/test/resources/extensions/webextensions-selenium-example.crx");
6464
File extensionFilePath = new File(path.toUri());
6565

@@ -74,7 +74,7 @@ public void extensionOptions() {
7474

7575
@Test
7676
public void excludeSwitches() {
77-
EdgeOptions options = new EdgeOptions();
77+
EdgeOptions options = getDefaultEdgeOptions();
7878

7979
options.setExperimentalOption("excludeSwitches", List.of("disable-popup-blocking"));
8080

@@ -83,7 +83,7 @@ public void excludeSwitches() {
8383

8484
@Test
8585
public void loggingPreferences() {
86-
EdgeOptions options = new EdgeOptions();
86+
EdgeOptions options = getDefaultEdgeOptions();
8787
LoggingPreferences logPrefs = new LoggingPreferences();
8888
logPrefs.enable(LogType.PERFORMANCE, Level.ALL);
8989
options.setCapability(EdgeOptions.LOGGING_PREFS, logPrefs);
@@ -170,7 +170,7 @@ public void disableBuildChecks() throws IOException {
170170
}
171171

172172
private File getEdgeLocation() {
173-
EdgeOptions options = new EdgeOptions();
173+
EdgeOptions options = getDefaultEdgeOptions();
174174
options.setBrowserVersion("stable");
175175
DriverFinder finder = new DriverFinder(EdgeDriverService.createDefaultService(), options);
176176
return new File(finder.getBrowserPath());

Diff for: examples/java/src/test/java/dev/selenium/drivers/HttpClientTest.java

+26-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void remoteWebDriverWithClientConfig() throws Exception {
4141
.readTimeout(Duration.ofSeconds(3600))
4242
.authenticateAs(new UsernameAndPassword("admin", "myStrongPassword"))
4343
.version(HTTP_1_1.toString());
44-
ChromeOptions options = new ChromeOptions();
44+
ChromeOptions options = getDefaultChromeOptions();
4545
options.setEnableDownloads(true);
4646
driver = RemoteWebDriver.builder()
4747
.oneOf(options)
@@ -60,7 +60,7 @@ public void remoteWebDriverIgnoreSSL() throws Exception {
6060
.readTimeout(Duration.ofSeconds(3600))
6161
.authenticateAs(new UsernameAndPassword("admin", "myStrongPassword"))
6262
.version(HTTP_1_1.toString());
63-
ChromeOptions options = new ChromeOptions();
63+
ChromeOptions options = getDefaultChromeOptions();
6464
options.setEnableDownloads(true);
6565
driver = RemoteWebDriver.builder()
6666
.oneOf(options)
@@ -70,6 +70,30 @@ public void remoteWebDriverIgnoreSSL() throws Exception {
7070
driver.quit();
7171
}
7272

73+
@Test
74+
public void remoteWebDriverWithEmbedAuthUrl() throws Exception {
75+
ClientConfig clientConfig = ClientConfig.defaultConfig()
76+
.withRetries()
77+
.sslContext(createSSLContextWithCA(Path.of("src/test/resources/tls.crt").toAbsolutePath().toString()))
78+
.connectionTimeout(Duration.ofSeconds(300))
79+
.readTimeout(Duration.ofSeconds(3600))
80+
.version(HTTP_1_1.toString());
81+
ChromeOptions options = getDefaultChromeOptions();
82+
options.setEnableDownloads(true);
83+
driver = RemoteWebDriver.builder()
84+
.oneOf(options)
85+
.address(embedAuthToUrl(gridUrl, "admin", "myStrongPassword"))
86+
.config(clientConfig)
87+
.build();
88+
driver.quit();
89+
}
90+
91+
private URL embedAuthToUrl(URL url, String username, String password) throws Exception {
92+
String userInfo = username + ":" + password;
93+
String urlWithAuth = url.getProtocol() + "://" + userInfo + "@" + url.getHost() + ":" + url.getPort() + url.getPath();
94+
return new URL(urlWithAuth);
95+
}
96+
7397
public static SSLContext createSSLContextWithCA(String caCertPath) throws Exception {
7498
FileInputStream fis = new FileInputStream(caCertPath);
7599
CertificateFactory cf = CertificateFactory.getInstance("X.509");

0 commit comments

Comments
 (0)