Skip to content

Commit e211eba

Browse files
authored
Merge branch 'trunk' into trunk
2 parents 167d479 + df10d88 commit e211eba

File tree

126 files changed

+2680
-866
lines changed

Some content is hidden

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

126 files changed

+2680
-866
lines changed

.github/workflows/calibreapp-image-actions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
if: |
5050
github.event_name != 'pull_request' &&
5151
steps.calibre.outputs.markdown != ''
52-
uses: peter-evans/create-pull-request@v6
52+
uses: peter-evans/create-pull-request@v7
5353
with:
5454
title: Auto Compress Images
5555
branch-suffix: timestamp

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
deploy:
1010
if: contains(toJson(github.event.commits), '[deploy site]') == true
11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-24.04
1212
steps:
1313
- name: Checkout repo
1414
uses: actions/checkout@v4

.github/workflows/dotnet-examples.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ jobs:
4848
if: matrix.release == 'stable'
4949
uses: actions/setup-dotnet@v4
5050
with:
51-
dotnet-version: 6.x
51+
dotnet-version: 8.x
5252
- name: Set up .Net Nightly
5353
if: matrix.release == 'nightly'
5454
uses: actions/setup-dotnet@v4
5555
with:
56-
dotnet-version: 6.x
56+
dotnet-version: 8.x
5757
source-url: https://nuget.pkg.github.com/seleniumhq/index.json
5858
env:
5959
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/java-examples.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ jobs:
6767
command: |
6868
pip install yq
6969
xml_content=$(curl -sf https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/)
70-
latest_snapshot=$(echo $xml_content | xq '.content.data."content-item"' | jq -r .text)
71-
echo $latest_snapshot
70+
latest_snapshot=$(echo "$xml_content" | xq '.content.data."content-item"' | jq -r 'sort_by(.lastModified) | last | .text')
71+
echo "Latest Selenium Snapshot: $latest_snapshot"
7272
cd examples/java
7373
mvn -B -U test -Dselenium.version="$latest_snapshot"
7474
@@ -81,7 +81,7 @@ jobs:
8181
command: |
8282
pip install yq
8383
$xml_content = Invoke-WebRequest -Uri "https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/"
84-
$latest_snapshot = $xml_content.Content | xq '.content.data.\"content-item\"' | jq -r .text
85-
Write-Output $latest_snapshot
84+
$latest_snapshot = $xml_content.Content | xq '.content.data.\"content-item\"' | jq -r 'sort_by(.lastModified) | last | .text'
85+
Write-Output "Latest Selenium Snapshot: $latest_snapshot"
8686
cd examples/java
8787
mvn -B -U test "-Dselenium.version=$latest_snapshot"

.github/workflows/label-commenter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111

1212
jobs:
1313
comment:
14-
runs-on: ubuntu-22.04
14+
runs-on: ubuntu-24.04
1515
steps:
1616
- uses: actions/checkout@v4
1717
- name: Label Commenter

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
test_build:
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-24.04
1414
steps:
1515
- name: Checkout repo
1616
uses: actions/checkout@v4

.gitpod.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
tasks:
22
- name: Install Hugo, init submodules and start website
33
init: |
4-
curl -LO https://github.com/gohugoio/hugo/releases/download/v0.110.0/hugo_extended_0.110.0_linux-amd64.deb && \
5-
sudo dpkg -i hugo_extended_0.110.0_linux-amd64.deb && \
6-
sudo rm hugo_extended_0.110.0_linux-amd64.deb
4+
curl -LO https://github.com/gohugoio/hugo/releases/download/v0.125.4/hugo_extended_0.125.4_linux-amd64.deb && \
5+
sudo dpkg -i hugo_extended_0.125.4_linux-amd64.deb && \
6+
sudo rm hugo_extended_0.125.4_linux-amd64.deb
77
command: |
88
cd website_and_docs
9-
hugo server --baseUrl $(gp url 1313) --appendPort=false
9+
hugo server --baseURL $(gp url 1313) --appendPort=false
1010
1111
# List the ports you want to expose and what to do when they are served. See https://www.gitpod.io/docs/config-ports/
1212
ports:

examples/dotnet/SeleniumDocs/BaseTest.cs

Lines changed: 1 addition & 1 deletion
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.23.0.jar";
20+
private const string ServerJarName = "selenium-server-4.25.0.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));

examples/dotnet/SeleniumDocs/BiDi/CDP/NetworkTest.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
using OpenQA.Selenium;
77
using OpenQA.Selenium.DevTools;
88
using System.Linq;
9+
910
using System.Threading;
10-
using OpenQA.Selenium.DevTools.V127.Browser;
11-
using OpenQA.Selenium.DevTools.V127.Network;
12-
using OpenQA.Selenium.DevTools.V127.Performance;
11+
using OpenQA.Selenium.DevTools.V129.Browser;
12+
using OpenQA.Selenium.DevTools.V129.Network;
13+
using OpenQA.Selenium.DevTools.V129.Performance;
14+
1315

1416

1517
namespace SeleniumDocs.BiDi.CDP
@@ -20,7 +22,7 @@ public class NetworkTest : BaseTest
2022
[TestInitialize]
2123
public void Startup()
2224
{
23-
StartDriver("127");
25+
StartDriver("129");
2426
}
2527

2628
[TestMethod]
@@ -113,9 +115,9 @@ public async Task PerformanceMetrics()
113115
driver.Url = "https://www.selenium.dev/selenium/web/frameset.html";
114116

115117
var session = ((IDevTools)driver).GetDevToolsSession();
116-
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V127.DevToolsSessionDomains>();
118+
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V129.DevToolsSessionDomains>();
117119

118-
await domains.Performance.Enable(new OpenQA.Selenium.DevTools.V127.Performance.EnableCommandSettings());
120+
await domains.Performance.Enable(new OpenQA.Selenium.DevTools.V129.Performance.EnableCommandSettings());
119121
var metricsResponse =
120122
await session.SendCommand<GetMetricsCommandSettings, GetMetricsCommandResponse>(
121123
new GetMetricsCommandSettings()
@@ -134,8 +136,8 @@ await session.SendCommand<GetMetricsCommandSettings, GetMetricsCommandResponse>(
134136
public async Task SetCookie()
135137
{
136138
var session = ((IDevTools)driver).GetDevToolsSession();
137-
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V127.DevToolsSessionDomains>();
138-
await domains.Network.Enable(new OpenQA.Selenium.DevTools.V127.Network.EnableCommandSettings());
139+
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V129.DevToolsSessionDomains>();
140+
await domains.Network.Enable(new OpenQA.Selenium.DevTools.V129.Network.EnableCommandSettings());
139141

140142
var cookieCommandSettings = new SetCookieCommandSettings
141143
{
Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,74 @@
1+
// Licensed to the Software Freedom Conservancy (SFC) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The SFC licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
19+
using System;
120
using Microsoft.VisualStudio.TestTools.UnitTesting;
21+
using OpenQA.Selenium;
22+
using OpenQA.Selenium.Chrome;
23+
using System.Collections.Generic;
224

325
namespace SeleniumDocs.Interactions
426
{
5-
[TestClass]
6-
public class FramesTest : BaseTest
27+
[TestClass]
28+
public class FramesTest
729
{
30+
[TestMethod]
31+
public void TestFrames()
32+
{
33+
WebDriver driver = new ChromeDriver();
34+
driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromMilliseconds(500);
35+
36+
// Navigate to Url
37+
driver.Url= "https://www.selenium.dev/selenium/web/iframes.html";
38+
//switch To IFrame using Web Element
39+
IWebElement iframe = driver.FindElement(By.Id("iframe1"));
40+
//Switch to the frame
41+
driver.SwitchTo().Frame(iframe);
42+
Assert.AreEqual(true, driver.PageSource.Contains("We Leave From Here"));
43+
//Now we can type text into email field
44+
IWebElement emailE = driver.FindElement(By.Id("email"));
45+
emailE.SendKeys("[email protected]");
46+
emailE.Clear();
47+
driver.SwitchTo().DefaultContent();
48+
49+
50+
//switch To IFrame using name or id
51+
driver.FindElement(By.Name("iframe1-name"));
52+
//Switch to the frame
53+
driver.SwitchTo().Frame(iframe);
54+
Assert.AreEqual(true, driver.PageSource.Contains("We Leave From Here"));
55+
IWebElement email = driver.FindElement(By.Id("email"));
56+
//Now we can type text into email field
57+
email.SendKeys("[email protected]");
58+
email.Clear();
59+
driver.SwitchTo().DefaultContent();
60+
61+
62+
//switch To IFrame using index
63+
driver.SwitchTo().Frame(0);
64+
Assert.AreEqual(true, driver.PageSource.Contains("We Leave From Here"));
65+
66+
//leave frame
67+
driver.SwitchTo().DefaultContent();
68+
Assert.AreEqual(true, driver.PageSource.Contains("This page has iframes"));
69+
70+
//quit the browser
71+
driver.Quit();
72+
}
873
}
974
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Licensed to the Software Freedom Conservancy (SFC) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The SFC licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
19+
using System;
20+
using Microsoft.VisualStudio.TestTools.UnitTesting;
21+
using OpenQA.Selenium;
22+
using OpenQA.Selenium.Chrome;
23+
namespace SeleniumDocumentation.SeleniumInteractions
24+
{
25+
[TestClass]
26+
public class InteractionsTest
27+
{
28+
[TestMethod]
29+
public void TestInteractions()
30+
{
31+
WebDriver driver = new ChromeDriver();
32+
driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromMilliseconds(500);
33+
34+
// Navigate to Url
35+
driver.Url="https://www.selenium.dev/";
36+
//GetTitle
37+
String title = driver.Title;
38+
Assert.AreEqual(title, "Selenium");
39+
40+
//GetCurrentURL
41+
String url = driver.Url;
42+
Assert.AreEqual(url, "https://www.selenium.dev/");
43+
44+
//quitting driver
45+
driver.Quit(); //close all windows
46+
}
47+
}
48+
}

examples/dotnet/SeleniumDocs/SeleniumDocs.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<GenerateProgramFile>false</GenerateProgramFile>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
9+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
1010
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.7.1" />
11-
<PackageReference Include="MSTest.TestAdapter" Version="3.5.2" />
12-
<PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
13-
<PackageReference Include="Selenium.Support" Version="4.24.0" />
14-
<PackageReference Include="Selenium.WebDriver" Version="4.24.0" />
11+
<PackageReference Include="MSTest.TestAdapter" Version="3.6.0" />
12+
<PackageReference Include="MSTest.TestFramework" Version="3.6.0" />
13+
<PackageReference Include="Selenium.Support" Version="4.25.0" />
14+
<PackageReference Include="Selenium.WebDriver" Version="4.25.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

examples/java/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ repositories {
1010
}
1111

1212
dependencies {
13-
testImplementation 'org.seleniumhq.selenium:selenium-java:4.24.0'
14-
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.11.0'
13+
testImplementation 'org.seleniumhq.selenium:selenium-java:4.25.0'
14+
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.11.2'
1515
}
1616

1717
test {

examples/java/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

examples/java/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<maven.compiler.source>11</maven.compiler.source>
1414
<maven.compiler.target>11</maven.compiler.target>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16-
<selenium.version>4.24.0</selenium.version>
16+
<selenium.version>4.25.0</selenium.version>
1717
</properties>
1818

1919
<repositories>
@@ -40,7 +40,7 @@
4040
<dependency>
4141
<groupId>org.junit.jupiter</groupId>
4242
<artifactId>junit-jupiter-engine</artifactId>
43-
<version>5.11.0</version>
43+
<version>5.11.2</version>
4444
<scope>test</scope>
4545
</dependency>
4646
<dependency>
@@ -55,7 +55,7 @@
5555
<plugin>
5656
<groupId>org.apache.maven.plugins</groupId>
5757
<artifactId>maven-surefire-plugin</artifactId>
58-
<version>3.5.0</version>
58+
<version>3.5.1</version>
5959
<configuration>
6060
<properties>
6161
<configurationParameters>
Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,44 @@
11
package dev.selenium.elements;
2-
2+
import org.openqa.selenium.By;
3+
import org.openqa.selenium.support.pagefactory.ByAll;
4+
import org.openqa.selenium.support.pagefactory.ByChained;
35
import dev.selenium.BaseTest;
6+
import java.util.List;
7+
8+
import org.openqa.selenium.WebDriver;
9+
import org.openqa.selenium.WebElement;
10+
import org.openqa.selenium.chrome.ChromeDriver;
411

512
public class LocatorsTest extends BaseTest {
613

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+
30+
public String ByChainedTest() {
31+
// Create instance of ChromeDriver
32+
WebDriver driver = new ChromeDriver();
33+
// Navigate to Url
34+
driver.get("https://www.selenium.dev/selenium/web/login.html");
35+
36+
// Find username-field inside of login-form
37+
By example = new ByChained(By.id("login-form"), By.id("username-field"));
38+
WebElement username_input = driver.findElement(example);
39+
40+
//return placeholder text
41+
String placeholder = username_input.getAttribute("placeholder");
42+
return placeholder;
43+
}
744
}

0 commit comments

Comments
 (0)