Tuesday 22 November 2011

Connecting Remote System with Selenium webdriver using CSharp


Selenium standalone server should be run on the remote system.Then follow the procedure

namespace SeleniumFeatures
{
    [TestFixture]
    class SeleniumRemoteWebdriver
    {
        RemoteWebDriver driver;

        [SetUp]
        public void setupTest()
        {
driver = new RemoteWebDriver(new Uri("http://127.0.0.1:4444/wd/hub"),  DesiredCapabilities.Firefox());   // Change the ip iddress to target remote system ip address
        }
        [Test]
        public void Test()
        {
            driver.Navigate().GoToUrl("http://google.co.in");
            driver.FindElement(By.Name("q")).SendKeys("testing tutorials");
            driver.FindElement(By.Name("btnG")).Click();

        }
    }
}

1 comment: