Пример #1
0
        public void ExecuteTest()
        {
            PageObject page = new PageObject();

            // 2.Login to Find a Flight authentication with the following credentials:
            // a.Username: mercury
            // SeleniumSetMethods.EnterText("userName", "mercury", PropertyType.Name);
            // POM
            page.txtUserName.SendKeys("mercury");

            // b.Password: mercury
            // SeleniumSetMethods.EnterText("password", "mercury", PropertyType.Name);
            // POM
            page.txtPassword.SendKeys("mercury");

            // Click Sign in button
            // SeleniumSetMethods.ClickElement( "login", PropertyType.Name);
            // POM
            page.btnLogin.Click();

            // 3.Select One Way radio button
            SeleniumSetMethods.SelectDropdown("tripType", "oneway", PropertyType.Id);

            // 4.Depart from Sydney
            SeleniumSetMethods.SelectDropdown("fromPort", "Sydney", PropertyType.Id);

            // 5.Arrive in London
            SeleniumSetMethods.SelectDropdown("toPort", "London", PropertyType.Id);

            // 6.Select First Class service class.
            SeleniumSetMethods.SelectDropdown("servClass", "First", PropertyType.Id);

            //7.     Click Continue
            // POM
            page.btnContinue.Click();

            //8.     On the Select Flight page click the Continue button.
            // POM
            page.btnReserveContinue.Click();

            //9.     Provide a First Name
            // POM
            page.txtPassFirst.SendKeys("John");

            //10.  Provide a Last Name
            page.txtPassLast.SendKeys("Doe");

            //11.  Provide a Credit Card Number
            page.txtCardAmex.SendKeys("378282246310005");

            //12.  Check the Ticketless Travel box.
            page.cboxTicketless.Click();

            //13.  Click the Secure Purchase button.
            page.btnSecurePurchase.Click();

            Console.WriteLine("Executed Test");
        }
Пример #2
0
 public void ExecuteTest()
 {
     //Title
     SeleniumSetMethods.selectDropDown(driver, "TitleId", "Mr.", "Id");
     SeleniumSetMethods.Entertext(driver, "Initial", "ExecuteAutomation", "Name");
     Console.WriteLine("Value of Title is " + SeleniumGetMethods.GetTextFromDDL(driver, "TitleId", "Id"));
     Console.WriteLine("Value of Initial is " + SeleniumGetMethods.GetText(driver, "Initial", "Name"));
     SeleniumSetMethods.Click(driver, "Save", "Name");
 }
Пример #3
0
        public void FillUserForm(string initial, string middleName, string firstName)
        {
            SeleniumSetMethods.EnterText(txtInitial, initial);
            SeleniumSetMethods.EnterText(txtFirstname, firstName);
            SeleniumSetMethods.EnterText(txtMiddleName, middleName);
            SeleniumSetMethods.Clicks(btnSave);


            // txtInitial.SendKeys(initial);
            // txtFirstname.SendKeys(firstName);
            // txtMiddleName.SendKeys(middleName);
            // btnSave.Click();
        }
Пример #4
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");
        }
Пример #5
0
        public void ExecuteTest()
        {
            // Title
            // SeleniumSetMethods.SelectDropDown(driver, "TitleId", "Mr.", "Id");
            SeleniumSetMethods.SetDropDownValue(driver, "TitleId", 1, "Id");

            // Initial
            SeleniumSetMethods.EnterText(driver, "Initial", "executeautomation", "Name");

            // Get Text from controls
            Console.WriteLine("The value of my Title is {0}", SeleniumGetMethods.GetText(driver, "TitleId", "Id"));
            Console.WriteLine("The value of my Initial is {0}", SeleniumGetMethods.GetText(driver, "Initial", "Name"));

            // Click
            //  SeleniumSetMethods.Click(driver, "Save", "Name");
            //Console.WriteLine("Executed test");
        }
Пример #6
0
        public void FillUserForm(string initial, string middleName, string firstName)
        {
            TxtInitial.EnterText(initial);
            TxtFirstName.EnterText(firstName);
            TxtMiddleName.EnterText(middleName);
            BtnSave.Click();

            SeleniumSetMethods.EnterText(TxtInitial, initial);
            SeleniumSetMethods.EnterText(TxtFirstName, firstName);
            SeleniumSetMethods.EnterText(TxtMiddleName, middleName);
            SeleniumSetMethods.Click(BtnSave);

            //TxtInitial.SendKeys(initial);
            //TxtFirstName.SendKeys(firstName);
            //TxtMiddleName.SendKeys(middleName);
            //BtnSave.Click();
        }
Пример #7
0
        public void FillUserForm(string titleId, string initial, string firstName, string middleName)
        {
            SeleniumSetMethods.EnterText(txtInitial, initial);
            SeleniumSetMethods.EnterText(txtFirstName, firstName);
            SeleniumSetMethods.EnterText(txtMiddleName, middleName);
            SeleniumSetMethods.Click(btnSave);
            SeleniumSetMethods.Click(btnFemale);
            SeleniumSetMethods.Click(btnHindi);


            //ddlTitleId.SendKeys(titleId);
            //txtInitial.SendKeys(initial);
            //txtFirstName.SendKeys(firstName);
            //txtMiddleName.SendKeys(middleName);

            //btnFemale.Click();
            //btnHindi.Click();
            //btnSave.Click();
        }
Пример #8
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");
        }
Пример #9
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");
        }
Пример #10
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");
        }
Пример #11
0
 public void OtherTest()
 {
     // Click
     SeleniumSetMethods.Click(driver, "Save", "Name");
     Console.WriteLine("Executed test");
 }