Exemple #1
0
        public static void LoginToGather()
        {
            driver = new ChromeDriver();
            driver.Manage().Window.Maximize();

            //Go to Gather
            driver.Navigate().GoToUrl("https://engagement.int.ert.com");

            //Check a few pieces of text on the login page
            GenericFunctions.CheckTextIsOnPageNew("Username", driver);
            GenericFunctions.CheckTextIsOnPageNew("Password", driver);
            GenericFunctions.CheckTextIsOnPageNew("Forgot Password", driver);
            GenericFunctions.CheckTextIsOnPageNew("Forgot Username", driver);
            GenericFunctions.CheckTextIsOnPageNew("LOGIN", driver);
            GenericFunctions.CheckTextIsOnPageNew("Terms & Conditions", driver);
            GenericFunctions.CheckTextIsOnPageNew("Privacy Policy", driver);

            //Enter login credentials
            GenericFunctions.Type("ccraiser.studyall", "Username", driver);
            GenericFunctions.Type("User1234", "Password", driver);
            GenericFunctions.Wait(3);

            //Login
            GenericFunctions.ClickOnButton("login-submit-button", driver);
            GenericFunctions.Wait(3);

            //Select the tabs at the top of the page.
            GenericFunctions.ClickOnLink("Reporting", driver);
            GenericFunctions.Wait(3);
            GenericFunctions.ClickOnLink("Change Control", driver);

            //Close Browser
            GenericFunctions.Wait(5);
            driver.Quit();
        }
Exemple #2
0
        public static void NavigateAroundAnotherSite()
        {
            driver = new ChromeDriver();
            driver.Manage().Window.Maximize();

            //Go to Training HTML
            driver.Navigate().GoToUrl("file:///C:/Ranjit/Automation/TrainingTasks/IntroductionToAutomation/Testng.html");
            GenericFunctions.Wait(2);

            //Click on a hyperlink
            GenericFunctions.ClickOnLink("Click Me", driver);
            GenericFunctions.Wait(2);

            //Navigate Back
            driver.Navigate().Back();
            GenericFunctions.Wait(2);

            //Select a value from a Dropdown
            GenericFunctions.SelectFromList("Audi", "CarsList", driver);
            GenericFunctions.Wait(2);

            //Tick / Untick a checkbox
            GenericFunctions.TickCheckBox("Bike", driver);
            GenericFunctions.Wait(2);
            GenericFunctions.UnTickCheckBox("Bike", driver);
            GenericFunctions.Wait(2);

            //Check text is on a page.
            GenericFunctions.CheckTextIsOnPageNew("Login", driver);
            GenericFunctions.CheckTextIsOnPageNew("Username:"******"Password:"******"What transport do you have?", driver);
            GenericFunctions.CheckTextIsOnPageNew("What car do you have?", driver);

            //Check text is not on a page.
            GenericFunctions.CheckTextIsNotOnPageNew("Elephant", driver);
            GenericFunctions.CheckTextIsNotOnPageNew("Tiger", driver);
            GenericFunctions.CheckTextIsNotOnPageNew("Dog", driver);
            GenericFunctions.CheckTextIsNotOnPageNew("Cat", driver);

            //Close Browser
            GenericFunctions.Wait(2);
            driver.Quit();
        }