diff --git a/docs_source_files/content/remote_webdriver/remote_webdriver_client.en.md b/docs_source_files/content/remote_webdriver/remote_webdriver_client.en.md index 26d7186adf80..ac3d66838117 100644 --- a/docs_source_files/content/remote_webdriver/remote_webdriver_client.en.md +++ b/docs_source_files/content/remote_webdriver/remote_webdriver_client.en.md @@ -72,7 +72,13 @@ driver.quit(); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +ChromeOptions chromeOptions = new ChromeOptions(); +DesiredCapabilities desiredCapabilities = new DesiredCapabilities(); +desiredCapabilities.SetCapability("browserVersion", "78"); +desiredCapabilities.SetCapability("platformName", "Windows 10"); +IWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), desiredCapabilities); +driver.Navigate().GoToUrl("http://www.google.com"); +driver.Quit(); {{< / code-panel >}} {{< code-panel language="ruby" >}} caps = Selenium::WebDriver::Remote::Capabilities.chrome @@ -113,7 +119,8 @@ driver.setFileDetector(new LocalFileDetector()); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +var allowsDetection = this.driver as IAllowsFileDetection; +allowsDetection.FileDetector = new LocalFileDetector(); {{< / code-panel >}} {{< code-panel language="ruby" >}} @driver.file_detector = lambda do |args| @@ -142,7 +149,9 @@ upload.sendKeys("/Users/sso/the/local/path/to/darkbulb.jpg"); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +driver.Navigate().GoToUrl("http://sso.dev.saucelabs.com/test/guinea-file-upload"); +IWebElement upload = driver.FindElement(By.Id("myfile")); +upload.SendKeys(@"/Users/sso/the/local/path/to/darkbulb.jpg"); {{< / code-panel >}} {{< code-panel language="ruby" >}} @driver.navigate.to "http://sso.dev.saucelabs.com/test/guinea-file-upload" diff --git a/docs_source_files/content/remote_webdriver/remote_webdriver_client.es.md b/docs_source_files/content/remote_webdriver/remote_webdriver_client.es.md index 25b00a0aea83..3dc8e582d183 100644 --- a/docs_source_files/content/remote_webdriver/remote_webdriver_client.es.md +++ b/docs_source_files/content/remote_webdriver/remote_webdriver_client.es.md @@ -78,7 +78,13 @@ driver.quit(); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +ChromeOptions chromeOptions = new ChromeOptions(); +DesiredCapabilities desiredCapabilities = new DesiredCapabilities(); +desiredCapabilities.SetCapability("browserVersion", "78"); +desiredCapabilities.SetCapability("platformName", "Windows 10"); +IWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), desiredCapabilities); +driver.Navigate().GoToUrl("http://www.google.com"); +driver.Quit(); {{< / code-panel >}} {{< code-panel language="ruby" >}} caps = Selenium::WebDriver::Remote::Capabilities.chrome @@ -119,7 +125,8 @@ driver.setFileDetector(new LocalFileDetector()); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +var allowsDetection = this.driver as IAllowsFileDetection; +allowsDetection.FileDetector = new LocalFileDetector(); {{< / code-panel >}} {{< code-panel language="ruby" >}} @driver.file_detector = lambda do |args| @@ -148,7 +155,9 @@ upload.sendKeys("/Users/sso/the/local/path/to/darkbulb.jpg"); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +driver.Navigate().GoToUrl("http://sso.dev.saucelabs.com/test/guinea-file-upload"); +IWebElement upload = driver.FindElement(By.Id("myfile")); +upload.SendKeys(@"/Users/sso/the/local/path/to/darkbulb.jpg"); {{< / code-panel >}} {{< code-panel language="ruby" >}} @driver.navigate.to "http://sso.dev.saucelabs.com/test/guinea-file-upload" diff --git a/docs_source_files/content/remote_webdriver/remote_webdriver_client.fr.md b/docs_source_files/content/remote_webdriver/remote_webdriver_client.fr.md index 353ab68b2e10..19c74aea1f44 100644 --- a/docs_source_files/content/remote_webdriver/remote_webdriver_client.fr.md +++ b/docs_source_files/content/remote_webdriver/remote_webdriver_client.fr.md @@ -78,7 +78,13 @@ driver.quit(); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +ChromeOptions chromeOptions = new ChromeOptions(); +DesiredCapabilities desiredCapabilities = new DesiredCapabilities(); +desiredCapabilities.SetCapability("browserVersion", "78"); +desiredCapabilities.SetCapability("platformName", "Windows 10"); +IWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), desiredCapabilities); +driver.Navigate().GoToUrl("http://www.google.com"); +driver.Quit(); {{< / code-panel >}} {{< code-panel language="ruby" >}} caps = Selenium::WebDriver::Remote::Capabilities.chrome @@ -119,7 +125,8 @@ driver.setFileDetector(new LocalFileDetector()); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +var allowsDetection = this.driver as IAllowsFileDetection; +allowsDetection.FileDetector = new LocalFileDetector(); {{< / code-panel >}} {{< code-panel language="ruby" >}} @driver.file_detector = lambda do |args| @@ -148,7 +155,9 @@ upload.sendKeys("/Users/sso/the/local/path/to/darkbulb.jpg"); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +driver.Navigate().GoToUrl("http://sso.dev.saucelabs.com/test/guinea-file-upload"); +IWebElement upload = driver.FindElement(By.Id("myfile")); +upload.SendKeys(@"/Users/sso/the/local/path/to/darkbulb.jpg"); {{< / code-panel >}} {{< code-panel language="ruby" >}} @driver.navigate.to "http://sso.dev.saucelabs.com/test/guinea-file-upload" diff --git a/docs_source_files/content/remote_webdriver/remote_webdriver_client.ja.md b/docs_source_files/content/remote_webdriver/remote_webdriver_client.ja.md index c63520a81736..fb6bfe5afa35 100644 --- a/docs_source_files/content/remote_webdriver/remote_webdriver_client.ja.md +++ b/docs_source_files/content/remote_webdriver/remote_webdriver_client.ja.md @@ -77,7 +77,13 @@ driver.quit(); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +ChromeOptions chromeOptions = new ChromeOptions(); +DesiredCapabilities desiredCapabilities = new DesiredCapabilities(); +desiredCapabilities.SetCapability("browserVersion", "78"); +desiredCapabilities.SetCapability("platformName", "Windows 10"); +IWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), desiredCapabilities); +driver.Navigate().GoToUrl("http://www.google.com"); +driver.Quit(); {{< / code-panel >}} {{< code-panel language="ruby" >}} caps = Selenium::WebDriver::Remote::Capabilities.chrome @@ -118,7 +124,8 @@ driver.setFileDetector(new LocalFileDetector()); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +var allowsDetection = this.driver as IAllowsFileDetection; +allowsDetection.FileDetector = new LocalFileDetector(); {{< / code-panel >}} {{< code-panel language="ruby" >}} @driver.file_detector = lambda do |args| @@ -147,7 +154,9 @@ upload.sendKeys("/Users/sso/the/local/path/to/darkbulb.jpg"); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +driver.Navigate().GoToUrl("http://sso.dev.saucelabs.com/test/guinea-file-upload"); +IWebElement upload = driver.FindElement(By.Id("myfile")); +upload.SendKeys(@"/Users/sso/the/local/path/to/darkbulb.jpg"); {{< / code-panel >}} {{< code-panel language="ruby" >}} @driver.navigate.to "http://sso.dev.saucelabs.com/test/guinea-file-upload" diff --git a/docs_source_files/content/remote_webdriver/remote_webdriver_client.nl.md b/docs_source_files/content/remote_webdriver/remote_webdriver_client.nl.md index fa0bc1204655..9f85ae8d33dd 100644 --- a/docs_source_files/content/remote_webdriver/remote_webdriver_client.nl.md +++ b/docs_source_files/content/remote_webdriver/remote_webdriver_client.nl.md @@ -78,7 +78,13 @@ driver.quit(); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +ChromeOptions chromeOptions = new ChromeOptions(); +DesiredCapabilities desiredCapabilities = new DesiredCapabilities(); +desiredCapabilities.SetCapability("browserVersion", "78"); +desiredCapabilities.SetCapability("platformName", "Windows 10"); +IWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), desiredCapabilities); +driver.Navigate().GoToUrl("http://www.google.com"); +driver.Quit(); {{< / code-panel >}} {{< code-panel language="ruby" >}} caps = Selenium::WebDriver::Remote::Capabilities.chrome @@ -119,7 +125,8 @@ driver.setFileDetector(new LocalFileDetector()); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +var allowsDetection = this.driver as IAllowsFileDetection; +allowsDetection.FileDetector = new LocalFileDetector(); {{< / code-panel >}} {{< code-panel language="ruby" >}} @driver.file_detector = lambda do |args| @@ -148,7 +155,9 @@ upload.sendKeys("/Users/sso/the/local/path/to/darkbulb.jpg"); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +driver.Navigate().GoToUrl("http://sso.dev.saucelabs.com/test/guinea-file-upload"); +IWebElement upload = driver.FindElement(By.Id("myfile")); +upload.SendKeys(@"/Users/sso/the/local/path/to/darkbulb.jpg"); {{< / code-panel >}} {{< code-panel language="ruby" >}} @driver.navigate.to "http://sso.dev.saucelabs.com/test/guinea-file-upload" diff --git a/docs_source_files/content/remote_webdriver/remote_webdriver_client.zh-cn.md b/docs_source_files/content/remote_webdriver/remote_webdriver_client.zh-cn.md index c87b0f9cf9b8..74e9705dc10e 100644 --- a/docs_source_files/content/remote_webdriver/remote_webdriver_client.zh-cn.md +++ b/docs_source_files/content/remote_webdriver/remote_webdriver_client.zh-cn.md @@ -77,7 +77,13 @@ driver.quit(); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +ChromeOptions chromeOptions = new ChromeOptions(); +DesiredCapabilities desiredCapabilities = new DesiredCapabilities(); +desiredCapabilities.SetCapability("browserVersion", "78"); +desiredCapabilities.SetCapability("platformName", "Windows 10"); +IWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), desiredCapabilities); +driver.Navigate().GoToUrl("http://www.google.com"); +driver.Quit(); {{< / code-panel >}} {{< code-panel language="ruby" >}} caps = Selenium::WebDriver::Remote::Capabilities.chrome @@ -118,7 +124,8 @@ driver.setFileDetector(new LocalFileDetector()); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +var allowsDetection = this.driver as IAllowsFileDetection; +allowsDetection.FileDetector = new LocalFileDetector(); {{< / code-panel >}} {{< code-panel language="ruby" >}} @driver.file_detector = lambda do |args| @@ -147,7 +154,9 @@ upload.sendKeys("/Users/sso/the/local/path/to/darkbulb.jpg"); # We don't have a Python code sample yet - Help us out and raise a PR {{< / code-panel >}} {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR +driver.Navigate().GoToUrl("http://sso.dev.saucelabs.com/test/guinea-file-upload"); +IWebElement upload = driver.FindElement(By.Id("myfile")); +upload.SendKeys(@"/Users/sso/the/local/path/to/darkbulb.jpg"); {{< / code-panel >}} {{< code-panel language="ruby" >}} @driver.navigate.to "http://sso.dev.saucelabs.com/test/guinea-file-upload" diff --git a/docs_source_files/content/support_packages/browser_navigation.en.md b/docs_source_files/content/support_packages/browser_navigation.en.md index 28a0c99667c6..92fb0a02c42a 100644 --- a/docs_source_files/content/support_packages/browser_navigation.en.md +++ b/docs_source_files/content/support_packages/browser_navigation.en.md @@ -71,7 +71,21 @@ driver.navigate.back driver.navigate.refresh {{< / code-panel >}} {{< code-panel language="javascript" >}} -// We don't have a JavaScript code sample yet - Help us out and raise a PR +# Navigate to a URL (both of the statements below are +# functionally equivalent). +driver.get("https://www.google.com"); +driver.navigate().to("https://www.google.com"); + +# Go forward one page in the browser (if you're not on the +# last page that was viewed). +driver.navigate().forward(); + +# Go back one page in the browser (if you're not on the +# first page that was viewed). +driver.navigate().back(); + +# Refresh the current page. +driver.navigate().refresh(); {{< / code-panel >}} {{< code-panel language="kotlin" >}} // Navigate to a URL (both of the statements below are diff --git a/docs_source_files/content/support_packages/browser_navigation.es.md b/docs_source_files/content/support_packages/browser_navigation.es.md index 35cacc291926..40d0c16e1199 100644 --- a/docs_source_files/content/support_packages/browser_navigation.es.md +++ b/docs_source_files/content/support_packages/browser_navigation.es.md @@ -77,7 +77,21 @@ driver.navigate.back driver.navigate.refresh {{< / code-panel >}} {{< code-panel language="javascript" >}} -// We don't have a JavaScript code sample yet - Help us out and raise a PR +# Navigate to a URL (both of the statements below are +# functionally equivalent). +driver.get("https://www.google.com"); +driver.navigate().to("https://www.google.com"); + +# Go forward one page in the browser (if you're not on the +# last page that was viewed). +driver.navigate().forward(); + +# Go back one page in the browser (if you're not on the +# first page that was viewed). +driver.navigate().back(); + +# Refresh the current page. +driver.navigate().refresh(); {{< / code-panel >}} {{< code-panel language="kotlin" >}} // Navigate to a URL (both of the statements below are diff --git a/docs_source_files/content/support_packages/browser_navigation.fr.md b/docs_source_files/content/support_packages/browser_navigation.fr.md index 017b22303b85..4573333915b6 100644 --- a/docs_source_files/content/support_packages/browser_navigation.fr.md +++ b/docs_source_files/content/support_packages/browser_navigation.fr.md @@ -77,7 +77,21 @@ driver.navigate.back driver.navigate.refresh {{< / code-panel >}} {{< code-panel language="javascript" >}} -// We don't have a JavaScript code sample yet - Help us out and raise a PR +# Navigate to a URL (both of the statements below are +# functionally equivalent). +driver.get("https://www.google.com"); +driver.navigate().to("https://www.google.com"); + +# Go forward one page in the browser (if you're not on the +# last page that was viewed). +driver.navigate().forward(); + +# Go back one page in the browser (if you're not on the +# first page that was viewed). +driver.navigate().back(); + +# Refresh the current page. +driver.navigate().refresh(); {{< / code-panel >}} {{< code-panel language="kotlin" >}} // Navigate to a URL (both of the statements below are diff --git a/docs_source_files/content/support_packages/browser_navigation.ja.md b/docs_source_files/content/support_packages/browser_navigation.ja.md index 0e5fb4053581..7fac00450a38 100644 --- a/docs_source_files/content/support_packages/browser_navigation.ja.md +++ b/docs_source_files/content/support_packages/browser_navigation.ja.md @@ -76,7 +76,21 @@ driver.navigate.back driver.navigate.refresh {{< / code-panel >}} {{< code-panel language="javascript" >}} -// We don't have a JavaScript code sample yet - Help us out and raise a PR +# Navigate to a URL (both of the statements below are +# functionally equivalent). +driver.get("https://www.google.com"); +driver.navigate().to("https://www.google.com"); + +# Go forward one page in the browser (if you're not on the +# last page that was viewed). +driver.navigate().forward(); + +# Go back one page in the browser (if you're not on the +# first page that was viewed). +driver.navigate().back(); + +# Refresh the current page. +driver.navigate().refresh(); {{< / code-panel >}} {{< code-panel language="kotlin" >}} // Navigate to a URL (both of the statements below are diff --git a/docs_source_files/content/support_packages/browser_navigation.nl.md b/docs_source_files/content/support_packages/browser_navigation.nl.md index 31309df71cde..4fa32a490107 100644 --- a/docs_source_files/content/support_packages/browser_navigation.nl.md +++ b/docs_source_files/content/support_packages/browser_navigation.nl.md @@ -77,7 +77,21 @@ driver.navigate.back driver.navigate.refresh {{< / code-panel >}} {{< code-panel language="javascript" >}} -// We don't have a JavaScript code sample yet - Help us out and raise a PR +# Navigate to a URL (both of the statements below are +# functionally equivalent). +driver.get("https://www.google.com"); +driver.navigate().to("https://www.google.com"); + +# Go forward one page in the browser (if you're not on the +# last page that was viewed). +driver.navigate().forward(); + +# Go back one page in the browser (if you're not on the +# first page that was viewed). +driver.navigate().back(); + +# Refresh the current page. +driver.navigate().refresh(); {{< / code-panel >}} {{< code-panel language="kotlin" >}} // Navigate to a URL (both of the statements below are diff --git a/docs_source_files/content/support_packages/browser_navigation.zh-cn.md b/docs_source_files/content/support_packages/browser_navigation.zh-cn.md index 4b0da78f3b94..2ea68a5d15ff 100644 --- a/docs_source_files/content/support_packages/browser_navigation.zh-cn.md +++ b/docs_source_files/content/support_packages/browser_navigation.zh-cn.md @@ -76,7 +76,21 @@ driver.navigate.back driver.navigate.refresh {{< / code-panel >}} {{< code-panel language="javascript" >}} -// We don't have a JavaScript code sample yet - Help us out and raise a PR +# Navigate to a URL (both of the statements below are +# functionally equivalent). +driver.get("https://www.google.com"); +driver.navigate().to("https://www.google.com"); + +# Go forward one page in the browser (if you're not on the +# last page that was viewed). +driver.navigate().forward(); + +# Go back one page in the browser (if you're not on the +# first page that was viewed). +driver.navigate().back(); + +# Refresh the current page. +driver.navigate().refresh(); {{< / code-panel >}} {{< code-panel language="kotlin" >}} // Navigate to a URL (both of the statements below are diff --git a/docs_source_files/content/support_packages/working_with_select_elements.en.md b/docs_source_files/content/support_packages/working_with_select_elements.en.md index c4a4a97bcf82..db3ccb48205d 100644 --- a/docs_source_files/content/support_packages/working_with_select_elements.en.md +++ b/docs_source_files/content/support_packages/working_with_select_elements.en.md @@ -1,277 +1,296 @@ ---- -title: "Working with select elements" -weight: 3 ---- - -Select elements can require quite a bit of boiler plate code to automate. -To reduce this, and make your tests cleaner, there is a -`Select` class in the Selenium support package. -To use it, you will need the following import statement: - -{{< code-tab >}} - {{< code-panel language="java" >}} -import org.openqa.selenium.support.ui.Select; - {{< / code-panel >}} - {{< code-panel language="python" >}} -from selenium.webdriver.support.select import Select - {{< / code-panel >}} - {{< code-panel language="csharp" >}} -// We don't have a C# code sample yet - Help us out and raise a PR - {{< / code-panel >}} - {{< code-panel language="ruby" >}} -include Selenium::WebDriver::Support - {{< / code-panel >}} - {{< code-panel language="javascript" >}} -// We don't have a JavaScript code sample yet - Help us out and raise a PR - {{< / code-panel >}} - {{< code-panel language="kotlin" >}} -import org.openqa.selenium.support.ui.Select - {{< / code-panel >}} -{{< / code-tab >}} - -You are then able to create a Select object using a WebElement that -references a `` element. -First of all, there are different ways of selecting an option -from the ` - - - - -``` - -There are three ways to select the first option from the above element: - -{{< code-tab >}} - {{< code-panel language="java" >}} -// Select an