Category: <span>Selenium WebDriver</span>

Smart click (part 3)

In this part I decided to show some examples of using the SmartClick() method just to make the way it works easier to understand. Example 1 – the simplest. In 99% of cases you can use it without any parameters just like an IWebElement interface extension method: public void GoogleSearch() { IWebDriver driver = new FirefoxDriver(); driver.Navigate().GoToUrl(“http://www.google.com”); IWebElement query, btnSearch; WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5)); query = driver.FindElement(By.Name(“q”)); query.Clear(); query.SendKeys(“selenium”); btnSearch = driver.FindElement(By.Name(“btnG”)); btnSearch.SmartClick(); wait.Until((d) => { return d.Title.StartsWith(“selenium”); }); Assert.AreEqual(“selenium – Google Search”, driver.Title); } In this case SmartClick works like native method Click() with some additional functionalities, such …

Google Chrome and ChromeDriver with Selenium

Google Chrome and ChromeDriver with Selenium Before going in details about google chrome and ChromeDriver lets learn some terminology. Wire Protocol: defined as RESTful web services using JSON over HTTP that is being used by webdriver/RemoteWebDriver, to communicate with browser. ChromeDriver is a standalone server developed by Chromium team(Google) which implements wire protocol. ChromeDriver consist of three separate pieces, a. Chrome Browser. b. Selenium Project code (driver) AND c.  An Executable that helps code to communicate with chrome browser (lets call it server for ease) server expects you to have chrome installed in the default location of computer. Before start, …

Selenium Commands That You must know.

Pay attention to following commands as these are going to play pivotal role in selenium. 1: SelectFrame (locator): To learn this command we need to understand basics of HTML frame element first. Spend some time to learn HTML Frames, if don’t know much about frame elements. While performing any action to any web element, we first select the frame where it resides then we perform any action to any element inside that frame. To access other elements coded in different frame, again we need to select that frame using this command and then we can access their elements. We use …