This document provides an overview of various actions and interactions that can be performed using Selenium WebDriver, including navigation, selecting elements, keyboard/mouse interactions, waiting, and touch actions. It summarizes the main capabilities of Selenium such as finding elements, performing actions on elements, waiting for elements to be in a certain state, cleaning data between tests, and using touch actions on mobile.
This document provides an overview of various actions and interactions that can be performed using Selenium WebDriver, including navigation, selecting elements, keyboard/mouse interactions, waiting, and touch actions. It summarizes the main capabilities of Selenium such as finding elements, performing actions on elements, waiting for elements to be in a certain state, cleaning data between tests, and using touch actions on mobile.
var nestedElement = var element = (IWebElement) ((IJavaScriptExecutor)driver) houseTile.FindElement(selector); .ExecuteScript("return $('.city')[0]"); Waiting Waiting for state driver.Manage().Timeouts().SetScriptTimeout(TimeSpan.FromSeconds(10)); wait.Until( driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(10)); ExpectedConditions
var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); ElementExists
ElementIsVisible ElementSelectionStateToBe Wait until element found ElementToBeClickable WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); ElementToBeSelected IWebElement myDynamicElement = wait.Until<IWebElement>((d) => AlertIsPresent { AlertState return d.FindElement(By.Id("someDynamicElement")); FrameToBeAvailableAndSwitchToIt }); InvisibilityOfElementLocated InvisibilityOfElementWithText PresenceOfAllElementsLocatedBy Cleaning VisibilityOfAllElementsLocatedBy StalenessOf driver.Manage().Cookies.DeleteAllCookies(); TextToBePresentInElement new RemoteLocalStorage(driver).Clear(); TextToBePresentInElementLocated new RemoteSessionStorage(driver).Clear(); TextToBePresentInElementValue TitleContains TitleIs TouchActions UrlContains var touchAction = new TouchActions(driver); UrlMatches UrlToBe touchAction .SingleTap(element) .DoubleTap(element) .Scroll(offsetX, offsetY) .Down(locationX, locationY) www.diwebsity.com .Up(locationX, locationY) Web diversity in few simple words .LongPress(element) .Flick(element, offsetX, offsetY, speed) Blog about modern technology in web .Build(); development and testing
Waweru Mwaura - End-to-End Web Testing With Cypress - Explore Techniques For Automated Frontend Web Testing With Cypress and JavaScript (2021, Packt Publishing LTD) - Libgen - Li