[Test, Category("MyOption Tests")] //Email Opt Out Yes public void MyOptionEmailOptOutYes() { utilities.ConsoleMessageStart(); utilities.extenttest = utilities.extent.StartTest("MyOptions Email Optput Yes"); utilities.extenttest.AssignCategory("MyOption Tests"); loginMain.NavigateTo(); loginMain.LogInSuccess(); myoptionMain.AccessMyoptionIcon(); myoptionMain.MyoptionEmailOptOutYes(); myoptionMain.MyoptionSaveButton(); IWebElement displaynametest = driver.FindElement(By.XPath("//*[@id='ctl00_MainContentPlaceHolder_txtDisplayName']")); string displayName = displaynametest.GetAttribute("value"); Thread.Sleep(3000); contactMain.AccessContactsTab(); // contact.SearchingContactFromDisplayName(displayName); Thread.Sleep(2000); // Assert.IsTrue(driver.FindElement(By.Id("ctl00_MainContentPlaceHolder_usergrdList_ctl00_ctl04_chkEmailOptOut")).Selected); if (driver.FindElement(By.Id("ctl00_MainContentPlaceHolder_usergrdList_ctl00_ctl04_chkEmailOptOut")).Selected) { Console.WriteLine("Email Opt Out selected"); utilities.extenttest.Log(LogStatus.Pass, "Assert pass "); Assert.Pass(); } else { Console.WriteLine("Email Opt out not selected"); Assert.Fail(); } }
public void ContactButtonClicked() { utilities.ConsoleMessageStart(); utilities.extenttest = utilities.extent.StartTest("Contact Button Clicked"); utilities.extenttest.AssignCategory("Contact Tests"); loginMain.NavigateTo(); loginMain.LogInSuccess(); contactMain.AccessContactsTab(); if (driver.FindElement(By.Id("ctl00_MainContentPlaceHolder_usergrdList")).Displayed) { Console.WriteLine("Contacts Button Clicked"); utilities.extenttest.Log(LogStatus.Pass, "Assert pass "); Assert.Pass(); } else { Console.WriteLine("Contacts button was not clicked"); Assert.Fail(); } }