diff --git a/.github/workflows/dotnet-examples.yml b/.github/workflows/dotnet-examples.yml index 3eb7d8899f78..440c52856b7e 100644 --- a/.github/workflows/dotnet-examples.yml +++ b/.github/workflows/dotnet-examples.yml @@ -19,7 +19,6 @@ env: DISPLAY: :99 GITHUB_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }} GH_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }} - EDGE_PATH: "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe" jobs: test_examples: @@ -48,7 +47,7 @@ jobs: browser: firefox version: latest - name: Run tests - uses: nick-invision/retry@v2.7.1 + uses: nick-invision/retry@v2.8.2 with: timeout_minutes: 20 max_attempts: 3 diff --git a/.github/workflows/java-examples.yml b/.github/workflows/java-examples.yml index 88b40f74a5d2..270eb58491b8 100644 --- a/.github/workflows/java-examples.yml +++ b/.github/workflows/java-examples.yml @@ -19,7 +19,6 @@ env: DISPLAY: :99 GITHUB_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }} GH_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }} - EDGE_PATH: "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe" jobs: test_examples: @@ -49,7 +48,7 @@ jobs: browser: firefox version: latest - name: Run Tests - uses: nick-invision/retry@v2.7.1 + uses: nick-invision/retry@v2.8.2 with: timeout_minutes: 20 max_attempts: 3 diff --git a/.github/workflows/js-examples.yml b/.github/workflows/js-examples.yml index 1a2ec62e6612..972bbdf536ff 100644 --- a/.github/workflows/js-examples.yml +++ b/.github/workflows/js-examples.yml @@ -19,7 +19,6 @@ env: DISPLAY: :99 GITHUB_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }} GH_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }} - EDGE_PATH: "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe" jobs: test_examples: @@ -43,14 +42,16 @@ jobs: with: browser: firefox version: latest + - name: Install Requirements + working-directory: ./examples/javascript + run: npm install - name: Run tests - uses: nick-invision/retry@v2.7.1 env: SELENIUM_BROWSER: chrome + uses: nick-invision/retry@v2.8.2 with: timeout_minutes: 20 max_attempts: 3 command: | cd examples/javascript - npm install npm test diff --git a/.github/workflows/kotlin-examples.yml b/.github/workflows/kotlin-examples.yml index 9da5398ddfc6..fae9e27d2eec 100644 --- a/.github/workflows/kotlin-examples.yml +++ b/.github/workflows/kotlin-examples.yml @@ -19,7 +19,6 @@ env: DISPLAY: :99 GITHUB_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }} GH_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }} - EDGE_PATH: "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe" jobs: test_examples: @@ -49,7 +48,7 @@ jobs: browser: firefox version: latest - name: Run tests - uses: nick-invision/retry@v2.7.1 + uses: nick-invision/retry@v2.8.2 with: timeout_minutes: 20 max_attempts: 3 diff --git a/.github/workflows/python-examples.yml b/.github/workflows/python-examples.yml index b998cd2a0a33..a7b7e61fdc02 100644 --- a/.github/workflows/python-examples.yml +++ b/.github/workflows/python-examples.yml @@ -19,7 +19,6 @@ env: DISPLAY: :99 GITHUB_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }} GH_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }} - EDGE_PATH: "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe" jobs: test_examples: @@ -43,12 +42,20 @@ jobs: with: browser: firefox version: latest + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Install dependencies + working-directory: ./examples/python + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt - name: Run tests - uses: nick-invision/retry@v2.7.1 + uses: nick-invision/retry@v2.8.2 with: timeout_minutes: 20 max_attempts: 3 command: | cd examples/python - pip3 install -r requirements.txt pytest diff --git a/.github/workflows/ruby-examples.yml b/.github/workflows/ruby-examples.yml index 1abccab5fcab..24c62a32da53 100644 --- a/.github/workflows/ruby-examples.yml +++ b/.github/workflows/ruby-examples.yml @@ -19,7 +19,6 @@ env: DISPLAY: :99 GITHUB_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }} GH_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }} - EDGE_PATH: "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe" jobs: test_examples: @@ -29,31 +28,33 @@ jobs: os: [ ubuntu-latest, windows-latest, macos-latest ] runs-on: ${{ matrix.os }} steps: - - name: Checkout GitHub repo - uses: actions/checkout@v2 - - name: Start Xvfb - if: matrix.os == 'ubuntu-latest' - run: Xvfb :99 & - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7 - bundler-cache: true - - name: Install Chrome - uses: browser-actions/setup-chrome@latest - - name: Install Edge - uses: browser-actions/setup-edge@latest - - name: Install Firefox - uses: abhi1693/setup-browser@v0.3.4 - with: - browser: firefox - version: latest - - name: Run tests - uses: nick-invision/retry@v2.7.1 - with: - timeout_minutes: 20 - max_attempts: 3 - command: | - cd examples/ruby - bundle install - bundle exec rspec + - name: Checkout GitHub repo + uses: actions/checkout@v2 + - name: Start Xvfb + if: matrix.os == 'ubuntu-latest' + run: Xvfb :99 & + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true + - name: Install Chrome + uses: browser-actions/setup-chrome@latest + - name: Install Edge + uses: browser-actions/setup-edge@latest + - name: Install Firefox + uses: abhi1693/setup-browser@v0.3.4 + with: + browser: firefox + version: latest + - name: Install Gems + working-directory: ./examples/ruby + run: bundle install + - name: Run tests + uses: nick-invision/retry@v2.8.2 + with: + timeout_minutes: 20 + max_attempts: 3 + command: | + cd examples/ruby + bundle exec rspec diff --git a/examples/dotnet/SeleniumDocs/ActionsAPI/ActionsTest.cs b/examples/dotnet/SeleniumDocs/ActionsAPI/ActionsTest.cs index 33f6a1bc27e0..7e09199ea787 100644 --- a/examples/dotnet/SeleniumDocs/ActionsAPI/ActionsTest.cs +++ b/examples/dotnet/SeleniumDocs/ActionsAPI/ActionsTest.cs @@ -6,7 +6,7 @@ namespace SeleniumDocs.ActionsAPI { [TestClass] - public class ActionsTest : BaseTest + public class ActionsTest : BaseChromeTest { [TestMethod] public void Pause() diff --git a/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs b/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs index fc71810c9cb8..fabfe32844a0 100644 --- a/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs +++ b/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs @@ -6,7 +6,7 @@ namespace SeleniumDocs.ActionsAPI { [TestClass] - public class KeysTest : BaseTest + public class KeysTest : BaseFirefoxTest { [TestMethod] public void KeyDown() diff --git a/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs b/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs index a9f554dd4f79..0f891e7333d7 100644 --- a/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs +++ b/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs @@ -7,7 +7,7 @@ namespace SeleniumDocs.ActionsAPI { [TestClass] - public class MouseTest : BaseTest + public class MouseTest : BaseChromeTest { [TestMethod] public void ClickAndHold() diff --git a/examples/dotnet/SeleniumDocs/ActionsAPI/PenTest.cs b/examples/dotnet/SeleniumDocs/ActionsAPI/PenTest.cs index 25e8dcf872f2..9543dcc71c31 100644 --- a/examples/dotnet/SeleniumDocs/ActionsAPI/PenTest.cs +++ b/examples/dotnet/SeleniumDocs/ActionsAPI/PenTest.cs @@ -9,7 +9,7 @@ namespace SeleniumDocs.ActionsAPI { [TestClass] - public class PenTest : BaseTest + public class PenTest : BaseChromeTest { [TestMethod] public void UsePen() @@ -35,25 +35,25 @@ public void UsePen() Point location = pointerArea.Location; Size size = pointerArea.Size; - int centerX = (int) Math.Floor((decimal) location.X + size.Width / 2); - int centerY = (int) Math.Floor((decimal) location.Y + size.Height / 2); + decimal centerX = location.X + size.Width / 2; + decimal centerY = location.Y + size.Height / 2; Assert.AreEqual("-1", moveTo["button"]); Assert.AreEqual("pen", moveTo["pointerType"]); - Assert.AreEqual((centerX).ToString(), moveTo["pageX"]); - Assert.AreEqual((centerY - 1).ToString(), moveTo["pageY"]); + Assert.IsTrue(VerifyEquivalent(centerX, moveTo["pageX"])); + Assert.IsTrue(VerifyEquivalent(centerY, moveTo["pageY"])); Assert.AreEqual("0", down["button"]); Assert.AreEqual("pen", down["pointerType"]); - Assert.AreEqual((centerX).ToString(), down["pageX"]); - Assert.AreEqual((centerY - 1).ToString(), down["pageY"]); + Assert.IsTrue(VerifyEquivalent(centerX, down["pageX"])); + Assert.IsTrue(VerifyEquivalent(centerY, down["pageY"])); Assert.AreEqual("-1", moveBy["button"]); Assert.AreEqual("pen", moveBy["pointerType"]); - Assert.AreEqual((centerX + 2).ToString(), moveBy["pageX"]); - Assert.AreEqual((centerY + 1).ToString(), moveBy["pageY"]); + Assert.IsTrue(VerifyEquivalent(centerX + 2, moveBy["pageX"])); + Assert.IsTrue(VerifyEquivalent(centerY + 2, moveBy["pageY"])); Assert.AreEqual("0", up["button"]); Assert.AreEqual("pen", up["pointerType"]); - Assert.AreEqual((centerX + 2).ToString(), up["pageX"]); - Assert.AreEqual((centerY + 1).ToString(), up["pageY"]); + Assert.IsTrue(VerifyEquivalent(centerX + 2, up["pageX"])); + Assert.IsTrue(VerifyEquivalent(centerY + 2, up["pageY"])); } [TestMethod] @@ -84,28 +84,28 @@ public void SetPointerEventProperties() Point location = pointerArea.Location; Size size = pointerArea.Size; - int centerX = location.X + size.Width / 2; - int centerY = location.Y + size.Height / 2; + decimal centerX = location.X + size.Width / 2; + decimal centerY = location.Y + size.Height / 2; Assert.AreEqual("-1", moveTo["button"]); Assert.AreEqual("pen", moveTo["pointerType"]); - Assert.AreEqual((centerX).ToString(), moveTo["pageX"]); - Assert.AreEqual((centerY - 1).ToString(), moveTo["pageY"]); + Assert.IsTrue(VerifyEquivalent(centerX, moveTo["pageX"])); + Assert.IsTrue(VerifyEquivalent(centerY, moveTo["pageY"])); Assert.AreEqual("0", down["button"]); Assert.AreEqual("pen", down["pointerType"]); - Assert.AreEqual((centerX).ToString(), down["pageX"]); - Assert.AreEqual((centerY - 1).ToString(), down["pageY"]); + Assert.IsTrue(VerifyEquivalent(centerX, down["pageX"])); + Assert.IsTrue(VerifyEquivalent(centerY, down["pageY"])); Assert.AreEqual("-1", moveBy["button"]); Assert.AreEqual("pen", moveBy["pointerType"]); - Assert.AreEqual((centerX + 2).ToString(), moveBy["pageX"]); - Assert.AreEqual((centerY + 1).ToString(), moveBy["pageY"]); + Assert.IsTrue(VerifyEquivalent(centerX + 2, moveBy["pageX"])); + Assert.IsTrue(VerifyEquivalent(centerY + 2, moveBy["pageY"])); Assert.AreEqual((-72).ToString(), moveBy["tiltX"]); Assert.AreEqual((9).ToString(), moveBy["tiltY"]); Assert.AreEqual((86).ToString(), moveBy["twist"]); Assert.AreEqual("0", up["button"]); Assert.AreEqual("pen", up["pointerType"]); - Assert.AreEqual((centerX + 2).ToString(), up["pageX"]); - Assert.AreEqual((centerY + 1).ToString(), up["pageY"]); + Assert.IsTrue(VerifyEquivalent(centerX + 2, up["pageX"])); + Assert.IsTrue(VerifyEquivalent(centerY + 2, up["pageY"])); } private Dictionary getProperties(IWebElement element) @@ -115,5 +115,16 @@ private Dictionary getProperties(IWebElement element) IEnumerable keyValue = str.Split(", ").Select(part => part.Split(":")); return keyValue.ToDictionary(split => split[0].Trim(), split => split[1].Trim()); } + + private bool VerifyEquivalent(decimal expected, string actual) + { + var absolute = Math.Abs(expected - decimal.Parse(actual)); + if (absolute <= 1) + { + return true; + } + + throw new Exception("Expected: " + expected + "; but received: " + actual); + } } } \ No newline at end of file diff --git a/examples/dotnet/SeleniumDocs/ActionsAPI/WheelTest.cs b/examples/dotnet/SeleniumDocs/ActionsAPI/WheelTest.cs index 86e5ad934335..f5532c9269cc 100644 --- a/examples/dotnet/SeleniumDocs/ActionsAPI/WheelTest.cs +++ b/examples/dotnet/SeleniumDocs/ActionsAPI/WheelTest.cs @@ -6,7 +6,7 @@ namespace SeleniumDocs.ActionsAPI { [TestClass] - public class WheelTest : BaseTest + public class WheelTest : BaseChromeTest { [TestMethod] public void ShouldAllowScrollingToAnElement() diff --git a/examples/dotnet/SeleniumDocs/BaseChromeTest.cs b/examples/dotnet/SeleniumDocs/BaseChromeTest.cs new file mode 100644 index 000000000000..6b5695d8c47f --- /dev/null +++ b/examples/dotnet/SeleniumDocs/BaseChromeTest.cs @@ -0,0 +1,14 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using OpenQA.Selenium.Chrome; + +namespace SeleniumDocs +{ + public class BaseChromeTest : BaseTest + { + [TestInitialize] + public void CreateDriver() + { + driver = new ChromeDriver(); + } + } +} \ No newline at end of file diff --git a/examples/dotnet/SeleniumDocs/BaseFirefoxTest.cs b/examples/dotnet/SeleniumDocs/BaseFirefoxTest.cs new file mode 100644 index 000000000000..885d2db3a358 --- /dev/null +++ b/examples/dotnet/SeleniumDocs/BaseFirefoxTest.cs @@ -0,0 +1,14 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using OpenQA.Selenium.Firefox; + +namespace SeleniumDocs +{ + public class BaseFirefoxTest : BaseTest + { + [TestInitialize] + public void CreateDriver() + { + driver = new FirefoxDriver(); + } + } +} \ No newline at end of file diff --git a/examples/dotnet/SeleniumDocs/BaseTest.cs b/examples/dotnet/SeleniumDocs/BaseTest.cs index ec1bdc3e8c3a..084553b3170b 100644 --- a/examples/dotnet/SeleniumDocs/BaseTest.cs +++ b/examples/dotnet/SeleniumDocs/BaseTest.cs @@ -1,8 +1,5 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; -using WebDriverManager; -using WebDriverManager.DriverConfigs.Impl; namespace SeleniumDocs { @@ -10,13 +7,6 @@ public class BaseTest { protected IWebDriver driver; - [TestInitialize] - public void CreateDriver() - { - new DriverManager().SetUpDriver(new ChromeConfig()); - driver = new ChromeDriver(); - } - [TestCleanup] public void QuitDriver() { diff --git a/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs b/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs index 6ac9e328c905..9969420eacdd 100644 --- a/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs +++ b/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs @@ -1,7 +1,5 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using OpenQA.Selenium.Chrome; -using WebDriverManager; -using WebDriverManager.DriverConfigs.Impl; namespace SeleniumDocs.Browsers { @@ -11,8 +9,6 @@ public class ChromeTest [TestMethod] public void BasicOptions() { - new DriverManager().SetUpDriver(new ChromeConfig()); - var options = new ChromeOptions(); var driver = new ChromeDriver(options); diff --git a/examples/dotnet/SeleniumDocs/Browsers/EdgeTest.cs b/examples/dotnet/SeleniumDocs/Browsers/EdgeTest.cs index ba5ba3f9aa9d..40129778fd7e 100644 --- a/examples/dotnet/SeleniumDocs/Browsers/EdgeTest.cs +++ b/examples/dotnet/SeleniumDocs/Browsers/EdgeTest.cs @@ -1,7 +1,5 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using OpenQA.Selenium.Edge; -using WebDriverManager; -using WebDriverManager.DriverConfigs.Impl; namespace SeleniumDocs.Browsers { @@ -11,8 +9,6 @@ public class EdgeTest [TestMethod] public void BasicOptions() { - new DriverManager().SetUpDriver(new EdgeConfig()); - var options = new EdgeOptions(); var driver = new EdgeDriver(options); diff --git a/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs b/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs index bb40d7109de6..cd7fedfa60b4 100644 --- a/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs +++ b/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs @@ -3,8 +3,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using OpenQA.Selenium; using OpenQA.Selenium.Firefox; -using WebDriverManager; -using WebDriverManager.DriverConfigs.Impl; namespace SeleniumDocs.Browsers { @@ -19,12 +17,6 @@ public void QuitDriver() driver.Quit(); } - [TestInitialize] - public void SetupDriver() - { - new DriverManager().SetUpDriver(new FirefoxConfig()); - } - [TestMethod] public void BasicOptions() { @@ -53,7 +45,7 @@ public void UnInstallAddon() driver = new FirefoxDriver(); string baseDir = AppDomain.CurrentDomain.BaseDirectory; - string extensionFilePath = Path.Combine(baseDir, "../../../extensions/webextensions-selenium-example.xpi"); + string extensionFilePath = Path.Combine(baseDir, "../../../Extensions/webextensions-selenium-example.xpi"); string extensionId = driver.InstallAddOnFromFile(Path.GetFullPath(extensionFilePath)); driver.UninstallAddOn(extensionId); @@ -67,7 +59,7 @@ public void InstallUnsignedAddon() driver = new FirefoxDriver(); string baseDir = AppDomain.CurrentDomain.BaseDirectory; - string extensionDirPath = Path.Combine(baseDir, "../../../extensions/webextensions-selenium-example/"); + string extensionDirPath = Path.Combine(baseDir, "../../../Extensions/webextensions-selenium-example/"); driver.InstallAddOnFromDirectory(Path.GetFullPath(extensionDirPath), true); driver.Url = "https://www.selenium.dev/selenium/web/blank.html"; diff --git a/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs b/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs index fe7b3d7e1008..c0544a0dd316 100644 --- a/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs +++ b/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs @@ -15,19 +15,17 @@ public void ReferenceHardCodedDriver() { var hardCodedPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "../../../"); var path = Path.GetFullPath(hardCodedPath); - Environment.SetEnvironmentVariable("EDGE_DRIVER_PATH", path); + Environment.SetEnvironmentVariable("IE_DRIVER_PATH", path); } [TestMethod] public void BasicOptions() { - var driverPath = Environment.GetEnvironmentVariable("EDGE_DRIVER_PATH"); + var driverPath = Environment.GetEnvironmentVariable("IE_DRIVER_PATH"); var service = InternetExplorerDriverService.CreateDefaultService(driverPath); var options = new InternetExplorerOptions { IgnoreZoomLevel = true, - AttachToEdgeChrome = true, - EdgeExecutablePath = Environment.GetEnvironmentVariable("EDGE_PATH") }; var driver = new InternetExplorerDriver(service, options); diff --git a/examples/dotnet/SeleniumDocs/ChromeDevTools/NetworkInterceptor.cs b/examples/dotnet/SeleniumDocs/ChromeDevTools/NetworkInterceptor.cs index 5cf02a089192..7b2fc4e95c63 100644 --- a/examples/dotnet/SeleniumDocs/ChromeDevTools/NetworkInterceptor.cs +++ b/examples/dotnet/SeleniumDocs/ChromeDevTools/NetworkInterceptor.cs @@ -4,7 +4,7 @@ namespace SeleniumDocs.ChromeDevTools { [TestClass] - public class NetworkInterceptorTest : BaseTest + public class NetworkInterceptorTest : BaseChromeTest { [TestMethod] public void InterceptNetworkForAuthentication() diff --git a/examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs b/examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs index 1979bd50736c..2507ddc63dc6 100644 --- a/examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs +++ b/examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs @@ -2,8 +2,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using OpenQA.Selenium; using OpenQA.Selenium.Chrome; -using WebDriverManager; -using WebDriverManager.DriverConfigs.Impl; namespace SeleniumDocs.GettingStarted { @@ -11,24 +9,11 @@ namespace SeleniumDocs.GettingStarted public class FirstScriptTest { - protected IWebDriver driver; - - [TestInitialize] - public void CreateDriver() - { - new DriverManager().SetUpDriver(new ChromeConfig()); - driver = new ChromeDriver(); - } - - [TestCleanup] - public void QuitDriver() - { - driver.Quit(); - } - [TestMethod] public void ChromeSession() { + IWebDriver driver = new ChromeDriver(); + driver.Navigate().GoToUrl("https://www.selenium.dev/selenium/web/web-form.html"); var title = driver.Title; @@ -45,6 +30,8 @@ public void ChromeSession() var message = driver.FindElement(By.Id("message")); var value = message.Text; Assert.AreEqual("Received!", value); + + driver.Quit(); } } } \ No newline at end of file diff --git a/examples/dotnet/SeleniumDocs/IEDriverServer.exe b/examples/dotnet/SeleniumDocs/IEDriverServer.exe index f39f1213f3e6..df58612d6907 100644 Binary files a/examples/dotnet/SeleniumDocs/IEDriverServer.exe and b/examples/dotnet/SeleniumDocs/IEDriverServer.exe differ diff --git a/examples/dotnet/SeleniumDocs/LocalPackages/add-local-packages-here b/examples/dotnet/SeleniumDocs/LocalPackages/add-local-packages-here new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/examples/dotnet/SeleniumDocs/NuGet.config b/examples/dotnet/SeleniumDocs/NuGet.config new file mode 100644 index 000000000000..45c0bc37a95a --- /dev/null +++ b/examples/dotnet/SeleniumDocs/NuGet.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj b/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj index 6f8cb60b49f1..a8afcc3124a9 100644 --- a/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj +++ b/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj @@ -11,8 +11,12 @@ - + + + + + \ No newline at end of file diff --git a/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs b/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs index 40a3cf792277..8692e4599b53 100644 --- a/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs +++ b/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs @@ -1,15 +1,15 @@ +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using OpenQA.Selenium; -using OpenQA.Selenium.Remote; using OpenQA.Selenium.Support.UI; namespace SeleniumDocs.Support { [TestClass] - public class SelectListTest : BaseTest + public class SelectListTest : BaseChromeTest { [TestInitialize] public void Navigate() @@ -74,7 +74,7 @@ public void DisabledOption() var selectElement = driver.FindElement(By.Name("single_disabled")); var select = new SelectElement(selectElement); - Assert.ThrowsException(() => select.SelectByValue("disabled")); + Assert.ThrowsException(() => select.SelectByValue("disabled")); } } } \ No newline at end of file diff --git a/examples/dotnet/SeleniumDocs/VirtualAuthentication/VirtualAuthenticatorTest.cs b/examples/dotnet/SeleniumDocs/VirtualAuthentication/VirtualAuthenticatorTest.cs index 35794ead535e..a774f471e282 100644 --- a/examples/dotnet/SeleniumDocs/VirtualAuthentication/VirtualAuthenticatorTest.cs +++ b/examples/dotnet/SeleniumDocs/VirtualAuthentication/VirtualAuthenticatorTest.cs @@ -9,7 +9,7 @@ namespace SeleniumDocs.VirtualAuthentication { [TestClass] - public class VirtualAuthenticatorTest : BaseTest + public class VirtualAuthenticatorTest : BaseChromeTest { //A pkcs#8 encoded encrypted RSA private key as a base64 string. private static string base64EncodedRSAPK = diff --git a/examples/java/build.gradle b/examples/java/build.gradle new file mode 100644 index 000000000000..2c1d6b882a3f --- /dev/null +++ b/examples/java/build.gradle @@ -0,0 +1,21 @@ +plugins { + id 'java' +} + +group 'dev.selenium' +version '1.0-SNAPSHOT' + +repositories { + mavenCentral() +} + +dependencies { + testImplementation 'org.seleniumhq.selenium:selenium-java:4.6.0' + testImplementation 'org.seleniumhq.selenium:selenium-grid:4.6.0' + testImplementation 'io.github.bonigarcia:webdrivermanager:5.2.3' + testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.0' +} + +test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/examples/java/gradle/wrapper/gradle-wrapper.jar b/examples/java/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 000000000000..41d9927a4d4f Binary files /dev/null and b/examples/java/gradle/wrapper/gradle-wrapper.jar differ diff --git a/examples/java/gradle/wrapper/gradle-wrapper.properties b/examples/java/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000000..41dfb87909a8 --- /dev/null +++ b/examples/java/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/examples/java/gradlew b/examples/java/gradlew new file mode 100755 index 000000000000..1b6c787337ff --- /dev/null +++ b/examples/java/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed 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 +# +# https://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. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/examples/java/gradlew.bat b/examples/java/gradlew.bat new file mode 100644 index 000000000000..107acd32c4e6 --- /dev/null +++ b/examples/java/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/examples/java/pom.xml b/examples/java/pom.xml index 248230df8ddc..cfb8c7523b5d 100644 --- a/examples/java/pom.xml +++ b/examples/java/pom.xml @@ -9,56 +9,47 @@ 1.0.0 - 4.5.0 - 1.7.36 - 1.2.11 - - 5.9.0 - 5.2.3 - 3.0.0-M7 - 8 ${java.version} ${java.version} - - UTF-8 - ${project.encondig} - ${project.encondig} + UTF-8 + ${project.encoding} + ${project.encoding} org.seleniumhq.selenium selenium-java - ${selenium.version} + 4.6.0 org.seleniumhq.selenium selenium-grid - ${selenium.version} + 4.6.0 org.slf4j slf4j-api - ${slf4j.version} + 1.7.36 ch.qos.logback logback-classic - ${logback.version} + 1.2.11 org.junit.jupiter junit-jupiter-engine - ${junit5.version} + 5.9.0 test io.github.bonigarcia webdrivermanager - ${wdm.version} + 5.2.3 test diff --git a/examples/java/src/test/java/dev/selenium/BaseChromeTest.java b/examples/java/src/test/java/dev/selenium/BaseChromeTest.java new file mode 100644 index 000000000000..407ccbafbb90 --- /dev/null +++ b/examples/java/src/test/java/dev/selenium/BaseChromeTest.java @@ -0,0 +1,15 @@ +package dev.selenium; + +import org.junit.jupiter.api.BeforeEach; +import org.openqa.selenium.chrome.ChromeDriver; + +public class BaseChromeTest extends BaseTest { + + @BeforeEach + public void setup() { + System.setProperty("webdriver.chrome.logfile", "chromedriver.log"); + System.setProperty("webdriver.chrome.verboseLogging", "true"); + driver = new ChromeDriver(); + } + +} diff --git a/examples/java/src/test/java/dev/selenium/BaseFirefoxTest.java b/examples/java/src/test/java/dev/selenium/BaseFirefoxTest.java new file mode 100644 index 000000000000..7f9b37939086 --- /dev/null +++ b/examples/java/src/test/java/dev/selenium/BaseFirefoxTest.java @@ -0,0 +1,13 @@ +package dev.selenium; + +import org.junit.jupiter.api.BeforeEach; +import org.openqa.selenium.chrome.ChromeDriver; + +public class BaseFirefoxTest extends BaseTest { + + @BeforeEach + public void setup() { + driver = new ChromeDriver(); + } + +} diff --git a/examples/java/src/test/java/dev/selenium/BaseTest.java b/examples/java/src/test/java/dev/selenium/BaseTest.java index 17796f8a9f91..0b47f6059483 100644 --- a/examples/java/src/test/java/dev/selenium/BaseTest.java +++ b/examples/java/src/test/java/dev/selenium/BaseTest.java @@ -1,24 +1,11 @@ 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; import org.openqa.selenium.WebDriver; -import org.openqa.selenium.chrome.ChromeDriver; + public class BaseTest { public WebDriver driver; - @BeforeAll - public static void setDriver() { - WebDriverManager.chromedriver().setup(); - } - - @BeforeEach - public void setup() { - driver = new ChromeDriver(); - } - @AfterEach public void quit() { driver.quit(); diff --git a/examples/java/src/test/java/dev/selenium/actions_api/ActionsTest.java b/examples/java/src/test/java/dev/selenium/actions_api/ActionsTest.java index 65ba40560522..524008e666d6 100644 --- a/examples/java/src/test/java/dev/selenium/actions_api/ActionsTest.java +++ b/examples/java/src/test/java/dev/selenium/actions_api/ActionsTest.java @@ -1,6 +1,6 @@ package dev.selenium.actions_api; -import dev.selenium.BaseTest; +import dev.selenium.BaseChromeTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.openqa.selenium.By; @@ -11,7 +11,7 @@ import java.time.Duration; -public class ActionsTest extends BaseTest { +public class ActionsTest extends BaseChromeTest { @Test public void pause() { driver.get("https://www.selenium.dev/selenium/web/mouse_interaction.html"); diff --git a/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java b/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java index 433a1dfd6047..e4321f25731b 100644 --- a/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java +++ b/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java @@ -1,6 +1,6 @@ package dev.selenium.actions_api; -import dev.selenium.BaseTest; +import dev.selenium.BaseChromeTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.openqa.selenium.By; @@ -9,7 +9,7 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; -public class KeysTest extends BaseTest { +public class KeysTest extends BaseChromeTest { @Test public void keyDown() { driver.get("https://www.selenium.dev/selenium/web/single_text_input.html"); diff --git a/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java b/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java index b7a8ef3f1cf1..adc1746165e8 100644 --- a/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java +++ b/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java @@ -1,6 +1,6 @@ package dev.selenium.actions_api; -import dev.selenium.BaseTest; +import dev.selenium.BaseChromeTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.openqa.selenium.By; @@ -14,7 +14,7 @@ import java.time.Duration; import java.util.Collections; -public class MouseTest extends BaseTest { +public class MouseTest extends BaseChromeTest { @Test public void clickAndHold() { driver.get("https://www.selenium.dev/selenium/web/mouse_interaction.html"); diff --git a/examples/java/src/test/java/dev/selenium/actions_api/PenTest.java b/examples/java/src/test/java/dev/selenium/actions_api/PenTest.java index fc8dd1458ee2..42da362fcf43 100644 --- a/examples/java/src/test/java/dev/selenium/actions_api/PenTest.java +++ b/examples/java/src/test/java/dev/selenium/actions_api/PenTest.java @@ -1,6 +1,6 @@ package dev.selenium.actions_api; -import dev.selenium.BaseTest; +import dev.selenium.BaseChromeTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.openqa.selenium.By; @@ -18,7 +18,7 @@ import java.util.Map; import java.util.stream.Collectors; -public class PenTest extends BaseTest { +public class PenTest extends BaseChromeTest { @Test public void usePen() { driver.get("https://www.selenium.dev/selenium/web/pointerActionsPage.html"); diff --git a/examples/java/src/test/java/dev/selenium/actions_api/WheelTest.java b/examples/java/src/test/java/dev/selenium/actions_api/WheelTest.java index eb79ca310088..435be96a29ad 100644 --- a/examples/java/src/test/java/dev/selenium/actions_api/WheelTest.java +++ b/examples/java/src/test/java/dev/selenium/actions_api/WheelTest.java @@ -1,6 +1,6 @@ package dev.selenium.actions_api; -import dev.selenium.BaseTest; +import dev.selenium.BaseChromeTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.openqa.selenium.By; @@ -9,7 +9,7 @@ import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.interactions.WheelInput; -public class WheelTest extends BaseTest { +public class WheelTest extends BaseChromeTest { @Test public void shouldScrollToElement() { driver.get("https://www.selenium.dev/selenium/web/scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html"); diff --git a/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java b/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java similarity index 75% rename from examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java rename to examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java index 2ce7054d541a..a5ee2b716e82 100644 --- a/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java +++ b/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java @@ -1,20 +1,8 @@ -package dev.selenium.augmenter; - -import static org.openqa.selenium.devtools.events.CdpEventTypes.domMutation; -import static org.openqa.selenium.remote.http.Contents.utf8String; - -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicReference; +package dev.selenium.bidirectional; +import com.google.common.net.MediaType; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.openqa.selenium.By; @@ -39,25 +27,27 @@ import org.openqa.selenium.remote.http.HttpResponse; import org.openqa.selenium.remote.http.Route; -import com.google.common.net.MediaType; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; -import io.github.bonigarcia.wdm.WebDriverManager; +import static org.openqa.selenium.devtools.events.CdpEventTypes.domMutation; +import static org.openqa.selenium.remote.http.Contents.utf8String; -public class CdpRemoteWebDriverTest { +public class BidiApiRemotewebdriverTest { private static URL gridUrl; private WebDriver driver; - @BeforeAll - static void setDriver() { - WebDriverManager.chromedriver().setup(); - } - @BeforeEach public void setup() throws MalformedURLException { int port = PortProber.findFreePort(); - WebDriverManager.chromedriver().setup(); Main.main(new String[] { "standalone", "--port", String.valueOf(port) }); gridUrl = new URL(String.format("http://localhost:%d/", port)); @@ -81,24 +71,25 @@ public void testCreateCDPSession() { public void testBasicAuth() { AtomicReference devToolsAtomicReference = new AtomicReference<>(); - driver = new Augmenter().addDriverAugmentation("chrome", - HasAuthentication.class, - (caps, exec) -> (whenThisMatches, useTheseCredentials) -> { - devToolsAtomicReference.get() - .createSessionIfThereIsNotOne(); - devToolsAtomicReference.get().getDomains() - .network() - .addAuthHandler(whenThisMatches, - useTheseCredentials); - - }).augment(driver); + driver = new Augmenter() + .addDriverAugmentation("chrome", + HasAuthentication.class, + (caps, exec) -> (whenThisMatches, useTheseCredentials) -> { + devToolsAtomicReference.get() + .createSessionIfThereIsNotOne(); + devToolsAtomicReference.get().getDomains() + .network() + .addAuthHandler(whenThisMatches, + useTheseCredentials); + }).augment(driver); DevTools devTools = ((HasDevTools) driver).getDevTools(); devTools.createSession(); devToolsAtomicReference.set(devTools); - ((HasAuthentication) driver).register(UsernameAndPassword.of("admin", "admin")); - driver.get("https://the-internet.herokuapp.com/basic_auth"); + ((HasAuthentication) driver). + register(UsernameAndPassword.of("admin", "admin")); + driver.get("https://the-internet.herokuapp.com/basic_auth"); WebElement element = driver.findElement(By.tagName("p")); Assertions @@ -111,25 +102,20 @@ public void testDomMutation() throws Exception { AtomicReference augmentedDriver = new AtomicReference<>(); CountDownLatch latch = new CountDownLatch(1); - Augmenter augmenter = new Augmenter(); + driver = new Augmenter() + .addDriverAugmentation("chrome", + HasLogEvents.class, + (caps, exec) -> new HasLogEvents() { + @Override + public void onLogEvent(EventType kind) { - driver = augmenter. - addDriverAugmentation("chrome", HasLogEvents.class, (caps, exec) -> new HasLogEvents() { - @Override - public void onLogEvent(EventType kind) { - kind.initializeListener(augmentedDriver.get()); - } - }).augment(driver); + kind.initializeListener(augmentedDriver.get()); + } + }).augment(driver); DevTools devTools = ((HasDevTools) driver).getDevTools(); devTools.createSession(); - - if (driver instanceof HasLogEvents) { - augmentedDriver.set(driver); - } else { - throw new Exception("Not an instance of HasLogEvents"); - } - + augmentedDriver.set(driver); ((HasLogEvents) driver).onLogEvent(domMutation(mutation -> { if ("cheese".equals(mutation.getAttributeName())) { seen.set(mutation); @@ -138,8 +124,8 @@ public void onLogEvent(EventType kind) { })); driver.get("https://www.google.com"); - WebElement span = driver.findElement(By.cssSelector("span")); + WebElement span = driver.findElement(By.cssSelector("span")); ((JavascriptExecutor) driver) .executeScript("arguments[0].setAttribute('cheese', 'gouda');", span); @@ -155,13 +141,9 @@ public void testConsoleLogListener() throws InterruptedException { DevTools devTools = ((HasDevTools) driver).getDevTools(); devTools.createSession(); - // Use as per Devtools version devTools.send(org.openqa.selenium.devtools.v85.runtime.Runtime.enable()); devTools.send(Log.enable()); - // https://chromedevtools.github.io/devtools-protocol/tot/Console/ states that post deprecation either Runtime or Log domain is to be used - // Depending on the implementation, events from either of the domains can be fired for console logs. - devTools.addListener(Log.entryAdded(), logEntry -> { System.out.println("log: " + logEntry.getText()); @@ -169,7 +151,6 @@ public void testConsoleLogListener() throws InterruptedException { latch.countDown(); }); - // Use as per Devtools version devTools.addListener(org.openqa.selenium.devtools.v85.runtime.Runtime.consoleAPICalled(), consoleLog -> System.out.println("Type: " + consoleLog.getType())); @@ -208,7 +189,6 @@ public void testNetworkInterceptor() { DevTools devTools = ((HasDevTools) driver).getDevTools(); devTools.createSession(); - // Intercept and change response if the request uri contains "google" try (NetworkInterceptor interceptor = new NetworkInterceptor( driver, Route.matching(req -> req.getUri().contains("google")) diff --git a/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java b/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java index 67181e14df6f..209bc58b0528 100644 --- a/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java +++ b/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java @@ -1,8 +1,6 @@ package dev.selenium.browsers; -import io.github.bonigarcia.wdm.WebDriverManager; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; @@ -10,11 +8,6 @@ public class ChromeTest { public ChromeDriver driver; - @BeforeAll - public static void setDriver() { - WebDriverManager.chromedriver().setup(); - } - @AfterEach public void quit() { driver.quit(); diff --git a/examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java b/examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java index 38cdf63f56f1..eaa2bb521722 100644 --- a/examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java +++ b/examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java @@ -1,8 +1,6 @@ package dev.selenium.browsers; -import io.github.bonigarcia.wdm.WebDriverManager; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.openqa.selenium.edge.EdgeDriver; import org.openqa.selenium.edge.EdgeOptions; @@ -10,11 +8,6 @@ public class EdgeTest { public EdgeDriver driver; - @BeforeAll - public static void setDriver() { - WebDriverManager.edgedriver().setup(); - } - @AfterEach public void quit() { driver.quit(); diff --git a/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java b/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java index 72b4612a3e98..d7e70826fde5 100644 --- a/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java +++ b/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java @@ -1,9 +1,7 @@ package dev.selenium.browsers; -import io.github.bonigarcia.wdm.WebDriverManager; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; @@ -16,11 +14,6 @@ public class FirefoxTest { public FirefoxDriver driver; - @BeforeAll - public static void setDriver() { - WebDriverManager.firefoxdriver().setup(); - } - @AfterEach public void quit() { driver.quit(); diff --git a/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java b/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java index f43d0641d3f8..313542111b84 100644 --- a/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java +++ b/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java @@ -26,8 +26,7 @@ public void quit() { @Test public void basicOptions() { InternetExplorerOptions options = new InternetExplorerOptions(); - options.attachToEdgeChrome(); - options.withEdgeExecutablePath(System.getenv("EDGE_PATH")); + options.ignoreZoomSettings(); driver = new InternetExplorerDriver(options); } } diff --git a/examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java b/examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java index a630b396a63f..d37179231774 100644 --- a/examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java +++ b/examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java @@ -1,41 +1,20 @@ package dev.selenium.getting_started; -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.time.Duration; - -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; -import io.github.bonigarcia.wdm.WebDriverManager; - -public class FirstScriptTest { - - public WebDriver driver; - - @BeforeAll - public static void setDriver() { - WebDriverManager.chromedriver().setup(); - } +import java.time.Duration; - @BeforeEach - public void setup() { - driver = new ChromeDriver(); - } +import static org.junit.jupiter.api.Assertions.assertEquals; - @AfterEach - public void quit() { - driver.quit(); - } +public class FirstScriptTest { @Test public void eightComponents() { + WebDriver driver = new ChromeDriver(); driver.get("https://www.selenium.dev/selenium/web/web-form.html"); String title = driver.getTitle(); @@ -52,6 +31,8 @@ public void eightComponents() { WebElement message = driver.findElement(By.id("message")); String value = message.getText(); assertEquals("Received!", value); + + driver.quit(); } } diff --git a/examples/java/src/test/java/dev/selenium/support/SelectListTest.java b/examples/java/src/test/java/dev/selenium/support/SelectListTest.java index 46e67a7e895f..330a4d2b9228 100644 --- a/examples/java/src/test/java/dev/selenium/support/SelectListTest.java +++ b/examples/java/src/test/java/dev/selenium/support/SelectListTest.java @@ -1,6 +1,6 @@ package dev.selenium.support; -import dev.selenium.BaseTest; +import dev.selenium.BaseChromeTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -11,7 +11,7 @@ import java.util.ArrayList; import java.util.List; -public class SelectListTest extends BaseTest { +public class SelectListTest extends BaseChromeTest { @BeforeEach public void navigate() { diff --git a/examples/python/requirements.txt b/examples/python/requirements.txt index c8d11b2f66ad..e5c665639872 100644 --- a/examples/python/requirements.txt +++ b/examples/python/requirements.txt @@ -1,4 +1,4 @@ -selenium==4.5.0 +selenium==4.6.0 pytest flake8 webdriver_manager==3.8.3 diff --git a/examples/python/tests/actions_api/test_keys.py b/examples/python/tests/actions_api/test_keys.py index 66c8aeafcde8..da37355990dd 100644 --- a/examples/python/tests/actions_api/test_keys.py +++ b/examples/python/tests/actions_api/test_keys.py @@ -50,7 +50,8 @@ def test_send_keys_to_designated_element(driver): assert driver.find_element(By.ID, "textInput").get_attribute('value') == "abc" -def test_copy_and_paste(driver): +def test_copy_and_paste(firefox_driver): + driver = firefox_driver driver.get('https://selenium.dev/selenium/web/single_text_input.html') cmd_ctrl = Keys.COMMAND if sys.platform == 'darwin' else Keys.CONTROL diff --git a/examples/python/tests/browsers/test_chrome.py b/examples/python/tests/browsers/test_chrome.py index 3555a2df9950..6fcbe9aa24c4 100644 --- a/examples/python/tests/browsers/test_chrome.py +++ b/examples/python/tests/browsers/test_chrome.py @@ -1,12 +1,9 @@ from selenium import webdriver from selenium.webdriver.chrome.options import Options as ChromeOptions -from selenium.webdriver.chrome.service import Service as ChromeService -from webdriver_manager.chrome import ChromeDriverManager def test_basic_options(): - service = ChromeService(executable_path=ChromeDriverManager().install()) options = ChromeOptions() - driver = webdriver.Chrome(options=options, service=service) + driver = webdriver.Chrome(options=options) driver.quit() diff --git a/examples/python/tests/browsers/test_edge.py b/examples/python/tests/browsers/test_edge.py index c02cfa59acff..9e67c064a88e 100644 --- a/examples/python/tests/browsers/test_edge.py +++ b/examples/python/tests/browsers/test_edge.py @@ -1,12 +1,9 @@ from selenium import webdriver from selenium.webdriver.edge.options import Options as EdgeOptions -from selenium.webdriver.edge.service import Service as EdgeService -from webdriver_manager.microsoft import EdgeChromiumDriverManager def test_basic_options(): - service = EdgeService(executable_path=EdgeChromiumDriverManager().install()) options = EdgeOptions() - driver = webdriver.Edge(options=options, service=service) + driver = webdriver.Edge(options=options) driver.quit() diff --git a/examples/python/tests/browsers/test_firefox.py b/examples/python/tests/browsers/test_firefox.py index 47c7da41cddd..d111fd862800 100644 --- a/examples/python/tests/browsers/test_firefox.py +++ b/examples/python/tests/browsers/test_firefox.py @@ -3,14 +3,11 @@ from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.firefox.options import Options as FirefoxOptions -from selenium.webdriver.firefox.service import Service as FirefoxService -from webdriver_manager.firefox import GeckoDriverManager def test_basic_options(): - service = FirefoxService(executable_path=GeckoDriverManager().install()) options = FirefoxOptions() - driver = webdriver.Firefox(options=options, service=service) + driver = webdriver.Firefox(options=options) driver.quit() diff --git a/examples/python/tests/browsers/test_internet_explorer.py b/examples/python/tests/browsers/test_internet_explorer.py index 7fec5c188ed4..e71381e32749 100644 --- a/examples/python/tests/browsers/test_internet_explorer.py +++ b/examples/python/tests/browsers/test_internet_explorer.py @@ -12,8 +12,7 @@ def test_basic_options(): service = InternetExplorerService(executable_path=IEDriverManager().install()) options = InternetExplorerOptions() - options.attach_to_edge_chrome = True - options.edge_executable_path = os.getenv("EDGE_PATH") + options.ignore_zoom_level = True driver = webdriver.Ie(options=options, service=service) driver.quit() diff --git a/examples/python/tests/conftest.py b/examples/python/tests/conftest.py index a3fe61eaa98f..619556094883 100644 --- a/examples/python/tests/conftest.py +++ b/examples/python/tests/conftest.py @@ -1,15 +1,10 @@ import pytest from selenium import webdriver -from selenium.webdriver.chrome.service import Service as ChromeService -from selenium.webdriver.firefox.service import Service as FirefoxService -from webdriver_manager.chrome import ChromeDriverManager -from webdriver_manager.firefox import GeckoDriverManager @pytest.fixture(scope='function') def driver(): - service = ChromeService(executable_path=ChromeDriverManager().install()) - driver = webdriver.Chrome(service=service) + driver = webdriver.Chrome() yield driver @@ -18,8 +13,7 @@ def driver(): @pytest.fixture(scope='function') def firefox_driver(): - service = FirefoxService(executable_path=GeckoDriverManager().install()) - driver = webdriver.Firefox(service=service) + driver = webdriver.Firefox() yield driver diff --git a/examples/python/tests/getting_started/test_first_script.py b/examples/python/tests/getting_started/test_first_script.py index aa6bfaf624b5..8af0a1deeb20 100644 --- a/examples/python/tests/getting_started/test_first_script.py +++ b/examples/python/tests/getting_started/test_first_script.py @@ -1,11 +1,9 @@ from selenium import webdriver from selenium.webdriver.common.by import By -from selenium.webdriver.chrome.service import Service as ChromeService -from webdriver_manager.chrome import ChromeDriverManager def test_eight_components(): - driver = webdriver.Chrome(service=ChromeService(executable_path=ChromeDriverManager().install())) + driver = webdriver.Chrome() driver.get("https://www.selenium.dev/selenium/web/web-form.html") diff --git a/examples/ruby/Gemfile b/examples/ruby/Gemfile index bd72ba5780da..5bafed48eedf 100644 --- a/examples/ruby/Gemfile +++ b/examples/ruby/Gemfile @@ -7,6 +7,6 @@ gem 'rake', '~> 13.0' gem 'rspec', '~> 3.0' gem 'rubocop', '~> 1.35' gem 'rubocop-rspec', '~> 2.12' -gem 'selenium-webdriver', '= 4.5' +gem 'selenium-webdriver', '= 4.6.1' gem 'webdrivers', '~> 5.1' gem 'ffi', '~> 1.15', '>= 1.15.5' \ No newline at end of file diff --git a/examples/ruby/Gemfile.lock b/examples/ruby/Gemfile.lock index 40ccafd8b5f6..61fce49a9d16 100644 --- a/examples/ruby/Gemfile.lock +++ b/examples/ruby/Gemfile.lock @@ -47,7 +47,7 @@ GEM rubocop (~> 1.33) ruby-progressbar (1.11.0) rubyzip (2.3.2) - selenium-webdriver (4.5.0) + selenium-webdriver (4.6.1) childprocess (>= 0.5, < 5.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) @@ -70,7 +70,7 @@ DEPENDENCIES rspec (~> 3.0) rubocop (~> 1.35) rubocop-rspec (~> 2.12) - selenium-webdriver (= 4.5) + selenium-webdriver (= 4.6.1) webdrivers (~> 5.1) BUNDLED WITH diff --git a/examples/ruby/spec/actions_api/keys_spec.rb b/examples/ruby/spec/actions_api/keys_spec.rb index c6b97e41a4f1..62acfb00e650 100644 --- a/examples/ruby/spec/actions_api/keys_spec.rb +++ b/examples/ruby/spec/actions_api/keys_spec.rb @@ -56,7 +56,8 @@ expect(text_field.attribute('value')).to eq 'Selenium!' end - it 'copy and paste' do + it 'copy and paste', except: {browser: :chrome, + reason: 'https://bugs.chromium.org/p/chromedriver/issues/detail?id=4264'} do driver.get 'https://www.selenium.dev/selenium/web/single_text_input.html' wait.until { driver.find_element(id: 'textInput').attribute('autofocus') } diff --git a/examples/ruby/spec/actions_api/pen_spec.rb b/examples/ruby/spec/actions_api/pen_spec.rb index 967bc1f2a794..d80e2d0acab9 100644 --- a/examples/ruby/spec/actions_api/pen_spec.rb +++ b/examples/ruby/spec/actions_api/pen_spec.rb @@ -77,9 +77,9 @@ 'pointerType' => 'pen', 'pageX' => (center_x + 2).to_s, 'pageY' => (center_y + 2).floor.to_s, - 'tiltX' => -72.floor.to_s, - 'tiltY' => 9.floor.to_s, - 'twist' => 86.floor.to_s) + 'tiltX' => -72.to_s, + 'tiltY' => 9.to_s, + 'twist' => 86.to_s) expect(up).to include('button' => '0', 'pointerType' => 'pen', 'pageX' => (center_x + 2).to_s, diff --git a/examples/ruby/spec/browsers/chrome_spec.rb b/examples/ruby/spec/browsers/chrome_spec.rb index 6b11cadf4a69..4553e1b1fb61 100644 --- a/examples/ruby/spec/browsers/chrome_spec.rb +++ b/examples/ruby/spec/browsers/chrome_spec.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'spec_helper' -require 'webdrivers' RSpec.describe 'Chrome' do it 'basic options' do diff --git a/examples/ruby/spec/browsers/edge_spec.rb b/examples/ruby/spec/browsers/edge_spec.rb index b07ba513e16a..a31e455e8258 100644 --- a/examples/ruby/spec/browsers/edge_spec.rb +++ b/examples/ruby/spec/browsers/edge_spec.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'spec_helper' -require 'webdrivers' RSpec.describe 'Edge' do it 'basic options' do diff --git a/examples/ruby/spec/browsers/firefox_spec.rb b/examples/ruby/spec/browsers/firefox_spec.rb index 1042e3bc9dde..9f35bd617b45 100644 --- a/examples/ruby/spec/browsers/firefox_spec.rb +++ b/examples/ruby/spec/browsers/firefox_spec.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'spec_helper' -require 'webdrivers' RSpec.describe 'Firefox' do let(:driver) { start_firefox } diff --git a/examples/ruby/spec/browsers/internet_explorer_spec.rb b/examples/ruby/spec/browsers/internet_explorer_spec.rb index 06bdb05a68e3..f13431510844 100644 --- a/examples/ruby/spec/browsers/internet_explorer_spec.rb +++ b/examples/ruby/spec/browsers/internet_explorer_spec.rb @@ -5,8 +5,7 @@ RSpec.describe 'Internet Explorer', exclusive: {platform: :windows} do it 'basic options' do - options = Selenium::WebDriver::Options.internet_explorer(attach_to_edge_chrome: true, - edge_executable_path: ENV['EDGE_PATH']) + options = Selenium::WebDriver::Options.ie(ignore_zoom_level: true) @driver = Selenium::WebDriver.for :ie, options: options end end diff --git a/examples/ruby/spec/browsers/safari_spec.rb b/examples/ruby/spec/browsers/safari_spec.rb index ce48172f452f..4276d3b67328 100644 --- a/examples/ruby/spec/browsers/safari_spec.rb +++ b/examples/ruby/spec/browsers/safari_spec.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'spec_helper' -require 'webdrivers' RSpec.describe 'Safari', exclusive: {platform: :macosx} do it 'basic options' do diff --git a/examples/ruby/spec/getting_started/install_drivers_spec.rb b/examples/ruby/spec/getting_started/install_drivers_spec.rb index abf2eb1800dd..0f22df98a66c 100644 --- a/examples/ruby/spec/getting_started/install_drivers_spec.rb +++ b/examples/ruby/spec/getting_started/install_drivers_spec.rb @@ -6,9 +6,7 @@ it 'chrome session' do require 'webdrivers' - driver = Selenium::WebDriver.for :chrome - - driver.quit + @driver = Selenium::WebDriver.for :chrome end it 'edge session' do diff --git a/examples/ruby/spec/spec_helper.rb b/examples/ruby/spec/spec_helper.rb index 0f20cf0b0257..52d6b6580967 100644 --- a/examples/ruby/spec/spec_helper.rb +++ b/examples/ruby/spec/spec_helper.rb @@ -26,12 +26,11 @@ config.after { @driver&.quit } def start_session - require 'webdrivers' @driver = Selenium::WebDriver.for :chrome end def start_firefox - require 'webdrivers' - @driver = Selenium::WebDriver.for :firefox + options = Selenium::WebDriver::Options.firefox(timeouts: {implicit: 1500}) + @driver = Selenium::WebDriver.for :firefox, options: options end end diff --git a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.en.md b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.en.md index c249c6ae554b..5653b9feb948 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.en.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.en.md @@ -153,13 +153,13 @@ This code will end up with the text: `SeleniumSelenium!` {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L73-L85" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/actions_api/test_keys.py#L55-L66" >}} +{{< gh-codeblock path="examples/python/tests/actions_api/test_keys.py#L56-L67" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L72-L82" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="examples/ruby/spec/actions_api/keys_spec.rb#L63-L73" >}} +{{< gh-codeblock path="examples/ruby/spec/actions_api/keys_spec.rb#L64-L74" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< gh-codeblock path="examples/javascript/test/actionsApi/keysTest.spec.js#L75-L87" >}} diff --git a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.ja.md b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.ja.md index b4e7fab63b3b..f3cf973127e8 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.ja.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.ja.md @@ -153,13 +153,13 @@ This code will end up with the text: `SeleniumSelenium!` {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L73-L85" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/actions_api/test_keys.py#L55-L66" >}} +{{< gh-codeblock path="examples/python/tests/actions_api/test_keys.py#L56-L67" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L72-L82" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="examples/ruby/spec/actions_api/keys_spec.rb#L63-L73" >}} +{{< gh-codeblock path="examples/ruby/spec/actions_api/keys_spec.rb#L64-L74" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< gh-codeblock path="examples/javascript/test/actionsApi/keysTest.spec.js#L75-L87" >}} diff --git a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.pt-br.md b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.pt-br.md index 855e8c725cf2..970f836fa7d8 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.pt-br.md @@ -153,13 +153,13 @@ This code will end up with the text: `SeleniumSelenium!` {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L73-L85" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/actions_api/test_keys.py#L55-L66" >}} +{{< gh-codeblock path="examples/python/tests/actions_api/test_keys.py#L56-L67" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L72-L82" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="examples/ruby/spec/actions_api/keys_spec.rb#L63-L73" >}} +{{< gh-codeblock path="examples/ruby/spec/actions_api/keys_spec.rb#L64-L74" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< gh-codeblock path="examples/javascript/test/actionsApi/keysTest.spec.js#L75-L87" >}} diff --git a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.zh-cn.md b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.zh-cn.md index 66477898c6b2..dbd823a76895 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.zh-cn.md @@ -153,13 +153,13 @@ This code will end up with the text: `SeleniumSelenium!` {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L73-L85" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/actions_api/test_keys.py#L55-L66" >}} +{{< gh-codeblock path="examples/python/tests/actions_api/test_keys.py#L56-L67" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L72-L82" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="examples/ruby/spec/actions_api/keys_spec.rb#L63-L73" >}} +{{< gh-codeblock path="examples/ruby/spec/actions_api/keys_spec.rb#L64-L74" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< gh-codeblock path="examples/javascript/test/actionsApi/keysTest.spec.js#L75-L87" >}} diff --git a/website_and_docs/content/documentation/webdriver/bidirectional/bidi_api_remotewebdriver.en.md b/website_and_docs/content/documentation/webdriver/bidirectional/bidi_api_remotewebdriver.en.md index d3992db91ff2..253715bed83f 100644 --- a/website_and_docs/content/documentation/webdriver/bidirectional/bidi_api_remotewebdriver.en.md +++ b/website_and_docs/content/documentation/webdriver/bidirectional/bidi_api_remotewebdriver.en.md @@ -13,7 +13,7 @@ With Selenium, you can automate the input of basic auth credentials whenever the {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L82-105" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L72-90" >}} {{< /tab >}} {{< /tabpane >}} @@ -25,7 +25,7 @@ element in the DOM. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L110-148" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L101-124" >}} {{< /tab >}} {{< /tabpane >}} @@ -35,7 +35,7 @@ Listen to the `console.log` events and register callbacks to process the event. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L153-178" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L139-155" >}} {{< /tab >}} {{< /tabpane >}} @@ -43,7 +43,7 @@ Listen to the `console.log` events and register callbacks to process the event. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L183-202" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L164-171" >}} {{< /tab >}} {{< /tabpane >}} @@ -54,7 +54,7 @@ it with the following examples. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L207-L223" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L188-L198" >}} {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/bidirectional/bidi_api_remotewebdriver.ja.md b/website_and_docs/content/documentation/webdriver/bidirectional/bidi_api_remotewebdriver.ja.md index c03ecddcfdf9..205d316315b2 100644 --- a/website_and_docs/content/documentation/webdriver/bidirectional/bidi_api_remotewebdriver.ja.md +++ b/website_and_docs/content/documentation/webdriver/bidirectional/bidi_api_remotewebdriver.ja.md @@ -22,7 +22,7 @@ With Selenium, you can automate the input of basic auth credentials whenever the {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L82-105" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L72-90" >}} {{< /tab >}} {{< /tabpane >}} @@ -34,7 +34,7 @@ element in the DOM. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L110-148" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L101-124" >}} {{< /tab >}} {{< /tabpane >}} @@ -44,7 +44,7 @@ Listen to the `console.log` events and register callbacks to process the event. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L153-178" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L139-155" >}} {{< /tab >}} {{< /tabpane >}} @@ -52,7 +52,7 @@ Listen to the `console.log` events and register callbacks to process the event. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L183-202" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L164-171" >}} {{< /tab >}} {{< /tabpane >}} @@ -63,7 +63,7 @@ it with the following examples. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L207-L223" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L188-L198" >}} {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/bidirectional/bidi_api_remotewebdriver.pt-br.md b/website_and_docs/content/documentation/webdriver/bidirectional/bidi_api_remotewebdriver.pt-br.md index be98a1bb5353..cbc626840d03 100644 --- a/website_and_docs/content/documentation/webdriver/bidirectional/bidi_api_remotewebdriver.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/bidirectional/bidi_api_remotewebdriver.pt-br.md @@ -21,7 +21,7 @@ With Selenium, you can automate the input of basic auth credentials whenever the {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L82-105" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L72-90" >}} {{< /tab >}} {{< /tabpane >}} @@ -33,7 +33,7 @@ element in the DOM. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L110-148" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L101-124" >}} {{< /tab >}} {{< /tabpane >}} @@ -43,7 +43,7 @@ Listen to the `console.log` events and register callbacks to process the event. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L153-178" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L139-155" >}} {{< /tab >}} {{< /tabpane >}} @@ -51,7 +51,7 @@ Listen to the `console.log` events and register callbacks to process the event. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L183-202" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L164-171" >}} {{< /tab >}} {{< /tabpane >}} @@ -62,7 +62,7 @@ it with the following examples. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L207-L223" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L188-L198" >}} {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/bidirectional/bidi_api_remotewebdriver.zh-cn.md b/website_and_docs/content/documentation/webdriver/bidirectional/bidi_api_remotewebdriver.zh-cn.md index 292239fff4cb..91cdf2aeee11 100644 --- a/website_and_docs/content/documentation/webdriver/bidirectional/bidi_api_remotewebdriver.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/bidirectional/bidi_api_remotewebdriver.zh-cn.md @@ -22,7 +22,7 @@ With Selenium, you can automate the input of basic auth credentials whenever the {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L82-105" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L72-90" >}} {{< /tab >}} {{< /tabpane >}} @@ -34,7 +34,7 @@ element in the DOM. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L110-148" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L101-124" >}} {{< /tab >}} {{< /tabpane >}} @@ -44,7 +44,7 @@ Listen to the `console.log` events and register callbacks to process the event. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L153-178" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L139-155" >}} {{< /tab >}} {{< /tabpane >}} @@ -52,7 +52,7 @@ Listen to the `console.log` events and register callbacks to process the event. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L183-202" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L164-171" >}} {{< /tab >}} {{< /tabpane >}} @@ -63,7 +63,7 @@ it with the following examples. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/augmenter/CdpRemoteWebDriverTest.java#L207-L223" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/BidiApiRemotewebdriverTest.java#L188-L198" >}} {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md index a6d000fbd046..c181f613e028 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md @@ -22,17 +22,16 @@ Starting a Chrome session with basic defined options looks like this: {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L25-L26" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L18-L19" >}} {{< /tab >}} {{% tab header="Python" %}} -Note that Python must specify service class to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) -{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L8-L10" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L6-L7" >}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L16-L17" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L12-L13" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L8-L9" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L7-L8" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< gh-codeblock path="/examples/javascript/test/getting_started/openChromeTest.spec.js#L10-L14">}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md index 150822a1034f..a60f3ecf1e5a 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md @@ -22,17 +22,16 @@ Chrome に固有のCapabilityは、Google の[Capabilities & ChromeOptions](http {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L25-L26" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L18-L19" >}} {{< /tab >}} {{% tab header="Python" %}} -Note that Python must specify service class to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) -{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L8-L10" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L6-L7" >}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L16-L17" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L12-L13" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L8-L9" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L7-L8" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< gh-codeblock path="/examples/javascript/test/getting_started/openChromeTest.spec.js#L10-L14">}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md index 6f6c1d171557..365038e06f9c 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md @@ -21,17 +21,16 @@ Este é um exemplo de como iniciar uma sessão Chrome com um conjunto de opçõe {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L25-L26" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L18-L19" >}} {{< /tab >}} {{% tab header="Python" %}} -Note that Python must specify service class to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) -{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L8-L10" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L6-L7" >}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L16-L17" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L12-L13" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L8-L9" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L7-L8" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< gh-codeblock path="/examples/javascript/test/getting_started/openChromeTest.spec.js#L10-L14">}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md index e1954bd0532d..77635389baf7 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md @@ -22,17 +22,16 @@ Starting a Chrome session with basic defined options looks like this: {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L25-L26" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L18-L19" >}} {{< /tab >}} {{% tab header="Python" %}} -Note that Python must specify service class to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) -{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L8-L10" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L6-L7" >}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L16-L17" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L12-L13" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L8-L9" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L7-L8" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< gh-codeblock path="/examples/javascript/test/getting_started/openChromeTest.spec.js#L10-L14">}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md index b2b57ca0cb89..fd585bf4ba42 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md @@ -17,17 +17,16 @@ Starting an Edge session with basic defined options looks like this: {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L25-L26" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L18-L19" >}} {{< /tab >}} {{% tab header="Python" %}} -Note that Python must specify service class to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) -{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L8-L10" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L6-L7" >}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L16-L17" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L12-L13" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L8-L9" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L7-L8" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< gh-codeblock path="/examples/javascript/test/getting_started/openEdgeTest.spec.js#L11-L16">}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md index ad2687ffc0fd..f76076180268 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md @@ -17,17 +17,16 @@ Chromeと同様に、edgedriverのメジャー バージョン番号は、Edge {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L25-L26" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L18-L19" >}} {{< /tab >}} {{% tab header="Python" %}} -Note that Python must specify service class to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) -{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L8-L10" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L6-L7" >}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L16-L17" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L12-L13" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L8-L9" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L7-L8" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< gh-codeblock path="/examples/javascript/test/getting_started/openEdgeTest.spec.js#L11-L16">}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md index 6c493e21fcf4..9f2773b970e5 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md @@ -17,17 +17,16 @@ Este é um exemplo de como iniciar uma sessão Edge com um conjunto de opções {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L25-L26" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L18-L19" >}} {{< /tab >}} {{% tab header="Python" %}} -Note that Python must specify service class to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) -{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L8-L10" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L6-L7" >}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L16-L17" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L12-L13" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L8-L9" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L7-L8" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< gh-codeblock path="/examples/javascript/test/getting_started/openEdgeTest.spec.js#L11-L16">}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md index b2b57ca0cb89..fd585bf4ba42 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md @@ -17,17 +17,16 @@ Starting an Edge session with basic defined options looks like this: {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L25-L26" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L18-L19" >}} {{< /tab >}} {{% tab header="Python" %}} -Note that Python must specify service class to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) -{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L8-L10" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L6-L7" >}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L16-L17" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L12-L13" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L8-L9" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L7-L8" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< gh-codeblock path="/examples/javascript/test/getting_started/openEdgeTest.spec.js#L11-L16">}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md index d84f3f24278e..ea9b1e09b745 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md @@ -21,17 +21,16 @@ Starting a Firefox session with basic defined options looks like this: {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L31-L32" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L24-L25" >}} {{< /tab >}} {{% tab header="Python" %}} -Note that Python must specify service class to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) -{{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L11-L13" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L9-L10" >}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs#L31-L32" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs#L23-L24" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L10-L11" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L9-L10" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< gh-codeblock path="/examples/javascript/test/getting_started/openFirefoxTest.spec.js#L10-L14">}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md index 4bd36450769c..790d00c6056e 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md @@ -21,17 +21,16 @@ Starting a Firefox session with basic defined options looks like this: {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L31-L32" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L24-L25" >}} {{< /tab >}} {{% tab header="Python" %}} -Note that Python must specify service class to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) -{{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L11-L13" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L9-L10" >}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs#L31-L32" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs#L23-L24" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L10-L11" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L9-L10" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< gh-codeblock path="/examples/javascript/test/getting_started/openFirefoxTest.spec.js#L10-L14">}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md index 7f03af671a48..81ed12bf1d0a 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md @@ -21,17 +21,16 @@ Este é um exemplo de como iniciar uma sessão Firefox com um conjunto de opçõ {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L31-L32" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L24-L25" >}} {{< /tab >}} {{% tab header="Python" %}} -Note that Python must specify service class to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) -{{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L11-L13" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L9-L10" >}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs#L31-L32" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs#L23-L24" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L10-L11" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L9-L10" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< gh-codeblock path="/examples/javascript/test/getting_started/openFirefoxTest.spec.js#L10-L14">}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md index 9e674c1d71fe..33ffe4b933ed 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md @@ -21,17 +21,16 @@ Starting a Firefox session with basic defined options looks like this: {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L31-L32" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L24-L25" >}} {{< /tab >}} {{% tab header="Python" %}} -Note that Python must specify service class to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) -{{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L11-L13" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L9-L10" >}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs#L31-L32" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs#L23-L24" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L10-L11" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L9-L10" >}} {{< /tab >}} {{< tab header="JavaScript" >}} {{< gh-codeblock path="/examples/javascript/test/getting_started/openFirefoxTest.spec.js#L10-L14">}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.en.md b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.en.md index a7606084c2bd..8412d337babc 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.en.md @@ -29,21 +29,21 @@ Starting a Microsoft Edge browser in Internet Explorer Compatibility mode with b {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#28-L31" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#28-L30" >}} {{< /tab >}} {{% tab header="Python" %}} -Note that Python must specify service class to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) -{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L14-L17" >}} +Note that Python must specify service class for IE to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) +{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L13-L16" >}} {{% /tab %}} {{% tab header="CSharp" %}} Note that the .NET [Driver Manager]({{< ref "../getting_started/install_drivers#1-driver-management-software" >}}) does not support Internet Explorer, so the location must be in a [directory on PATH]({{< ref "../getting_started/install_drivers#2-the-path-environment-variable" >}}), or specified explicitly as in this example. -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L24-L32" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L24-L30" >}} {{% /tab %}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/internet_explorer_spec.rb#L8-L10" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/internet_explorer_spec.rb#L8-L9" >}} {{< /tab >}} {{< tab header="JavaScript" code=true >}} let driver = await new Builder() diff --git a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.ja.md b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.ja.md index b3e22d8fde5d..c04728f25e76 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.ja.md @@ -29,21 +29,21 @@ Starting a Microsoft Edge browser in Internet Explorer Compatibility mode with b {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#28-L31" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#28-L30" >}} {{< /tab >}} {{% tab header="Python" %}} -Note that Python must specify service class to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) -{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L14-L17" >}} +Note that Python must specify service class for IE to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) +{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L13-L16" >}} {{% /tab %}} {{% tab header="CSharp" %}} Note that the .NET [Driver Manager]({{< ref "../getting_started/install_drivers#1-driver-management-software" >}}) does not support Internet Explorer, so the location must be in a [directory on PATH]({{< ref "../getting_started/install_drivers#2-the-path-environment-variable" >}}), or specified explicitly as in this example. -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L24-L32" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L24-L30" >}} {{% /tab %}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/internet_explorer_spec.rb#L8-L10" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/internet_explorer_spec.rb#L8-L9" >}} {{< /tab >}} {{< tab header="JavaScript" code=true >}} let driver = await new Builder() diff --git a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.pt-br.md index d8993315434b..946a1c009ef8 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.pt-br.md @@ -29,21 +29,21 @@ usando um conjunto de opções básicas: {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#28-L31" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#28-L30" >}} {{< /tab >}} {{% tab header="Python" %}} -Note that Python must specify service class to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) -{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L14-L17" >}} +Note that Python must specify service class for IE to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) +{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L13-L16" >}} {{% /tab %}} {{% tab header="CSharp" %}} Note that the .NET [Driver Manager]({{< ref "../getting_started/install_drivers#1-driver-management-software" >}}) does not support Internet Explorer, so the location must be in a [directory on PATH]({{< ref "../getting_started/install_drivers#2-the-path-environment-variable" >}}), or specified explicitly as in this example. -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L24-L32" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L24-L30" >}} {{% /tab %}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/internet_explorer_spec.rb#L8-L10" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/internet_explorer_spec.rb#L8-L9" >}} {{< /tab >}} {{< tab header="JavaScript" code=true >}} let driver = await new Builder() diff --git a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.zh-cn.md index 49ff3ed39d5f..f96e114234de 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.zh-cn.md @@ -29,21 +29,21 @@ Starting a Microsoft Edge browser in Internet Explorer Compatibility mode with b {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#28-L31" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#28-L30" >}} {{< /tab >}} {{% tab header="Python" %}} -Note that Python must specify service class to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) -{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L14-L17" >}} +Note that Python must specify service class for IE to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}}) +{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L13-L16" >}} {{% /tab %}} {{% tab header="CSharp" %}} Note that the .NET [Driver Manager]({{< ref "../getting_started/install_drivers#1-driver-management-software" >}}) does not support Internet Explorer, so the location must be in a [directory on PATH]({{< ref "../getting_started/install_drivers#2-the-path-environment-variable" >}}), or specified explicitly as in this example. -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L24-L32" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L24-L30" >}} {{% /tab %}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/internet_explorer_spec.rb#L8-L10" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/internet_explorer_spec.rb#L8-L9" >}} {{< /tab >}} {{< tab header="JavaScript" code=true >}} let driver = await new Builder() diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.en.md b/website_and_docs/content/documentation/webdriver/browsers/safari.en.md index 517f6449ea2b..68d99d6e3ba4 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.en.md @@ -35,7 +35,7 @@ Starting a Safari session with basic defined options looks like this: {{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/SafariTest.cs#L14-L15" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/internet_explorer_spec.rb#L8-L9" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/safari_spec.rb#L7-L8" >}} {{< /tab >}} {{< tab header="JavaScript" >}} let options = new safari.Options(); diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md b/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md index 6d94a8113bce..61b37488b1c8 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md @@ -35,7 +35,7 @@ Starting a Safari session with basic defined options looks like this: {{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/SafariTest.cs#L14-L15" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/internet_explorer_spec.rb#L8-L9" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/safari_spec.rb#L7-L8" >}} {{< /tab >}} {{< tab header="JavaScript" >}} let options = new safari.Options(); diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md index 9caa4a7f622a..46a1165a0f20 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md @@ -35,7 +35,7 @@ Este é um exemplo de como iniciar uma sessão Safari com um conjunto de opçõe {{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/SafariTest.cs#L14-L15" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/internet_explorer_spec.rb#L8-L9" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/safari_spec.rb#L7-L8" >}} {{< /tab >}} {{< tab header="JavaScript" >}} let options = new safari.Options(); diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md index 60d639bae446..1af479cd4ec3 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md @@ -35,7 +35,7 @@ Starting a Safari session with basic defined options looks like this: {{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/SafariTest.cs#L14-L15" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/browsers/internet_explorer_spec.rb#L8-L9" >}} +{{< gh-codeblock path="/examples/ruby/spec/browsers/safari_spec.rb#L7-L8" >}} {{< /tab >}} {{< tab header="JavaScript" >}} let options = new safari.Options(); 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 05cc7ebc6564..47265ba241f3 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 @@ -20,13 +20,13 @@ For more details on starting a session read our documentation on [driver session {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L29" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L17" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L8" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L6" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L20" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L15" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L7" >}} @@ -44,13 +44,13 @@ In this example we are [navigating]({{< ref "/documentation/webdriver/interactio {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L39" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L18" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L10" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L8" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L32" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L17" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L9" >}} @@ -70,13 +70,13 @@ can request, including window handles, browser size / position, cookies, alerts, {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L41" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L20" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L12" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L10" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L34" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L19" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L11" >}} @@ -104,13 +104,13 @@ Read more about [Waiting strategies]({{< ref "/documentation/webdriver/waits.md" {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L44" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L23" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L15" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L13" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L37" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L22" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L14" >}} @@ -129,13 +129,13 @@ with one without first [finding an element]({{< ref "/documentation/webdriver/el {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L46-L47" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L25-L26" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L17-L18" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L15-L16" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L39-L40" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L24-L25" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L16-L17" >}} @@ -154,13 +154,13 @@ but you will use them frequently. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L49-L50" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L28-L29" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L20-L21" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L18-L19" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L42-L43" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L27-L28" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L19-L20" >}} @@ -178,13 +178,13 @@ Elements store a lot of [information that can be requested]({{< ref "/documentat {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L53" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L32" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L24" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L22" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L46" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L31" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L23" >}} @@ -204,13 +204,13 @@ No more commands can be sent to this driver instance. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L34" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L35" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L27" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L25" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L26" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L34" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L26" >}} 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 f6d01468d578..06db8873f599 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 @@ -21,13 +21,13 @@ For more details on starting a session read our documentation on [driver sessio {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L29" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L17" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L8" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L6" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L20" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L15" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L7" >}} @@ -45,13 +45,13 @@ In this example we are ブラウザが[ナビゲート]({{< ref "/documentation/ {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L39" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L18" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L10" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L8" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L32" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L17" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L9" >}} @@ -71,13 +71,13 @@ can request, including window handles, browser size / position, cookies, alerts, {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L41" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L20" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L12" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L10" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L35" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L19" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L11" >}} @@ -105,13 +105,13 @@ Read more about [Waiting strategies]({{< ref "/documentation/webdriver/waits.md" {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L44" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L23" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L15" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L13" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L37" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L22" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L14" >}} @@ -130,13 +130,13 @@ with one without first [finding an element]({{< ref "/documentation/webdriver/el {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L46-L47" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L25-L26" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L17-L18" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L15-L16" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L39-L40" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L24-L25" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L16-L17" >}} @@ -155,13 +155,13 @@ but you will use them frequently. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L49-L50" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L28-L29" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L20-L21" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L18-L19" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L42-L43" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L27-L28" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L19-L20" >}} @@ -179,13 +179,13 @@ Elements store a lot of [information that can be requested]({{< ref "/documentat {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L53" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L32" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L24" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L22" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L46" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L31" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L23" >}} @@ -205,13 +205,13 @@ No more commands can be sent to this driver instance. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L34" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L35" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L27" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L25" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L26" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L34" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L26" >}} 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 1d41348a7f26..2c9043db6f28 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 @@ -19,13 +19,13 @@ Para ter mais detalhes sobre como iniciar uma sessão, leia nossa documentação {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L29" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L17" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L8" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L6" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L20" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L15" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L7" >}} @@ -43,13 +43,13 @@ Nesse exemplo estamos [navegando]({{< ref "/documentation/webdriver/interactions {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L39" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L18" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L10" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L8" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L32" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L17" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L9" >}} @@ -68,13 +68,13 @@ pode solicitar, incluindo window handles, tamanho / posição do navegador, cook {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L41" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L20" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L12" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L10" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L35" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L19" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L11" >}} @@ -103,13 +103,13 @@ Leia mais sobre [Estratégias de espera]({{< ref "/documentation/webdriver/waits {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L44" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L23" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L15" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L13" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L37" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L22" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L14" >}} @@ -129,13 +129,13 @@ com um sem o primeiro [encontrando um elemento]({{< ref "/documentation/webdrive {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L46-L47" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L25-L26" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L17-L18" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L15-L16" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L39-L40" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L24-L25" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L16-L17" >}} @@ -154,13 +154,13 @@ mas você irá usá-las com frequência. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L49-L50" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L28-L29" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L20-L21" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L18-L19" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L42-L43" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L27-L28" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L19-L20" >}} @@ -178,13 +178,13 @@ Elementos podem guardar muitas [informações que podem ser solicitadas]({{< ref {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L53" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L32" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L24" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L22" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L46" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L31" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L23" >}} @@ -204,13 +204,13 @@ Nenhum outro comando pode ser enviado para esta instância do driver. {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L34" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L35" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L27" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L25" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L26" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L34" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L26" >}} 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 eae092455845..40564dd6d29f 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 @@ -23,13 +23,13 @@ Selenium所做的一切, {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L29" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L17" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L8" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L6" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L20" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L15" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L7" >}} @@ -50,13 +50,13 @@ Selenium所做的一切, {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L39" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L18" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L10" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L8" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L32" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L17" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L9" >}} @@ -76,13 +76,13 @@ Selenium所做的一切, {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L41" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L20" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L12" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L10" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L35" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L19" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L11" >}} @@ -115,13 +115,13 @@ Selenium所做的一切, {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L44" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L23" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L15" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L13" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L37" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L22" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L14" >}} @@ -141,13 +141,13 @@ Selenium所做的一切, {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L46-L47" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L25-L26" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L17-L18" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L15-L16" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L39-L40" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L24-L25" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L16-L17" >}} @@ -167,13 +167,13 @@ Selenium所做的一切, {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L49-L50" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L28-L29" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L20-L21" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L18-L19" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L42-L43" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L27-L28" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L19-L20" >}} @@ -191,13 +191,13 @@ Selenium所做的一切, {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L53" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L32" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L24" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L22" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L46" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L31" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L23" >}} @@ -218,13 +218,13 @@ Selenium所做的一切, {{< tabpane code=false langEqualsHeader=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L34" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScriptTest.java#L35" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L27" >}} +{{< gh-codeblock path="examples/python/tests/getting_started/test_first_script.py#L25" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L26" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScriptTest.cs#L34" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script_spec.rb#L26" >}} 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 3d808560a6e2..361d90b78fb4 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 @@ -45,22 +45,14 @@ the correct driver for your browser, there are many third party libraries to ass {{% tab header="Java" %}} 1. Import [WebDriverManager](https://github.com/bonigarcia/webdrivermanager) + ```java import io.github.bonigarcia.wdm.WebDriverManager; ``` -2. Calling `setup()` automatically puts the correct browser driver where the code will see it: -```java -WebDriverManager.chromedriver().setup(); -``` -3. Just initialize the driver as you normally would: -```java -ChromeDriver driver = new ChromeDriver(); -``` - +2. Call `setup()`: + +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/InstallDriversTest.java#L16-L18" >}} {{% /tab %}} {{% tab header="Python" %}} @@ -71,21 +63,9 @@ See full example on GitHub. from webdriver_manager.chrome import ChromeDriverManager ``` -2. Use `install()` to get the location used by the manager and pass it into service class - -```py -service = Service(executable_path=ChromeDriverManager().install()) -``` - -3. Use `Service` instance when initializing the driver: -```py -driver = webdriver.Chrome(service=service) -``` +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#L14-L16" >}} {{% /tab %}} {{% tab header="CSharp" %}} @@ -100,20 +80,7 @@ using WebDriverManager.DriverConfigs.Impl; 2. Use the `SetUpDriver()` which requires a config class: -```csharp -new DriverManager().SetUpDriver(new ChromeConfig()); -``` - -3. Initialize your driver as you normally would: - -```csharp -var driver = new ChromeDriver() -``` - - +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/InstallDriversTest.cs#L18-L20" >}} {{% /tab %}} {{% tab header="Ruby" %}} @@ -124,19 +91,8 @@ gem 'webdrivers', '~> 5.0' ``` 2. Require webdrivers in your project: -```rb -require 'webdrivers' -``` - -3. Initialize driver as you normally would: -```rb -driver = Selenium::WebDriver.for :chrome -``` - +{{< gh-codeblock path="examples/ruby/spec/getting_started/install_drivers_spec.rb#L7-L9" >}} {{% /tab %}} {{% tab header="JavaScript" %}} 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 a6b2f3a46aff..ddc89237d9e6 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 @@ -58,19 +58,9 @@ Read more at the blog announcement for [Selenium Manager ](/blog/2022/introducin ```java import io.github.bonigarcia.wdm.WebDriverManager; ``` -2. Calling `setup()` automatically puts the correct browser driver where the code will see it: -```java -WebDriverManager.chromedriver().setup(); -``` -3. Just initialize the driver as you normally would: -```java -ChromeDriver driver = new ChromeDriver(); -``` +2. Call `setup()`: - +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/InstallDriversTest.java#L16-L18" >}} {{% /tab %}} {{% tab header="Python" %}} @@ -81,21 +71,9 @@ See full example on GitHub. from webdriver_manager.chrome import ChromeDriverManager ``` -2. Use `install()` to get the location used by the manager and pass it into service class +2. Use `install()` to get the location used by the manager and pass it to the driver in a service class instance: -```py -service = Service(executable_path=ChromeDriverManager().install()) -``` - -3. Use `Service` instance when initializing the driver: -```py -driver = webdriver.Chrome(service=service) -``` - - +{{< gh-codeblock path="examples/python/tests/getting_started/test_install_drivers.py#L14-L16" >}} {{% /tab %}} {{% tab header="CSharp" %}} @@ -108,20 +86,7 @@ using WebDriverManager.DriverConfigs.Impl; 2. Use the `SetUpDriver()` which requires a config class: -```csharp -new DriverManager().SetUpDriver(new ChromeConfig()); -``` - -3. Initialize your driver as you normally would: - -```csharp -var driver = new ChromeDriver() -``` - - +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/InstallDriversTest.cs#L18-L20" >}} {{% /tab %}} {{% tab header="Ruby" %}} 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 acd7664c493d..eba66eb1c69c 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 @@ -59,19 +59,9 @@ o driver correto para o seu navegador de internet, existem diversas bibliotecas ```java import io.github.bonigarcia.wdm.WebDriverManager; ``` -2. Invocar o `setup()` coloca automaticamente o driver correto, onde o código conseguirá enxergá-lo: -```java -WebDriverManager.chromedriver().setup(); -``` -3. Inicialize o seu driver como você normalmente faria: -```java -ChromeDriver driver = new ChromeDriver(); -``` +2. Invocar o `setup()`: - +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/InstallDriversTest.java#L16-L18" >}} {{% /tab %}} {{% tab header="Python" %}} @@ -84,19 +74,7 @@ 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 -```py -service = Service(executable_path=ChromeDriverManager().install()) -``` - -3. Use a instância `Service` ao inicializar o driver: -```py -driver = webdriver.Chrome(service=service) -``` - - +{{< gh-codeblock path="examples/python/tests/getting_started/test_install_drivers.py#L14-L16" >}} {{% /tab %}} {{% tab header="CSharp" %}} @@ -109,20 +87,7 @@ using WebDriverManager.DriverConfigs.Impl; 2. Use o `SetUpDriver()` que requer uma classe de configuração: -```csharp -new DriverManager().SetUpDriver(new ChromeConfig()); -``` - -3. Inicialize o seu driver como você normalmente faria: - -```csharp -var driver = new ChromeDriver() -``` - - +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/InstallDriversTest.cs#L18-L20" >}} {{% /tab %}} {{% tab header="Ruby" %}} 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 2a474701364b..7820c2e12159 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 @@ -62,21 +62,9 @@ Read more at the blog announcement for [Selenium Manager ](/blog/2022/introducin ```java import io.github.bonigarcia.wdm.WebDriverManager; ``` -2. 调用 `setup()` 会自动将正确的浏览器驱动程序 -放在代码可以看到的位置: +2. 调用 `setup()`: -```java -WebDriverManager.chromedriver().setup(); -``` -3. 只需像平常一样初始化驱动程序: -```java -ChromeDriver driver = new ChromeDriver(); -``` - - +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/InstallDriversTest.java#L16-L18" >}} {{% /tab %}} {{% tab header="Python" %}} @@ -89,19 +77,7 @@ from webdriver_manager.chrome import ChromeDriverManager 2. 使用 `install()` 获取管理器使用的位置, 并将其传递到服务类中 -```py -service = Service(executable_path=ChromeDriverManager().install()) -``` - -3. 使用 `Service` 实例并初始化驱动程序: -```py -driver = webdriver.Chrome(service=service) -``` - - +{{< gh-codeblock path="examples/python/tests/getting_started/test_install_drivers.py#L14-L16" >}} {{% /tab %}} {{% tab header="CSharp" %}} @@ -114,20 +90,7 @@ using WebDriverManager.DriverConfigs.Impl; 2. 使用 `SetUpDriver()` 时需要一个配置类: -```csharp -new DriverManager().SetUpDriver(new ChromeConfig()); -``` - -3. 像往常一样初始化驱动程序: - -```csharp -var driver = new ChromeDriver() -``` - - +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/InstallDriversTest.cs#L18-L20" >}} {{% /tab %}} {{% tab header="Ruby" %}} diff --git a/website_and_docs/content/documentation/webdriver/getting_started/install_library.en.md b/website_and_docs/content/documentation/webdriver/getting_started/install_library.en.md index a1e8f4b348ea..2c31700dc977 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/install_library.en.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/install_library.en.md @@ -20,79 +20,76 @@ you are using the latest version. {{< tabpane code=false langEqualsHeader=true >}} {{% tab header="Java" %}} -Installation of Selenium libraries for Java is accomplished using a build tool. -You can see all available versions on -[Maven Repository](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java) +View the minimum supported Java version [here](https://github.com/SeleniumHQ/selenium/blob/trunk/.bazelrc#L13). -For Maven, add the _selenium-java_ dependency in your project `pom.xml` file: +Installation of Selenium libraries for Java is accomplished using a build tool. -```xml - - org.seleniumhq.selenium - selenium-java - 4.4.0 - -``` +### Maven +Specify the dependency in the project's `pom.xml` file: -For Gradle, add the _selenium-java_ dependency in your project `build.gradle` file: +{{< gh-codeblock path="examples/java/pom.xml#L22-L26" >}} -```text -dependencies { - compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.4.0' -``` +### Gradle +Specify the dependency in the project `build.gradle` file as `testImplementation`: -Gradle 7.0 and above: +{{< gh-codeblock path="examples/java/build.gradle#L13" >}} -```text -dependencies { - implementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.4.0' -``` -## Supported Minimum Version + {{% /tab %}} + {{% tab header="Python" %}} +The minimum supported Python version for each Selenium version can be found +in `Supported Python Versions` on [PyPi](https://pypi.org/project/selenium/) -Make sure to use the Java version greater than or equal to the minimum supported version by Selenium. -Java 8 is currently the minimum supported version by Selenium. -View the updates in the minimum version supported [here](https://github.com/SeleniumHQ/selenium/blob/trunk/.bazelrc#L13). +There are a couple different ways to install Selenium. - {{% /tab %}} - {{% tab header="Python" %}} - Installation of Selenium libraries for Python can be done using pip: +### Pip ```shell pip install selenium ``` +### Download + Alternatively you can download the [PyPI source archive](https://pypi.org/project/selenium/#files) (selenium-x.x.x.tar.gz) and install it using _setup.py_: ```shell python setup.py install ``` -## Supported Minimum Version -Make sure to use the Python version greater than or equal to the minimum supported version by Selenium. -Python 3.7 is currently the minimum supported version by Selenium. -View the updates in the minimum version supported [here](https://github.com/SeleniumHQ/selenium/blob/trunk/py/setup.py#L41). +### Require in project + +To use it in a project, add it to the `requirements.txt` file: +{{< gh-codeblock path="examples/python/requirements.txt#L1" >}} {{% /tab %}} {{% tab header="CSharp" %}} - Installation of Selenium libraries for C# can be done using NuGet in one of two ways +A list of all supported frameworks for each version of Selenium +is available on [Nuget](https://www.nuget.org/packages/Selenium.WebDriver) + +There are a few options for installing Selenium. + +### Packet Manager - * Using a Packet Manager: ```shell Install-Package Selenium.WebDriver ``` - * Using .NET CLI + +### .NET CLI + ```shell dotnet add package Selenium.WebDriver ``` -## Supported .NET Versions -Make sure to use the .NET SDK version compatible with relevant [Selenium package](https://www.nuget.org/packages/Selenium.WebDriver). -Check the dependencies section to find out the [supported .NET version](https://dotnet.microsoft.com/en-us/download/dotnet). -At the time of this update, .NET 5.0 (Visual Studio 2019) is known to be supported, and .NET 6.0 is not supported. -You can download [MSBuild Tools 2019 from here](https://docs.microsoft.com/en-us/visualstudio/install/create-an-offline-installation-of-visual-studio?view=vs-2019) to install the needed components and dependencies such as .NET SDK and NuGet Package Manager. - -## Using Visual Studio Code (vscode) and C# -This is a quick guide to help you get started with vscode and C#, however, more research may be required. + +### CSProj + +in the project's `csproj` file, specify the dependency as a `PackageReference` in `ItemGroup`: + +{{< gh-codeblock language="xml" path="examples/dotnet/SeleniumDocs/SeleniumDocs.csproj#L14" >}} + +### Additional considerations + +Further items of note for using Visual Studio Code (vscode) and C# + Install the compatible .NET SDK as per the section above. Also install the vscode extensions (Ctrl-Shift-X) for C# and NuGet. Follow the [instruction here](https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code?pivots=dotnet-5-0) @@ -118,37 +115,39 @@ Now you can use the examples in the documentation related to C# with vscode. {{% /tab %}} {{% tab header="Ruby" %}} - Installation of Selenium libraries for Ruby can be done using gem: +You can see the minimum required version of Ruby for any given Selenium version +on [rubygems.org](https://rubygems.org/gems/selenium-webdriver/) -```shell -gem install selenium-webdriver -``` +Selenium can be installed two different ways. -Or add it to your `Gemfile`: +### Install manually -```rb -gem 'selenium-webdriver', '~> 4.4' +```shell +gem install selenium-webdriver ``` -## Supported Minimum Version +### Add to project's gemfile -Make sure to use the Ruby version greater than or equal to the minimum supported version by Selenium. -Ruby 2.7 is currently the minimum supported version by Selenium. -View the updates in the minimum version supported [here](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/selenium-webdriver.gemspec#L32). +{{< gh-codeblock language="ruby" path="examples/ruby/Gemfile#L10" >}} {{% /tab %}} {{% tab header="JavaScript" %}} - Installation of Selenium libraries for JavaScript can be done using npm: +You can find the minimum required version of Node for any given version of Selenium in the +`Node Support Policy` section on [npmjs](https://www.npmjs.com/package/selenium-webdriver) + +Selenium is typically installed using npm. + +### Install locally ```shell npm install selenium-webdriver ``` -## Supported Minimum Version +### Add to project + +In your project's `package.json`, add requirement to `dependencies`: -Make sure to use the Node version greater than or equal to the minimum supported version by Selenium. -Node 14.20.0 is currently the minimum supported version by Selenium. -View the updates in the minimum version supported [here](https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/node/selenium-webdriver/package.json#L23). +{{< gh-codeblock path="examples/javascript/package.json#L14" >}} {{% /tab %}} {{< tab header="Kotlin" >}} diff --git a/website_and_docs/content/documentation/webdriver/getting_started/install_library.ja.md b/website_and_docs/content/documentation/webdriver/getting_started/install_library.ja.md index b65e23c39537..f32de041847d 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/install_library.ja.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/install_library.ja.md @@ -14,80 +14,83 @@ aliases: [ 最初にあなたの自動化プロジェクトにSeleniumのバインディングをインストールする必要があります。 インストールの方法は選択した言語によって異なります。 +## Requirements by language + {{< tabpane code=false langEqualsHeader=true >}} {{% tab header="Java" %}} -JavaへのSeleniumライブラリのインストールはMavenを使います。 -プロジェクトのpom.xmlに _selenium-java_ の依存関係を追加してください。 - -```xml - - org.seleniumhq.selenium - selenium-java - 4.4.0 - -``` +View the minimum supported Java version [here](https://github.com/SeleniumHQ/selenium/blob/trunk/.bazelrc#L13). -For Gradle, add the _selenium-java_ dependency in your project `build.gradle` file: - -```text -dependencies { - compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.4.0' -``` +Installation of Selenium libraries for Java is accomplished using a build tool. -Gradle 7.0 and above: +### Maven +Specify the dependency in the project's `pom.xml` file: -```text -dependencies { - implementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.4.0' -``` +{{< gh-codeblock path="examples/java/pom.xml#L22-L26" >}} -## Supported Minimum Version +### Gradle +Specify the dependency in the project `build.gradle` file as `testImplementation`: -Make sure to use the Java version greater than or equal to the minimum supported version by Selenium. -Java 8 is currently the minimum supported version by Selenium. -View the updates in the minimum version supported [here](https://github.com/SeleniumHQ/selenium/blob/trunk/.bazelrc#L13). +{{< gh-codeblock path="examples/java/build.gradle#L13" >}} {{% /tab %}} {{% tab header="Python" %}} - PythonへのSeleniumライブラリのインストールはpipを使います。 +The minimum supported Python version for each Selenium version can be found +in `Supported Python Versions` on [PyPi](https://pypi.org/project/selenium/) + +There are a couple different ways to install Selenium. + +### Pip ```shell pip install selenium ``` -また、[PyPI source archive](https://pypi.org/project/selenium/#files) -(selenium-x.x.x.tar.gz)をダウンロードして、 _setup.py_ でインストールすることもできます。 +### Download + +Alternatively you can download the [PyPI source archive](https://pypi.org/project/selenium/#files) +(selenium-x.x.x.tar.gz) and install it using _setup.py_: ```shell python setup.py install ``` -## Supported Minimum Version -Make sure to use the Python version greater than or equal to the minimum supported version by Selenium. -Python 3.7 is currently the minimum supported version by Selenium. -View the updates in the minimum version supported [here](https://github.com/SeleniumHQ/selenium/blob/trunk/py/setup.py#L41). +### Require in project + +To use it in a project, add it to the `requirements.txt` file: +{{< gh-codeblock path="examples/python/requirements.txt#L1" >}} {{% /tab %}} {{% tab header="CSharp" %}} - C#へのSeleniumライブラリのインストールはNuGetを使います。 +A list of all supported frameworks for each version of Selenium +is available on [Nuget](https://www.nuget.org/packages/Selenium.WebDriver) + +There are a few options for installing Selenium. + +### Packet Manager ```shell -# Using package manager Install-Package Selenium.WebDriver -# or using .Net CLI +``` + +### .NET CLI + +```shell dotnet add package Selenium.WebDriver ``` -## Supported .NET Versions -Make sure to use the .NET SDK version compatible with relevant [Selenium package](https://www.nuget.org/packages/Selenium.WebDriver). -Check the dependencies section to find out the [supported .NET version](https://dotnet.microsoft.com/en-us/download/dotnet). -At the time of this update, .NET 5.0 (Visual Studio 2019) is known to be supported, and .NET 6.0 is not supported. -You can download [MSBuild Tools 2019 from here](https://docs.microsoft.com/en-us/visualstudio/install/create-an-offline-installation-of-visual-studio?view=vs-2019) to install the needed components and dependencies such as .NET SDK and NuGet Package Manager. - -## Using Visual Studio Code (vscode) and C# -This is a quick guide to help you get started with vscode and C#, however, more research may be required. + +### CSProj + +in the project's `csproj` file, specify the dependency as a `PackageReference` in `ItemGroup`: + +{{< gh-codeblock language="xml" path="examples/dotnet/SeleniumDocs/SeleniumDocs.csproj#L14" >}} + +### Additional considerations + +Further items of note for using Visual Studio Code (vscode) and C# + Install the compatible .NET SDK as per the section above. Also install the vscode extensions (Ctrl-Shift-X) for C# and NuGet. -Follow the [instruction here](https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code?pivots=dotnet-5-0) +Follow the [instruction here](https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code?pivots=dotnet-5-0) to create and run the "Hello World" console project using C#. You may also create a NUnit starter project using the command line `dotnet new NUnit`. Make sure the file `%appdata%\NuGet\nuget.config` is configured properly as some developers reported that it will be empty due to some issues. @@ -107,37 +110,46 @@ You may have to customize `nuget.config` to meet you needs. Now, go back to vscode, press Ctrl-Shift-P, and type "NuGet Add Package", and enter the required Selenium packages such as `Selenium.WebDriver`. Press Enter and select the version. Now you can use the examples in the documentation related to C# with vscode. - + {{% /tab %}} {{% tab header="Ruby" %}} - RubyへのSeleniumライブラリのインストールはgemを使います。 +You can see the minimum required version of Ruby for any given Selenium version +on [rubygems.org](https://rubygems.org/gems/selenium-webdriver/) + +Selenium can be installed two different ways. + +### Install manually ```shell gem install selenium-webdriver ``` -## Supported Minimum Version -Make sure to use the Ruby version greater than or equal to the minimum supported version by Selenium. -Ruby 2.7 is currently the minimum supported version by Selenium. -View the updates in the minimum version supported [here](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/selenium-webdriver.gemspec#L32). +### Add to project's gemfile + +{{< gh-codeblock language="ruby" path="examples/ruby/Gemfile#L10" >}} {{% /tab %}} {{% tab header="JavaScript" %}} - JavaScriptへのSeleniumライブラリのインストールはnpmを使います。 +You can find the minimum required version of Node for any given version of Selenium in the +`Node Support Policy` section on [npmjs](https://www.npmjs.com/package/selenium-webdriver) + +Selenium is typically installed using npm. + +### Install locally ```shell npm install selenium-webdriver ``` -## Supported Minimum Version -Make sure to use the Node version greater than or equal to the minimum supported version by Selenium. -Node 14.20.0 is currently the minimum supported version by Selenium. -View the updates in the minimum version supported [here](https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/node/selenium-webdriver/package.json#L23). +### Add to project + +In your project's `package.json`, add requirement to `dependencies`: + +{{< gh-codeblock path="examples/javascript/package.json#L14" >}} {{% /tab %}} {{< tab header="Kotlin" >}} - Kotlinのネイティブ言語バインディングが欠落しているため、Javaバインディングを使用する必要があります。 - 例えば、 maven [Java](#java) を使用します。 + Use the Java bindings for Kotlin. {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/getting_started/install_library.pt-br.md b/website_and_docs/content/documentation/webdriver/getting_started/install_library.pt-br.md index 2247d30414eb..a1d99f0b633e 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/install_library.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/install_library.pt-br.md @@ -15,83 +15,88 @@ aliases: [ Primeiro você precisa instalar as bibliotecas Selenium para seu projeto de automação. O processo de instalação de bibliotecas depende da linguagem que você escolher usar. +## Requirements by language + {{< tabpane code=false langEqualsHeader=true >}} {{% tab header="Java" %}} -A instalação de bibliotecas Selenium para Java pode ser feita usando Maven. -Adicione a dependência selenium-java em seu pom.xml: - -```xml - - org.seleniumhq.selenium - selenium-java - 4.4.0 - -``` +View the minimum supported Java version [here](https://github.com/SeleniumHQ/selenium/blob/trunk/.bazelrc#L13). -For Gradle, add the _selenium-java_ dependency in your project `build.gradle` file: +Installation of Selenium libraries for Java is accomplished using a build tool. -```text -dependencies { - compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.4.0' -``` +### Maven +Specify the dependency in the project's `pom.xml` file: -Gradle 7.0 and above: +{{< gh-codeblock path="examples/java/pom.xml#L22-L26" >}} -```text -dependencies { - implementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.4.0' -``` -## Supported Minimum Version +### Gradle +Specify the dependency in the project `build.gradle` file as `testImplementation`: -Make sure to use the Java version greater than or equal to the minimum supported version by Selenium. -Java 8 is currently the minimum supported version by Selenium. -View the updates in the minimum version supported [here](https://github.com/SeleniumHQ/selenium/blob/trunk/.bazelrc#L13). +{{< gh-codeblock path="examples/java/build.gradle#L13" >}} {{% /tab %}} {{% tab header="Python" %}} - A instalação de bibliotecas Selenium para Python pode ser feita usando pip: +The minimum supported Python version for each Selenium version can be found +in `Supported Python Versions` on [PyPi](https://pypi.org/project/selenium/) + +There are a couple different ways to install Selenium. + +### Pip ```shell pip install selenium ``` -Como alternativa, você pode baixar o [arquivo de origem do PyPI](https://pypi.org/project/selenium/#files) -(selenium-x.x.x.tar.gz) e instale-o usando _setup.py_: +### Download + +Alternatively you can download the [PyPI source archive](https://pypi.org/project/selenium/#files) +(selenium-x.x.x.tar.gz) and install it using _setup.py_: ```shell python setup.py install ``` -## Supported Minimum Version +### Require in project -Make sure to use the Python version greater than or equal to the minimum supported version by Selenium. -Python 3.7 is currently the minimum supported version by Selenium. -View the updates in the minimum version supported [here](https://github.com/SeleniumHQ/selenium/blob/trunk/py/setup.py#L41). +To use it in a project, add it to the `requirements.txt` file: +{{< gh-codeblock path="examples/python/requirements.txt#L1" >}} {{% /tab %}} {{% tab header="CSharp" %}} - A instalação de bibliotecas Selenium para C# pode ser feita usando NuGet: +A list of all supported frameworks for each version of Selenium +is available on [Nuget](https://www.nuget.org/packages/Selenium.WebDriver) + +There are a few options for installing Selenium. + +### Packet Manager ```shell -# Using package manager Install-Package Selenium.WebDriver -# or using .Net CLI +``` + +### .NET CLI + +```shell dotnet add package Selenium.WebDriver ``` -## Versões Suportadas .NET -Tenha certeza de utilizar a versão .NET SDK compatível com os [Pacotes Selenium](https://www.nuget.org/packages/Selenium.WebDriver) relevantes. -Veja a seção de dependências em [Versões suportadas .NET](https://dotnet.microsoft.com/en-us/download/dotnet). -Até esta atualização, .NET 5.0 (Visual Studio 2019) é suportada e .NET 6.0 não é suportada. -
Você pode fazer o download [MSBuild Tools 2019 aqui](https://docs.microsoft.com/en-us/visualstudio/install/create-an-offline-installation-of-visual-studio?view=vs-2019) e instalar os componentes e dependências necessárias, como .NET SDK e NuGet Package Manager. - -## Usando Visual Studio Code (vscode) e C# -Este é um guia rápido para você iniciar com VSCode e C#, no entanto, mais pesquisas podem ser necessárias. -
Instale o .NET SDK compativel como mostrado na seção acima. -Além disso instale as extensões (Ctrl-Shift-X) C# e NuGet no VSCode. -
Siga as [instruções aqui](https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code?pivots=dotnet-5-0) para criar e executar um projeto "Hello World" no console usando C#. Além disso crie um projeto inicial NUnit usando o comando `dotnet new NUnit`. -
Certifique-se de que o arquivo `%appdata%\NuGet\nuget.config` está configurado corretamente, pois alguns desenvolvedores reportaram que estará vazio devido alguns problemas. -Se o arquivo `nuget.config` estiver vazio, ou não configurado corretamente, então o build .NET irá falhar para projetos Selenium. -
Adicione a seguinte seção ao arquivo `nuget.config` se ele estiver vazio: + +### CSProj + +in the project's `csproj` file, specify the dependency as a `PackageReference` in `ItemGroup`: + +{{< gh-codeblock language="xml" path="examples/dotnet/SeleniumDocs/SeleniumDocs.csproj#L14" >}} + +### Additional considerations + +Further items of note for using Visual Studio Code (vscode) and C# + +Install the compatible .NET SDK as per the section above. +Also install the vscode extensions (Ctrl-Shift-X) for C# and NuGet. +Follow the [instruction here](https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code?pivots=dotnet-5-0) +to create and run the "Hello World" console project using C#. +You may also create a NUnit starter project using the command line `dotnet new NUnit`. +Make sure the file `%appdata%\NuGet\nuget.config` is configured properly as some developers reported that it will be empty due to some issues. +If `nuget.config` is empty, or not configured properly, then .NET builds will fail for Selenium Projects. +Add the following section to the file `nuget.config` if it is empty: ``` @@ -100,42 +105,52 @@ Se o arquivo `nuget.config` estiver vazio, ou não configurado corretamente, ent ... ``` -Para mais informações sobre o arquivo `nuget.config` [clique aqui](https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file). -Você pode ter de personalizar o arquivo `nuget.config` atender suas necessidades. +For more info about `nuget.config` [click here](https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file). +You may have to customize `nuget.config` to meet you needs. -Agora, volte ao VSCode, pressione Ctrl-Shift-P e digite "NuGet Add Package" e adicione os pacotes requeridos para Selenium, como o pacote `Selenium.WebDriver`. Pressione enter e selecione a versão. -Agora você pode utilizar os exemplos na documentação relacionada para C# com VSCode. +Now, go back to vscode, press Ctrl-Shift-P, and type "NuGet Add Package", and enter the required Selenium packages such as `Selenium.WebDriver`. +Press Enter and select the version. +Now you can use the examples in the documentation related to C# with vscode. {{% /tab %}} {{% tab header="Ruby" %}} - A instalação de bibliotecas Selenium para Ruby pode ser feita usando gem: +You can see the minimum required version of Ruby for any given Selenium version +on [rubygems.org](https://rubygems.org/gems/selenium-webdriver/) + +Selenium can be installed two different ways. + +### Install manually ```shell gem install selenium-webdriver ``` -## Supported Minimum Version +### Add to project's gemfile -Make sure to use the Ruby version greater than or equal to the minimum supported version by Selenium. -Ruby 2.7 is currently the minimum supported version by Selenium. -View the updates in the minimum version supported [here](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/selenium-webdriver.gemspec#L32). +{{< gh-codeblock language="ruby" path="examples/ruby/Gemfile#L10" >}} {{% /tab %}} {{% tab header="JavaScript" %}} - A instalação de bibliotecas Selenium para JavaScript pode ser feita usando npm: +You can find the minimum required version of Node for any given version of Selenium in the +`Node Support Policy` section on [npmjs](https://www.npmjs.com/package/selenium-webdriver) + +Selenium is typically installed using npm. + +### Install locally ```shell npm install selenium-webdriver ``` -## Supported Minimum Version -Make sure to use the Node version greater than or equal to the minimum supported version by Selenium. -Node 14.20.0 is currently the minimum supported version by Selenium. -View the updates in the minimum version supported [here](https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/node/selenium-webdriver/package.json#L23). +### Add to project + +In your project's `package.json`, add requirement to `dependencies`: + +{{< gh-codeblock path="examples/javascript/package.json#L14" >}} {{% /tab %}} {{< tab header="Kotlin" >}} - Devido à ausência de vínculos de linguagem nativo para Kotlin, você deve usar vínculos Java, por exemplo, com Maven [Java](#java) + Use the Java bindings for Kotlin. {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/getting_started/install_library.zh-cn.md b/website_and_docs/content/documentation/webdriver/getting_started/install_library.zh-cn.md index d7889b27135d..a344ea20f269 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/install_library.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/install_library.zh-cn.md @@ -14,89 +14,88 @@ aliases: [ 首先,您需要为自动化项目安装 Selenium 绑定库。 库的安装过程取决于您选择使用的语言。 +## Requirements by language + {{< tabpane code=false langEqualsHeader=true >}} {{% tab header="Java" %}} -可以使用 Maven 安装 Java 的 Selenium 库。 -在项目 pom.xml 中添加 _selenium-java_ 依赖项: - -```xml - - org.seleniumhq.selenium - selenium-java - 4.4.0 - -``` +View the minimum supported Java version [here](https://github.com/SeleniumHQ/selenium/blob/trunk/.bazelrc#L13). -对于 Gradle, 在您项目的 `build.gradle` 文件中添加 _selenium-java_ 依赖 : +Installation of Selenium libraries for Java is accomplished using a build tool. -```text -dependencies { - compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.4.0' -``` +### Maven +Specify the dependency in the project's `pom.xml` file: -Gradle 7.0 及以上版本: +{{< gh-codeblock path="examples/java/pom.xml#L22-L26" >}} -```text -dependencies { - implementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.4.0' -``` -## Supported Minimum Version +### Gradle +Specify the dependency in the project `build.gradle` file as `testImplementation`: -Make sure to use the Java version greater than or equal to the minimum supported version by Selenium. -Java 8 is currently the minimum supported version by Selenium. -View the updates in the minimum version supported [here](https://github.com/SeleniumHQ/selenium/blob/trunk/.bazelrc#L13). +{{< gh-codeblock path="examples/java/build.gradle#L13" >}} {{% /tab %}} {{% tab header="Python" %}} - 可以使用 pip 安装 Python 的 Selenium 库: +The minimum supported Python version for each Selenium version can be found +in `Supported Python Versions` on [PyPi](https://pypi.org/project/selenium/) + +There are a couple different ways to install Selenium. + +### Pip ```shell pip install selenium ``` -或者,您也可以下载 [PyPI source archive](https://pypi.org/project/selenium/#files) -(selenium-x.x.x.tar.gz) 并使用 _setup.py_ 进行安装: +### Download + +Alternatively you can download the [PyPI source archive](https://pypi.org/project/selenium/#files) +(selenium-x.x.x.tar.gz) and install it using _setup.py_: ```shell python setup.py install ``` -## Supported Minimum Version -Make sure to use the Python version greater than or equal to the minimum supported version by Selenium. -Python 3.7 is currently the minimum supported version by Selenium. -View the updates in the minimum version supported [here](https://github.com/SeleniumHQ/selenium/blob/trunk/py/setup.py#L41). +### Require in project + +To use it in a project, add it to the `requirements.txt` file: +{{< gh-codeblock path="examples/python/requirements.txt#L1" >}} {{% /tab %}} {{% tab header="CSharp" %}} - 可以使用 NuGet 安装 C# 的 Selenium 库: +A list of all supported frameworks for each version of Selenium +is available on [Nuget](https://www.nuget.org/packages/Selenium.WebDriver) + +There are a few options for installing Selenium. + +### Packet Manager ```shell -# Using package manager Install-Package Selenium.WebDriver -# or using .Net CLI +``` + +### .NET CLI + +```shell dotnet add package Selenium.WebDriver ``` -## 支持的 .NET 版本 -确保使用与.NET SDK版本兼容的相关[Selenium包](https://www.nuget.org/packages/Selenium.WebDriver). -检查依赖的部分用以找出[支持的 .NET 版本](https://dotnet.microsoft.com/en-us/download/dotnet). -在本次升级时, .NET 5.0 (Visual Studio 2019) 是已知的被支持的版本, 并且 .NET 6.0 并未支持. -您可以下载 [MSBuild Tools 2019 于此](https://docs.microsoft.com/en-us/visualstudio/install/create-an-offline-installation-of-visual-studio?view=vs-2019) -以安装所需的组件和依赖项, 例如 .NET SDK 和 NuGet 包管理器. - -## 使用 Visual Studio Code (vscode) 以及 C# -这是一个快速指南, 可帮助您开始使用 vscode 和 C#, 但可能需要进行更多调研. -按照上一节安装兼容的 .NET SDK. -还要安装适用于 C# 和 NuGet 的 vscode 扩展 (Ctrl-Shift-X). -参考 [此处指令](https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code?pivots=dotnet-5-0) -创建并且使用C#运行 "Hello World" 的控制台项目. -您也可以使用命令行 `dotnet new NUnit`创建一个 NUnit 初创项目. -确保文件 `%appdata%\NuGet\nuget.config` 已正确配置, -因为某些开发人员报告说, -由于某些问题, 该文件将为空. -如果 `nuget.config` 为空, -或者未正确配置, -则Selenium项目的.NET构建将失败. -将以下部分添加到文件 `nuget.config` (如果为空) : + +### CSProj + +in the project's `csproj` file, specify the dependency as a `PackageReference` in `ItemGroup`: + +{{< gh-codeblock language="xml" path="examples/dotnet/SeleniumDocs/SeleniumDocs.csproj#L14" >}} + +### Additional considerations + +Further items of note for using Visual Studio Code (vscode) and C# + +Install the compatible .NET SDK as per the section above. +Also install the vscode extensions (Ctrl-Shift-X) for C# and NuGet. +Follow the [instruction here](https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code?pivots=dotnet-5-0) +to create and run the "Hello World" console project using C#. +You may also create a NUnit starter project using the command line `dotnet new NUnit`. +Make sure the file `%appdata%\NuGet\nuget.config` is configured properly as some developers reported that it will be empty due to some issues. +If `nuget.config` is empty, or not configured properly, then .NET builds will fail for Selenium Projects. +Add the following section to the file `nuget.config` if it is empty: ``` @@ -105,49 +104,52 @@ dotnet add package Selenium.WebDriver ... ``` -有关 `nuget.config` 的更多信息[点此](https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file). -你也可以自定义 `nuget.config` 以满足所需. - -现在, 返回 vscode, 按 Ctrl-Shift-P, -然后键入"NuGet Add Package", -然后输入所需的 Selenium 包, -如"Selenium.WebDriver". +For more info about `nuget.config` [click here](https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file). +You may have to customize `nuget.config` to meet you needs. -按 Enter 并选择版本. - -现在, 您可以通过vscode与文档中 C# 相关示例结合使用. +Now, go back to vscode, press Ctrl-Shift-P, and type "NuGet Add Package", and enter the required Selenium packages such as `Selenium.WebDriver`. +Press Enter and select the version. +Now you can use the examples in the documentation related to C# with vscode. {{% /tab %}} {{% tab header="Ruby" %}} - 可以使用 gem 安装 Ruby 的 Selenium 库: +You can see the minimum required version of Ruby for any given Selenium version +on [rubygems.org](https://rubygems.org/gems/selenium-webdriver/) + +Selenium can be installed two different ways. + +### Install manually ```shell gem install selenium-webdriver ``` -## Supported Minimum Version +### Add to project's gemfile -Make sure to use the Ruby version greater than or equal to the minimum supported version by Selenium. -Ruby 2.7 is currently the minimum supported version by Selenium. -View the updates in the minimum version supported [here](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/selenium-webdriver.gemspec#L32). +{{< gh-codeblock language="ruby" path="examples/ruby/Gemfile#L10" >}} {{% /tab %}} {{% tab header="JavaScript" %}} - 可以使用 npm 安装 JavaScript 的 Selenium 库 +You can find the minimum required version of Node for any given version of Selenium in the +`Node Support Policy` section on [npmjs](https://www.npmjs.com/package/selenium-webdriver) + +Selenium is typically installed using npm. + +### Install locally ```shell npm install selenium-webdriver ``` -## Supported Minimum Version +### Add to project + +In your project's `package.json`, add requirement to `dependencies`: -Make sure to use the Node version greater than or equal to the minimum supported version by Selenium. -Node 14.20.0 is currently the minimum supported version by Selenium. -View the updates in the minimum version supported [here](https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/node/selenium-webdriver/package.json#L23). +{{< gh-codeblock path="examples/javascript/package.json#L14" >}} {{% /tab %}} {{< tab header="Kotlin" >}} - 由于缺少Kotlin的原生语言的绑定, 您不得不借助Java的生态环境, 例如Maven [Java](#java) + Use the Java bindings for Kotlin. {{< /tab >}} {{< /tabpane >}}