diff --git a/examples/dotnet/SeleniumDocs/GettingStarted/InstallDriversTest.cs b/examples/dotnet/SeleniumDocs/GettingStarted/InstallDriversTest.cs deleted file mode 100644 index 504ba2009c8c..000000000000 --- a/examples/dotnet/SeleniumDocs/GettingStarted/InstallDriversTest.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using OpenQA.Selenium.Chrome; -using OpenQA.Selenium.Edge; -using OpenQA.Selenium.Firefox; -using OpenQA.Selenium.IE; -using SeleniumDocs.TestSupport; -using WebDriverManager; -using WebDriverManager.DriverConfigs.Impl; - -namespace SeleniumDocs.GettingStarted -{ - [TestClassCustom] - [Ignore("Running these tests can cause problems with other tests")] - public class InstallDriversTest - { - [TestMethod] - public void ChromeSession() - { - new DriverManager().SetUpDriver(new ChromeConfig()); - - var driver = new ChromeDriver(); - - driver.Quit(); - } - - [TestMethod] - public void EdgeSession() - { - new DriverManager().SetUpDriver(new EdgeConfig()); - - var driver = new EdgeDriver(); - - driver.Quit(); - } - - [TestMethod] - public void FirefoxSession() - { - new DriverManager().SetUpDriver(new FirefoxConfig()); - - var driver = new FirefoxDriver(); - - driver.Quit(); - } - - [TestMethod] - public void InternetExplorerSession() - { - new DriverManager().SetUpDriver(new InternetExplorerConfig()); - - var driver = new InternetExplorerDriver(); - - driver.Quit(); - } - } -} \ No newline at end of file diff --git a/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj b/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj index f7d31ca446b8..36812656bfa7 100644 --- a/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj +++ b/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj @@ -12,7 +12,6 @@ - diff --git a/examples/java/build.gradle b/examples/java/build.gradle index 80a53c62b019..ab233a7f8020 100644 --- a/examples/java/build.gradle +++ b/examples/java/build.gradle @@ -12,7 +12,6 @@ repositories { dependencies { testImplementation 'org.seleniumhq.selenium:selenium-java:4.9.1' testImplementation 'org.seleniumhq.selenium:selenium-grid:4.9.1' - testImplementation 'io.github.bonigarcia:webdrivermanager:5.3.2' testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.0' } diff --git a/examples/java/pom.xml b/examples/java/pom.xml index 7f733555aa21..bcc1864ef559 100644 --- a/examples/java/pom.xml +++ b/examples/java/pom.xml @@ -56,12 +56,6 @@ 5.9.2 test - - io.github.bonigarcia - webdrivermanager - 5.3.2 - test - diff --git a/examples/java/src/test/java/dev/selenium/getting_started/InstallDriversTest.java b/examples/java/src/test/java/dev/selenium/getting_started/InstallDriversTest.java deleted file mode 100644 index 397bbd92e788..000000000000 --- a/examples/java/src/test/java/dev/selenium/getting_started/InstallDriversTest.java +++ /dev/null @@ -1,53 +0,0 @@ -package dev.selenium.getting_started; - -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.chrome.ChromeDriver; -import org.openqa.selenium.edge.EdgeDriver; -import org.openqa.selenium.firefox.FirefoxDriver; -import org.openqa.selenium.ie.InternetExplorerDriver; - -import io.github.bonigarcia.wdm.WebDriverManager; - -public class InstallDriversTest { - @Test - @Disabled("Do not run in CI") - public void chromeSession() { - WebDriverManager.chromedriver().setup(); - - WebDriver driver = new ChromeDriver(); - - driver.quit(); - } - - @Test - @Disabled("Do not run in CI") - public void edgeSession() { - WebDriverManager.edgedriver().setup(); - - WebDriver driver = new EdgeDriver(); - - driver.quit(); - } - - @Test - @Disabled("Do not run in CI") - public void firefoxSession() { - WebDriverManager.firefoxdriver().setup(); - - WebDriver driver = new FirefoxDriver(); - - driver.quit(); - } - - @Test - @Disabled("Do not run in CI") - public void ieSession() { - WebDriverManager.iedriver().setup(); - - WebDriver driver = new InternetExplorerDriver(); - - driver.quit(); - } -} diff --git a/examples/kotlin/pom.xml b/examples/kotlin/pom.xml index a6ebc595b01f..8ce27bb04c7d 100644 --- a/examples/kotlin/pom.xml +++ b/examples/kotlin/pom.xml @@ -54,12 +54,6 @@ ${junit5.version} test - - io.github.bonigarcia - webdrivermanager - ${wdm.version} - test - org.jetbrains.kotlin kotlin-stdlib-jdk8 diff --git a/examples/kotlin/src/test/kotlin/dev/selenium/BaseTest.kt b/examples/kotlin/src/test/kotlin/dev/selenium/BaseTest.kt index 3f8cb1e5cf17..dfe1bcef70a5 100644 --- a/examples/kotlin/src/test/kotlin/dev/selenium/BaseTest.kt +++ b/examples/kotlin/src/test/kotlin/dev/selenium/BaseTest.kt @@ -1,6 +1,5 @@ package dev.selenium; -import io.github.bonigarcia.wdm.WebDriverManager; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -12,11 +11,6 @@ import org.junit.jupiter.api.TestInstance open class BaseTest { lateinit var driver: WebDriver - @BeforeAll - fun setupAll() { - WebDriverManager.chromedriver().setup() - } - @BeforeEach fun setup() { driver = ChromeDriver() diff --git a/examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt b/examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt index 1534666ce6d2..01d8181ba385 100644 --- a/examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt +++ b/examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt @@ -1,6 +1,5 @@ package dev.selenium.getting_started -import io.github.bonigarcia.wdm.WebDriverManager import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.assertEquals import org.openqa.selenium.By @@ -12,23 +11,10 @@ import java.time.Duration class FirstScriptTest { private lateinit var driver: WebDriver - @BeforeAll - fun setupAll() { - WebDriverManager.chromedriver().setup() - } - - @BeforeEach - fun setup() { - driver = ChromeDriver() - } - - @AfterEach - fun teardown() { - driver.quit() - } - @Test fun eightComponents() { + driver = ChromeDriver() + driver.get("https://www.selenium.dev/selenium/web/web-form.html") val title = driver.title @@ -45,6 +31,8 @@ class FirstScriptTest { val message = driver.findElement(By.id("message")) val value = message.getText() assertEquals("Received!", value) + + driver.quit() } } \ No newline at end of file diff --git a/examples/kotlin/src/test/kotlin/dev/selenium/getting_started/InstallDriversTest.kt b/examples/kotlin/src/test/kotlin/dev/selenium/getting_started/InstallDriversTest.kt deleted file mode 100644 index 6878c0038ad7..000000000000 --- a/examples/kotlin/src/test/kotlin/dev/selenium/getting_started/InstallDriversTest.kt +++ /dev/null @@ -1,45 +0,0 @@ -package dev.selenium.getting_started - -import io.github.bonigarcia.wdm.WebDriverManager -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test -import org.openqa.selenium.WebDriver -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.edge.EdgeDriver -import org.openqa.selenium.firefox.FirefoxDriver -import org.openqa.selenium.ie.InternetExplorerDriver - - -class InstallDriversTest { - @Test - @Disabled("Do not run in CI") - fun chromeSession() { - WebDriverManager.chromedriver().setup() - val driver: WebDriver = ChromeDriver() - driver.quit() - } - - @Test - @Disabled("Do not run in CI") - fun edgeSession() { - WebDriverManager.edgedriver().setup() - val driver: WebDriver = EdgeDriver() - driver.quit() - } - - @Test - @Disabled("Do not run in CI") - fun firefoxSession() { - WebDriverManager.firefoxdriver().setup() - val driver: WebDriver = FirefoxDriver() - driver.quit() - } - - @Test - @Disabled("Do not run in CI") - fun ieSession() { - WebDriverManager.iedriver().setup() - val driver: WebDriver = InternetExplorerDriver() - driver.quit() - } -} \ No newline at end of file diff --git a/examples/python/requirements.txt b/examples/python/requirements.txt index fa6e4553f86d..faca201f39fc 100644 --- a/examples/python/requirements.txt +++ b/examples/python/requirements.txt @@ -1,4 +1,3 @@ selenium==4.9.1 pytest flake8 -webdriver_manager==3.8.3 diff --git a/examples/python/tests/conftest.py b/examples/python/tests/conftest.py index 619556094883..5cd8bf123ed3 100644 --- a/examples/python/tests/conftest.py +++ b/examples/python/tests/conftest.py @@ -14,6 +14,7 @@ def driver(): @pytest.fixture(scope='function') def firefox_driver(): driver = webdriver.Firefox() + driver.implicitly_wait(1) yield driver diff --git a/examples/python/tests/getting_started/test_install_drivers.py b/examples/python/tests/getting_started/test_install_drivers.py deleted file mode 100644 index db81cd6e003d..000000000000 --- a/examples/python/tests/getting_started/test_install_drivers.py +++ /dev/null @@ -1,46 +0,0 @@ -import pytest -from selenium import webdriver -from selenium.webdriver.chrome.service import Service as ChromeService -from selenium.webdriver.edge.service import Service as EdgeService -from selenium.webdriver.firefox.service import Service as FirefoxService -from selenium.webdriver.ie.service import Service as IEService -from webdriver_manager.chrome import ChromeDriverManager -from webdriver_manager.firefox import GeckoDriverManager -from webdriver_manager.microsoft import EdgeChromiumDriverManager -from webdriver_manager.microsoft import IEDriverManager - - -@pytest.mark.skip(reason="Do not run in CI") -def test_driver_manager_chrome(): - service = ChromeService(executable_path=ChromeDriverManager().install()) - - driver = webdriver.Chrome(service=service) - - driver.quit() - - -@pytest.mark.skip(reason="Do not run in CI") -def test_edge_session(): - service = EdgeService(executable_path=EdgeChromiumDriverManager().install()) - - driver = webdriver.Edge(service=service) - - driver.quit() - - -@pytest.mark.skip(reason="Do not run in CI") -def test_firefox_session(): - service = FirefoxService(executable_path=GeckoDriverManager().install()) - - driver = webdriver.Firefox(service=service) - - driver.quit() - - -@pytest.mark.skip(reason="Do not run in CI") -def test_ie_session(): - service = IEService(executable_path=IEDriverManager().install()) - - driver = webdriver.Ie(service=service) - - driver.quit() diff --git a/examples/python/tests/troubleshooting/test_logging.py b/examples/python/tests/troubleshooting/test_logging.py index f17a6c6c4a72..b836df9253c5 100644 --- a/examples/python/tests/troubleshooting/test_logging.py +++ b/examples/python/tests/troubleshooting/test_logging.py @@ -1,3 +1,4 @@ +import atexit import logging import os @@ -24,4 +25,6 @@ def test_logging(): with open(log_path, 'r') as fp: assert len(fp.readlines()) == 3 finally: - os.remove(log_path) + atexit.register(delete_path, log_path) +def delete_path(path): + os.remove(path) diff --git a/examples/ruby/Gemfile b/examples/ruby/Gemfile index 15e0ac191de4..ecb10ce232a4 100644 --- a/examples/ruby/Gemfile +++ b/examples/ruby/Gemfile @@ -8,4 +8,3 @@ gem 'rspec', '~> 3.0' gem 'rubocop', '~> 1.35' gem 'rubocop-rspec', '~> 2.12' gem 'selenium-webdriver', '= 4.9.1' -gem 'webdrivers', '~> 5.1' diff --git a/examples/ruby/spec/getting_started/install_drivers_spec.rb b/examples/ruby/spec/getting_started/install_drivers_spec.rb deleted file mode 100644 index d11cd95dafe1..000000000000 --- a/examples/ruby/spec/getting_started/install_drivers_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'Install Drivers', exclude: {ci: :github} do - it 'chrome session' do - require 'webdrivers' - - @driver = Selenium::WebDriver.for :chrome - end - - it 'edge session' do - require 'webdrivers' - - driver = Selenium::WebDriver.for :edge - - driver.quit - end - - it 'firefox session' do - require 'webdrivers' - - driver = Selenium::WebDriver.for :firefox - - driver.quit - end - - it 'IE session', exclusive: {platform: :windows} do - require 'webdrivers' - - driver = Selenium::WebDriver.for :ie - - driver.quit - end -end diff --git a/website_and_docs/content/documentation/about/style.en.md b/website_and_docs/content/documentation/about/style.en.md index a371437a74dd..45fd603e8cb6 100644 --- a/website_and_docs/content/documentation/about/style.en.md +++ b/website_and_docs/content/documentation/about/style.en.md @@ -191,7 +191,7 @@ A basic comparison of code looks like: {{}} {{}} {{}} - {{}} + {{}} {{}} {{}} @@ -214,7 +214,7 @@ Which looks like this: {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L23-L24" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L39-L40" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L25-L26" >}} {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/about/style.ja.md b/website_and_docs/content/documentation/about/style.ja.md index a371437a74dd..45fd603e8cb6 100644 --- a/website_and_docs/content/documentation/about/style.ja.md +++ b/website_and_docs/content/documentation/about/style.ja.md @@ -191,7 +191,7 @@ A basic comparison of code looks like: {{}} {{}} {{}} - {{}} + {{}} {{}} {{}} @@ -214,7 +214,7 @@ Which looks like this: {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L23-L24" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L39-L40" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L25-L26" >}} {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/about/style.pt-br.md b/website_and_docs/content/documentation/about/style.pt-br.md index a371437a74dd..45fd603e8cb6 100644 --- a/website_and_docs/content/documentation/about/style.pt-br.md +++ b/website_and_docs/content/documentation/about/style.pt-br.md @@ -191,7 +191,7 @@ A basic comparison of code looks like: {{}} {{}} {{}} - {{}} + {{}} {{}} {{}} @@ -214,7 +214,7 @@ Which looks like this: {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L23-L24" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L39-L40" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L25-L26" >}} {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/about/style.zh-cn.md b/website_and_docs/content/documentation/about/style.zh-cn.md index a371437a74dd..45fd603e8cb6 100644 --- a/website_and_docs/content/documentation/about/style.zh-cn.md +++ b/website_and_docs/content/documentation/about/style.zh-cn.md @@ -191,7 +191,7 @@ A basic comparison of code looks like: {{}} {{}} {{}} - {{}} + {{}} {{}} {{}} @@ -214,7 +214,7 @@ Which looks like this: {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L23-L24" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L39-L40" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L25-L26" >}} {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/bidirectional/chrome_devtools.en.md b/website_and_docs/content/documentation/webdriver/bidirectional/chrome_devtools.en.md index 4e92d6ca6237..e60bff310390 100644 --- a/website_and_docs/content/documentation/webdriver/bidirectional/chrome_devtools.en.md +++ b/website_and_docs/content/documentation/webdriver/bidirectional/chrome_devtools.en.md @@ -329,8 +329,6 @@ using OpenQA.Selenium.Chrome; using OpenQA.Selenium.DevTools; using System.Threading.Tasks; using OpenQA.Selenium.DevTools.V91.Emulation; -using WebDriverManager; -using WebDriverManager.DriverConfigs.Impl; using DevToolsSessionDomains = OpenQA.Selenium.DevTools.V91.DevToolsSessionDomains; namespace Selenium4Sample { @@ -341,7 +339,6 @@ public class ExampleDevice { protected DevToolsSessionDomains devToolsSession; public async Task DeviceModeTest() { - new DriverManager().SetUpDriver(new ChromeConfig()); ChromeOptions chromeOptions = new ChromeOptions(); //Set ChromeDriver driver = new ChromeDriver(); diff --git a/website_and_docs/content/documentation/webdriver/bidirectional/chrome_devtools.ja.md b/website_and_docs/content/documentation/webdriver/bidirectional/chrome_devtools.ja.md index 09c3559dcdfc..63ec718cae1a 100644 --- a/website_and_docs/content/documentation/webdriver/bidirectional/chrome_devtools.ja.md +++ b/website_and_docs/content/documentation/webdriver/bidirectional/chrome_devtools.ja.md @@ -338,8 +338,6 @@ using OpenQA.Selenium.Chrome; using OpenQA.Selenium.DevTools; using System.Threading.Tasks; using OpenQA.Selenium.DevTools.V91.Emulation; -using WebDriverManager; -using WebDriverManager.DriverConfigs.Impl; using DevToolsSessionDomains = OpenQA.Selenium.DevTools.V91.DevToolsSessionDomains; namespace Selenium4Sample { @@ -350,7 +348,6 @@ public class ExampleDevice { protected DevToolsSessionDomains devToolsSession; public async Task DeviceModeTest() { - new DriverManager().SetUpDriver(new ChromeConfig()); ChromeOptions chromeOptions = new ChromeOptions(); //Set ChromeDriver driver = new ChromeDriver(); diff --git a/website_and_docs/content/documentation/webdriver/bidirectional/chrome_devtools.pt-br.md b/website_and_docs/content/documentation/webdriver/bidirectional/chrome_devtools.pt-br.md index 01c93855bf60..1a918e44aa19 100644 --- a/website_and_docs/content/documentation/webdriver/bidirectional/chrome_devtools.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/bidirectional/chrome_devtools.pt-br.md @@ -324,8 +324,6 @@ using OpenQA.Selenium.Chrome; using OpenQA.Selenium.DevTools; using System.Threading.Tasks; using OpenQA.Selenium.DevTools.V91.Emulation; -using WebDriverManager; -using WebDriverManager.DriverConfigs.Impl; using DevToolsSessionDomains = OpenQA.Selenium.DevTools.V91.DevToolsSessionDomains; namespace Selenium4Sample { @@ -336,7 +334,6 @@ public class ExampleDevice { protected DevToolsSessionDomains devToolsSession; public async Task DeviceModeTest() { - new DriverManager().SetUpDriver(new ChromeConfig()); ChromeOptions chromeOptions = new ChromeOptions(); //Set ChromeDriver driver = new ChromeDriver(); diff --git a/website_and_docs/content/documentation/webdriver/bidirectional/chrome_devtools.zh-cn.md b/website_and_docs/content/documentation/webdriver/bidirectional/chrome_devtools.zh-cn.md index 0bcabc5233a3..7ad07572fa26 100644 --- a/website_and_docs/content/documentation/webdriver/bidirectional/chrome_devtools.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/bidirectional/chrome_devtools.zh-cn.md @@ -338,8 +338,6 @@ using OpenQA.Selenium.Chrome; using OpenQA.Selenium.DevTools; using System.Threading.Tasks; using OpenQA.Selenium.DevTools.V91.Emulation; -using WebDriverManager; -using WebDriverManager.DriverConfigs.Impl; using DevToolsSessionDomains = OpenQA.Selenium.DevTools.V91.DevToolsSessionDomains; namespace Selenium4Sample { @@ -350,7 +348,6 @@ public class ExampleDevice { protected DevToolsSessionDomains devToolsSession; public async Task DeviceModeTest() { - new DriverManager().SetUpDriver(new ChromeConfig()); ChromeOptions chromeOptions = new ChromeOptions(); //Set ChromeDriver driver = new ChromeDriver(); diff --git a/website_and_docs/content/documentation/webdriver/elements/file_upload.en.md b/website_and_docs/content/documentation/webdriver/elements/file_upload.en.md index 5c4bb8366ee6..cec7f3ca2085 100644 --- a/website_and_docs/content/documentation/webdriver/elements/file_upload.en.md +++ b/website_and_docs/content/documentation/webdriver/elements/file_upload.en.md @@ -23,10 +23,8 @@ import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; -import io.github.bonigarcia.wdm.WebDriverManager; class fileUploadDoc{ public static void main(String[] args) { - WebDriverManager.chromedriver().setup(); WebDriver driver = new ChromeDriver(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.get("https://the-internet.herokuapp.com/upload"); @@ -46,8 +44,6 @@ class fileUploadDoc{ {{< /tab >}} {{< tab header="Python" >}} from selenium import webdriver -from webdriver_manager.chrome import ChromeDriverManager -driver = webdriver.Chrome(ChromeDriverManager().install()) driver.implicitly_wait(10) driver.get("https://the-internet.herokuapp.com/upload"); driver.find_element(By.ID,"file-upload").send_keys("selenium-snapshot.jpg") diff --git a/website_and_docs/content/documentation/webdriver/elements/file_upload.ja.md b/website_and_docs/content/documentation/webdriver/elements/file_upload.ja.md index ed898fe9c39a..344afad01b09 100644 --- a/website_and_docs/content/documentation/webdriver/elements/file_upload.ja.md +++ b/website_and_docs/content/documentation/webdriver/elements/file_upload.ja.md @@ -23,10 +23,8 @@ import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; -import io.github.bonigarcia.wdm.WebDriverManager; class fileUploadDoc{ public static void main(String[] args) { - WebDriverManager.chromedriver().setup(); WebDriver driver = new ChromeDriver(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.get("https://the-internet.herokuapp.com/upload"); @@ -46,8 +44,6 @@ class fileUploadDoc{ {{< /tab >}} {{< tab header="Python" >}} from selenium import webdriver -from webdriver_manager.chrome import ChromeDriverManager -driver = webdriver.Chrome(ChromeDriverManager().install()) driver.implicitly_wait(10) driver.get("https://the-internet.herokuapp.com/upload"); driver.find_element(By.ID,"file-upload").send_keys("selenium-snapshot.jpg") diff --git a/website_and_docs/content/documentation/webdriver/elements/file_upload.pt-br.md b/website_and_docs/content/documentation/webdriver/elements/file_upload.pt-br.md index bba144d68cf7..a39190084997 100644 --- a/website_and_docs/content/documentation/webdriver/elements/file_upload.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/elements/file_upload.pt-br.md @@ -23,10 +23,8 @@ import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; -import io.github.bonigarcia.wdm.WebDriverManager; class fileUploadDoc{ public static void main(String[] args) { - WebDriverManager.chromedriver().setup(); WebDriver driver = new ChromeDriver(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.get("https://the-internet.herokuapp.com/upload"); @@ -46,8 +44,6 @@ class fileUploadDoc{ {{< /tab >}} {{< tab header="Python" >}} from selenium import webdriver -from webdriver_manager.chrome import ChromeDriverManager -driver = webdriver.Chrome(ChromeDriverManager().install()) driver.implicitly_wait(10) driver.get("https://the-internet.herokuapp.com/upload"); driver.find_element(By.ID,"file-upload").send_keys("selenium-snapshot.jpg") diff --git a/website_and_docs/content/documentation/webdriver/elements/file_upload.zh-cn.md b/website_and_docs/content/documentation/webdriver/elements/file_upload.zh-cn.md index b3ec7f9b3fe9..7a2d665f4cef 100644 --- a/website_and_docs/content/documentation/webdriver/elements/file_upload.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/elements/file_upload.zh-cn.md @@ -21,10 +21,8 @@ import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; -import io.github.bonigarcia.wdm.WebDriverManager; class fileUploadDoc{ public static void main(String[] args) { - WebDriverManager.chromedriver().setup(); WebDriver driver = new ChromeDriver(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.get("https://the-internet.herokuapp.com/upload"); @@ -44,8 +42,6 @@ class fileUploadDoc{ {{< /tab >}} {{< tab header="Python" >}} from selenium import webdriver -from webdriver_manager.chrome import ChromeDriverManager -driver = webdriver.Chrome(ChromeDriverManager().install()) driver.implicitly_wait(10) driver.get("https://the-internet.herokuapp.com/upload"); driver.find_element(By.ID,"file-upload").send_keys("selenium-snapshot.jpg") diff --git a/website_and_docs/content/documentation/webdriver/getting_started/first_script.en.md b/website_and_docs/content/documentation/webdriver/getting_started/first_script.en.md index a7d8274655ec..2b9bc778268b 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/first_script.en.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/first_script.en.md @@ -35,7 +35,7 @@ For more details on starting a session read our documentation on [driver session {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L10" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L22" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L16" >}} {{< /tab >}} {{< /tabpane >}} @@ -59,7 +59,7 @@ In this example we are [navigating]({{< ref "/documentation/webdriver/interactio {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L16" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L32" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L18" >}} {{< /tab >}} {{< /tabpane >}} @@ -85,7 +85,7 @@ can request, including window handles, browser size / position, cookies, alerts, {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L18" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L34" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L20" >}} {{< /tab >}} {{< /tabpane >}} @@ -119,7 +119,7 @@ Read more about [Waiting strategies]({{< ref "/documentation/webdriver/waits.md" {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L21" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L37" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L23" >}} {{< /tab >}} {{< /tabpane >}} @@ -144,7 +144,7 @@ with one without first [finding an element]({{< ref "/documentation/webdriver/el {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L23-L24" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L39-L40" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L25-L26" >}} {{< /tab >}} {{< /tabpane >}} @@ -169,7 +169,7 @@ but you will use them frequently. {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L26-L27" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L42-L43" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L28-L29" >}} {{< /tab >}} {{< /tabpane >}} @@ -193,7 +193,7 @@ Elements store a lot of [information that can be requested]({{< ref "/documentat {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L30" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L46" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L18" >}} {{< /tab >}} {{< /tabpane >}} @@ -219,7 +219,7 @@ No more commands can be sent to this driver instance. {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L13" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L27" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L35" >}} {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/getting_started/first_script.ja.md b/website_and_docs/content/documentation/webdriver/getting_started/first_script.ja.md index fb5494f98645..e803e2762619 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/first_script.ja.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/first_script.ja.md @@ -36,7 +36,7 @@ For more details on starting a session read our documentation on [driver sessio {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L10" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L22" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L16" >}} {{< /tab >}} {{< /tabpane >}} @@ -60,7 +60,7 @@ In this example we are ブラウザが[ナビゲート]({{< ref "/documentation/ {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L16" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L32" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L18" >}} {{< /tab >}} {{< /tabpane >}} @@ -86,7 +86,7 @@ can request, including window handles, browser size / position, cookies, alerts, {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L18" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L34" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L20" >}} {{< /tab >}} {{< /tabpane >}} @@ -120,7 +120,7 @@ Read more about [Waiting strategies]({{< ref "/documentation/webdriver/waits.md" {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L21" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L37" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L23" >}} {{< /tab >}} {{< /tabpane >}} @@ -145,7 +145,7 @@ with one without first [finding an element]({{< ref "/documentation/webdriver/el {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L23-L24" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L39-L40" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L25-L26" >}} {{< /tab >}} {{< /tabpane >}} @@ -170,7 +170,7 @@ but you will use them frequently. {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L26-L27" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L42-L43" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L28-L29" >}} {{< /tab >}} {{< /tabpane >}} @@ -194,7 +194,7 @@ Elements store a lot of [information that can be requested]({{< ref "/documentat {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L30" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L46" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L18" >}} {{< /tab >}} {{< /tabpane >}} @@ -220,7 +220,7 @@ No more commands can be sent to this driver instance. {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L13" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L27" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L35" >}} {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/getting_started/first_script.pt-br.md b/website_and_docs/content/documentation/webdriver/getting_started/first_script.pt-br.md index 0aa3395a557d..2a3a862f7530 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/first_script.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/first_script.pt-br.md @@ -34,7 +34,7 @@ Para ter mais detalhes sobre como iniciar uma sessão, leia nossa documentação {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L10" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L22" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L16" >}} {{< /tab >}} {{< /tabpane >}} @@ -58,7 +58,7 @@ Nesse exemplo estamos [navegando]({{< ref "/documentation/webdriver/interactions {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L16" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L32" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L18" >}} {{< /tab >}} {{< /tabpane >}} @@ -83,7 +83,7 @@ pode solicitar, incluindo window handles, tamanho / posição do navegador, cook {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L18" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L34" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L20" >}} {{< /tab >}} {{< /tabpane >}} @@ -118,7 +118,7 @@ Leia mais sobre [Estratégias de espera]({{< ref "/documentation/webdriver/waits {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L21" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L37" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L23" >}} {{< /tab >}} {{< /tabpane >}} @@ -144,7 +144,7 @@ com um sem o primeiro [encontrando um elemento]({{< ref "/documentation/webdrive {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L23-L24" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L39-L40" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L25-L26" >}} {{< /tab >}} {{< /tabpane >}} @@ -169,7 +169,7 @@ mas você irá usá-las com frequência. {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L26-L27" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L42-L43" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L28-L29" >}} {{< /tab >}} {{< /tabpane >}} @@ -193,7 +193,7 @@ Elementos podem guardar muitas [informações que podem ser solicitadas]({{< ref {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L30" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L46" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L18" >}} {{< /tab >}} {{< /tabpane >}} @@ -219,7 +219,7 @@ Nenhum outro comando pode ser enviado para esta instância do driver. {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L13" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L27" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L35" >}} {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/getting_started/first_script.zh-cn.md b/website_and_docs/content/documentation/webdriver/getting_started/first_script.zh-cn.md index 45f18d11f9cf..1e6019cabf6b 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/first_script.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/first_script.zh-cn.md @@ -38,7 +38,7 @@ Selenium所做的一切, {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L10" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L22" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L16" >}} {{< /tab >}} {{< /tabpane >}} @@ -65,7 +65,7 @@ Selenium所做的一切, {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L16" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L32" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L18" >}} {{< /tab >}} {{< /tabpane >}} @@ -91,7 +91,7 @@ Selenium所做的一切, {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L18" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L34" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L20" >}} {{< /tab >}} {{< /tabpane >}} @@ -130,7 +130,7 @@ Selenium所做的一切, {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L21" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L37" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L23" >}} {{< /tab >}} {{< /tabpane >}} @@ -156,7 +156,7 @@ Selenium所做的一切, {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L23-L24" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L39-L40" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L25-L26" >}} {{< /tab >}} {{< /tabpane >}} @@ -182,7 +182,7 @@ Selenium所做的一切, {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L26-L27" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L42-L43" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L28-L29" >}} {{< /tab >}} {{< /tabpane >}} @@ -206,7 +206,7 @@ Selenium所做的一切, {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L30" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L46" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L18" >}} {{< /tab >}} {{< /tabpane >}} @@ -233,7 +233,7 @@ Selenium所做的一切, {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L13" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L27" >}} +{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L35" >}} {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/getting_started/install_drivers.en.md b/website_and_docs/content/documentation/webdriver/getting_started/install_drivers.en.md index 4bc9aa88b69c..b5285e648ab6 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/install_drivers.en.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/install_drivers.en.md @@ -29,89 +29,34 @@ in our [driver configuration]({{< ref "/documentation/webdriver/drivers/" >}}) d {{< badge-version version="4.6" >}} -Selenium Manager helps you to get a working environment to run Selenium out of the box. Beta 1 -of Selenium Manager will configure the drivers for Chrome, Firefox, and Edge if they are not -found on the `PATH`. No extra configuration is needed. Future releases of Selenium Manager -will eventually even download browsers if necessary. - -Read more at the blog announcement for [Selenium Manager ](/blog/2022/introducing-selenium-manager/). +Selenium Manager helps you to get a working environment to run Selenium out of the box +(no additional downloads! no additional configurations!). +Selenium Manager attempts to obtain the most correct driver for any browser +supported by Selenium in a performant way. +Selenium Manager is currently "opt-in," which means +that it is only used if code would otherwise fail. +That means if you manage drivers by one of the approaches below, Selenium Manager +will not be used. ### 2. Driver Management Software -Most machines automatically update the browser, but the driver does not. To make sure you get -the correct driver for your browser, there are many third party libraries to assist you. - -{{< tabpane text=true langEqualsHeader=true >}} -{{% tab header="Java" %}} - -1. Import [WebDriverManager](https://github.com/bonigarcia/webdrivermanager) - -```java -import io.github.bonigarcia.wdm.WebDriverManager; -``` - -2. Call `setup()`: +Before Selenium Manager was created, many users turned to other projects to automatically +manage their drivers. Most of the functionality of these libraries exists natively in +the latest version of Selenium. -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/InstallDriversTest.java#L17-L19" >}} - -{{% /tab %}} -{{% tab header="Python" %}} - -1. Import [WebDriver Manager for Python](https://github.com/SergeyPirogov/webdriver_manager) - -```py -from webdriver_manager.chrome import ChromeDriverManager -``` +If you can't use Selenium Manager because you are using +an older version of Selenium (please upgrade), +or need an advanced feature not yet implemented by Selenium Manager, +you might try one of these tools: -2. Use `install()` to get the location used by the manager and pass it to the driver in a service class instance: - -{{< gh-codeblock path="examples/python/tests/getting_started/test_install_drivers.py#L15-L17" >}} - -{{% /tab %}} -{{% tab header="CSharp" %}} -**Important:** This package does not currently work for IEDriverServer v4+ - -1. Import [WebDriver Manager Package](https://github.com/rosolko/WebDriverManager.Net) - -```csharp -using WebDriverManager; -using WebDriverManager.DriverConfigs.Impl; -``` - -2. Use the `SetUpDriver()` which requires a config class: - -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/InstallDriversTest.cs#L19-L21" >}} - -{{% /tab %}} -{{% tab header="Ruby" %}} -1. Add [webdrivers gem](https://github.com/titusfortner/webdrivers) to Gemfile: - -```rb -gem 'webdrivers', '~> 5.0' -``` - -2. Require webdrivers in your project: - -{{< gh-codeblock path="examples/ruby/spec/getting_started/install_drivers_spec.rb#L7-L9" >}} - -{{% /tab %}} -{{% tab header="JavaScript" %}} - *There is not a recommended driver manager for JavaScript at this time* -{{% /tab %}} -{{% tab header="Kotlin" %}} - -1. Import [WebDriver Manager](https://github.com/bonigarcia/webdrivermanager) -```java -import io.github.bonigarcia.wdm.WebDriverManager; -``` -2. Call the setup method before initializing the driver as you normally would: - -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/InstallDriversTest.kt#L17-L18" >}} - -{{% /tab %}} -{{< /tabpane >}} +* [WebDriverManager](https://github.com/bonigarcia/webdrivermanager) (Java) +* [WebDriver Manager](https://github.com/SergeyPirogov/webdriver_manager) (Python) +* [WebDriver Manager Package](https://github.com/rosolko/WebDriverManager.Net) (.NET) +* [webdrivers gem](https://github.com/titusfortner/webdrivers) (Ruby) ### 3. The `PATH` Environment Variable +Note: we highly recommend removing drivers from `PATH` and using [Selenium Manager](#1-selenium-manager--beta-) if possible. + This option first requires manually downloading the driver (See [Quick Reference Section](#quick-reference) for links). This is a flexible option to change location of drivers without having to update your code, and will work @@ -132,9 +77,9 @@ you can add a new directory to PATH: echo 'export PATH=$PATH:/path/to/driver' >> ~/.bash_profile source ~/.bash_profile ``` -You can test if it has been added correctly by starting the driver: +You can test if it has been added correctly by checking the version of the driver: ```shell -chromedriver +chromedriver --version ``` {{% /tab %}} {{% tab header="Zsh" %}} @@ -148,9 +93,9 @@ you can add a new directory to PATH: echo 'export PATH=$PATH:/path/to/driver' >> ~/.zshenv source ~/.zshenv ``` -You can test if it has been added correctly by starting the driver: +You can test if it has been added correctly by checking the version of the driver: ```shell -chromedriver +chromedriver --version ``` {{% /tab %}} {{% tab header="Windows" %}} @@ -163,26 +108,31 @@ you can add a new directory to PATH: ```shell setx PATH "%PATH%;C:\WebDriver\bin" ``` -You can test if it has been added correctly by starting the driver: +You can test if it has been added correctly by checking the version of the driver: ```shell -chromedriver.exe +chromedriver.exe --version ``` {{% /tab %}} {{< /tabpane >}} If your `PATH` is configured correctly above, -you will see some output relating to the startup of the driver: +you will see the version printed like: -``` -Starting ChromeDriver 95.0.4638.54 (d31a821ec901f68d0d34ccdbaea45b4c86ce543e-refs/branch-heads/4638@{#871}) on port 9515 -Only local connections are allowed. -Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. -ChromeDriver was started successfully. +```shell +ChromeDriver 111.0.5563.64 (c710e93d5b63b7095afe8c2c17df34408078439d-refs/branch-heads/5563@{#995}) ``` -You can regain control of your command prompt by pressing Ctrl+C +If it is not found, you'll see: +```shell +chromedriver.exe : The term 'chromedriver.exe' is not recognized as the name of a cmdlet, function, script file, or operable program +``` +or +```shell +chromedriver: command not found +``` ### 4. Hard Coded Location +Note: we highly recommend not directly referencing the drivers and using [Selenium Manager](#1-selenium-manager--beta-) if possible. Similar to Option 3 above, you need to manually download the driver (See [Quick Reference Section](#quick-reference) for links). Specifying the location in the code itself has the advantage of not needing to figure out Environment Variables on diff --git a/website_and_docs/content/documentation/webdriver/getting_started/install_drivers.ja.md b/website_and_docs/content/documentation/webdriver/getting_started/install_drivers.ja.md index 665bdde1f054..86c267e67263 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/install_drivers.ja.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/install_drivers.ja.md @@ -38,97 +38,34 @@ in our [driver configuration]({{< ref "/documentation/webdriver/drivers/" >}}) d {{< badge-version version="4.6" >}} -Selenium Manager helps you to get a working environment to run Selenium out of the box. Beta 1 -of Selenium Manager will configure the drivers for Chrome, Firefox, and Edge if they are not -found on the `PATH`. No extra configuration is needed. Future releases of Selenium Manager -will eventually even download browsers if necessary. - -Read more at the blog announcement for [Selenium Manager ](/blog/2022/introducing-selenium-manager/). +Selenium Manager helps you to get a working environment to run Selenium out of the box +(no additional downloads! no additional configurations!). +Selenium Manager attempts to obtain the most correct driver for any browser +supported by Selenium in a performant way. +Selenium Manager is currently "opt-in," which means +that it is only used if code would otherwise fail. +That means if you manage drivers by one of the approaches below, Selenium Manager +will not be used. ### 2. ドライバー管理ソフトウェア -ほとんどのマシンはブラウザを自動的に更新しますが、ドライバは更新しません。 -ブラウザに適切なドライバを確実に入手するために、多くのサードパーティライブラリが役立ちます。 - -{{< tabpane text=true langEqualsHeader=true >}} -{{% tab header="Java" %}} -**Important:** This package does not currently work for IEDriverServer v4+ - -1. Import [WebDriverManager](https://github.com/bonigarcia/webdrivermanager) -```java -import io.github.bonigarcia.wdm.WebDriverManager; -``` -2. Call `setup()`: - -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/InstallDriversTest.java#L17-L19" >}} - -{{% /tab %}} -{{% tab header="Python" %}} - -1. Import [WebDriver Manager for Python](https://github.com/SergeyPirogov/webdriver_manager) - -```py -from webdriver_manager.chrome import ChromeDriverManager -``` - -2. Use `install()` to get the location used by the manager and pass it to the driver in a service class instance: - -{{< gh-codeblock path="examples/python/tests/getting_started/test_install_drivers.py#L15-L17" >}} - -{{% /tab %}} -{{% tab header="CSharp" %}} -1. Import [WebDriver Manager Package](https://github.com/rosolko/WebDriverManager.Net) - -```csharp -using WebDriverManager; -using WebDriverManager.DriverConfigs.Impl; -``` - -2. Use the `SetUpDriver()` which requires a config class: - -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/InstallDriversTest.cs#L19-L21" >}} - -{{% /tab %}} -{{% tab header="Ruby" %}} -1. Add [webdrivers gem](https://github.com/titusfortner/webdrivers) to Gemfile: - -```rb -gem 'webdrivers', '~> 5.0' -``` - -2. Require webdrivers in your project: -```rb -require 'webdrivers' -``` +Before Selenium Manager was created, many users turned to other projects to automatically +manage their drivers. Most of the functionality of these libraries exists natively in +the latest version of Selenium. -3. Initialize driver as you normally would: -```rb -driver = Selenium::WebDriver.for :chrome -``` +If you can't use Selenium Manager because you are using +an older version of Selenium (please upgrade), +or need an advanced feature not yet implemented by Selenium Manager, +you might try one of these tools: - - -{{% /tab %}} -{{% tab header="JavaScript" %}} - *There is not a recommended driver manager for JavaScript at this time* -{{% /tab %}} -{{% tab header="Kotlin" %}} - -1. Import [WebDriver Manager](https://github.com/bonigarcia/webdrivermanager) -```java -import io.github.bonigarcia.wdm.WebDriverManager; -``` -2. Call the setup method before initializing the driver as you normally would: - -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/InstallDriversTest.kt#L17-L18" >}} - -{{% /tab %}} -{{< /tabpane >}} +* [WebDriverManager](https://github.com/bonigarcia/webdrivermanager) (Java) +* [WebDriver Manager](https://github.com/SergeyPirogov/webdriver_manager) (Python) +* [WebDriver Manager Package](https://github.com/rosolko/WebDriverManager.Net) (.NET) +* [webdrivers gem](https://github.com/titusfortner/webdrivers) (Ruby) ### 3. `PATH` 環境変数 +Note: we highly recommend removing drivers from `PATH` and using [Selenium Manager](#1-selenium-manager--beta-) if possible. + このオプションでは、最初に手動でドライバーをダウンロードする必要があります (リンクについては[クイックリファレンス](#クイックリファレンス)を参照してください)。 @@ -150,9 +87,9 @@ you can add a new directory to PATH: echo 'export PATH=$PATH:/path/to/driver' >> ~/.bash_profile source ~/.bash_profile ``` -* ドライバを起動することで、正しく追加されているかどうかをテストできます。 +* You can test if it has been added correctly by checking the version of the driver: ```shell -chromedriver +chromedriver --version ``` {{% /tab %}} {{% tab header="Zsh" %}} @@ -166,9 +103,9 @@ you can add a new directory to PATH: echo 'export PATH=$PATH:/path/to/driver' >> ~/.zshenv source ~/.zshenv ``` -* ドライバを起動することで、正しく追加されているかどうかをテストできます。 +* You can test if it has been added correctly by checking the version of the driver: ```shell -chromedriver +chromedriver --version ``` {{% /tab %}} {{% tab header="Windows" %}} @@ -181,28 +118,28 @@ you can add a new directory to PATH: ```shell setx PATH "%PATH%;C:\WebDriver\bin" ``` -* ドライバを起動することで、正しく追加されているかどうかをテストできます。 +* You can test if it has been added correctly by checking the version of the driver: ```shell -chromedriver.exe +chromedriver.exe --version ``` {{% /tab %}} {{< /tabpane >}}
-* If your `PATH` is configured correctly, -* `PATH` が正しく構成されている場合、ドライバーの起動に関連する出力が表示されます。 +* If your `PATH` is configured correctly, you will see the version printed like: -``` -Starting ChromeDriver 95.0.4638.54 (d31a821ec901f68d0d34ccdbaea45b4c86ce543e-refs/branch-heads/4638@{#871}) on port 9515 -Only local connections are allowed. -Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. -ChromeDriver was started successfully. +```shell +ChromeDriver 111.0.5563.64 (c710e93d5b63b7095afe8c2c17df34408078439d-refs/branch-heads/5563@{#995}) ``` - Ctrl+C を押して、コマンドプロンプトの制御を取り戻すことができます。 +If it is not found, you'll see: +```shell +chromedriver.exe : The term 'chromedriver.exe' is not recognized as the name of a cmdlet, function, script file, or operable program +``` ### 4. ハードコードされた場所 +Note: we highly recommend not directly referencing the drivers and using [Selenium Manager](#1-selenium-manager--beta-) if possible. 上記のオプション3と同様に、ドライバーを手動でダウンロードする必要があります。 (リンクについては [クイックリファレンス](#クイックリファレンス) を参照してください)。 diff --git a/website_and_docs/content/documentation/webdriver/getting_started/install_drivers.pt-br.md b/website_and_docs/content/documentation/webdriver/getting_started/install_drivers.pt-br.md index ea2c5f536ca7..abbd08c25222 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/install_drivers.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/install_drivers.pt-br.md @@ -30,99 +30,35 @@ Leia mais sobre opções avançadas para iniciar um driver {{< badge-version version="4.6" >}} -O Gerenciador Selenium te ajuda a ter um ambiente de desenvolvimento rodando Selenium mais facilmente. -O primeiro Beta irá configurar os drivers para Chrome, Firefox e Edge se eles não forem -encontrados no `PATH`. Nem uma configuração extra será necessária. Versões futuras do Gerenciador Selenium -irão eventualmente poder realizar o download dos browsers se necessário. - -Leia mais no anúncio feito no blog sobre o [Gerenciador Selenium](/blog/2022/introducing-selenium-manager/). +Selenium Manager helps you to get a working environment to run Selenium out of the box +(no additional downloads! no additional configurations!). +Selenium Manager attempts to obtain the most correct driver for any browser +supported by Selenium in a performant way. +Selenium Manager is currently "opt-in," which means +that it is only used if code would otherwise fail. +That means if you manage drivers by one of the approaches below, Selenium Manager +will not be used. ### 2. Software de gerenciamento de Driver -A maioria das máquinas atualiza automaticamente o navegador, mas não o driver. Para certificar de obter -o driver correto para o seu navegador de internet, existem diversas bibliotecas de terceiros para auxiliá-lo. - -**Importante:** Este módulo de momento não funciona com IEDriverServer v4+ - -{{< tabpane text=true langEqualsHeader=true >}} -{{% tab header="Java" %}} - -1. Importe o [WebDriverManager](https://github.com/bonigarcia/webdrivermanager) -```java -import io.github.bonigarcia.wdm.WebDriverManager; -``` -2. Invocar o `setup()`: - -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/InstallDriversTest.java#L17-L19" >}} - -{{% /tab %}} -{{% tab header="Python" %}} - -1. Importe o [Gerenciador de WebDriver para Python](https://github.com/SergeyPirogov/webdriver_manager) - -```py -from webdriver_manager.chrome import ChromeDriverManager -``` - -2. Use o `install()` para obter a localização usada pelo gerenciador WebDriver e passá-la para a classe de serviço - -{{< gh-codeblock path="examples/python/tests/getting_started/test_install_drivers.py#L15-L17" >}} - -{{% /tab %}} -{{% tab header="CSharp" %}} -1. Importe o [Pacote Gerenciador do WebDriver](https://github.com/rosolko/WebDriverManager.Net) - -```csharp -using WebDriverManager; -using WebDriverManager.DriverConfigs.Impl; -``` - -2. Use o `SetUpDriver()` que requer uma classe de configuração: - -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/InstallDriversTest.cs#L19-L21" >}} - -{{% /tab %}} -{{% tab header="Ruby" %}} -1. Add [webdrivers gem](https://github.com/titusfortner/webdrivers) to Gemfile: - -```rb -gem 'webdrivers', '~> 5.0' -``` - -2. Requer webdrivers no seu projeto: -```rb -require 'webdrivers' -``` - -3. Inicialize o seu driver como você normalmente faria: -```rb -driver = Selenium::WebDriver.for :chrome -``` - - - -{{% /tab %}} -{{% tab header="JavaScript" %}} -*Não há um gerenciador de driver recomendado para o JavaScript no momento* -{{% /tab %}} -{{% tab header="Kotlin" %}} - -1. Importe o [Gerenciador de WebDriver](https://github.com/bonigarcia/webdrivermanager) -```java -import io.github.bonigarcia.wdm.WebDriverManager; -``` -2. Invoque o método de configuração antes de inicializar o driver como faria normalmente: +Before Selenium Manager was created, many users turned to other projects to automatically +manage their drivers. Most of the functionality of these libraries exists natively in +the latest version of Selenium. -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/InstallDriversTest.kt#L17-L18" >}} +If you can't use Selenium Manager because you are using +an older version of Selenium (please upgrade), +or need an advanced feature not yet implemented by Selenium Manager, +you might try one of these tools: -{{% /tab %}} -{{< /tabpane >}} +* [WebDriverManager](https://github.com/bonigarcia/webdrivermanager) (Java) +* [WebDriver Manager](https://github.com/SergeyPirogov/webdriver_manager) (Python) +* [WebDriver Manager Package](https://github.com/rosolko/WebDriverManager.Net) (.NET) +* [webdrivers gem](https://github.com/titusfortner/webdrivers) (Ruby) ### 3. A variável de ambiente `PATH` +Note: we highly recommend removing drivers from `PATH` and using [Selenium Manager](#1-selenium-manager--beta-) if possible. + Esta opção requer primeiro o download manual do driver (Vejá a [sessão de Consulta de referencia rápida](#quick-reference) para links). Esta é uma opção flexível para alterar a localização dos drivers sem precisar atualizar seu código e funcionará @@ -144,9 +80,9 @@ você pode adicionar um novo diretório ao PATH: echo 'export PATH=$PATH:/path/to/driver' >> ~/.bash_profile source ~/.bash_profile ``` -Você pode testar se foi adicionado corretamente iniciando o driver: +You can test if it has been added correctly by checking the version of the driver: ```shell -chromedriver +chromedriver --version ``` {{% /tab %}} {{% tab header="Zsh" %}} @@ -160,9 +96,9 @@ você pode adicionar um novo diretório ao PATH: echo 'export PATH=$PATH:/path/to/driver' >> ~/.zshenv source ~/.zshenv ``` -Você pode testar se foi adicionado corretamente iniciando o driver: +You can test if it has been added correctly by checking the version of the driver: ```shell -chromedriver +chromedriver --version ``` {{% /tab %}} {{% tab header="Windows" %}} @@ -175,26 +111,27 @@ você pode adicionar um novo diretório ao PATH: ```shell setx PATH "%PATH%;C:\WebDriver\bin" ``` -Você pode testar se foi adicionado corretamente iniciando o driver: +You can test if it has been added correctly by checking the version of the driver: ```shell -chromedriver.exe +chromedriver.exe --version ``` {{% /tab %}} {{< /tabpane >}} Se o seu `PATH` estiver configurado corretamente como acima, -você verá algumas saídas relacionadas à inicialização do driver: +you will see the version printed like: -``` -Starting ChromeDriver 95.0.4638.54 (d31a821ec901f68d0d34ccdbaea45b4c86ce543e-refs/branch-heads/4638@{#871}) on port 9515 -Only local connections are allowed. -Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. -ChromeDriver was started successfully. +```shell +ChromeDriver 111.0.5563.64 (c710e93d5b63b7095afe8c2c17df34408078439d-refs/branch-heads/5563@{#995}) ``` -Você pode recuperar o controle do seu prompt de comando pressionando Ctrl+C +If it is not found, you'll see: +```shell +chromedriver.exe : The term 'chromedriver.exe' is not recognized as the name of a cmdlet, function, script file, or operable program +``` ### 4. Localização definida no código +Note: we highly recommend not directly referencing the drivers and using [Selenium Manager](#1-selenium-manager--beta-) if possible. Semelhante à opção 3 acima, você precisará baixar manualmente o driver (Vejá a [sessão de Consulta de referencia rápida](#quick-reference) para links). Especificar a localização no próprio código tem a vantagem de você não precisar se preocupar em descobrir variáveis de ambiente no diff --git a/website_and_docs/content/documentation/webdriver/getting_started/install_drivers.zh-cn.md b/website_and_docs/content/documentation/webdriver/getting_started/install_drivers.zh-cn.md index a6002830726d..1e06c4e7f700 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/install_drivers.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/install_drivers.zh-cn.md @@ -40,98 +40,34 @@ WebDriver尽量使用浏览器内置的自动化支持 {{< badge-version version="4.6" >}} -Selenium Manager可以帮助你获得一个运行Selenium的开箱即用的环境。 -如果在`PATH`中没有找到Chrome、Firefox和Edge的驱动,Selenium Manager的Beta 1版将为它们配置。 -不需要额外的配置。如果有必要,Selenium Manager的未来版本也会在必要时一同下载浏览器。 - -在这篇[公告](/blog/2022/introducing-selenium-manager/)中了解更多有关 Selenium Manager 的信息。 +Selenium Manager helps you to get a working environment to run Selenium out of the box +(no additional downloads! no additional configurations!). +Selenium Manager attempts to obtain the most correct driver for any browser +supported by Selenium in a performant way. +Selenium Manager is currently "opt-in," which means +that it is only used if code would otherwise fail. +That means if you manage drivers by one of the approaches below, Selenium Manager +will not be used. ### 2. 驱动管理软件 -大多数机器会自动更新浏览器, -但不会自动更新驱动程序. -为了确保为浏览器提供正确的驱动程序, -这里有许多第三方库可为您提供帮助. - -{{< tabpane text=true langEqualsHeader=true >}} -{{% tab header="Java" %}} -**注意:** 这个软件包目前不能用于IEDriverServer v4以上的版本。 - -1. 导入 [WebDriverManager](https://github.com/bonigarcia/webdrivermanager) -```java -import io.github.bonigarcia.wdm.WebDriverManager; -``` -2. 调用 `setup()`: - -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/InstallDriversTest.java#L17-L19" >}} - -{{% /tab %}} -{{% tab header="Python" %}} - -1. 导入 [WebDriver Manager for Python](https://github.com/SergeyPirogov/webdriver_manager) - -```py -from webdriver_manager.chrome import ChromeDriverManager -``` - -2. 使用 `install()` 获取管理器使用的位置, 并将其传递到服务类中 - -{{< gh-codeblock path="examples/python/tests/getting_started/test_install_drivers.py#L15-L17" >}} - -{{% /tab %}} -{{% tab header="CSharp" %}} -1. 导入 [WebDriver Manager Package](https://github.com/rosolko/WebDriverManager.Net) - -```csharp -using WebDriverManager; -using WebDriverManager.DriverConfigs.Impl; -``` - -2. 使用 `SetUpDriver()` 时需要一个配置类: +Before Selenium Manager was created, many users turned to other projects to automatically +manage their drivers. Most of the functionality of these libraries exists natively in +the latest version of Selenium. -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/InstallDriversTest.cs#L19-L21" >}} +If you can't use Selenium Manager because you are using +an older version of Selenium (please upgrade), +or need an advanced feature not yet implemented by Selenium Manager, +you might try one of these tools: -{{% /tab %}} -{{% tab header="Ruby" %}} -1. 增加 [webdrivers gem](https://github.com/titusfortner/webdrivers) 到 Gemfile: - -```rb -gem 'webdrivers', '~> 5.0' -``` - -2. 在程序中Require webdrivers: -```rb -require 'webdrivers' -``` - -3. 像往常一样初始化驱动程序: -```rb -driver = Selenium::WebDriver.for :chrome -``` - - - -{{% /tab %}} -{{% tab header="JavaScript" %}} - *暂时还没有推荐的JavaScript驱动管理器* -{{% /tab %}} -{{% tab header="Kotlin" %}} - -1. 导入 [WebDriver Manager](https://github.com/bonigarcia/webdrivermanager) -```java -import io.github.bonigarcia.wdm.WebDriverManager; -``` -2. 在初始化驱动程序之前调用setup方法: - -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/InstallDriversTest.kt#L17-L18" >}} - -{{% /tab %}} -{{< /tabpane >}} +* [WebDriverManager](https://github.com/bonigarcia/webdrivermanager) (Java) +* [WebDriver Manager](https://github.com/SergeyPirogov/webdriver_manager) (Python) +* [WebDriver Manager Package](https://github.com/rosolko/WebDriverManager.Net) (.NET) +* [webdrivers gem](https://github.com/titusfortner/webdrivers) (Ruby) ### 3. `PATH` 环境变量 +Note: we highly recommend removing drivers from `PATH` and using [Selenium Manager](#1-selenium-manager--beta-) if possible. + 此选项首先需要手动下载驱动程序 (有关链接, 请参阅[快速参考](#快速参考) 部分). @@ -159,9 +95,9 @@ echo $PATH echo 'export PATH=$PATH:/path/to/driver' >> ~/.bash_profile source ~/.bash_profile ``` -您可以通过启动驱动程序来测试其是否被正确添加: +You can test if it has been added correctly by checking the version of the driver: ```shell -chromedriver +chromedriver --version ``` {{% /tab %}} {{% tab header="Zsh" %}} @@ -175,9 +111,9 @@ echo $PATH echo 'export PATH=$PATH:/path/to/driver' >> ~/.zshenv source ~/.zshenv ``` -您可以通过启动驱动程序来测试其是否被正确添加: +You can test if it has been added correctly by checking the version of the driver: ```shell -chromedriver +chromedriver --version ``` {{% /tab %}} {{% tab header="Windows" %}} @@ -191,26 +127,27 @@ echo %PATH% ```shell setx PATH "%PATH%;C:\WebDriver\bin" ``` -您可以通过启动驱动程序来测试其是否被正确添加: +You can test if it has been added correctly by checking the version of the driver: ```shell -chromedriver.exe +chromedriver.exe --version ``` {{% /tab %}} {{< /tabpane >}} -如果`PATH`配置正确, - 您将看到一些与驱动程序启动相关的输出: +如果`PATH`配置正确, +you will see the version printed like: -``` -Starting ChromeDriver 95.0.4638.54 (d31a821ec901f68d0d34ccdbaea45b4c86ce543e-refs/branch-heads/4638@{#871}) on port 9515 -Only local connections are allowed. -Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. -ChromeDriver was started successfully. +```shell +ChromeDriver 111.0.5563.64 (c710e93d5b63b7095afe8c2c17df34408078439d-refs/branch-heads/5563@{#995}) ``` -想要重新控制命令提示符可以按下 Ctrl+C +If it is not found, you'll see: +```shell +chromedriver.exe : The term 'chromedriver.exe' is not recognized as the name of a cmdlet, function, script file, or operable program +``` ### 4. 硬编码位置 +Note: we highly recommend not directly referencing the drivers and using [Selenium Manager](#1-selenium-manager--beta-) if possible. 与上面的选项3类似, 您需要手动下载驱动程序(有关链接, 请参阅[快速参考](#快速参考) 部分).