Beispiel #1
0
        public void GoogleSearch()
        {
            TestDataAccess.DataAccess dataAccess = new TestDataAccess.DataAccess();
            var testData = dataAccess.GetTestData();

            testData.ForEach(testCase =>
            {
                browser.Goto("https://www.google.com/");
                googleHomePage.Search(testCase.Keyword, googlePageObject);
                Assert.AreEqual(testCase.ExpectedResult, driver.Title);
            });
        }
Beispiel #2
0
        public void SearchForParameterAndVerifyIsDisplayFirst()
        {
            //Google Home Page

            GoogleHomePage site = new GoogleHomePage(driver);

            site.goToPage(test_URL);

            site.Search(parameter);

            System.Threading.Thread.Sleep(6000);

            //Google Result Page

            ResultPage resultPage = new ResultPage(driver);

            string actualResult = resultPage.FirstSite.GetAttribute("href");

            //Assert

            Assert.AreEqual(expectedResult, actualResult);

            if (actualResult == expectedResult)
            {
                Console.WriteLine("For parameter " + parameter + " in Google Result Page is displaying this site first: " + actualResult);

                resultPage.clickOnFirstSite();

                System.Threading.Thread.Sleep(6000);
            }
            else
            {
                Assert.Fail();
            }
        }
        public void WhenISearchGoogleFor(string query)
        {
            GoogleHomePage          googleHome  = Get <GoogleHomePage>();
            GoogleSearchResultsPage resultsPage = googleHome.Search(query);

            Set <GoogleSearchResultsPage>(resultsPage);
        }
        public void ShouldSearchGoogleUsingChrome()
        {
            Driver.Navigate().GoToUrl("https://www.google.com");
            Assert.IsTrue(Driver.Title.Contains("Google"));

            _homePage.Search("UI Automation");
            Assert.IsTrue(Driver.Title.Contains("UI Automation"));
        }
Beispiel #5
0
        public void Test_GoogleSearch(string keyword, string expectedTitle)
        {
            // arrange
            googleHomePage = new GoogleHomePage();
            browser.Goto("https://www.google.com/");

            // act
            googleHomePage.Search(keyword, googlePageObject);

            // assert
            Assert.AreEqual(expectedTitle, driver.Title);
        }
Beispiel #6
0
        public void SearchWebsite()
        {
            _driver = new ChromeDriver();
            _wait   = new WebDriverWait(_driver, new TimeSpan(0, 0, 20));

            _driver.Navigate().GoToUrl("http://www.google.com/");

            var googleSeachPage = new GoogleHomePage(_driver, _wait);

            googleSeachPage.Search("feel it services iasi").SelectFirstResult().ClickTopMenuCareers().ClickTopMenuContactUs();

            Assert.NotNull(_driver.Title);
        }
Beispiel #7
0
        public void Test_GoogleSearch(string keyword, string expectedTitle)
        {
            // arrange
            test           = extentTest("GoogleSearch", "Google Search Test on google home page");
            googleHomePage = new GoogleHomePage();
            browser.Goto("https://www.google.com/");

            // act
            test.Log(Status.Info, "Test Case Starts.");
            googleHomePage.Search(keyword, googlePageObject);

            // assert
            Assert.AreEqual(expectedTitle, driver.Title);
        }
Beispiel #8
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();
        }
Beispiel #9
0
 public void WhenIConvertSomething(string ConversionString)
 {
     GoogleSearchResultsPage = GoogleHomePage.Search("convert " + ConversionString);
 }
Beispiel #10
0
 public void WhenISearchForARidiculouslySmallNumberOfResults()
 {
     GoogleSearchResultsPage = GoogleHomePage.Search("macrocryoglobulinemia marvel");
 }
Beispiel #11
0
 public void WhenISearchForSomething(string searchTerm)
 {
     GoogleSearchResultsPage = GoogleHomePage.Search(searchTerm);
 }