Selenium (software) =================== Selenium is an open source umbrella project for a range of tools and libraries aimed at supporting browser automation. It provides a playback tool for authoring functional tests across most modern web browsers, without the need to learn a test scripting language (Selenium IDE). It also provides a test domain-specific language (Selenese) to write tests in a number of popular programming languages, including JavaScript (Node.js), C#, Groovy, Java, Perl, PHP, Python, Ruby and Scala. Selenium runs on Windows, Linux, and macOS. It is open-source software released under the Apache License 2.0. Selenium is an open source umbrella project for a range of tools and libraries aimed at supporting browser automation. It provides a playback tool for authoring functional tests across most modern web browsers, without the need to learn a test scripting language (Selenium IDE). It also provides a test domain-specific language (Selenese) to write tests in a number of popular programming languages, including JavaScript (Node.js), C#, Groovy, Java, Perl, PHP, Python, Ruby and Scala. Selenium runs on Windows, Linux, and macOS. It is open-source software released under the Apache License 2.0. from selenium.webdriver import Firefox from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.expected_conditions import presence_of_element_located from selenium.webdriver.remote.webelement import WebElement if __name__ == "__main__": # This example requires Selenium WebDriver 3.13 or newer with Firefox() as driver: wait: WebDriverWait = WebDriverWait(driver, 10) driver.get("https://google.com/ncr") driver.find_element(By.NAME, "q").send_keys(f"cheese{Keys.RETURN}") first_result: WebElement = wait.until(presence_of_element_located((By.CSS_SELECTOR, "h3"))) print(first_result.get_attribute("textContent")) package org.wikipedia.examples; import java.time.Duration; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.WebDriverWait; import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated; public class HelloSelenium { public static void main(String[] args) { try (WebDriver driver = new FirefoxDriver()) { WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)) driver.get("https://google.com/ncr"); driver.findElement(By.name("q")).sendKeys("cheese" + Keys.ENTER); WebElement firstResult = wait.until(presenceOfElementLocated(By.cssSelector("h3"))); System.out.println(firstResult.getAttribute("textContent")); driver.quit(); } catch (Exception e) { System.err.printf("Error caught: %s%n", e.getMessage()); } } } namespace Wikipedia.Examples; using OpenQA.Selenium; using OpenQA.Selenium.Firefox; using OpenQA.Selenium.Support.UI; public class HelloSelenium { static void Main(string[] args) { using (IWebDriver driver = new FirefoxDriver()) { WebDriverWait wait = new(driver, TimeSpan.FromSeconds(10)); driver.Navigate().GoToUrl("https://www.google.com/"); driver.FindElement(By.Name("q")).SendKeys($"cheese{Keys.Enter}"); wait.Until(webDriver => webDriver.FindElement(By.CssSelector("h3")).Displayed); IWebElement firstResult = driver.FindElement(By.CssSelector("h3")); Console.WriteLine(firstResult.GetAttribute("textContent")); } } } ==See also== Appium, mobile and desktop apps automation using WebDriver Acceptance testing Capybara (software) Given-When-Then List of web testing tools MediaWiki Selenium Regression testing Robot Framework Cypress ==References== ==External links== REFERENCES ---------- BIBLIOGRAPHY (BibTeX) -------------------- @article{ref0, title = {Selenium (software)}, url = {https://encyclopegia.org/a/selenium-software} } BIBLIOGRAPHY (RIS) ------------------- TY - JOUR TI - Selenium (software) UR - https://encyclopegia.org/a/selenium-software ER - CITE THIS ARTICLE ---------------- Cite this article: Selenium (software) Derived from: https://en.wikipedia.org/w/index.php?oldid=1371333749 Licence: CC BY-SA 4.0 Snapshot: enwiki-001371333749 Permalink: /a/selenium-software