Posts

Showing posts from January 29, 2012

Web driver script

Hasan from Trainline shared with us Selenium WebDriver script. I was using Selenium before Web Driver came into the picture. Need to try this out.   using System; using NUnit.Framework; using OpenQA.Selenium; using OpenQA.Selenium.IE ; using OpenQA.Selenium.Remote; using OpenQA.Selenium.Support.UI; namespace WebDriver {     [TestFixture] class TrainlineTest     {         [Test] public void webDriverTest()         { var ieCapabilities = DesiredCapabilities.InternetExplorer();             ieCapabilities.SetCapability(InternetExplorerDriver.IntroduceInstabilityByIgnoringProtectedModeSettings, true); var driver = new InternetExplorerDriver(ieCapabilities);             driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10));            driver.Navigate().GoToUrl(" http://buytickets.thetrainline.tw.testttl.com ");             driver.FindElement(By.Id("OriginStation")).SendKeys("London");             driver.FindElement(By.Id("DestinationStation