Skip to content

Commit 2e14899

Browse files
authored
Merge branch 'trunk' into trunk
2 parents 13005ec + 799081f commit 2e14899

File tree

177 files changed

+3208
-1537
lines changed

Some content is hidden

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

177 files changed

+3208
-1537
lines changed

.github/workflows/js-examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
uses: nick-invision/retry@v3.0.2
120120
with:
121121
timeout_minutes: 20
122-
max_attempts: 3
122+
max_attempts: 2
123123
command: |
124124
cd examples/javascript
125125
npm test

.github/workflows/link-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup Node
2828
uses: actions/setup-node@v4
2929
with:
30-
node-version: '18.20.8'
30+
node-version: '22.17.0'
3131
cache: 'npm'
3232
# The action defaults to search for the dependency file (package-lock.json,
3333
# npm-shrinkwrap.json or yarn.lock) in the repository root, and uses its

.github/workflows/ruby-examples.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: |
4343
sudo rm -rf $CHROMEWEBDRIVER $EDGEWEBDRIVER $GECKOWEBDRIVER
4444
- name: Setup Fluxbox and Xvfb
45-
if: inputs.os == 'ubuntu'
45+
if: matrix.os == 'ubuntu'
4646
run: |
4747
sudo apt-get -y install fluxbox libxss1 libappindicator3-1 libindicator7
4848
Xvfb :99 &
@@ -51,7 +51,7 @@ jobs:
5151
- name: Set up Ruby
5252
uses: ruby/setup-ruby@v1
5353
with:
54-
ruby-version: 3.1
54+
ruby-version: 3.2
5555
bundler-cache: true
5656
- name: Install Gems Nightly non-Windows
5757
if: matrix.release == 'nightly' && matrix.os != 'windows'
@@ -97,7 +97,7 @@ jobs:
9797
cd examples/ruby
9898
bundle exec rspec
9999
new_command_on_retry: |
100-
cd examples/ruby; $env:DEBUG="true"; bundle exec rspec --only-failures
100+
cd examples/ruby; $env:DEBUG="true"; bundle exec rspec --only-failures --backtrace
101101
- name: Run tests on ${{ matrix.os }}
102102
if: matrix.os != 'windows'
103103
uses: nick-invision/retry@v3.0.2
@@ -109,4 +109,21 @@ jobs:
109109
bundle exec rspec
110110
new_command_on_retry: |
111111
cd examples/ruby
112-
DEBUG=true bundle exec rspec --only-failures
112+
DEBUG=true bundle exec rspec --only-failures --backtrace
113+
114+
lint:
115+
runs-on: ubuntu-latest
116+
steps:
117+
- name: Checkout GitHub repo
118+
uses: actions/checkout@v4
119+
- name: Set up Ruby
120+
uses: ruby/setup-ruby@v1
121+
with:
122+
ruby-version: 3.2
123+
bundler-cache: true
124+
- name: Install dependencies
125+
working-directory: ./examples/ruby
126+
run: bundle install
127+
- name: Run RuboCop
128+
working-directory: ./examples/ruby
129+
run: bundle exec rubocop

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ to use **[Hugo 0.125.4](https://github.com/gohugoio/hugo/releases/tag/v0.125.4)*
2121

2222
Steps needed to have this working locally and work on it:
2323

24-
- Follow the [Install Hugo](https://www.docsy.dev/docs/get-started/other-options/#install-hugo) instructions from Docsy
24+
- [Install Hugo](https://gohugo.io/installation/) and follow the [Get Started](https://www.docsy.dev/docs/get-started/) instructions from Docsy
2525
- [Install go](https://go.dev/doc/install)
2626
- Clone this repository
2727
- Run `cd website_and_docs`

examples/dotnet/SeleniumDocs/BaseTest.cs

Lines changed: 12 additions & 6 deletions
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.31.0.jar";
20+
private const string ServerJarName = "selenium-server-4.33.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));
@@ -33,12 +33,18 @@ public void Cleanup()
3333
}
3434
}
3535

36-
protected void StartDriver(string browserVersion = "stable")
36+
protected void StartDriver(string browserVersion = null)
3737
{
38-
ChromeOptions options = new ChromeOptions
38+
ChromeOptions options = new ChromeOptions();
39+
if (browserVersion != null)
3940
{
40-
BrowserVersion = browserVersion
41-
};
41+
options.BrowserVersion = browserVersion;
42+
string userDataDir = System.IO.Path.Combine(System.IO.Path.GetTempPath(), System.IO.Path.GetRandomFileName());
43+
System.IO.Directory.CreateDirectory(userDataDir);
44+
options.AddArgument($"--user-data-dir={userDataDir}");
45+
options.AddArgument("--no-sandbox");
46+
options.AddArgument("--disable-dev-shm-usage");
47+
}
4248
driver = new ChromeDriver(options);
4349
}
4450

@@ -111,4 +117,4 @@ private async Task EnsureGridIsRunningAsync()
111117
}
112118
}
113119
}
114-
}
120+
}

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
using OpenQA.Selenium;
55
using OpenQA.Selenium.DevTools;
66
using System.Linq;
7-
using OpenQA.Selenium.DevTools.V132.Network;
8-
using OpenQA.Selenium.DevTools.V132.Performance;
7+
using OpenQA.Selenium.DevTools.V137.Network;
8+
using OpenQA.Selenium.DevTools.V137.Performance;
99

1010

1111
namespace SeleniumDocs.BiDi.CDP
@@ -16,7 +16,7 @@ public class NetworkTest : BaseTest
1616
[TestInitialize]
1717
public void Startup()
1818
{
19-
StartDriver("132");
19+
StartDriver("137");
2020
}
2121

2222
[TestMethod]
@@ -109,9 +109,9 @@ public async Task PerformanceMetrics()
109109
driver.Url = "https://www.selenium.dev/selenium/web/frameset.html";
110110

111111
var session = ((IDevTools)driver).GetDevToolsSession();
112-
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V132.DevToolsSessionDomains>();
112+
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V137.DevToolsSessionDomains>();
113113

114-
await domains.Performance.Enable(new OpenQA.Selenium.DevTools.V132.Performance.EnableCommandSettings());
114+
await domains.Performance.Enable(new OpenQA.Selenium.DevTools.V137.Performance.EnableCommandSettings());
115115
var metricsResponse =
116116
await session.SendCommand<GetMetricsCommandSettings, GetMetricsCommandResponse>(
117117
new GetMetricsCommandSettings()
@@ -130,8 +130,8 @@ await session.SendCommand<GetMetricsCommandSettings, GetMetricsCommandResponse>(
130130
public async Task SetCookie()
131131
{
132132
var session = ((IDevTools)driver).GetDevToolsSession();
133-
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V132.DevToolsSessionDomains>();
134-
await domains.Network.Enable(new OpenQA.Selenium.DevTools.V132.Network.EnableCommandSettings());
133+
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V137.DevToolsSessionDomains>();
134+
await domains.Network.Enable(new OpenQA.Selenium.DevTools.V137.Network.EnableCommandSettings());
135135

136136
var cookieCommandSettings = new SetCookieCommandSettings
137137
{
@@ -148,4 +148,4 @@ public async Task SetCookie()
148148
}
149149

150150
}
151-
}
151+
}

examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ public void Arguments()
4444
[TestMethod]
4545
public void SetBrowserLocation()
4646
{
47+
string userDataDir = System.IO.Path.Combine(System.IO.Path.GetTempPath(), System.IO.Path.GetRandomFileName());
48+
System.IO.Directory.CreateDirectory(userDataDir);
4749
var options = new ChromeOptions();
50+
options.AddArgument($"--user-data-dir={userDataDir}");
51+
options.AddArgument("--no-sandbox");
52+
options.AddArgument("--disable-dev-shm-usage");
4853

4954
options.BinaryLocation = GetChromeLocation();
5055

@@ -59,6 +64,7 @@ public void InstallExtension()
5964
var extensionFilePath = Path.Combine(baseDir, "../../../Extensions/webextensions-selenium-example.crx");
6065

6166
options.AddExtension(extensionFilePath);
67+
options.AddArgument("--disable-features=DisableLoadExtensionCommandLineSwitch");
6268

6369
driver = new ChromeDriver(options);
6470

@@ -117,7 +123,7 @@ public void LogsLevel()
117123
var service = ChromeDriverService.CreateDefaultService();
118124
service.LogPath = GetLogLocation();
119125

120-
// service.LogLevel = ChromiumDriverLogLevel.Debug
126+
// service.LogLevel = ChromiumDriverLogLevel.Debug
121127

122128
driver = new ChromeDriver(service);
123129

@@ -180,4 +186,4 @@ private static string GetChromeLocation()
180186
return new DriverFinder(options).GetBrowserPath();
181187
}
182188
}
183-
}
189+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,57 @@
11
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using OpenQA.Selenium;
3+
using OpenQA.Selenium.Chrome;
24

35
namespace SeleniumDocs.Drivers
46
{
57
[TestClass]
68
public class OptionsTest : BaseTest
79
{
10+
[TestMethod]
11+
public void SetPageLoadStrategyNormal()
12+
{
13+
ChromeOptions chromeOptions = new ChromeOptions();
14+
chromeOptions.PageLoadStrategy = PageLoadStrategy.Normal;
15+
IWebDriver driver = new ChromeDriver(chromeOptions);
16+
try
17+
{
18+
// Navigate to Url
19+
driver.Navigate().GoToUrl("https://selenium.dev");
20+
}
21+
finally
22+
{
23+
driver.Quit();
24+
}
25+
}
26+
[TestMethod]
27+
public void SetPageLoadStrategyEager()
28+
{
29+
var chromeOptions = new ChromeOptions();
30+
chromeOptions.PageLoadStrategy = PageLoadStrategy.Eager;
31+
IWebDriver driver = new ChromeDriver(chromeOptions);
32+
try
33+
{
34+
driver.Navigate().GoToUrl("https://selenium.dev");
35+
}
36+
finally
37+
{
38+
driver.Quit();
39+
}
40+
}
41+
[TestMethod]
42+
public void SetPageLoadStrategyNone()
43+
{
44+
var chromeOptions = new ChromeOptions();
45+
chromeOptions.PageLoadStrategy = PageLoadStrategy.None;
46+
IWebDriver driver = new ChromeDriver(chromeOptions);
47+
try
48+
{
49+
driver.Navigate().GoToUrl("https://selenium.dev");
50+
}
51+
finally
52+
{
53+
driver.Quit();
54+
}
55+
}
856
}
957
}
Binary file not shown.

examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ public void TestFrames()
4848

4949

5050
//switch To IFrame using name or id
51-
driver.FindElement(By.Name("iframe1-name"));
51+
IWebElement iframe1=driver.FindElement(By.Name("iframe1-name"));
5252
//Switch to the frame
53-
driver.SwitchTo().Frame(iframe);
53+
driver.SwitchTo().Frame(iframe1);
5454
Assert.AreEqual(true, driver.PageSource.Contains("We Leave From Here"));
5555
IWebElement email = driver.FindElement(By.Id("email"));
5656
//Now we can type text into email field

examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public void TestOrientation()
1616
PrintOptions printOptions = new PrintOptions();
1717
printOptions.Orientation = PrintOrientation.Landscape;
1818
PrintOrientation currentOrientation = printOptions.Orientation;
19+
driver.Quit();
1920
}
2021

2122
[TestMethod]
@@ -26,7 +27,8 @@ public void TestRange()
2627
PrintOptions printOptions = new PrintOptions();
2728
printOptions.AddPageRangeToPrint("1-3"); // add range of pages
2829
printOptions.AddPageToPrint(5); // add individual page
29-
}
30+
driver.Quit();
31+
}
3032

3133
[TestMethod]
3234
public void TestSize()
@@ -35,6 +37,7 @@ public void TestSize()
3537
driver.Navigate().GoToUrl("https://www.selenium.dev/");
3638
PrintOptions printOptions = new PrintOptions();
3739
PrintOptions.PageSize currentDimensions = printOptions.PageDimensions;
40+
driver.Quit();
3841
}
3942

4043
[TestMethod]
@@ -45,6 +48,7 @@ public void TestBackgrounds()
4548
PrintOptions printOptions = new PrintOptions();
4649
printOptions.OutputBackgroundImages = true;
4750
bool currentBackgrounds = printOptions.OutputBackgroundImages;
51+
driver.Quit();
4852
}
4953

5054
[TestMethod]
@@ -54,6 +58,7 @@ public void TestMargins()
5458
driver.Navigate().GoToUrl("https://www.selenium.dev/");
5559
PrintOptions printOptions = new PrintOptions();
5660
PrintOptions.Margins currentMargins = printOptions.PageMargins;
61+
driver.Quit();
5762
}
5863

5964

@@ -65,6 +70,7 @@ public void TestScale()
6570
PrintOptions printOptions = new PrintOptions();
6671
printOptions.ScaleFactor = 0.5;
6772
double currentScale = printOptions.ScaleFactor;
73+
driver.Quit();
6874
}
6975

7076
[TestMethod]
@@ -75,16 +81,18 @@ public void TestShrinkToFit()
7581
PrintOptions printOptions = new PrintOptions();
7682
printOptions.ShrinkToFit = true;
7783
bool currentShrinkToFit = printOptions.ShrinkToFit;
84+
driver.Quit();
7885
}
7986

8087
[TestMethod]
81-
public void PrintWithPrintsPageTest()
88+
public void PrintWithPrintsPageTest()
8289
{
8390
WebDriver driver = new ChromeDriver();
8491
driver.Navigate().GoToUrl("https://www.selenium.dev/");
8592
PrintOptions printOptions = new PrintOptions();
8693
PrintDocument printedPage = driver.Print(printOptions);
8794
Assert.IsTrue(printedPage.AsBase64EncodedString.StartsWith("JVBER"));
95+
driver.Quit();
8896
}
8997
}
90-
}
98+
}

examples/dotnet/SeleniumDocs/SeleniumDocs.csproj

Lines changed: 2 additions & 2 deletions
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.31.0" />
14-
<PackageReference Include="Selenium.WebDriver" Version="4.31.0" />
13+
<PackageReference Include="Selenium.Support" Version="4.33.0" />
14+
<PackageReference Include="Selenium.WebDriver" Version="4.33.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using OpenQA.Selenium.Chrome;
3+
4+
namespace SeleniumDocs.SeleniumManagerTest
5+
{
6+
[TestClass]
7+
public class UsageTest
8+
{
9+
[TestMethod]
10+
public void TestWithSeleniumManager()
11+
{
12+
// Before
13+
// using var driver = new ChromeDriver("path/to/chromedriver");
14+
15+
// Now
16+
using var driver = new ChromeDriver();
17+
driver.Navigate().GoToUrl("https://www.selenium.dev/documentation/selenium_manager/");
18+
}
19+
}
20+
}

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.31.0'
14-
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.12.1'
13+
testImplementation 'org.seleniumhq.selenium:selenium-java:4.33.0'
14+
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.13.2'
1515
}
1616

1717
test {
59 Bytes
Binary file not shown.

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.13-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)