diff --git a/dotnet/src/webdriver/assets/nuget/README.md b/dotnet/src/webdriver/assets/nuget/README.md index e05cb38ab350b..16ebec04924ef 100644 --- a/dotnet/src/webdriver/assets/nuget/README.md +++ b/dotnet/src/webdriver/assets/nuget/README.md @@ -1,17 +1,48 @@ -Selenium is a set of different software tools each with a different approach to supporting browser automation. These tools are highly flexible, allowing many options for locating and manipulating elements within a browser, and one of its key features is the support for automating multiple browser platforms. This package contains the .NET bindings for the concise and object-based Selenium WebDriver API, which uses native OS-level events to manipulate the browser, bypassing the JavaScript sandbox, and does not require the Selenium Server to automate the browser. +# Selenium.WebDriver -# Usage +.NET language bindings for [Selenium WebDriver](https://selenium.dev). +Selenium automates browsers for testing and web-based task automation. + +## Installation + +```bash +dotnet add package Selenium.WebDriver +``` + +## Quick Start ```csharp using OpenQA.Selenium.Chrome; -using OpenQA.Selenium; -await using var driver = new ChromeDriver(); - -driver.Url = "https://www.google.com"; -driver.FindElement(By.Name("q")).SendKeys("webdriver" + Keys.Return); +using var driver = new ChromeDriver(); +driver.Url = "https://www.selenium.dev"; Console.WriteLine(driver.Title); ``` -# Contributing -Contributions are accepted either through [GitHub](https://github.com/SeleniumHQ/selenium/) pull requests or patches via the [Selenium issue tracker](https://github.com/SeleniumHQ/selenium/issues). +Selenium Manager automatically handles browser driver installation — no manual driver setup required. + +## Documentation + +- [Getting Started](https://www.selenium.dev/documentation/webdriver/getting_started/) +- [.NET API Docs](https://www.selenium.dev/selenium/docs/api/dotnet/) +- [Selenium Manager](https://www.selenium.dev/documentation/selenium_manager/) +- [Selenium Grid](https://www.selenium.dev/documentation/grid/) + +## Support + +- [Selenium Chat](https://www.selenium.dev/support/#ChatRoom) +- [GitHub Issues](https://github.com/SeleniumHQ/selenium/issues) + +## Contributing + +Contributions are welcome via [GitHub](https://github.com/SeleniumHQ/selenium/) pull requests. +See the [source code](https://github.com/SeleniumHQ/selenium/tree/trunk/dotnet) for this binding. + +## Links + +- [NuGet](https://www.nuget.org/packages/Selenium.WebDriver) +- [Documentation](https://www.selenium.dev/documentation/?tab=dotnet) + +## License + +Licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). diff --git a/java/README.md b/java/README.md new file mode 100644 index 0000000000000..b727f51eccc7d --- /dev/null +++ b/java/README.md @@ -0,0 +1,68 @@ +# Selenium WebDriver — Java + +Java language bindings for [Selenium WebDriver](https://www.selenium.dev). +Selenium automates browsers for testing and web-based task automation. + +## Installation + +### Maven + +```xml + + org.seleniumhq.selenium + selenium-java + ${selenium.version} + +``` + +### Gradle + +```groovy +implementation "org.seleniumhq.selenium:selenium-java:4.x.x" +``` + +Replace `4.x.x` with the latest version from [Maven Central](https://central.sonatype.com/artifact/org.seleniumhq.selenium/selenium-java). + +## Quick Start + +```java +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.chrome.ChromeDriver; + +public class Example { + public static void main(String[] args) { + WebDriver driver = new ChromeDriver(); + driver.get("https://www.selenium.dev"); + System.out.println(driver.getTitle()); + driver.quit(); + } +} +``` + +Selenium Manager automatically handles browser driver installation — no manual driver setup required. + +## Documentation + +- [Getting Started](https://www.selenium.dev/documentation/webdriver/getting_started/) +- [Java API Docs](https://www.selenium.dev/selenium/docs/api/java/) +- [Selenium Manager](https://www.selenium.dev/documentation/selenium_manager/) +- [Selenium Grid](https://www.selenium.dev/documentation/grid/) + +## Support + +- [Selenium Chat](https://www.selenium.dev/support/#ChatRoom) +- [GitHub Issues](https://github.com/SeleniumHQ/selenium/issues) + +## Contributing + +Contributions are welcome via [GitHub](https://github.com/SeleniumHQ/selenium/) pull requests. +See the [source code](https://github.com/SeleniumHQ/selenium/tree/trunk/java) for this binding. + +## Links + +- [Maven Central](https://central.sonatype.com/artifact/org.seleniumhq.selenium/selenium-java) +- [Documentation](https://www.selenium.dev/documentation/?tab=java) + +## License + +Licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). diff --git a/javascript/selenium-webdriver/README.md b/javascript/selenium-webdriver/README.md index 9224507b7cc74..a872752794444 100644 --- a/javascript/selenium-webdriver/README.md +++ b/javascript/selenium-webdriver/README.md @@ -1,230 +1,56 @@ # selenium-webdriver -Selenium is a browser automation library. Most often used for testing -web-applications, Selenium may be used for any task that requires automating -interaction with the browser. +JavaScript language bindings for [Selenium WebDriver](https://selenium.dev). +Selenium automates browsers for testing and web-based task automation. -## Installation - -Selenium may be installed via npm with - - npm install selenium-webdriver +Requires Node >= 20. -You will need to download additional components to work with each of the major -browsers. The drivers for Chrome, Firefox, and Microsoft's IE and Edge web -browsers are all standalone executables that should be placed on your system -[PATH]. Apple's safaridriver (v10 and above) can be found at the -following path – /usr/bin/safaridriver. To enable automation on safari, -you need to run command `safaridriver --enable`. - -| Browser | Component | -| :---------------- | :------------------------------- | -| Chrome | [chromedriver(.exe)][chrome] | -| Internet Explorer | [IEDriverServer.exe][release] | -| Edge | [MicrosoftWebDriver.msi][edge] | -| Firefox | [geckodriver(.exe)][geckodriver] | -| Opera | [operadriver(.exe)][operadriver] | -| Safari | [safaridriver] | +## Installation -## Usage +```bash +npm install selenium-webdriver +``` -The sample below and others are included in the `example` directory. You may -also find the tests for selenium-webdriver informative. +## Quick Start ```javascript -const { Builder, Browser, By, Key, until } = require('selenium-webdriver') +const { Builder, Browser } = require('selenium-webdriver') ;(async function example() { - let driver = await new Builder().forBrowser(Browser.FIREFOX).build() + let driver = await new Builder().forBrowser(Browser.CHROME).build() try { - await driver.get('https://www.google.com/ncr') - await driver.findElement(By.name('q')).sendKeys('webdriver', Key.RETURN) - await driver.wait(until.titleIs('webdriver - Google Search'), 1000) + await driver.get('https://www.selenium.dev') + console.log(await driver.getTitle()) } finally { await driver.quit() } })() ``` -### Using the Builder API - -The `Builder` class is your one-stop shop for configuring new WebDriver -instances. Rather than clutter your code with branches for the various browsers, -the builder lets you set all options in one flow. When you call -`Builder#build()`, all options irrelevant to the selected browser are dropped: - -```javascript -const webdriver = require('selenium-webdriver') -const chrome = require('selenium-webdriver/chrome') -const firefox = require('selenium-webdriver/firefox') - -let driver = new webdriver.Builder() - .forBrowser(webdriver.Browser.FIREFOX) - .setChromeOptions(/* ... */) - .setFirefoxOptions(/* ... */) - .build() -``` - -Why would you want to configure options irrelevant to the target browser? The -`Builder`'s API defines your _default_ configuration. You can change the target -browser at runtime through the `SELENIUM_BROWSER` environment variable. For -example, the `example/google_search.js` script is configured to run against -Firefox. You can run the example against other browsers just by changing the -runtime environment - - # cd node_modules/selenium-webdriver - node example/google_search - SELENIUM_BROWSER=chrome node example/google_search - SELENIUM_BROWSER=safari node example/google_search +Selenium Manager automatically handles browser driver installation — no manual driver setup required. -### The Standalone Selenium Server - -The standalone Selenium Server acts as a proxy between your script and the -browser-specific drivers. The server may be used when running locally, but it's -not recommend as it introduces an extra hop for each request and will slow -things down. The server is required, however, to use a browser on a remote host -(most browser drivers, like the IEDriverServer, do not accept remote -connections). - -To use the Selenium Server, you will need to install the -[JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html) and -download the latest server from [Selenium][release]. Once downloaded, run the -server with - - java -jar selenium-server-4.27.0.jar standalone - -You may configure your tests to run against a remote server through the Builder -API: - -```javascript -let driver = new webdriver.Builder() - .forBrowser(webdriver.Browser.FIREFOX) - .usingServer('http://localhost:4444/wd/hub') - .build() -``` - -Or change the Builder's configuration at runtime with the `SELENIUM_REMOTE_URL` -environment variable: +## Documentation - SELENIUM_REMOTE_URL="http://localhost:4444/wd/hub" node script.js +- [Getting Started](https://www.selenium.dev/documentation/webdriver/getting_started/) +- [JavaScript API Docs](https://www.selenium.dev/selenium/docs/api/javascript/) +- [Selenium Manager](https://www.selenium.dev/documentation/selenium_manager/) +- [Selenium Grid](https://www.selenium.dev/documentation/grid/) -You can experiment with these options using the `example/google_search.js` -script provided with `selenium-webdriver`. +## Support -## Documentation +- [Selenium Chat](https://www.selenium.dev/support/#ChatRoom) +- [GitHub Issues](https://github.com/SeleniumHQ/selenium/issues) -API documentation is available online from the [Selenium project][api]. -Additional resources include +## Contributing -- the #selenium channel on Libera IRC -- the [selenium-users@googlegroups.com][users] list -- [SeleniumHQ](https://selenium.dev/documentation/) documentation +Contributions are welcome via [GitHub](https://github.com/SeleniumHQ/selenium/) pull requests. +See the [source code](https://github.com/SeleniumHQ/selenium/tree/trunk/javascript/selenium-webdriver) for this binding. -## Contributing +## Links -Contributions are accepted either through [GitHub][gh] pull requests or patches -via the [Selenium issue tracker][issues]. - -## Node Support Policy - -Each version of selenium-webdriver will support the latest _semver-minor_ -version of the [LTS] and stable Node releases. All _semver-major_ & -_semver-minor_ versions between the LTS and stable release will have "best -effort" support. Following a Selenium release, any _semver-minor_ Node releases -will also have "best effort" support. Releases older than the latest LTS, -_semver-major_ releases, and all unstable release branches (e.g. "v.Next") -are considered strictly unsupported. - -For example, suppose the current LTS and stable releases are v22.13.0 and -v23.6.0, -respectively. Then a Selenium release would have the following support levels: - -| Version | Support | -| :--------: | :-----------: | -| <= 16.20.2 | _unsupported_ | -| 16.20.2 | supported | -| 18.8.0 | supported | -| >= 22.13.0 | best effort | -| v.Next | _unsupported_ | - -### Support Level Definitions - -- _supported:_ A selenium-webdriver release will be API compatible with the - platform API, without the use of runtime flags. - -- _best effort:_ Bugs will be investigated as time permits. API compatibility is - only guaranteed where required by a _supported_ release. This effectively - means the adoption of new JS features, such as ES2015 modules, will depend - on what is supported in Node's LTS. - -- _unsupported:_ Bug submissions will be closed as will-not-fix and API - compatibility is not guaranteed. - -### Projected Support Schedule - -If Node releases a new [LTS] each October and a new major version every 6 -months, the support window for selenium-webdriver will be roughly: - -| Release | Status | END-OF-LIFE | -| :-----: | :-------------: | :---------: | -| v18.x | Maintenance LTS | 2025-04-30 | -| v19.x | End-of-Life | 2023-06-01 | -| v20.x | Maintenance LTS | 2026-04-30 | -| v21.x | End-of-Life | 2024-06-01 | -| V22.x | Active LTS | 2027-04-30 | -| V23.x | Current | 2025-06-01 | - -## Issues - -Please report any issues using the [Selenium issue tracker][issues]. When using -the issue tracker - -- **Do** include a detailed description of the problem. -- **Do** include a link to a [gist](http://gist.github.com/) with any - interesting stack traces/logs (you may also attach these directly to the bug - report). -- **Do** include a [reduced test case][reduction]. Reporting "unable to find - element on the page" is _not_ a valid report - there's nothing for us to - look into. Expect your bug report to be closed if you do not provide enough - information for us to investigate. -- **Do not** use the issue tracker to submit basic help requests. All help - inquiries should be directed to the [user forum][users] or #selenium IRC - channel. -- **Do not** post empty "I see this too" or "Any updates?" comments. These - provide no additional information and clutter the log. -- **Do not** report regressions on closed bugs as they are not actively - monitored for updates (especially bugs that are >6 months old). Please open a - new issue and reference the original bug in your report. +- [npm](https://www.npmjs.com/package/selenium-webdriver) +- [Documentation](https://www.selenium.dev/documentation/?tab=javascript) ## License -Licensed to the Software Freedom Conservancy (SFC) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The SFC licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. - -[LTS]: https://github.com/nodejs/LTS -[PATH]: http://en.wikipedia.org/wiki/PATH_%28variable%29 -[api]: https://www.selenium.dev/selenium/docs/api/javascript/ -[chrome]: https://googlechromelabs.github.io/chrome-for-testing/#stable -[gh]: https://github.com/SeleniumHQ/selenium/ -[issues]: https://github.com/SeleniumHQ/selenium/issues -[edge]: http://go.microsoft.com/fwlink/?LinkId=619687 -[geckodriver]: https://github.com/mozilla/geckodriver/releases/ -[reduction]: http://www.webkit.org/quality/reduction.html -[release]: https://www.selenium.dev/downloads/ -[users]: https://groups.google.com/forum/#!forum/selenium-users -[safaridriver]: https://developer.apple.com/library/prerelease/content/releasenotes/General/WhatsNewInSafari/Articles/Safari_10_0.html#//apple_ref/doc/uid/TP40014305-CH11-DontLinkElementID_28 -[operadriver]: https://github.com/operasoftware/operachromiumdriver/releases +Licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). diff --git a/py/docs/source/index.rst b/py/docs/source/index.rst index 2da64a28865ae..211d87e21bdc2 100644 --- a/py/docs/source/index.rst +++ b/py/docs/source/index.rst @@ -2,187 +2,64 @@ Selenium Client Driver ====================== -Introduction -============ - -Python language bindings for Selenium WebDriver. - -The `selenium` package is used to automate web browser interaction from Python. - -+-------------------+--------------------------------------------------------+ -| **Home**: | https://selenium.dev | -+-------------------+--------------------------------------------------------+ -| **GitHub**: | https://github.com/SeleniumHQ/Selenium | -+-------------------+--------------------------------------------------------+ -| **PyPI**: | https://pypi.org/project/selenium | -+-------------------+--------------------------------------------------------+ -| **IRC/Slack**: | https://www.selenium.dev/support/#ChatRoom | -+-------------------+--------------------------------------------------------+ -| **Docs**: | https://www.selenium.dev/selenium/docs/api/py | -+-------------------+--------------------------------------------------------+ -| **API Reference**:| https://www.selenium.dev/selenium/docs/api/py/api.html | -+-------------------+--------------------------------------------------------+ - -Updated documentation published with each commit is available at: `readthedocs.io `_ - ----- +Python language bindings for `Selenium WebDriver `_. +Selenium automates browsers for testing and web-based task automation. Supported Python Versions ========================= * Python 3.10+ -Supported Browsers -================== - -Several browsers are supported, as well as the Remote protocol: - -* Chrome -* Edge -* Firefox -* Safari -* WebKitGTK -* WPEWebKit - Installing ========== -Install or upgrade the Python bindings with `pip `. +Install or upgrade the Python bindings with `pip `_. Latest official release:: pip install -U selenium -Nightly development release:: - - pip install -U --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ selenium - -Note: you should consider using a -`virtual environment `_ -to create an isolated Python environment for installation. - -Drivers -======= - -Selenium requires a driver to interface with the chosen browser (chromedriver, edgedriver, geckodriver, etc). - -In older versions of Selenium, it was necessary to install and manage these drivers yourself. You had to make sure the -driver executable was available on your system `PATH`, or specified explicitly in code. Modern versions of Selenium -handle browser and driver installation for you with -`Selenium Manager `_. You generally don't have to worry about -driver installation or configuration now that it's done for you when you instantiate a WebDriver. Selenium Manager works -with most supported platforms and browsers. If it doesn't meet your needs, you can still install and specify browsers -and drivers yourself. - -Links to some of the more popular browser drivers: - -+--------------+-----------------------------------------------------------------------+ -| **Chrome**: | https://developer.chrome.com/docs/chromedriver | -+--------------+-----------------------------------------------------------------------+ -| **Edge**: | https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver | -+--------------+-----------------------------------------------------------------------+ -| **Firefox**: | https://github.com/mozilla/geckodriver | -+--------------+-----------------------------------------------------------------------+ -| **Safari**: | https://webkit.org/blog/6900/webdriver-support-in-safari-10 | -+--------------+-----------------------------------------------------------------------+ - -Example 0: -========== - -* launch a new Chrome browser -* load a web page -* close the browser +Quick Start +=========== .. code-block:: python from selenium import webdriver - driver = webdriver.Chrome() - driver.get('https://selenium.dev/') + driver.get("https://www.selenium.dev") + print(driver.title) driver.quit() -Example 1: -========== - -* launch a new Chrome browser -* load the Selenium documentation page -* find the "Webdriver" link -* click the "WebDriver" link -* close the browser +Selenium Manager automatically handles browser driver installation — no manual driver setup required. +See `Selenium Manager `_ for details. -.. code-block:: python - - from selenium import webdriver - from selenium.webdriver.common.by import By - - - driver = webdriver.Chrome() - - driver.get('https://selenium.dev/documentation') - assert 'Selenium' in driver.title - - elem = driver.find_element(By.ID, 'm-documentationwebdriver') - elem.click() - assert 'WebDriver' in driver.title - - driver.quit() - -Example 2: -========== - -Selenium WebDriver is often used as a basis for testing web applications. Here is a simple example using Python's -standard `unittest `_ library: - -.. code-block:: python - - import unittest - from selenium import webdriver - - - class GoogleTestCase(unittest.TestCase): - - def setUp(self): - self.driver = webdriver.Firefox() - self.addCleanup(self.driver.quit) - - def test_page_title(self): - self.driver.get('https://www.google.com') - self.assertIn('Google', self.driver.title) - - if __name__ == '__main__': - unittest.main(verbosity=2) +Documentation +============= -Selenium Grid (optional) -========================== +- `Getting Started `_ +- `Python API Docs `_ +- `Selenium Grid `_ -For local Selenium scripts, the Java server is not needed. +Support +======= -To use Selenium remotely, you need to also run a Selenium Grid. For information on running Selenium Grid: -https://www.selenium.dev/documentation/grid/getting_started/ +- `Selenium Chat `_ +- `GitHub Issues `_ -To use Remote WebDriver see: https://www.selenium.dev/documentation/webdriver/drivers/remote_webdriver/?tab=python +Contributing +============= -Use The Source Luke! -==================== +Contributions are welcome via `GitHub `_ pull requests. +See the `source code `_ for this binding. -View source code online: +Links +===== -+---------------+-------------------------------------------------------+ -| **Official**: | https://github.com/SeleniumHQ/selenium/tree/trunk/py | -+---------------+-------------------------------------------------------+ +- `PyPI `_ +- `Documentation `_ -Contributing -============= +License +======= - - Fork the selenium repo - - Clone your fork locally - - Create a branch for your work - - `git checkout -b my-cool-branch-name` - - Create a virtual environment and install tox - - `python -m venv venv && source venv/bin/activate && pip install tox` - - Make your changes - - Run the linter/formatter - - `tox -e linting` - - If tox exits `0`, commit and push. Otherwise, fix the newly introduced style violations - - Submit a Pull Request +Licensed under the `Apache License 2.0 `_. diff --git a/rb/README.md b/rb/README.md index 396462bf17bf9..4881de778fccc 100644 --- a/rb/README.md +++ b/rb/README.md @@ -1,34 +1,51 @@ # selenium-webdriver -This gem provides Ruby bindings for Selenium and supports MRI >= 3.2. +Ruby language bindings for [Selenium WebDriver](https://selenium.dev). +Selenium automates browsers for testing and web-based task automation. -## Install +Supports MRI >= 3.2. - gem install selenium-webdriver +## Installation -## Links +```bash +gem install selenium-webdriver +``` -* https://rubygems.org/gems/selenium-webdriver -* https://www.selenium.dev/selenium/docs/api/rb/index.html -* https://www.selenium.dev/documentation/?tab=ruby -* https://github.com/SeleniumHQ/selenium/issues +## Quick Start -## License +```ruby +require "selenium-webdriver" + +driver = Selenium::WebDriver.for :chrome +driver.get "https://www.selenium.dev" +puts driver.title +driver.quit +``` + +Selenium Manager automatically handles browser driver installation — no manual driver setup required. + +## Documentation + +- [Getting Started](https://www.selenium.dev/documentation/webdriver/getting_started/) +- [Ruby API Docs](https://www.selenium.dev/selenium/docs/api/rb/index.html) +- [Selenium Manager](https://www.selenium.dev/documentation/selenium_manager/) +- [Selenium Grid](https://www.selenium.dev/documentation/grid/) -Copyright 2009-2024 Software Freedom Conservancy +## Support -Licensed to the Software Freedom Conservancy (SFC) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The SFC licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at +- [Selenium Chat](https://www.selenium.dev/support/#ChatRoom) +- [GitHub Issues](https://github.com/SeleniumHQ/selenium/issues) - http://www.apache.org/licenses/LICENSE-2.0 +## Contributing + +Contributions are welcome via [GitHub](https://github.com/SeleniumHQ/selenium/) pull requests. +See the [source code](https://github.com/SeleniumHQ/selenium/tree/trunk/rb) for this binding. + +## Links + +- [RubyGems](https://rubygems.org/gems/selenium-webdriver) +- [Documentation](https://www.selenium.dev/documentation/?tab=ruby) + +## License -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. +Licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).