Wednesday, July 2, 2014

Few Quick Walkthrough on How to work with Selenium

Download Selenium tool for Firefox IDE.

Once you install Selenium it will appear as small SE icon in web browser. Check the image.
One can record the web flow scenario as per test case and generate code out of it. These code can be used for custom automation test for regression test or integrated or product test.

Sample Generated Code file.
namespace SeleniumTests
public class Code
private IWebDriver driver;
private StringBuilder verificationErrors;
private string baseURL;
private bool acceptNextAlert = true;
public void SetupTest()
driver = new FirefoxDriver();
baseURL = "";
verificationErrors = new StringBuilder();
public void TeardownTest()
catch (Exception)
// Ignore errors if unable to close the browser
Assert.AreEqual("", verificationErrors.ToString());
public void TheCodeTest()
driver.Navigate().GoToUrl(baseURL + "/?gfe_rd=cr&ei=D7CzU9buL-bJ8gfYr4HQDw&gws_rd=ssl#q=Fifa+world+cup");
Post a Comment