Пример #1
0
        public void ExecuteTest()
        {
            //Title
            SeleniumSetMethods.SelectDropDown(driver, "TitleId", "Mr.", "Id");

            //Initial
            SeleniumSetMethods.EnterText(driver, "Initial", "executeautomation", "Name");
            Thread.Sleep(1000);
            Console.WriteLine("The value from my Title is:" + SeleniumGetMethod.GetTextFromDDL(driver, "TitleId", "Id"));

            Console.WriteLine("The value from my Initial is:" + SeleniumGetMethod.GetText(driver, "Initial", "Name"));

            //Click
            SeleniumSetMethods.Click(driver, "Save", "Name");
        }
Пример #2
0
        public void ExecuteTest()
        {
            // Enter(element,value,type) <-- put elements in new class

            //Title
            SeleniumSetMethods.SelectDropDown("TitleId", "Mr.", PropertyType.Id);

            //Initial
            SeleniumSetMethods.EnterText("Initial", "executeA", PropertyType.Name);

            Console.WriteLine("The value from my Title is:" + SeleniumGetMethods.GetText("TitleId", PropertyType.Id));
            Console.WriteLine("The value from my Initial is:" + SeleniumGetMethods.GetText("Initial", PropertyType.Name));

            //Click Save
            SeleniumSetMethods.Click("Save", PropertyType.Name);

            Console.WriteLine(PropertiesCollection.driver.Title);          //var title = driver.Title;
            Console.WriteLine("Executed Test");
        }
Пример #3
0
        public void ExecuteTest()
        {
            /*          //EnterText(element, value, type);
             *
             *          //Find the element
             *          IWebElement element = driver.FindElement(By.Name("q"));
             *
             *          //Perform Ops
             *          element.SendKeys("Execute Automation");
             *
             *          Console.WriteLine("Executed Test");
             */

            //Title
            SeleniumSetMethods.SelectDropDown(driver, "TitleId", "Mr.", "Id");

            //Initial
            SeleniumSetMethods.EnterText(driver, "Initial", "P.H.N.", "Id");


            //Console.WriteLine("The value from my title is:" + SeleniumGetMethods.GetText(driver, "TitleId", "Id"));

            Console.WriteLine("The value from my initial is: " + SeleniumGetMethods.GetText(driver, "Initial", "Id"));

            //First Name
            //SeleniumSetMethods.EnterText(driver, "FirstName", "Prosonna", "name");

            //Middle Name
            //SeleniumSetMethods.EnterText(driver, "MiddleName", "Hossain", "name");

            //Gender
            //SeleniumSetMethods.Click(driver, "Male", "name");

            //Languages Known
            //SeleniumSetMethods.Click(driver, "english", "name");

            //Click
            SeleniumSetMethods.Click(driver, "Save", "name");
        }
Пример #4
0
        static void Main(string[] args)
        {
            string pathToDriver = "/Users/cliff/Desktop/SeleniumFirst/assets/";
            // Create the reference for browser
            IWebDriver driver = new ChromeDriver(pathToDriver);

            Console.WriteLine("We are starting");

            // Navigate to Test Site
            driver.Navigate().GoToUrl("http://www.executeautomation.com/demosite/index.html?UserName=&Password=&Login=Login");
            Console.WriteLine("Browser Opened");

            // Select Title
            SeleniumSetMethods.SelectDropDown(driver, "TitleId", "Mr.", "Id");
            // Verify Selection
            Console.WriteLine("Title value is: " + SeleniumGetMethods.GetFromDropDown(driver, "TitleId", "Id"));

            // Enter Initial
            SeleniumSetMethods.EnterText(driver, "Initial", "JH", "Name");
            // Verify Text Entered
            Console.WriteLine("Initial value is: " + SeleniumGetMethods.GetText(driver, "Initial", "Name"));

            // Enter First Name
            SeleniumSetMethods.EnterText(driver, "FirstName", "Jim", "Name");
            // Verify Text Entered
            Console.WriteLine("FirstName value is: " + SeleniumGetMethods.GetText(driver, "FirstName", "Name"));

            // Enter Middle Name
            SeleniumSetMethods.EnterText(driver, "MiddleName", "Halpert", "Name");
            // Verify Text Entered
            Console.WriteLine("MiddleName value is: " + SeleniumGetMethods.GetText(driver, "MiddleName", "Name"));

            // Click
            SeleniumSetMethods.Click(driver, "Save", "Name");
            // Close Chrome
            driver.Close();
            Console.WriteLine("Browser Closed");
        }