Skip to content

Commit

Permalink
Merge branch 'trunk' into update-python-locators-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pmartinez1 authored Sep 23, 2024
2 parents 1aac7de + e1fa2da commit 4984152
Show file tree
Hide file tree
Showing 78 changed files with 854 additions and 185 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ jobs:
if: matrix.release == 'stable'
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.x
dotnet-version: 8.x
- name: Set up .Net Nightly
if: matrix.release == 'nightly'
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.x
dotnet-version: 8.x
source-url: https://nuget.pkg.github.com/seleniumhq/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
Expand Down
2 changes: 1 addition & 1 deletion examples/dotnet/SeleniumDocs/BaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class BaseTest
protected IWebDriver driver;
protected Uri GridUrl;
private Process _webserverProcess;
private const string ServerJarName = "selenium-server-4.23.0.jar";
private const string ServerJarName = "selenium-server-4.25.0.jar";
private static readonly string BaseDirectory = AppContext.BaseDirectory;
private const string RelativePathToGrid = "../../../../../";
private readonly string _examplesDirectory = Path.GetFullPath(Path.Combine(BaseDirectory, RelativePathToGrid));
Expand Down
14 changes: 7 additions & 7 deletions examples/dotnet/SeleniumDocs/BiDi/CDP/NetworkTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using OpenQA.Selenium;
using OpenQA.Selenium.DevTools;
using System.Linq;
using OpenQA.Selenium.DevTools.V127.Network;
using OpenQA.Selenium.DevTools.V127.Performance;
using OpenQA.Selenium.DevTools.V129.Network;
using OpenQA.Selenium.DevTools.V129.Performance;


namespace SeleniumDocs.BiDi.CDP
Expand All @@ -16,7 +16,7 @@ public class NetworkTest : BaseTest
[TestInitialize]
public void Startup()
{
StartDriver("127");
StartDriver("129");
}

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

var session = ((IDevTools)driver).GetDevToolsSession();
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V127.DevToolsSessionDomains>();
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V129.DevToolsSessionDomains>();

await domains.Performance.Enable(new OpenQA.Selenium.DevTools.V127.Performance.EnableCommandSettings());
await domains.Performance.Enable(new OpenQA.Selenium.DevTools.V129.Performance.EnableCommandSettings());
var metricsResponse =
await session.SendCommand<GetMetricsCommandSettings, GetMetricsCommandResponse>(
new GetMetricsCommandSettings()
Expand All @@ -130,8 +130,8 @@ await session.SendCommand<GetMetricsCommandSettings, GetMetricsCommandResponse>(
public async Task SetCookie()
{
var session = ((IDevTools)driver).GetDevToolsSession();
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V127.DevToolsSessionDomains>();
await domains.Network.Enable(new OpenQA.Selenium.DevTools.V127.Network.EnableCommandSettings());
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V129.DevToolsSessionDomains>();
await domains.Network.Enable(new OpenQA.Selenium.DevTools.V129.Network.EnableCommandSettings());

var cookieCommandSettings = new SetCookieCommandSettings
{
Expand Down
12 changes: 6 additions & 6 deletions examples/dotnet/SeleniumDocs/SeleniumDocs.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.7.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
<PackageReference Include="Selenium.Support" Version="4.24.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.24.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.0" />
<PackageReference Include="Selenium.Support" Version="4.25.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.25.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repositories {
}

dependencies {
testImplementation 'org.seleniumhq.selenium:selenium-java:4.24.0'
testImplementation 'org.seleniumhq.selenium:selenium-java:4.25.0'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.11.0'
}

Expand Down
2 changes: 1 addition & 1 deletion examples/java/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion examples/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<selenium.version>4.24.0</selenium.version>
<selenium.version>4.25.0</selenium.version>
</properties>

<repositories>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,44 @@
package dev.selenium.elements;

import org.openqa.selenium.By;
import org.openqa.selenium.support.pagefactory.ByAll;
import org.openqa.selenium.support.pagefactory.ByChained;
import dev.selenium.BaseTest;
import java.util.List;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

public class LocatorsTest extends BaseTest {


public void ByAllTest() {
// Create instance of ChromeDriver
WebDriver driver = new ChromeDriver();
// Navigate to Url
driver.get("https://www.selenium.dev/selenium/web/login.html");

// get both logins
By example = new ByAll(By.id("password-field"), By.id("username-field"));
List<WebElement> login_inputs = driver.findElements(example);

//send them both input
login_inputs.get(0).sendKeys("username");
login_inputs.get(1).sendKeys("password");
}

public String ByChainedTest() {
// Create instance of ChromeDriver
WebDriver driver = new ChromeDriver();
// Navigate to Url
driver.get("https://www.selenium.dev/selenium/web/login.html");

// Find username-field inside of login-form
By example = new ByChained(By.id("login-form"), By.id("username-field"));
WebElement username_input = driver.findElement(example);

//return placeholder text
String placeholder = username_input.getAttribute("placeholder");
return placeholder;
}
}
15 changes: 8 additions & 7 deletions examples/javascript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"license": "Apache-2.0",
"dependencies": {
"assert": "2.1.0",
"selenium-webdriver": "4.24.0"
"selenium-webdriver": "4.25.0"
},
"devDependencies": {
"mocha": "10.7.3"
Expand Down
4 changes: 2 additions & 2 deletions examples/kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
<kotlin.version>2.0.20</kotlin.version>

<slf4j.version>2.0.16</slf4j.version>
<logback.version>1.5.7</logback.version>
<logback.version>1.5.8</logback.version>

<junit5.version>5.11.0</junit5.version>
<wdm.version>5.2.3</wdm.version>

<maven-surefire-plugin.version>3.5.0</maven-surefire-plugin.version>

<java.version>1.8</java.version>
<selenium.version>4.24.0</selenium.version>
<selenium.version>4.25.0</selenium.version>

<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${java.version}</maven.compiler.source>
Expand Down
2 changes: 1 addition & 1 deletion examples/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
selenium==4.24.0
selenium==4.25.0
pytest
trio
pytest-trio
Expand Down
4 changes: 2 additions & 2 deletions examples/python/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def server_old(request):
os.path.abspath(__file__)
)
),
"selenium-server-4.23.0.jar",
"selenium-server-4.25.0.jar",
)

def wait_for_server(url, timeout):
Expand Down Expand Up @@ -198,7 +198,7 @@ def server():
)
)
),
"selenium-server-4.23.0.jar",
"selenium-server-4.25.0.jar",
)

args = [
Expand Down
4 changes: 2 additions & 2 deletions examples/ruby/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ gem 'rake', '~> 13.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', '~> 1.35'
gem 'rubocop-rspec', '~> 3.0'
gem 'selenium-devtools', '= 0.128.0'
gem 'selenium-webdriver', '= 4.24.0'
gem 'selenium-devtools', '= 0.129.0'
gem 'selenium-webdriver', '= 4.25.0'
24 changes: 11 additions & 13 deletions examples/ruby/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ GEM
diff-lcs (1.5.1)
json (2.7.2)
language_server-protocol (3.17.0.3)
logger (1.6.0)
logger (1.6.1)
parallel (1.26.3)
parser (3.3.4.2)
parser (3.3.5.0)
ast (~> 2.4.1)
racc
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.2)
rexml (3.3.6)
strscan
rexml (3.3.7)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
Expand All @@ -30,31 +29,30 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.0)
rubocop (1.66.0)
rubocop (1.66.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.1, < 2.0)
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.1)
rubocop-ast (1.32.3)
parser (>= 3.3.1.0)
rubocop-rspec (3.0.4)
rubocop-rspec (3.0.5)
rubocop (~> 1.61)
ruby-progressbar (1.13.0)
rubyzip (2.3.2)
selenium-devtools (0.128.0)
selenium-devtools (0.129.0)
selenium-webdriver (~> 4.2)
selenium-webdriver (4.24.0)
selenium-webdriver (4.25.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
strscan (3.1.0)
unicode-display_width (2.5.0)
websocket (1.2.11)

Expand All @@ -72,8 +70,8 @@ DEPENDENCIES
rspec (~> 3.0)
rubocop (~> 1.35)
rubocop-rspec (~> 3.0)
selenium-devtools (= 0.128.0)
selenium-webdriver (= 4.24.0)
selenium-devtools (= 0.129.0)
selenium-webdriver (= 4.25.0)

BUNDLED WITH
2.5.6
Binary file not shown.
Binary file modified favicon.ico
Binary file not shown.
Loading

0 comments on commit 4984152

Please sign in to comment.