diff --git a/.github/workflows/dotnet-examples.yml b/.github/workflows/dotnet-examples.yml index 448219ad3d7f..1bf2c7c49778 100644 --- a/.github/workflows/dotnet-examples.yml +++ b/.github/workflows/dotnet-examples.yml @@ -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}} diff --git a/examples/dotnet/SeleniumDocs/BaseTest.cs b/examples/dotnet/SeleniumDocs/BaseTest.cs index d09a6d72e9b3..ad061a66f9d8 100644 --- a/examples/dotnet/SeleniumDocs/BaseTest.cs +++ b/examples/dotnet/SeleniumDocs/BaseTest.cs @@ -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)); diff --git a/examples/dotnet/SeleniumDocs/BiDi/CDP/NetworkTest.cs b/examples/dotnet/SeleniumDocs/BiDi/CDP/NetworkTest.cs index 5ed1b236d272..85f115809f50 100644 --- a/examples/dotnet/SeleniumDocs/BiDi/CDP/NetworkTest.cs +++ b/examples/dotnet/SeleniumDocs/BiDi/CDP/NetworkTest.cs @@ -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 @@ -16,7 +16,7 @@ public class NetworkTest : BaseTest [TestInitialize] public void Startup() { - StartDriver("127"); + StartDriver("129"); } [TestMethod] @@ -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(); + var domains = session.GetVersionSpecificDomains(); - 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( new GetMetricsCommandSettings() @@ -130,8 +130,8 @@ await session.SendCommand( public async Task SetCookie() { var session = ((IDevTools)driver).GetDevToolsSession(); - var domains = session.GetVersionSpecificDomains(); - await domains.Network.Enable(new OpenQA.Selenium.DevTools.V127.Network.EnableCommandSettings()); + var domains = session.GetVersionSpecificDomains(); + await domains.Network.Enable(new OpenQA.Selenium.DevTools.V129.Network.EnableCommandSettings()); var cookieCommandSettings = new SetCookieCommandSettings { diff --git a/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj b/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj index 9bc3fb61e12f..127b9fae75d3 100644 --- a/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj +++ b/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj @@ -1,17 +1,17 @@ - net6.0 + net8.0 false - + - - - - + + + + diff --git a/examples/java/build.gradle b/examples/java/build.gradle index 10c9d1637306..89c1692b6828 100644 --- a/examples/java/build.gradle +++ b/examples/java/build.gradle @@ -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' } diff --git a/examples/java/gradle/wrapper/gradle-wrapper.properties b/examples/java/gradle/wrapper/gradle-wrapper.properties index 9355b4155759..0aaefbcaf0f1 100644 --- a/examples/java/gradle/wrapper/gradle-wrapper.properties +++ b/examples/java/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/examples/java/pom.xml b/examples/java/pom.xml index 411a96133f81..d1189c59b47e 100644 --- a/examples/java/pom.xml +++ b/examples/java/pom.xml @@ -13,7 +13,7 @@ 11 11 UTF-8 - 4.24.0 + 4.25.0 diff --git a/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java b/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java index 08f73a7384d6..bcc473f7a8be 100644 --- a/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java +++ b/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java @@ -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 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; + } } diff --git a/examples/javascript/package-lock.json b/examples/javascript/package-lock.json index f81de1d14dfe..7158c4770b49 100644 --- a/examples/javascript/package-lock.json +++ b/examples/javascript/package-lock.json @@ -10,7 +10,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" @@ -1023,9 +1023,10 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/selenium-webdriver": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.24.0.tgz", - "integrity": "sha512-qrqoHhHPZuKLiz5VAQUxrn3ILs7/cYqn2/x96r35g5JjkLUjOS1lX+F+tEJKhRMlQ/MGJ+N1016JF5g2xZUFzw==", + "version": "4.25.0", + "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.25.0.tgz", + "integrity": "sha512-zl9IX93caOT8wbcCpZzAkEtYa+hNgJ4C5GUN8uhpzggqRLvsg1asfKi0p1uNZC8buYVvsBZbx8S+9MjVAjs4oA==", + "license": "Apache-2.0", "dependencies": { "@bazel/runfiles": "^5.8.1", "jszip": "^3.10.1", @@ -2016,9 +2017,9 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "selenium-webdriver": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.24.0.tgz", - "integrity": "sha512-qrqoHhHPZuKLiz5VAQUxrn3ILs7/cYqn2/x96r35g5JjkLUjOS1lX+F+tEJKhRMlQ/MGJ+N1016JF5g2xZUFzw==", + "version": "4.25.0", + "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.25.0.tgz", + "integrity": "sha512-zl9IX93caOT8wbcCpZzAkEtYa+hNgJ4C5GUN8uhpzggqRLvsg1asfKi0p1uNZC8buYVvsBZbx8S+9MjVAjs4oA==", "requires": { "@bazel/runfiles": "^5.8.1", "jszip": "^3.10.1", diff --git a/examples/javascript/package.json b/examples/javascript/package.json index f87538140383..f3c893f814b4 100644 --- a/examples/javascript/package.json +++ b/examples/javascript/package.json @@ -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" diff --git a/examples/kotlin/pom.xml b/examples/kotlin/pom.xml index e8c9c2e7780a..faa286c6be19 100644 --- a/examples/kotlin/pom.xml +++ b/examples/kotlin/pom.xml @@ -12,7 +12,7 @@ 2.0.20 2.0.16 - 1.5.7 + 1.5.8 5.11.0 5.2.3 @@ -20,7 +20,7 @@ 3.5.0 1.8 - 4.24.0 + 4.25.0 ${java.version} ${java.version} diff --git a/examples/python/requirements.txt b/examples/python/requirements.txt index 19405785dcb0..e526f262fbeb 100644 --- a/examples/python/requirements.txt +++ b/examples/python/requirements.txt @@ -1,4 +1,4 @@ -selenium==4.24.0 +selenium==4.25.0 pytest trio pytest-trio diff --git a/examples/python/tests/conftest.py b/examples/python/tests/conftest.py index c7729abefafb..f340b56352ee 100644 --- a/examples/python/tests/conftest.py +++ b/examples/python/tests/conftest.py @@ -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): @@ -198,7 +198,7 @@ def server(): ) ) ), - "selenium-server-4.23.0.jar", + "selenium-server-4.25.0.jar", ) args = [ diff --git a/examples/ruby/Gemfile b/examples/ruby/Gemfile index be513cf12dfd..6f3682764b44 100644 --- a/examples/ruby/Gemfile +++ b/examples/ruby/Gemfile @@ -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' diff --git a/examples/ruby/Gemfile.lock b/examples/ruby/Gemfile.lock index 45e782484008..c65b914ced21 100644 --- a/examples/ruby/Gemfile.lock +++ b/examples/ruby/Gemfile.lock @@ -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) @@ -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) @@ -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 diff --git a/examples/selenium-server-4.23.0.jar b/examples/selenium-server-4.25.0.jar similarity index 85% rename from examples/selenium-server-4.23.0.jar rename to examples/selenium-server-4.25.0.jar index bba1a447c80d..8100971f045b 100644 Binary files a/examples/selenium-server-4.23.0.jar and b/examples/selenium-server-4.25.0.jar differ diff --git a/favicon.ico b/favicon.ico index cf9d9dda1ffe..80bf7ae9a9ac 100755 Binary files a/favicon.ico and b/favicon.ico differ diff --git a/website_and_docs/content/blog/2024/selenium-4-25-released.md b/website_and_docs/content/blog/2024/selenium-4-25-released.md new file mode 100644 index 000000000000..252fcacf99f1 --- /dev/null +++ b/website_and_docs/content/blog/2024/selenium-4-25-released.md @@ -0,0 +1,159 @@ +--- +title: "Selenium 4.25 Released!" +linkTitle: "Selenium 4.25 Released!" +date: 2024-09-20 +tags: ["selenium"] +categories: ["releases"] +author: Diego Molina [@diemol](https://www.diemol.com) +images: + - "/images/blog/2024/selenium_4.25.jpg" +description: > + Today we're happy to announce that Selenium 4.25 has been released! +--- + +We're very happy to announce the release of Selenium 4.25 for +Javascript, Ruby, Python, .NET, Java and the Grid! +Links to everything can be found on our [downloads page][downloads]. + +Selenium 4.25.0 introduces several important changes and improvements across multiple programming +languages and build systems. Below are the key highlights from this release. + +### General Updates +- Chrome DevTools support is now: v129, v128, and v127 (Firefox still uses v85 for all versions) +- Selenium has at least [4M active users](https://plausible.io/manager.selenium.dev) in the last 30 days. 1.5M more than 4 months ago! +- **First implementation of BiDi (Bidirectional WebDriver Protocol) for .NET**, providing advanced capabilities like inspecting browser contexts and receiving real-time events. + - We are looking for feedback on this feature, so please try it out and let us know what you think! Try `var bidi = await driver.AsBiDiAsync();` to get started. + +
+ +### Java +- Escape cookie values when required for tests ([#14486](https://github.com/SeleniumHQ/selenium/commit/375e841c7acaf575133617968406e289ee04b459)) +- Warn about an upcoming change enforcing string quotes in TOML ([#14491](https://github.com/SeleniumHQ/selenium/commit/6b4c39c19e9ac3f63bbf8827cfd26aa782e77042)) +- [See all changes](https://github.com/SeleniumHQ/selenium/blob/trunk/java/CHANGELOG) + +
+ +### Python +- Fixed type errors for `pointer_input.py`, `wheel_input.py`, and `firefox/options.py` ([#14476](https://github.com/SeleniumHQ/selenium/commit/05bce9b4c088d939d4a25a33e0d014d3f3a67473)) +- Fixed failing BiDi tests ([#14448](https://github.com/SeleniumHQ/selenium/commit/be40b5c85350b2f5cf83194cce4cb1ab23e13172)) +- Dropped support for Python 2.x in `firefox_profile.py` ([#14489](https://github.com/SeleniumHQ/selenium/commit/71a0629521b42263ad34874adba4e97cd8747fbd)) +- [See all changes](https://github.com/SeleniumHQ/selenium/blob/trunk/py/CHANGES) + +
+ +### JavaScript +- Fixed flaky network event tests for BiDi ([#14512](https://github.com/SeleniumHQ/selenium/commit/2970ad30a75d798edb4abdbcfd04666a95f8ef8a)) +- Closed CDP websocket connection on `driver.quit` ([#14501](https://github.com/SeleniumHQ/selenium/commit/7c8b46dd4a4ce11ad6fd1c436416cdbd448c1b73)) +- [See all changes](https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/node/selenium-webdriver/CHANGES.md) + +
+ +### .NET +- BiDi API updates, including renaming methods and simplifying context handling ([#14318](https://github.com/SeleniumHQ/selenium/commit/3e8b34cea24635e89aa42d09db8c37b6723a9005)) +- Exposed BiDi associated references in browsing context ([#14495](https://github.com/SeleniumHQ/selenium/commit/6c0df70463242ba1f7b182e11060fcf9a8e50a01)) +- [See all changes](https://github.com/SeleniumHQ/selenium/blob/trunk/dotnet/CHANGELOG) + +
+ +### Ruby +- Allowed driver path to be set using environment variables ([#14287](https://github.com/SeleniumHQ/selenium/commit/7602371488ebd14d2c6d8d980134bff42bbd17e9)) +- Fixed the `add_cause` method not being able to process an array of hashes ([#14433](https://github.com/SeleniumHQ/selenium/commit/247bc2bbced6502625786dc9fb56c602bc9786dc)) +- [See all changes](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES) + +
+ +### Rust +- Fixed errors in Selenium Manager when the browser path is incorrect ([#14381](https://github.com/SeleniumHQ/selenium/commit/0d426741c9b609f0748e64cff6e63343215eebcf)) +- Reused driver mirror URLs to discover Firefox versions ([#14493](https://github.com/SeleniumHQ/selenium/commit/64590084bc4baa5a00c8b7709b80c75e77de818a)) +- [See all changes](https://github.com/SeleniumHQ/selenium/blob/trunk/rust/CHANGELOG.md) + +### Docker Selenium +- KEDA Scaler in Kubernetes: + - Enhanced KEDA scaler behavior, addressing: + - Node with different platformName scaling: Fixed incorrect scaling behavior when both Linux and Windows node stereotypes are present ([#1925](https://github.com/SeleniumHQ/docker-selenium/issues/1925)). + - Excessive autoscaling: Resolved over-scaling of browser nodes ([#2160](https://github.com/SeleniumHQ/docker-selenium/issues/2160)). + - Added separate parameters for basic authentication (`username`, `password`) for the Grid GraphQL endpoint ([#2401](https://github.com/SeleniumHQ/docker-selenium/pull/2401)). + - Added support for `nodeMaxSessions` parameter to control maximum concurrent sessions per node, aligning with the node config `--max-sessions` ([#2402](https://github.com/SeleniumHQ/docker-selenium/pull/2402)). + + > Note: The above KEDA scaler updates are available experimentally via our built images approach. Check out [this](https://github.com/SeleniumHQ/docker-selenium/blob/4.25.0-20240922/.keda/README.md) for more details. + +- Selenium Grid Helm Chart: Updated to support the new KEDA scaler enhancements. +- [See all changes](https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.25.0-20240922) + +## Contributors + +**Special shout-out to everyone who helped the Selenium Team get this release out!** + +### [Selenium](https://github.com/SeleniumHQ/selenium) + +
+
+
+{{< gh-user "https://api.github.com/users/Delta456" >}} +{{< gh-user "https://api.github.com/users/aguspe" >}} +{{< gh-user "https://api.github.com/users/angiejones" >}} +{{< gh-user "https://api.github.com/users/cgossett" >}} +{{< gh-user "https://api.github.com/users/dnwe" >}} +{{< gh-user "https://api.github.com/users/manuelsblanco" >}} +{{< gh-user "https://api.github.com/users/mk868" >}} +{{< gh-user "https://api.github.com/users/navin772" >}} +{{< gh-user "https://api.github.com/users/sandeepsuryaprasad" >}} +{{< gh-user "https://api.github.com/users/shbenzer" >}} +
+
+
+ + +### [Selenium Docs & Website](https://github.com/SeleniumHQ/seleniumhq.github.io) + +
+
+
+{{< gh-user "https://api.github.com/users/KaranocaVe" >}} +{{< gh-user "https://api.github.com/users/aguspe" >}} +{{< gh-user "https://api.github.com/users/pallavigitwork" >}} +{{< gh-user "https://api.github.com/users/shbenzer" >}} +
+
+
+ +### [Docker Selenium](https://github.com/SeleniumHQ/docker-selenium) + +
+
+
+{{< gh-user "https://api.github.com/users/Koeppchen" >}} +
+
+
+ +### [Selenium Team Members][team] + +**Thanks as well to all the team members who contributed to this release:** + +
+
+
+{{< gh-user "https://api.github.com/users/AutomatedTester" >}} +{{< gh-user "https://api.github.com/users/bonigarcia" >}} +{{< gh-user "https://api.github.com/users/diemol" >}} +{{< gh-user "https://api.github.com/users/harsha509" >}} +{{< gh-user "https://api.github.com/users/joerg1985" >}} +{{< gh-user "https://api.github.com/users/nvborisenko" >}} +{{< gh-user "https://api.github.com/users/p0deje" >}} +{{< gh-user "https://api.github.com/users/pujagani" >}} +{{< gh-user "https://api.github.com/users/shs96c" >}} +{{< gh-user "https://api.github.com/users/titusfortner" >}} +{{< gh-user "https://api.github.com/users/VietND96" >}} +
+
+
+ +Stay tuned for updates by following SeleniumHQ on [X (Formerly Twitter)](https://twitter.com/seleniumhq) or [LinkedIn](https://www.linkedin.com/company/selenium/)! + +Happy automating! + +[downloads]: /downloads +[bindings]: /downloads#bindings +[team]: /project/structure +[BiDi]: https://github.com/w3c/webdriver-bidi diff --git a/website_and_docs/content/documentation/_index.ja.md b/website_and_docs/content/documentation/_index.ja.md index a1720d968327..794dacbe3419 100755 --- a/website_and_docs/content/documentation/_index.ja.md +++ b/website_and_docs/content/documentation/_index.ja.md @@ -10,11 +10,11 @@ Seleniumはブラウザー自動化を可能にし、それを支えるツール ユーザーとブラウザーのやり取りのエミュレーション、ブラウザーの割当を増強したり縮減する分散型サーバー、そしてすべてのメジャーなブラウザー用に置換可能なコードの実装を可能にする[W3C WebDriver 仕様](//www.w3.org/TR/webdriver/)インフラの提供します。 -このプロジェクトは多くの有志貢献者の何千時間に及ぶ個々の時間を費やした事とソースコード[自由に利用可能]({{< ref "/copyright.md#license" >}})を誰にでも利用、楽しめ、そして改良できることによって実現しました。 +このプロジェクトは多くの有志貢献者の何千時間に及ぶ個々の時間を費やした事とソースコード[自由に利用可能]({{< ref "copyright.md#license" >}})を誰にでも利用、楽しめ、そして改良できることによって実現しました。 Seleniumはウェブプラットフォームの自動化のより開かれた議論をするためブラウザーベンダー、エンジニア、愛好家をまとめます。このプロジェクトはコミュニティーを導きと育成のために[年次カンファレンス](//seleniumconf.com/)開催します。 -Seleniumの中核は[WebDriver]({{< ref "/webdriver.md" >}})であり、様々なブラウザーを変えてインストラクション集を実行できるインターフェースです。これは作りえる一番基本的な +Seleniumの中核は[WebDriver]({{< ref "webdriver.md" >}})であり、様々なブラウザーを変えてインストラクション集を実行できるインターフェースです。これは作りえる一番基本的な インストラクションの一つです: diff --git a/website_and_docs/content/documentation/_index.pt-br.md b/website_and_docs/content/documentation/_index.pt-br.md index 547702f66062..9fdaeeb151d1 100755 --- a/website_and_docs/content/documentation/_index.pt-br.md +++ b/website_and_docs/content/documentation/_index.pt-br.md @@ -24,7 +24,7 @@ para promover uma discussão aberta sobre a automação da plataforma da web. O projeto organiza [uma conferência anual](//seleniumconf.com/) para ensinar e nutrir a comunidade. -No núcleo do Selenium está [WebDriver]({{< ref "/webdriver.md" >}}), +No núcleo do Selenium está [WebDriver]({{< ref "webdriver.md" >}}), uma interface para escrever conjuntos de instruções que podem ser executados alternadamente em muitos navegadores. Aqui está uma das instruções mais simples que você pode fazer: diff --git a/website_and_docs/content/documentation/_index.zh-cn.md b/website_and_docs/content/documentation/_index.zh-cn.md index 70fb9ac185f7..a68a2a5cbb70 100755 --- a/website_and_docs/content/documentation/_index.zh-cn.md +++ b/website_and_docs/content/documentation/_index.zh-cn.md @@ -13,12 +13,12 @@ Selenium 是支持 web 浏览器自动化的一系列工具和库的综合项目 该 规范 允许您为所有主要 Web 浏览器编写可互换的代码。 这个项目是由志愿者贡献者实现的,他们投入了自己数千小时的时间, -并使源代码[免费提供]({{< ref "/copyright.md#许可" >}})给任何人使用、享受和改进。 +并使源代码[免费提供]({{< ref "copyright.md#许可" >}})给任何人使用、享受和改进。 Selenium 汇集了浏览器供应商,工程师和爱好者,以进一步围绕 Web 平台自动化进行公开讨论。 该项目组织了[一次年度会议](//seleniumconf.com/),以教学和培养社区。 -Selenium 的核心是 [WebDriver]({{< ref "/webdriver.md" >}}),这是一个编写指令集的接口,可以在许多浏览器中互换运行。 +Selenium 的核心是 [WebDriver]({{< ref "webdriver.md" >}}),这是一个编写指令集的接口,可以在许多浏览器中互换运行。 这里有一个最简单的说明: diff --git a/website_and_docs/content/documentation/grid/components.en.md b/website_and_docs/content/documentation/grid/components.en.md index a85fd66ee473..df29d7f0e628 100644 --- a/website_and_docs/content/documentation/grid/components.en.md +++ b/website_and_docs/content/documentation/grid/components.en.md @@ -87,7 +87,7 @@ part of the registration message. By default, the **Node** auto-registers all browser drivers available on the path of the machine where it runs. It also creates one slot per available CPU for Chromium based browsers and Firefox. For Safari, only one slot is -created. Through a specific [configuration]({{< ref "/configuration" >}}), it can run sessions in Docker +created. Through a specific [configuration]({{< ref "configuration" >}}), it can run sessions in Docker containers or relay commands. A **Node** only executes the received commands, it does not evaluate, make judgments, or control anything other diff --git a/website_and_docs/content/documentation/grid/components.ja.md b/website_and_docs/content/documentation/grid/components.ja.md index 91a185ac5b48..46cd256d235f 100644 --- a/website_and_docs/content/documentation/grid/components.ja.md +++ b/website_and_docs/content/documentation/grid/components.ja.md @@ -84,7 +84,7 @@ Grid は複数の**ノード**を持つことができます。 デフォルトでは、**ノード**はマシンのパス上に存在する全てのブラウザドライバーを自動で登録します。 また FireFox と Chromium ベースブラウザの場合、CPU1 つにつき 1 スロットを作成します。 Safari の場合は 1 つのスロットのみ作成します。 -[特定の設定によって]({{< ref "/configuration" >}})セッションを Docker コンテナで実行したり、コマンドを中継したりすることも可能です。 +[特定の設定によって]({{< ref "configuration" >}})セッションを Docker コンテナで実行したり、コマンドを中継したりすることも可能です。 **ノード**は受信したコマンドを実行するだけで、コマンドの評価・判断や、フロー制御以外の制御は行いません。 **ノード**が実行されているマシンは、他のコンポーネントと同じ OS を持つ必要はありません。 diff --git a/website_and_docs/content/documentation/grid/components.pt-br.md b/website_and_docs/content/documentation/grid/components.pt-br.md index e9800a183fff..9db5f2676706 100644 --- a/website_and_docs/content/documentation/grid/components.pt-br.md +++ b/website_and_docs/content/documentation/grid/components.pt-br.md @@ -85,7 +85,7 @@ como parte da mensagem de registo. Por omissão, o **Node** regista automaticamente todos os navegadores que estejam disponíveis no PATH da máquina onde executa. Cria também um slot de execução por cada CPU para os navegadores Chrome e Firefox. Para Safari, -apenas é criado um slot. Usando uma [configuração]({{< ref "/configuration" >}}) específica, é também +apenas é criado um slot. Usando uma [configuração]({{< ref "configuration" >}}) específica, é também possível executar sessões em containers Docker. O **Node** apenas executa os comandos que recebe, não avalia, faz julgamentos ou controla mais nada que não seja diff --git a/website_and_docs/content/documentation/grid/components.zh-cn.md b/website_and_docs/content/documentation/grid/components.zh-cn.md index 05a352487880..554b85f12adb 100644 --- a/website_and_docs/content/documentation/grid/components.zh-cn.md +++ b/website_and_docs/content/documentation/grid/components.zh-cn.md @@ -67,7 +67,7 @@ Selenium Grid 4 是对以前版本的彻底重写。除了对性能和标准合 **Node**通过**事件总线**向**分发器**注册自己,并将其配置作为注册消息发送。 -默认情况下,**Node**会自动注册其所在机器上路径中可用的所有浏览器驱动程序。它还为基于Chromium的浏览器和Firefox创建每个可用CPU一个插槽。对于Safari,只创建一个插槽。通过特定的[配置]({{< ref "/configuration" >}}),它可以在Docker容器中运行会话或转发命令。 +默认情况下,**Node**会自动注册其所在机器上路径中可用的所有浏览器驱动程序。它还为基于Chromium的浏览器和Firefox创建每个可用CPU一个插槽。对于Safari,只创建一个插槽。通过特定的[配置]({{< ref "configuration" >}}),它可以在Docker容器中运行会话或转发命令。 **Node**仅执行接收到的命令,不评估、不做出判断或控制任何除命令和响应流之外的东西。**Node**所在的机器不需要与其他组件具有相同的操作系统。例如,Windows节点可能具有在Edge上提供IE模式作为浏览器选项的能力,而在Linux或Mac上则不可能,网格可以配置多个具有Windows、Mac或Linux的**Node**。 diff --git a/website_and_docs/content/documentation/grid/getting_started.en.md b/website_and_docs/content/documentation/grid/getting_started.en.md index c5d956a88883..be495d64710f 100644 --- a/website_and_docs/content/documentation/grid/getting_started.en.md +++ b/website_and_docs/content/documentation/grid/getting_started.en.md @@ -216,7 +216,7 @@ endpoint or using [GraphQL]({{< ref "advanced_features/graphql_support.md" >}}) {{% pageinfo color="primary" %}} For simplicity, all command examples shown in this page assume that components are running locally. More detailed examples and usages can be found in the -[Configuring Components]({{< ref "/configuration" >}}) section. +[Configuring Components]({{< ref "configuration" >}}) section. {{% /pageinfo %}} ## Using the Java 11 HTTP Client {{% badge-version version="4.5" %}} @@ -311,6 +311,6 @@ overview of how a publicly exposed Grid could be misused: ## Further reading * [Components]({{< ref "components.md" >}}): learn how Grid's internal components relate to each other. -* [Configuration]({{< ref "/configuration" >}}): customize your Grid setup. +* [Configuration]({{< ref "configuration" >}}): customize your Grid setup. * [Architecture]({{< ref "architecture.md" >}}): understand key concepts in Grid. -* [Advanced Features]({{< ref "/advanced_features" >}}): explore more possibilities through Grid's features. +* [Advanced Features]({{< ref "advanced_features" >}}): explore more possibilities through Grid's features. diff --git a/website_and_docs/content/documentation/grid/getting_started.ja.md b/website_and_docs/content/documentation/grid/getting_started.ja.md index 869519d2b1a7..440772d1ba11 100644 --- a/website_and_docs/content/documentation/grid/getting_started.ja.md +++ b/website_and_docs/content/documentation/grid/getting_started.ja.md @@ -310,6 +310,6 @@ Grid を保護しないと、以下のような問題が発生する可能性が ## 参考文献 - [Components]({{< ref "components.md" >}}): 内部のコンポーネントの仕組みを知る -- [Configuration]({{< ref "/configuration" >}}): Grid の設定をカスタマイズする +- [Configuration]({{< ref "configuration" >}}): Grid の設定をカスタマイズする - [Architecture]({{< ref "architecture.md" >}}): Grid のコンセプトを理解する -- [Advanced Features]({{< ref "/advanced_features" >}}): Grid のさらなる可能性を探る +- [Advanced Features]({{< ref "advanced_features" >}}): Grid のさらなる可能性を探る diff --git a/website_and_docs/content/documentation/grid/getting_started.pt-br.md b/website_and_docs/content/documentation/grid/getting_started.pt-br.md index ab919c0ded6d..8c5446ac18e2 100644 --- a/website_and_docs/content/documentation/grid/getting_started.pt-br.md +++ b/website_and_docs/content/documentation/grid/getting_started.pt-br.md @@ -211,7 +211,7 @@ através de [GraphQL]({{< ref "advanced_features/graphql_support.md" >}}). {{% pageinfo color="primary" %}} Para simplificar, todos os exemplos apresentados assumem que os componentes estão a ser executados localmente. -Exemplos mais detalhados podem ser encontrados na secção [Configurando Componentes]({{< ref "/configuration" >}}). +Exemplos mais detalhados podem ser encontrados na secção [Configurando Componentes]({{< ref "configuration" >}}). {{% /pageinfo %}} ## Usando o cliente HTTP nativo Java 11 {{% badge-version version="4.5" %}} @@ -307,6 +307,6 @@ de como uma Grid exposta publicamente pode ser abusada: ## Leituras adicionais * [Componentes]({{< ref "components.md" >}}): compreender como usar os componentes da Grid -* [Configuração]({{< ref "/configuration" >}}): personalize a sua configuração Grid. +* [Configuração]({{< ref "configuration" >}}): personalize a sua configuração Grid. * [Arquitectura]({{< ref "architecture.md" >}}): entenda conceitos chave da Grid. -* [Advanced Features]({{< ref "/advanced_features" >}}): explore mais possibilidades da Grid. +* [Advanced Features]({{< ref "advanced_features" >}}): explore mais possibilidades da Grid. diff --git a/website_and_docs/content/documentation/grid/getting_started.zh-cn.md b/website_and_docs/content/documentation/grid/getting_started.zh-cn.md index b799eb48847f..13fc398883cb 100644 --- a/website_and_docs/content/documentation/grid/getting_started.zh-cn.md +++ b/website_and_docs/content/documentation/grid/getting_started.zh-cn.md @@ -209,7 +209,7 @@ driver.quit(); `API` 调用可以通过 [http://localhost:4444/status](http://localhost:4444/status) 端点或使用 [GraphQL]({{< ref "advanced_features/graphql_support.md" >}}) {{% pageinfo color="primary" %}} -为简单起见,本页中显示的所有命令示例均假定组件正在运行在本地。更详细的示例和用法可以在[配置组件]({{< ref "/configuration" >}}) 部分。 +为简单起见,本页中显示的所有命令示例均假定组件正在运行在本地。更详细的示例和用法可以在[配置组件]({{< ref "configuration" >}}) 部分。 {{% /pageinfo %}} ## 使用 Java 11 中的 HTTP Client {{% badge-version version="4.5" %}} @@ -277,6 +277,6 @@ java -Dwebdriver.http.factory=jdk-http-client -jar selenium-server-.jar ## 延伸阅读 * [Components]({{< ref "components.md" >}}):了解 `Grid` 的内部组件如何相互关联。 -* [Configuration]({{< ref "/configuration" >}}): 自定义您的 `Grid` 设置。 +* [Configuration]({{< ref "configuration" >}}): 自定义您的 `Grid` 设置。 * [Architecture]({{< ref "architecture.md" >}}): 理解 `Grid` 中的关键概念。 -* [Advanced Features]({{< ref "/advanced_features" >}}): 通过Grid的特性探索更多的可能性。 +* [Advanced Features]({{< ref "advanced_features" >}}): 通过Grid的特性探索更多的可能性。 diff --git a/website_and_docs/content/documentation/overview/_index.ja.md b/website_and_docs/content/documentation/overview/_index.ja.md index a1db08a3ccb0..13f5eba59aa6 100644 --- a/website_and_docs/content/documentation/overview/_index.ja.md +++ b/website_and_docs/content/documentation/overview/_index.ja.md @@ -12,7 +12,7 @@ Seleniumは一つのツールやAPIではありません。たくさんのツー ## WebDriver デスクトップのウェブサイトのテスト自動化をはじめるのなら、WebDriver APIを使いましょう。 -[WebDriver]({{< ref "/webdriver.md" >}}) はブラウザ自動化のAPIを使用します。このAPIは、ブラウザをコントロールしてテストを実行するためにブラウザベンダーによって提供されています。これは現実のユーザーがブラウザを操作するかのように動きます。 +[WebDriver]({{< ref "webdriver.md" >}}) はブラウザ自動化のAPIを使用します。このAPIは、ブラウザをコントロールしてテストを実行するためにブラウザベンダーによって提供されています。これは現実のユーザーがブラウザを操作するかのように動きます。 WebDriverのAPIはアプリケーションのコードと一緒にコンパイルする必要がありませんから、全く邪魔になりません。 これによって、あなたは本番環境と同じアプリケーションをテストすることができます。 @@ -31,4 +31,4 @@ Selenium Grid を使用すると、さまざまなプラットフォームのさ リモート端末によって自動的に実行されます。 WebDriverテストの開発後、複数のブラウザーとオペレーティングシステムの組み合わせでテストを実行する必要が出てくる場合があります。 -ここで [Grid]({{< ref "/grid.md" >}}) が登場します。 +ここで [Grid]({{< ref "grid.md" >}}) が登場します。 diff --git a/website_and_docs/content/documentation/overview/_index.pt-br.md b/website_and_docs/content/documentation/overview/_index.pt-br.md index e7f8797e6e0a..5c50abaa71fa 100644 --- a/website_and_docs/content/documentation/overview/_index.pt-br.md +++ b/website_and_docs/content/documentation/overview/_index.pt-br.md @@ -13,7 +13,7 @@ mas sim uma composição de várias ferramentas. ## WebDriver Se você está começando com automação de testes de um site de desktop ou site para celular, então -vai usar as APIs WebDriver. O [WebDriver]({{< ref "/webdriver.md" >}}) +vai usar as APIs WebDriver. O [WebDriver]({{< ref "webdriver.md" >}}) usa APIs de automação de navegador disponibilizadas por fornecedores de navegador para o controlar e executar testes. É como se um usuário real o estivesse operando. Como o WebDriver não exige que sua API seja compilada com o código do aplicativo, @@ -42,4 +42,4 @@ executados pela extremidade remota. Após o desenvolvimento dos testes WebDriver, você pode enfrentar a necessidade de executar seus testes em vários navegadores e combinações de sistemas operacionais. -É aqui que o [Grid]({{< ref "/grid.md" >}}) entra em cena. +É aqui que o [Grid]({{< ref "grid.md" >}}) entra em cena. diff --git a/website_and_docs/content/documentation/overview/_index.zh-cn.md b/website_and_docs/content/documentation/overview/_index.zh-cn.md index 303c75064d00..ab27288d82b4 100644 --- a/website_and_docs/content/documentation/overview/_index.zh-cn.md +++ b/website_and_docs/content/documentation/overview/_index.zh-cn.md @@ -13,7 +13,7 @@ Selenium 不仅仅是一个工具或 API, 它还包含许多工具. ## WebDriver 如果您开始使用桌面网站测试自动化, 那么您将使用 WebDriver APIs. -[WebDriver]({{< ref "/webdriver.md" >}}) 使用浏览器供应商提供的浏览器自动化 API 来控制浏览器和运行测试. +[WebDriver]({{< ref "webdriver.md" >}}) 使用浏览器供应商提供的浏览器自动化 API 来控制浏览器和运行测试. 这就像真正的用户正在操作浏览器一样. 由于 WebDriver 不要求使用应用程序代码编译其 API, 因此它本质上不具有侵入性. 因此, 您测试的应用程序与实时推送的应用程序相同. @@ -35,4 +35,4 @@ Selenium Grid允许您在不同平台的不同机器上运行测试用例. 当开发完WebDriver测试之后, 您可能需要在多个浏览器和操作系统的组合上运行测试. -这就是 [Grid]({{< ref "/grid.md" >}}) 的用途所在. +这就是 [Grid]({{< ref "grid.md" >}}) 的用途所在. diff --git a/website_and_docs/content/documentation/overview/details.ja.md b/website_and_docs/content/documentation/overview/details.ja.md index 10edf16e19ee..34332c6dacf8 100644 --- a/website_and_docs/content/documentation/overview/details.ja.md +++ b/website_and_docs/content/documentation/overview/details.ja.md @@ -41,7 +41,7 @@ Selenium はこれらの違いを "抽象化" し、コードを書いている Seleniumの必要最小限な設計アプローチは、より大きなアプリケーションのコンポーネントとして含まれる汎用性を提供します。 Seleniumの包括的なプロジェクトの下で提供される周辺インフラストラクチャは、 -[ブラウザーのgrid]({{< ref "/grid.md" >}})をまとめるためのツールを提供し、 +[ブラウザーのgrid]({{< ref "grid.md" >}})をまとめるためのツールを提供し、 さまざまなブラウザーやさまざまなマシンの複数のオペレーティングシステムでテストを実行できるようにします。 サーバールームやデータセンター内の一連のコンピューターがすべて同時にブラウザーを起動して、 diff --git a/website_and_docs/content/documentation/overview/details.pt-br.md b/website_and_docs/content/documentation/overview/details.pt-br.md index cd0f2639b0e9..edd1d1b0d23c 100644 --- a/website_and_docs/content/documentation/overview/details.pt-br.md +++ b/website_and_docs/content/documentation/overview/details.pt-br.md @@ -56,7 +56,7 @@ A abordagem de design minimalista do Selenium lhe dá a versatilidade para ser incluído como um componente em aplicações maiores. A infraestrutura circundante fornecida sob o Selenium dá a você as ferramentas para montar -sua [Grid de navegadores]({{< ref "/grid.md" >}}) +sua [Grid de navegadores]({{< ref "grid.md" >}}) para que os testes possam ser executados em diferentes navegadores e sistemas operacionais em uma variedade de máquinas. diff --git a/website_and_docs/content/documentation/overview/details.zh-cn.md b/website_and_docs/content/documentation/overview/details.zh-cn.md index bed93ef45425..e31bba574532 100644 --- a/website_and_docs/content/documentation/overview/details.zh-cn.md +++ b/website_and_docs/content/documentation/overview/details.zh-cn.md @@ -39,7 +39,7 @@ Selenium “抽象”了这些差异,向编写代码的人隐藏了它们的 Selenium 的极简设计方法使其具有通用性,可以作为更大应用程序中的组件。 Selenium 保护伞下提供的周边基础设施为您提供了组合自己的 -[浏览器 grid]({{< ref "/grid.md" >}}) 的工具, +[浏览器 grid]({{< ref "grid.md" >}}) 的工具, 因此测试就可以跨一系列机器在不同的浏览器和多个操作系统上运行。 想象一下, diff --git a/website_and_docs/content/documentation/selenium_manager.en.md b/website_and_docs/content/documentation/selenium_manager.en.md index c95ba868cf0b..86dea97d1806 100644 --- a/website_and_docs/content/documentation/selenium_manager.en.md +++ b/website_and_docs/content/documentation/selenium_manager.en.md @@ -326,5 +326,24 @@ In this case, the library to be installed is the following: sudo apt-get install libatk-bridge2.0-0 ``` +### Using an environment variable for the driver path +It's possible to use an environment variable to specify the driver path without using Selenium Manager. +The following environment variables are supported: + +* SE_CHROMEDRIVER +* SE_EDGEDRIVER +* SE_GECKODRIVER +* SE_IEDRIVER +* SE_SAFARIDRIVER + +For example, to specify the path to the chromedriver, +you can set the `SE_CHROMEDRIVER` environment variable to the path of the chromedriver executable. +The following bindings allow you to specify the driver path using an environment variable: + +* Ruby +* Java + +This feature is available in the Selenium Ruby binding starting from version 4.25.0. + ## Roadmap You can trace the work in progress in the [Selenium Manager project dashboard](https://github.com/orgs/SeleniumHQ/projects/5). Moreover, you can check the new features shipped with each Selenium Manager release in its [changelog file](https://github.com/SeleniumHQ/selenium/blob/trunk/rust/CHANGELOG.md). diff --git a/website_and_docs/content/documentation/selenium_manager.ja.md b/website_and_docs/content/documentation/selenium_manager.ja.md index c95ba868cf0b..463b984231e1 100644 --- a/website_and_docs/content/documentation/selenium_manager.ja.md +++ b/website_and_docs/content/documentation/selenium_manager.ja.md @@ -326,5 +326,24 @@ In this case, the library to be installed is the following: sudo apt-get install libatk-bridge2.0-0 ``` +### Using an environment variable for the driver path +It's possible to use an environment variable to specify the driver path without using Selenium Manager. +The following environment variables are supported: + +* SE_CHROMEDRIVER +* SE_EDGEDRIVER +* SE_GECKODRIVER +* SE_IEDRIVER +* SE_SAFARIDRIVER + +For example, to specify the path to the chromedriver, +you can set the `SE_CHROMEDRIVER` environment variable to the path of the chromedriver executable. +The following bindings allow you to specify the driver path using an environment variable: + +* Ruby +* Java + +This feature is available in the Selenium Ruby binding starting from version 4.25.0. + ## Roadmap You can trace the work in progress in the [Selenium Manager project dashboard](https://github.com/orgs/SeleniumHQ/projects/5). Moreover, you can check the new features shipped with each Selenium Manager release in its [changelog file](https://github.com/SeleniumHQ/selenium/blob/trunk/rust/CHANGELOG.md). diff --git a/website_and_docs/content/documentation/selenium_manager.pt-br.md b/website_and_docs/content/documentation/selenium_manager.pt-br.md index c95ba868cf0b..463b984231e1 100644 --- a/website_and_docs/content/documentation/selenium_manager.pt-br.md +++ b/website_and_docs/content/documentation/selenium_manager.pt-br.md @@ -326,5 +326,24 @@ In this case, the library to be installed is the following: sudo apt-get install libatk-bridge2.0-0 ``` +### Using an environment variable for the driver path +It's possible to use an environment variable to specify the driver path without using Selenium Manager. +The following environment variables are supported: + +* SE_CHROMEDRIVER +* SE_EDGEDRIVER +* SE_GECKODRIVER +* SE_IEDRIVER +* SE_SAFARIDRIVER + +For example, to specify the path to the chromedriver, +you can set the `SE_CHROMEDRIVER` environment variable to the path of the chromedriver executable. +The following bindings allow you to specify the driver path using an environment variable: + +* Ruby +* Java + +This feature is available in the Selenium Ruby binding starting from version 4.25.0. + ## Roadmap You can trace the work in progress in the [Selenium Manager project dashboard](https://github.com/orgs/SeleniumHQ/projects/5). Moreover, you can check the new features shipped with each Selenium Manager release in its [changelog file](https://github.com/SeleniumHQ/selenium/blob/trunk/rust/CHANGELOG.md). diff --git a/website_and_docs/content/documentation/selenium_manager.zh-cn.md b/website_and_docs/content/documentation/selenium_manager.zh-cn.md index c95ba868cf0b..463b984231e1 100644 --- a/website_and_docs/content/documentation/selenium_manager.zh-cn.md +++ b/website_and_docs/content/documentation/selenium_manager.zh-cn.md @@ -326,5 +326,24 @@ In this case, the library to be installed is the following: sudo apt-get install libatk-bridge2.0-0 ``` +### Using an environment variable for the driver path +It's possible to use an environment variable to specify the driver path without using Selenium Manager. +The following environment variables are supported: + +* SE_CHROMEDRIVER +* SE_EDGEDRIVER +* SE_GECKODRIVER +* SE_IEDRIVER +* SE_SAFARIDRIVER + +For example, to specify the path to the chromedriver, +you can set the `SE_CHROMEDRIVER` environment variable to the path of the chromedriver executable. +The following bindings allow you to specify the driver path using an environment variable: + +* Ruby +* Java + +This feature is available in the Selenium Ruby binding starting from version 4.25.0. + ## Roadmap You can trace the work in progress in the [Selenium Manager project dashboard](https://github.com/orgs/SeleniumHQ/projects/5). Moreover, you can check the new features shipped with each Selenium Manager release in its [changelog file](https://github.com/SeleniumHQ/selenium/blob/trunk/rust/CHANGELOG.md). diff --git a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.en.md b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.en.md index be02b1de5833..c72f7f128477 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.en.md @@ -21,3 +21,8 @@ test e.g. invalid order records. * Create a new WebDriver instance per test. This helps ensure test isolation and makes parallelization simpler. + + * If you choose [pytest](https://pytest.org/) as your test runner, this can be + easily done by yielding your driver in a global fixture. This way each test gets its own + driver instance, and you can ensure that drivers always quit after a test is finished + (pass or fail). diff --git a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.ja.md index 46b2d439fca8..7ed49b54fc10 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.ja.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.ja.md @@ -19,3 +19,8 @@ aliases: [ * テストごとに新しいWebDriverインスタンスを作成します。 これにより、テストの分離が保証され、並列化がより簡単になります。 + + * If you choose [pytest](https://pytest.org/) as your test runner, this can be + easily done by yielding your driver in a global fixture. This way each test gets its own + driver instance, and you can ensure that drivers always quit after a test is finished + (pass or fail). diff --git a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.pt-br.md index ec5e65483136..b40d8e89d3ad 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.pt-br.md @@ -21,3 +21,8 @@ teste, por exemplo registros de pedidos inválidos. * Crie uma nova instância do WebDriver por teste. Isso ajuda a garantir o isolamento do teste e torna a paralelização mais simples. + + * If you choose [pytest](https://pytest.org/) as your test runner, this can be + easily done by yielding your driver in a global fixture. This way each test gets its own + driver instance, and you can ensure that drivers always quit after a test is finished + (pass or fail). diff --git a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.zh-cn.md index da8115aa8f7d..b68921f15ec4 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.zh-cn.md @@ -19,3 +19,8 @@ aliases: [ * 每次测试都创建一个新的WebDriver实例. 这在确保测试隔离的同时可以保障并行化更为简单. + + * If you choose [pytest](https://pytest.org/) as your test runner, this can be + easily done by yielding your driver in a global fixture. This way each test gets its own + driver instance, and you can ensure that drivers always quit after a test is finished + (pass or fail). diff --git a/website_and_docs/content/documentation/test_practices/overview.en.md b/website_and_docs/content/documentation/test_practices/overview.en.md index de5475a50320..c0ca18457f91 100644 --- a/website_and_docs/content/documentation/test_practices/overview.en.md +++ b/website_and_docs/content/documentation/test_practices/overview.en.md @@ -33,7 +33,7 @@ Browser automation has the reputation of being “flaky”, but in reality, that is because users frequently demand too much of it. In later chapters, we will return to techniques you can use to mitigate apparent intermittent problems in tests, -in particular on how to [overcome race conditions]({{< ref "/waits.md" >}}) +in particular on how to [overcome race conditions]({{< ref "waits.md" >}}) between the browser and WebDriver. By keeping your tests short @@ -218,7 +218,7 @@ to provide methods such as `createAdminUser()`, and `createUserWithPayment()`. The point is, these two lines of code do not distract you from the ultimate purpose of this test: configuring a unicorn. -The intricacies of the [Page Object model]({{< ref "/page_object_models.md" >}}) +The intricacies of the [Page Object model]({{< ref "page_object_models.md" >}}) will be discussed in later chapters, but we will introduce the concept here: Your tests should be composed of actions, diff --git a/website_and_docs/content/documentation/test_practices/overview.ja.md b/website_and_docs/content/documentation/test_practices/overview.ja.md index 6714feb51044..7b1c12df4b34 100644 --- a/website_and_docs/content/documentation/test_practices/overview.ja.md +++ b/website_and_docs/content/documentation/test_practices/overview.ja.md @@ -25,7 +25,7 @@ Webブラウザーのテストビジネスに参加していることを確認 これらの手順はできるだけ短くしてください。 ほとんどの場合、1つまたは2つの操作で十分です。 ブラウザの自動化は"不安定"であるという評判がありますが、実際には、ユーザーが頻繁に多くを求めることが多いためです。 -後の章では、特にブラウザーとWebDriver間の[競合状態を克服する]({{< ref "/waits.md" >}})方法に関する、テストでの断続的な問題を軽減するために使用できる手法に戻ります。 +後の章では、特にブラウザーとWebDriver間の[競合状態を克服する]({{< ref "waits.md" >}})方法に関する、テストでの断続的な問題を軽減するために使用できる手法に戻ります。 テストを短くして、代替手段がまったくない場合にのみWebブラウザーを使用することで、不安定さを最小限にして多くのテストを実行できます。 @@ -178,7 +178,7 @@ val accountPage = loginAs(user.getEmail(), user.getPassword()) ご想像のとおり、 `UserFactory` を拡張して `createAdminUser()` や `createUserWithPayment()` などのメソッドを提供できます。 重要なのは、これらの2行のコードは、このテストの最終目的であるユニコーンの構成からあなたをそらすものではないということです。 -[ページオブジェクトモデル]({{< ref "/page_object_models.md" >}})の込み入った事柄については、後の章で説明しますが、ここで概念を紹介します。 +[ページオブジェクトモデル]({{< ref "page_object_models.md" >}})の込み入った事柄については、後の章で説明しますが、ここで概念を紹介します。 テストは、サイトのページのコンテキスト内で、ユーザーの観点から実行されるアクションで構成される必要があります。 これらのページはオブジェクトとして保存され、Webページがどのように構成され、アクションがどのように実行されるかに関する特定の情報が含まれます。 diff --git a/website_and_docs/content/documentation/test_practices/overview.pt-br.md b/website_and_docs/content/documentation/test_practices/overview.pt-br.md index 5ff1223a847e..83804203a666 100644 --- a/website_and_docs/content/documentation/test_practices/overview.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/overview.pt-br.md @@ -33,7 +33,7 @@ A automação do navegador tem a reputação de ser "instável", mas, na realidade, é porque os usuários freqüentemente exigem muito dele. Em capítulos posteriores, retornaremos às técnicas que você pode usar para mitigar problemas aparentemente intermitentes nos testes, -em particular sobre como [superar as condições de corrida]({{< ref "/waits.md" >}}) +em particular sobre como [superar as condições de corrida]({{< ref "waits.md" >}}) entre o navegador e o WebDriver. Mantendo seus testes curtos @@ -218,7 +218,7 @@ para fornecer métodos como `createAdminUser ()` e `createUserWithPayment ()`. A questão é que essas duas linhas de código não o distraem do objetivo final deste teste: configurando um unicórnio. -Os detalhes do [modelo de objeto de página]({{< relref "/page_object_models.md" >}}) +Os detalhes do [modelo de objeto de página]({{< relref "page_object_models.md" >}}) será discutido em capítulos posteriores, mas vamos apresentar o conceito aqui: Seus testes devem ser compostos de ações, diff --git a/website_and_docs/content/documentation/test_practices/overview.zh-cn.md b/website_and_docs/content/documentation/test_practices/overview.zh-cn.md index 7ab9ebedffd8..2240d389bd93 100644 --- a/website_and_docs/content/documentation/test_practices/overview.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/overview.zh-cn.md @@ -32,7 +32,7 @@ aliases: [ 但实际上那是因为用户经常对它要求过高。 在后面的章节中,我们将回到您可以使用的技术, 为了缓解测试中明显的间歇性问题, -特别是如何克服 浏览器 和 WebDriver 之间的[竞争条件]({{< ref "/waits.md" >}})。 +特别是如何克服 浏览器 和 WebDriver 之间的[竞争条件]({{< ref "waits.md" >}})。 通过保持测试简短并仅在您完全没有替代方案时使用Web浏览器,您可以用最小的代码片段来完成很多测试。 @@ -189,7 +189,7 @@ val accountPage = loginAs(user.getEmail(), user.getPassword()) 关键是,这两行代码不会分散您对此测试的最终目的的注意力: 配置独角兽。 -[页面对象模型]({{< ref "/page_object_models.md" >}}) +[页面对象模型]({{< ref "page_object_models.md" >}}) 的复杂性将在后面的章节中讨论,但我们将在这里介绍这个概念: 您的测试应该由操作组成,从用户的角度出发,在站点的页面上下文中执行。 diff --git a/website_and_docs/content/documentation/webdriver/bidi/_index.en.md b/website_and_docs/content/documentation/webdriver/bidi/_index.en.md index a37413b7fc1a..81e61bd7f953 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/bidi/_index.en.md @@ -26,7 +26,33 @@ communication for enhanced browser automation and testing functionality, including streaming events from the user agent to the controlling software via WebSockets. Users will be able to listen for and record or manipulate events as they happen during the course of a Selenium session. -To use WebDriver BiDi, you must [enable it in Options](http://www.example.com) +### Enabling BiDi in Selenium + +In order to use WebDriver BiDi, setting the capability in the browser options will enable the required functionality: + +{{< tabpane langEqualsHeader=true >}} +{{< tab header="Java" >}} + options.setCapability("webSocketUrl", true); +{{< /tab >}} +{{% tab header="Python" text=true %}} +{{< badge-code >}} +{{% /tab %}} +{{< tab header="CSharp" >}} +UseWebSocketUrl = true, +{{< /tab >}} +{{< tab header="Ruby" >}} +options.web_socket_url = true +{{< /tab >}} +{{< tab header="JavaScript" >}} +Options().enableBidi(); +{{< /tab >}} +{{< tab header="Kotlin" >}} +options.setCapability("webSocketUrl", true); +{{< /tab >}} +{{< /tabpane >}} + +This enables the WebSocket connection for bidirectional communication, +unlocking the full potential of the WebDriver BiDi protocol. Note that Selenium is updating its entire implementation from WebDriver Classic to WebDriver BiDi (while maintaining backwards compatibility as much as possible), but this section of documentation focuses on the new diff --git a/website_and_docs/content/documentation/webdriver/bidi/cdp/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/bidi/cdp/_index.zh-cn.md index 45c20b63adb4..56482fa237e4 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/cdp/_index.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/bidi/cdp/_index.zh-cn.md @@ -1,10 +1,10 @@ --- -title: "Chrome DevTools Protocol" +title: "Chrome DevTools 协议" linkTitle: "CDP" weight: 10 description: > - Examples of working with Chrome DevTools Protocol in Selenium. - CDP support is temporary until WebDriver BiDi has been implemented. + 使用 Selenium 操作 Chrome DevTools 协议的示例。 + CDP 的支持是临时的,直到 WebDriver BiDi 实现为止。 aliases: [ "/documentation/en/support_packages/chrome_devtools/", "/documentation/support_packages/chrome_devtools/", @@ -15,30 +15,16 @@ aliases: [ ] --- -{{% pageinfo color="warning" %}} -

- - Page being translated from - English to Chinese. Do you speak Chinese? Help us to translate - it by sending us pull requests! -

-{{% /pageinfo %}} -Many browsers provide "DevTools" -- a set of tools that are integrated with the browser that -developers can use to debug web apps and explore the performance of their pages. Google Chrome's -DevTools make use of a protocol called the Chrome DevTools Protocol (or "CDP" for short). -As the name suggests, this is not designed for testing, nor to have a stable API, so functionality -is highly dependent on the version of the browser. -Selenium is working to implement a standards-based, cross-browser, stable alternative to CDP called -[WebDriver BiDi]. Until the support for this new protocol has finished, Selenium plans to provide access -to CDP features where applicable. +许多浏览器提供“开发者工具”(DevTools),这是与浏览器集成的一组工具,开发人员可以使用它们来调试网页应用程序并探索网页的性能。Google Chrome 的开发者工具使用一种称为 Chrome DevTools 协议(简称 "CDP")的协议。顾名思义,该协议并非为测试设计,也没有稳定的 API,因此功能很大程度上取决于浏览器的版本。 -### Using Chrome DevTools Protocol with Selenium +Selenium 正在致力于实现一种基于标准的、跨浏览器的、稳定的 CDP 替代方案,称为 [WebDriver BiDi]。在对该新协议的支持完成之前,Selenium 计划在适用的地方提供对 CDP 功能的访问。 -Chrome and Edge have a method to send basic CDP commands. -This does not work for features that require bidirectional communication, and you need to know what domains to enable when -and the exact names and types of domains/methods/parameters. +### 在 Selenium 中使用 Chrome DevTools 协议 + +Chrome 和 Edge 提供了发送基本 CDP 命令的方法。 +但对于需要双向通信的功能,这种方法无效。你需要知道在何时启用哪些域,以及域、方法和参数的确切名称和类型。 {{< tabpane text=true >}} {{% tab header="Java" %}} @@ -62,21 +48,14 @@ and the exact names and types of domains/methods/parameters. {{< /tabpane >}} -To make working with CDP easier, and to provide access to the more advanced features, Selenium bindings -automatically generate classes and methods for the most common domains. -CDP methods and implementations can change from version to version, though, so you want to keep the -version of Chrome and the version of DevTools matching. Selenium supports the 3 most -recent versions of Chrome at any given time, -and tries to time releases to ensure that access to the latest versions are available. +为简化 CDP 的使用并提供对更高级功能的访问,Selenium 绑定会自动为最常见的域生成类和方法。 +不过,CDP 方法和实现可能会因版本而异,因此你需要确保 Chrome 版本和 DevTools 版本相匹配。 +Selenium 在任何时间点支持 Chrome 的最近三个版本,并且尽量同步发布以确保可以访问最新版本。 + +这种限制给一些绑定带来了额外的挑战,动态生成的 CDP 支持要求用户定期更新代码,以引用正确版本的 CDP。 +在某些情况下,已创建了一个理想化的实现,它应该适用于任何版本的 CDP,而无需用户更改代码,但这并非总是可用。 -This limitation provides additional challenges for several bindings, where dynamically -generated CDP support requires users to regularly update their code to reference the proper version of CDP. -In some cases an idealized implementation has been created that should work for any version of CDP without the -user needing to change their code, but that is not always available. +关于如何在 Selenium 测试中使用 CDP 的示例可以在以下页面找到,但我们想提到一些常被引用但实际价值有限的例子: +* **地理位置** ——几乎所有网站都使用 IP 地址来确定物理位置,因此设置模拟地理位置很少能达到预期效果。 +* **覆盖设备指标** ——Chrome 提供了一个很棒的 API 来在 Options 类中设置[移动模拟](https://chromedriver.chromium.org/mobile-emulation),这通常比尝试使用 CDP 更优越。 -Examples of how to use CDP in your Selenium tests can be found on the following pages, but -we want to call out a couple commonly cited examples that are of limited practical value. -* **Geo Location** — almost all sites use the IP address to determine physical location, -so setting an emulated geolocation rarely has the desired effect. -* **Overriding Device Metrics** — Chrome provides a great API for setting [Mobile Emulation](https://chromedriver.chromium.org/mobile-emulation) -in the Options classes, which is generally superior to attempting to do this with CDP. diff --git a/website_and_docs/content/documentation/webdriver/bidi/logging.en.md b/website_and_docs/content/documentation/webdriver/bidi/logging.en.md index d663fec69e0a..312123ec9737 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/logging.en.md +++ b/website_and_docs/content/documentation/webdriver/bidi/logging.en.md @@ -11,7 +11,8 @@ aliases: [ ] --- -Remember that to use WebDriver BiDi, you must [enable it in Options](http://www.example.com) +Remember that to use WebDriver BiDi, you must enable it in Options. +For more details, see [Enabling BiDi]({{< ref "BiDi" >}}) ## Console Message Handlers diff --git a/website_and_docs/content/documentation/webdriver/bidi/network.en.md b/website_and_docs/content/documentation/webdriver/bidi/network.en.md index 248ad86b9c82..989ec39ca556 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/network.en.md +++ b/website_and_docs/content/documentation/webdriver/bidi/network.en.md @@ -12,7 +12,8 @@ aliases: [ The implementation of these features is being tracked here: [#13993](https://github.com/SeleniumHQ/selenium/issues/13993) -Remember that to use WebDriver BiDi, you must [enable it in Options](http://www.example.com) +Remember that to use WebDriver BiDi, you must enable it in Options. +For more details, see [Enabling BiDi]({{< ref "BiDi" >}}) ## Authentication Handlers diff --git a/website_and_docs/content/documentation/webdriver/bidi/script.en.md b/website_and_docs/content/documentation/webdriver/bidi/script.en.md index 2ce8c4c15032..32bac136952c 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/script.en.md +++ b/website_and_docs/content/documentation/webdriver/bidi/script.en.md @@ -12,7 +12,8 @@ aliases: [ The implementation of these features is being tracked here: [#13992](https://github.com/SeleniumHQ/selenium/issues/13992) -Remember that to use WebDriver BiDi, you must [enable it in Options](http://www.example.com) +Remember that to use WebDriver BiDi, you must enable it in Options. +For more details, see [Enabling BiDi]({{< ref "BiDi" >}}) ## Script Pinning diff --git a/website_and_docs/content/documentation/webdriver/elements/locators.en.md b/website_and_docs/content/documentation/webdriver/elements/locators.en.md index 20820fab2a07..d09e718e754c 100644 --- a/website_and_docs/content/documentation/webdriver/elements/locators.en.md +++ b/website_and_docs/content/documentation/webdriver/elements/locators.en.md @@ -328,6 +328,8 @@ The FindElement makes using locators a breeze! For most languages, all you need to do is utilize `webdriver.common.by.By`, however in others it's as simple as setting a parameter in the FindElement function +### By + {{< tabpane langEqualsHeader=true >}} {{< badge-examples >}} {{< tab header="Java" >}} @@ -356,6 +358,59 @@ others it's as simple as setting a parameter in the FindElement function {{< /tab >}} {{< /tabpane >}} +### ByChained + +The `ByChained` class enables you to _chain_ two By locators together. For example, instead of having to locate a parent element, +and then a child element of that parent, you can instead combine those two `FindElement()` functions into one. + +{{< tabpane langEqualsHeader=true >}} + {{< tab header="Java" text=true >}} + {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#L37-L38">}} + {{< /tab >}} + {{< tab header="Python" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="CSharp" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="Ruby" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="JavaScript" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="Kotlin" text=true >}} + {{< badge-code >}} + {{< /tab >}} +{{< /tabpane >}} + +### ByAll + +The `ByAll` class enables you to utilize two By locators at once, finding elements that mach _either_ of your By locators. +For example, instead of having to utilize two `FindElement()` functions to find the username and password input fields +seperately, you can instead find them together in one clean `FindElements()` + +{{< tabpane langEqualsHeader=true >}} + {{< tab header="Java" text=true >}} + {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#L22-L23">}} + {{< /tab >}} + {{< tab header="Python" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="CSharp" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="Ruby" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="JavaScript" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="Kotlin" text=true >}} + {{< badge-code >}} + {{< /tab >}} +{{< /tabpane >}} + ## Relative Locators **Selenium 4** introduces Relative Locators (previously diff --git a/website_and_docs/content/documentation/webdriver/elements/locators.ja.md b/website_and_docs/content/documentation/webdriver/elements/locators.ja.md index 11ae11e3c0da..6ea5c5dcd6fc 100644 --- a/website_and_docs/content/documentation/webdriver/elements/locators.ja.md +++ b/website_and_docs/content/documentation/webdriver/elements/locators.ja.md @@ -318,6 +318,8 @@ The FindElement makes using locators a breeze! For most languages, all you need to do is utilize `webdriver.common.by.By`, however in others it's as simple as setting a parameter in the FindElement function +### By + {{< tabpane langEqualsHeader=true >}} {{< badge-examples >}} {{< tab header="Java" >}} @@ -346,7 +348,59 @@ others it's as simple as setting a parameter in the FindElement function {{< /tab >}} {{< /tabpane >}} +### ByChained + +The `ByChained` class enables you to _chain_ two By locators together. For example, instead of having to +locate a parent element, and then a child element of that parent, you can instead combine those two `FindElement` +functions into one. + +{{< tabpane langEqualsHeader=true >}} + {{< tab header="Java" text=true >}} + {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#L37-L38" >}} + {{< /tab >}} + {{< tab header="Python" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="CSharp" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="Ruby" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="JavaScript" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="Kotlin" text=true >}} + {{< badge-code >}} + {{< /tab >}} +{{< /tabpane >}} +### ByAll + +The `ByAll` class enables you to utilize two By locators at once, finding elements that mach _either_ of your By locators. +For example, instead of having to utilize two `FindElement()` functions to find the username and password input fields seperately, +you can instead find them together in one clean `FindElements()` + +{{< tabpane langEqualsHeader=true >}} + {{< tab header="Java" text=true >}} + {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#L22-L23">}} + {{< /tab >}} + {{< tab header="Python" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="CSharp" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="Ruby" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="JavaScript" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="Kotlin" text=true >}} + {{< badge-code >}} + {{< /tab >}} +{{< /tabpane >}} ## 相対ロケーター diff --git a/website_and_docs/content/documentation/webdriver/elements/locators.pt-br.md b/website_and_docs/content/documentation/webdriver/elements/locators.pt-br.md index 9ec62e23b20c..b167bf70ac5f 100644 --- a/website_and_docs/content/documentation/webdriver/elements/locators.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/elements/locators.pt-br.md @@ -321,6 +321,8 @@ The FindElement makes using locators a breeze! For most languages, all you need to do is utilize `webdriver.common.by.By`, however in others it's as simple as setting a parameter in the FindElement function +### By + {{< tabpane langEqualsHeader=true >}} {{< badge-examples >}} {{< tab header="Java" >}} @@ -349,6 +351,60 @@ others it's as simple as setting a parameter in the FindElement function {{< /tab >}} {{< /tabpane >}} +### ByChained + +The `ByChained` class enables you to _chain_ two By locators together. For example, instead of +having to locate a parent element, and then a child element of that parent, you can instead +combine those two `FindElement` functions into one. + +{{< tabpane langEqualsHeader=true >}} + {{< tab header="Java" text=true >}} + {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#L37-L38" >}} + {{< /tab >}} + {{< tab header="Python" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="CSharp" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="Ruby" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="JavaScript" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="Kotlin" text=true >}} + {{< badge-code >}} + {{< /tab >}} +{{< /tabpane >}} + +### ByAll + +The `ByAll` class enables you to utilize two By locators at once, finding elements that mach _either_ of your By locators. +For example, instead of having to utilize two `FindElement()` functions to find the username and password input fields +seperately, you can instead find them together in one clean `FindElements()` + +{{< tabpane langEqualsHeader=true >}} + {{< tab header="Java" text=true >}} + {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#L22-L23">}} + {{< /tab >}} + {{< tab header="Python" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="CSharp" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="Ruby" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="JavaScript" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="Kotlin" text=true >}} + {{< badge-code >}} + {{< /tab >}} +{{< /tabpane >}} + ## Relative Locators **Selenium 4** introduces Relative Locators (previously diff --git a/website_and_docs/content/documentation/webdriver/elements/locators.zh-cn.md b/website_and_docs/content/documentation/webdriver/elements/locators.zh-cn.md index 90995a357d4a..c395dd916640 100644 --- a/website_and_docs/content/documentation/webdriver/elements/locators.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/elements/locators.zh-cn.md @@ -321,6 +321,8 @@ The FindElement makes using locators a breeze! For most languages, all you need to do is utilize `webdriver.common.by.By`, however in others it's as simple as setting a parameter in the FindElement function +### By + {{< tabpane langEqualsHeader=true >}} {{< badge-examples >}} {{< tab header="Java" >}} @@ -349,6 +351,60 @@ others it's as simple as setting a parameter in the FindElement function {{< /tab >}} {{< /tabpane >}} +### ByChained + +The `ByChained` class enables you to _chain_ two By locators together. For example, +instead of having to locate a parent element, and then a child element of that parent, +you can instead combine those two `FindElement` functions into one. + +{{< tabpane langEqualsHeader=true >}} + {{< tab header="Java" text=true >}} + {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#L37-L38" >}} + {{< /tab >}} + {{< tab header="Python" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="CSharp" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="Ruby" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="JavaScript" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="Kotlin" text=true >}} + {{< badge-code >}} + {{< /tab >}} +{{< /tabpane >}} + +### ByAll + +The `ByAll` class enables you to utilize two By locators at once, finding elements that mach _either_ of your By locators. +For example, instead of having to utilize two `FindElement()` functions to find the username and password input fields +seperately, you can instead find them together in one clean `FindElements()` + +{{< tabpane langEqualsHeader=true >}} + {{< tab header="Java" text=true >}} + {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/LocatorsTest.java#L22-L23">}} + {{< /tab >}} + {{< tab header="Python" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="CSharp" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="Ruby" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="JavaScript" text=true >}} + {{< badge-code >}} + {{< /tab >}} + {{< tab header="Kotlin" text=true >}} + {{< badge-code >}} + {{< /tab >}} +{{< /tabpane >}} + ## Relative Locators **Selenium 4** introduces Relative Locators (previously diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.en.md b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.en.md index 32aee5a1714f..5d675125e850 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.en.md @@ -53,7 +53,7 @@ Elements do not get relocated automatically; the driver creates a reference ID f has a particular place it expects to find it in the DOM. If it can not find the element in the current DOM, any action using that element will result in this exception. -### Common Causes +### Likely Cause This can happen when: @@ -61,7 +61,7 @@ This can happen when: * You have navigated to a different page. * You have switched to another window or into or out of a frame or iframe. -### Common Solutions +### Possible Solutions **The DOM has changed** @@ -98,14 +98,50 @@ You can't just relocate it from the current context, and you can't switch back to an active context where it is valid. If this is the reason for your error, you must both navigate back to the correct location and relocate it. +## ElementClickInterceptedException + +This exception occurs when Selenium tries to click an element, but the click would instead be received +by a different element. Before Selenium will click an element, it checks if the element is visible, +unobscured by any other elements, and enabled - if the element is obscured, it will raise this exception. + +### Likely Cause + +**UI Elements Overlapping** + +Elements on the UI are typically placed next to each other, but occasionally elements may overlap. For example, +a navbar always staying at the top of your window as you scroll a page. If that navbar happens to be covering +an element we are trying to click, Selenium might believe it to be visible and enabled, but when you try to click +it will throw this exception. Pop-ups and Modals are also common offenders here. + +**Animations** + +Elements with animations have the potential to cause this exception as well - it is recommended to wait for +animations to cease before attempting to click an element. + +### Possible Solutions + +**Use Explicit Waits** + +[Explicit Waits]({{< ref "/documentation/webdriver/waits" >}}) will likely be your best friend in these instances. +A great way is to use `ExpectedCondition.ToBeClickable()` with `WebDriverWait` to wait until the right moment. + +**Scroll the Element into View** + +In instances where the element is out of view, but Selenium still registers the element as visible +(e.g. navbars overlapping a section at the top of your screen), you can use the `WebDriver.executeScript()` +method to execute a javascript function to scroll (e.g. `WebDriver.executeScript('window.scrollBy(0,-250)')`) +or you can utilize the Actions class with `Actions.moveToElement(element)`. + ## Invalid SessionId Exception Sometimes the session you're trying to access is different than what's currently available ### Likely Cause -This usually occurs when the session has been deleted (e.g. `driver.quit()`) or if the session has changed, like when the last tab/browser has closed (e.g. `driver.close()`) +This usually occurs when the session has been deleted (e.g. `driver.quit()`) or if the session has changed, +like when the last tab/browser has closed (e.g. `driver.close()`) ### Possible Solutions -Check your script for instances of `driver.close()` and `driver.quit()`, and any other possible causes of closed tabs/browsers. It could be that you are locating an element before you should/can. +Check your script for instances of `driver.close()` and `driver.quit()`, and any other possible causes +of closed tabs/browsers. It could be that you are locating an element before you should/can. diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.ja.md b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.ja.md index 17f3179eb5ed..7e9c9709d67b 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.ja.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.ja.md @@ -47,7 +47,7 @@ Elements do not get relocated automatically; the driver creates a reference ID f has a particular place it expects to find it in the DOM. If it can not find the element in the current DOM, any action using that element will result in this exception. -### Common Causes +### Likely Cause This can happen when: @@ -55,7 +55,7 @@ This can happen when: * You have navigated to a different page. * You have switched to another window or into or out of a frame or iframe. -### Common Solutions +### Possible Solutions **The DOM has changed** @@ -92,14 +92,52 @@ You can't just relocate it from the current context, and you can't switch back to an active context where it is valid. If this is the reason for your error, you must both navigate back to the correct location and relocate it. +## ElementClickInterceptedException + +This exception occurs when Selenium tries to click an element, but the click would instead +be received by a different element. Before Selenium will click an element, it checks if the +element is visible, unobscured by any other elements, and enabled - if the element is obscured, +it will raise this exception. + +### Likely Cause + +**UI Elements Overlapping** + +Elements on the UI are typically placed next to each other, but occasionally elements may overlap. +For example, a navbar always staying at the top of your window as you scroll a page. If that navbar +happens to be covering an element we are trying to click, Selenium might believe it to be visible +and enabled, but when you try to click it will throw this exception. Pop-ups and Modals are also +common offenders here. + +**Animations** + +Elements with animations have the potential to cause this exception as well - it is recommended to +wait for animations to cease before attempting to click an element. + +### Possible Solutions + +**Use Explicit Waits** + +[Explicit Waits]({{< ref "/documentation/webdriver/waits" >}}) will likely be your best friend in these instances. +A great way is to use `ExpectedCondition.ToBeClickable()` with `WebDriverWait` to wait until the right moment. + +**Scroll the Element into View** + +In instances where the element is out of view, but Selenium still registers the element as visible +(e.g. navbars overlapping a section at the top of your screen), you can use the `WebDriver.executeScript()` +method to execute a javascript function to scroll (e.g. `WebDriver.executeScript('window.scrollBy(0,-250)')`) +or you can utilize the Actions class with `Actions.moveToElement(element)`. + ## Invalid SessionId Exception Sometimes the session you're trying to access is different than what's currently available ### Likely Cause -This usually occurs when the session has been deleted (e.g. `driver.quit()`) or if the session has changed, like when the last tab/browser has closed (e.g. `driver.close()`) +This usually occurs when the session has been deleted (e.g. `driver.quit()`) or if the session has changed, +like when the last tab/browser has closed (e.g. `driver.close()`) ### Possible Solutions -Check your script for instances of `driver.close()` and `driver.quit()`, and any other possible causes of closed tabs/browsers. It could be that you are locating an element before you should/can. +Check your script for instances of `driver.close()` and `driver.quit()`, and any other possible causes of closed +tabs/browsers. It could be that you are locating an element before you should/can. diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.pt-br.md index 17f3179eb5ed..571b54e61f76 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.pt-br.md @@ -47,7 +47,7 @@ Elements do not get relocated automatically; the driver creates a reference ID f has a particular place it expects to find it in the DOM. If it can not find the element in the current DOM, any action using that element will result in this exception. -### Common Causes +### Likely Cause This can happen when: @@ -55,7 +55,7 @@ This can happen when: * You have navigated to a different page. * You have switched to another window or into or out of a frame or iframe. -### Common Solutions +### Possible Solutions **The DOM has changed** @@ -92,6 +92,44 @@ You can't just relocate it from the current context, and you can't switch back to an active context where it is valid. If this is the reason for your error, you must both navigate back to the correct location and relocate it. +## ElementClickInterceptedException + +This exception occurs when Selenium tries to click an element, but the click would instead +be received by a different element. Before Selenium will click an element, it checks if the +element is visible, unobscured by any other elements, and enabled - if the element is obscured, +it will raise this exception. + +### Likely Cause + +**UI Elements Overlapping** + +Elements on the UI are typically placed next to each other, but occasionally elements may overlap. +For example, a navbar always staying at the top of your window as you scroll a page. If that navbar +happens to be covering an element we are trying to click, Selenium might believe it to be visible +and enabled, but when you try to click it will throw this exception. Pop-ups and Modals are also +common offenders here. + +**Animations** + +Elements with animations have the potential to cause this exception as well - it is recommended +to wait for animations to cease before attempting to click an element. + +### Possible Solutions + +**Use Explicit Waits** + +[Explicit Waits]({{< ref "/documentation/webdriver/waits" >}}) will likely be your best friend in these instances. +A great way is to use `ExpectedCondition.ToBeClickable()` with `WebDriverWait` +to wait until the right moment. + +**Scroll the Element into View** + +In instances where the element is out of view, but Selenium still registers the element as visible +(e.g. navbars overlapping a section at the top of your screen), you can use the +`WebDriver.executeScript()` method to execute a javascript function to scroll +(e.g. `WebDriver.executeScript('window.scrollBy(0,-250)')`) or you can utilize the Actions +class with `Actions.moveToElement(element)`. + ## Invalid SessionId Exception Sometimes the session you're trying to access is different than what's currently available diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.zh-cn.md index d570d3b82aa3..b88ec8355af3 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.zh-cn.md @@ -99,6 +99,44 @@ WebDriver并不会自动重新定位, 如果这是您的错误原因, 您必须回到正确的位置并重新定位元素。 +## ElementClickInterceptedException + +This exception occurs when Selenium tries to click an element, but the click would instead +be received by a different element. Before Selenium will click an element, it checks if the +element is visible, unobscured by any other elements, and enabled - if the element is obscured, +it will raise this exception. + +### Likely Cause + +**UI Elements Overlapping** + +Elements on the UI are typically placed next to each other, but occasionally elements may overlap. +For example, a navbar always staying at the top of your window as you scroll a page. If that navbar +happens to be covering an element we are trying to click, Selenium might believe it to be visible +and enabled, but when you try to click it will throw this exception. Pop-ups and Modals are also +common offenders here. + +**Animations** + +Elements with animations have the potential to cause this exception as well - it is recommended +to wait for animations to cease before attempting to click an element. + +### Possible Solutions + +**Use Explicit Waits** + +[Explicit Waits]({{< ref "/documentation/webdriver/waits" >}}) will likely be your best friend +in these instances. A great way is to use `ExpectedCondition.ToBeClickable()` +with `WebDriverWait` to wait until the right moment. + +**Scroll the Element into View** + +In instances where the element is out of view, but Selenium still registers the element as visible +(e.g. navbars overlapping a section at the top of your screen), you can use the +`WebDriver.executeScript()` method to execute a javascript function to scroll +(e.g. `WebDriver.executeScript('window.scrollBy(0,-250)')`) or you can utilize the +Actions class with `Actions.moveToElement(element)`. + ## 无效 SessionId 异常 有时您尝试访问的会话与当前可用的会话不同。 diff --git a/website_and_docs/hugo.toml b/website_and_docs/hugo.toml index fb7795ef93ca..471f8b3a6297 100644 --- a/website_and_docs/hugo.toml +++ b/website_and_docs/hugo.toml @@ -164,8 +164,8 @@ plausible_analytics = true prism_syntax_highlighting = true # Enable announcement banner below navbar (Go to announcement-banner.html to change the message) -banner_flag = true -announcement_banner = true +banner_flag = false +announcement_banner = false # Enable Algolia DocSearch [params.search.algolia] @@ -340,7 +340,7 @@ year = "year" [security] enableInlineShortcodes = false [security.exec] - allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$'] + allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$', '^git$'] osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$'] [security.funcs] diff --git a/website_and_docs/layouts/downloads/list.html b/website_and_docs/layouts/downloads/list.html index 1ca9e41cde26..2bb890115221 100644 --- a/website_and_docs/layouts/downloads/list.html +++ b/website_and_docs/layouts/downloads/list.html @@ -25,7 +25,7 @@

Latest stable version - 4.24.0 + 4.25.0

To use the Selenium Server in a Grid configuration see the @@ -107,7 +107,7 @@

C# NuGet

- Nuget latest release is 4.24.0 Released on August 28, 2024. + Nuget latest release is 4.25.0 Released on September 20, 2024.