Tuesday, July 7, 2015

C# Selenium - automation script for protractor, AngularJS application

Here you can find the script for protractor

Add reference Protractor library to Application,

using Protractor; // Namespace need to be included

using (IWebDriver ngDriver = new NgWebDriver(new FirefoxDriver()))
{
                ngDriver.Url = "http://www.angularjs.org";

                ngDriver.FindElement(NgBy.Model("yourName")).SendKeys("Selenium");

                System.Console.WriteLine("TEST : " + ngDriver.FindElement(NgBy.Model("yourName")).Text);
                Assert.AreEqual("Hello Selenium!", ngDriver.FindElement(NgBy.Binding("yourName")).Text);
         
}

0 comments