public void CheckButtonTest() { PropertiesCollection.driver.Navigate().GoToUrl("http://testing.todorvachev.com"); HomePageObject homePage = new HomePageObject(); SpecialElementsPageObject specialElementsPage = new SpecialElementsPageObject(); CheckButtonTestPageObject checkButtonTestPage = new CheckButtonTestPageObject(); specialElementsPage = homePage.ClickSpecialElementsPage(); checkButtonTestPage = specialElementsPage.ClickCheckButtonTestPage(); checkButtonTestPage.btnCheckBox1.Click(); if (checkButtonTestPage.btnCheckBox1.GetAttribute("checked") == "true") { Assert.Pass(); } else { Assert.Fail(); } if (checkButtonTestPage.btnCheckBox2.GetAttribute("checked") == "true") { Assert.Pass(); } else { Assert.Fail(); } checkButtonTestPage.btnCheckBox2.Click(); }
public void AlertBoxTest() { PropertiesCollection.driver.Navigate().GoToUrl("http://testing.todorvachev.com"); HomePageObject homePage = new HomePageObject(); SpecialElementsPageObject specialElementsPage = new SpecialElementsPageObject(); AlertBoxPageObject alertBoxPage = new AlertBoxPageObject(); specialElementsPage = homePage.ClickSpecialElementsPage(); alertBoxPage = specialElementsPage.ClickAlertBoxTestPage(); IAlert alert = PropertiesCollection.driver.SwitchTo().Alert(); alert.Accept(); Thread.Sleep(5000); if (alertBoxPage.imgAlertBox.Displayed) { Assert.Pass(); } else { Assert.Fail(); } }
public void DropDownMenuTest() { PropertiesCollection.driver.Navigate().GoToUrl("http://testing.todorvachev.com"); HomePageObject homePage = new HomePageObject(); SpecialElementsPageObject specialElementsPage = new SpecialElementsPageObject(); DropDownMenuTestPageObject dropDownMenuTestPage = new DropDownMenuTestPageObject(); specialElementsPage = homePage.ClickSpecialElementsPage(); dropDownMenuTestPage = specialElementsPage.ClickDropDownMenuTestPage(); dropDownMenuTestPage.SelectFromDDM("Audi"); }
public void TextInputFieldTest() { PropertiesCollection.driver.Navigate().GoToUrl("http://testing.todorvachev.com"); HomePageObject homePage = new HomePageObject(); SpecialElementsPageObject specialElementsPage = new SpecialElementsPageObject(); TextInputFieldPageObject textInputFieldPage = new TextInputFieldPageObject(); specialElementsPage = homePage.ClickSpecialElementsPage(); textInputFieldPage = specialElementsPage.ClickTextInputFieldTestPage(); textInputFieldPage.txtTextField.SendKeys("Hello there"); Console.WriteLine(textInputFieldPage.txtTextField.GetAttribute("value")); }
public void RadioButtonTest() { PropertiesCollection.driver.Navigate().GoToUrl("http://testing.todorvachev.com"); HomePageObject homePage = new HomePageObject(); SpecialElementsPageObject specialElementsPage = new SpecialElementsPageObject(); RadioButtonTestPageObject radioButtonTestPage = new RadioButtonTestPageObject(); specialElementsPage = homePage.ClickSpecialElementsPage(); radioButtonTestPage = specialElementsPage.ClickRadioButtonTestPage(); if (radioButtonTestPage.btnRadioButton1.GetAttribute("checked") == "true") { Assert.Pass(); } else { Assert.Fail(); } if (radioButtonTestPage.btnRadioButton2.GetAttribute("checked") == "false") { Assert.Pass(); } else { Assert.Fail(); } radioButtonTestPage.btnRadioButton2.Click(); if (radioButtonTestPage.btnRadioButton2.GetAttribute("checked") == "true") { Assert.Pass(); } else { Assert.Fail(); } }