public void Initialize(SCore.Selenium browser, string url) { _browser = browser; _browser.Initialize(); _browser.Navigation.OpenUrl(url); }
public void FindElementByClassName_InPage_ElementNotFound(SCore.Selenium browser) { // Arrange Initialize(browser); // Act var element = browser.Element.FindElementByClassName(_classNotFound); // Assert Assert.True(element == null); }
public void FindElementByClassName_InPage_ReturnsTheElement(SCore.Selenium browser) { // Arrange Initialize(browser); // Act var element = browser.Element.FindElementByClassName(_class); // Assert Assert.True(element != null); }
public void GetCurrentUrl_InPage_CheckIfTheCurrentURLIsThatItWasOpen(SCore.Selenium browser) { Initialize(browser); // Arrange string currentUrl; // Act browser.Navigation.OpenUrl(_url); currentUrl = browser.Navigation.GetCurrentUrl(); // Assert Assert.True(currentUrl.NormalizeUrl() == _url.NormalizeUrl()); }
public void CloseWebBrowser(SCore.Selenium browser) { Initialize(browser); // Arrange string currentUrl; // Act browser.Navigation.OpenUrl(_url); browser.Navigation.CloseWebBrowser(); currentUrl = browser.Navigation.GetCurrentUrl(); // Assert Assert.True(currentUrl.NormalizeUrl() == "about:blank"); }
public void Click_InPage_ClickInTheButton(SCore.Selenium browser) { // Arrange var button = By.ClassName(_button); var resultUrl = @"https://login.live.com/login.srf"; string currentUrl; Initialize(browser, _url2); // Act browser.Element.Click(button); currentUrl = browser.Navigation.GetCurrentUrl(); // Assert Assert.True(currentUrl.NormalizeUrl() == resultUrl.NormalizeUrl()); }
public void NavigateBack(SCore.Selenium browser) { Initialize(browser); // Arrange string currentUrl; var secondUrl = "google.com.br"; // Act browser.Navigation.OpenUrl(_url); browser.Navigation.OpenUrl(secondUrl); browser.Navigation.NavigateBack(); currentUrl = browser.Navigation.GetCurrentUrl(); // Assert Assert.True(currentUrl.NormalizeUrl() == _url.NormalizeUrl()); }
public void Initialize(SCore.Selenium browser) { Initialize(browser, _url); }
public void OpenUrl_InPage_OpenTheNewPage(SCore.Selenium browser) { Initialize(browser); // Arrange string currentUrl; // Act browser.Navigation.OpenUrl(_url); currentUrl = browser.Navigation.GetCurrentUrl(); // Assert Assert.True(currentUrl.NormalizeUrl() == _url.NormalizeUrl()); }
public void Submit_InPage_LogInToSystem(SCore.Selenium browser) { // Arrange var button = By.Id("idSIButton9"); var txtLogin = By.Name("loginfmt"); var txtPasswd = By.Name("passwd"); var valLogin = "******"; var valPass = "******"; string currentUrl; string resultUrl = @"http://account.microsoft.com"; Initialize(browser, @"https://login.live.com/login.srf"); // Act browser.Element.SendKeys(txtLogin, valLogin); browser.Element.SendKeys(txtPasswd, valPass); browser.Element.Click(button); currentUrl = browser.Navigation.GetCurrentUrl(); // Assert Assert.True(resultUrl.Normalize() == currentUrl.NormalizeUrl()); }
public void SendKeys_InPage_WriteLogin(SCore.Selenium browser) { Initialize(browser, @"https://login.live.com/login.srf"); // Arrange var txtLogin = By.Name("loginfmt"); var valLogin = "******"; // Act browser.Element.SendKeys(txtLogin, valLogin); // Assert Assert.True(browser.Element.GetValue(txtLogin) == valLogin); }
public void SelectDropDownByValue_InDDL_SelectTheBRLValue(SCore.Selenium browser) { Initialize(browser, @"https://www.paypal.com/us/webapps/mpp/home"); // Arrange var passo1 = By.Id("header-send"); var dropDown = By.Id("currency_code"); string value; // Act browser.Element.Click(passo1); browser.Element.SelectDropDownByValue(dropDown, "BRL"); value = browser.Element.GetValue(dropDown); // Assert Assert.True(value == "BRL"); }
public void GetValue_InPage_GetTheValueOfTheLoginField(SCore.Selenium browser) { Initialize(browser, @"https://login.live.com/login.srf"); // Arrange var txtLogin = By.Name("loginfmt"); var valLogin = "******"; string attr; // Act browser.Element.SendKeys(txtLogin, valLogin); attr = browser.Element.GetValue(txtLogin); // Assert Assert.True(attr == valLogin); }
public void FindElement_InPage_ReturnsTheElement(SCore.Selenium browser) { // Arrange var id = By.Id(_elementId); Initialize(browser); // Act var element = browser.Element.FindElement(id); // Assert Assert.True(element != null); }
public void FindElement_InPage_ElementNotFound(SCore.Selenium browser) { // Arrange var id = By.Id(_elementIdNotFound); Initialize(browser); // Act var element = browser.Element.FindElement(id); // Assert Assert.True(element == null); }