예제 #1
0
        public void ExecuteTest()
        {
            //Method 1
            //Find the Element we want to use
            // IWebElement element = GlobalProperties.driver.FindElement(By.Name("q"));
            // System.Console.WriteLine("Successfully found Element");

            // //Perform operations
            // element.SendKeys("What is Trunk Club?");
            // System.Console.WriteLine("Successfully mimicked a keyboard..Ha!");

            //Method 2
            //Enter Text by calling the EnterText method from our custom methods
            // CustomMethods.EnterText("q", "What is Trunk Club?", IdentificationType.Name);

            //Perform click event
            // CustomMethods.Click("btnK", IdentificationType.Name);

            //Perform click event
            // CustomMethods.ClickLink("FAQ |Trunk Club", IdentificationType.LinkText);


            //Method 3
            //Using Selenium Inbuilt methods and PageFactory

            //First initialize the page and all its objects by calling its reference
            GoogleHomePage SearchPage = new GoogleHomePage();

            // //perform page operations using the variable page
            // searchPage.SearchBox.SendKeys("What is Trunk Club?");

            // searchPage.SearchButton.Click();

            //Input search text and open target link text
            ResultsPage SearchResults = SearchPage.Search("What is Trunk Club?");

            SearchResults.OpenFAQLink();
        }