Using Selenium 2 Webdriver to test HTML5 – Drag and Drop example

Here is a sample test code that I have written in Selenium 2 Webdriver coded in Java that explains you how Webdriver can be used for testing HTML5 pages. I am testing a simple HTML5 page – import java.util.NoSuchElementException; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import […]

StaleElementReferenceException resolved with Selenium 2.5.1 drivers

The issue relating to StaleElementReferenceException when trying to use Selenium 2 SelectByText – selectElementEntity.SelectByText() is resolved in the latest version of Selenium Client Driver – Selenium 2.5.1 drivers (.NET bindings for Selenium, including the RC and WebDriver APIs)

Using verifyTextPresent in Selenium 2 Webdriver

There is no verifyTextPresent in Selenium 2 Webdriver; I have created a function that you use to verify if a particular text is present on a web page. You can change the name of the function to anything you want. public void verifyTextPresent(String value) { driver.PageSource.Contains(value); ; } Using the function in your test script. […]

Creating getText function for Selenium 2 in C Sharp

As most of you know there is no getText() function in Selenium 2 C#; I have created a function that you can use to get the text associated with a element/xpath. public String getText(String xpath) { String x = driver.FindElement(By.XPath(xpath)).Text; return x; } Here is how I have used the getText() function in my test […]