public static void ITC_CheckLastEventDate(int sub, string expectedDate, IWebDriver driver) { ////Search for subject string subID = sub.ToString(); GenericFunctions.Wait(2); GenericFunctions.ClickOnLink("My Subjects", driver); GenericFunctions.waitforElement("subjectId", driver); driver.FindElement(By.Id("subjectId")).Clear(); driver.FindElement(By.Id("subjectId")).SendKeys(subID); GenericFunctions.Wait(2); GenericFunctions.ClickOnButton("searchBtn", driver); GenericFunctions.CheckTextIsOnPage(subID, driver); GenericFunctions.Wait(2); //Get last event date string EventDate = driver.FindElement(By.XPath("//*[@id='Grid']/div[2]/table/tbody/tr/td[6]")).Text; Functions.Reporting.ReportScreenshot("AlertEmail", driver); //Compare actual last event date to expected last event date if (expectedDate.Equals(EventDate)) { GenericFunctions.ReportTheTestPassed("The last event date (" + EventDate + ") is correct"); _startUp.TestPasses++; _startUp.Passes++; } else { GenericFunctions.ReportTheTestFailed("The last event date is incorrect. The expected date is: " + expectedDate + " The actual date is: " + EventDate); _startUp.TestFails++; _startUp.Fails++; } }
public static void LoginToGather() { driver = new ChromeDriver(); driver.Manage().Window.Maximize(); //Go to Gather driver.Navigate().GoToUrl("https://engagement.int.ert.com"); //Check a few pieces of text on the login page GenericFunctions.CheckTextIsOnPageNew("Username", driver); GenericFunctions.CheckTextIsOnPageNew("Password", driver); GenericFunctions.CheckTextIsOnPageNew("Forgot Password", driver); GenericFunctions.CheckTextIsOnPageNew("Forgot Username", driver); GenericFunctions.CheckTextIsOnPageNew("LOGIN", driver); GenericFunctions.CheckTextIsOnPageNew("Terms & Conditions", driver); GenericFunctions.CheckTextIsOnPageNew("Privacy Policy", driver); //Enter login credentials GenericFunctions.Type("ccraiser.studyall", "Username", driver); GenericFunctions.Type("User1234", "Password", driver); GenericFunctions.Wait(3); //Login GenericFunctions.ClickOnButton("login-submit-button", driver); GenericFunctions.Wait(3); //Select the tabs at the top of the page. GenericFunctions.ClickOnLink("Reporting", driver); GenericFunctions.Wait(3); GenericFunctions.ClickOnLink("Change Control", driver); //Close Browser GenericFunctions.Wait(5); driver.Quit(); }
//Function accepting string as a parameter as well as an optional parameter public static void LoginToGather(string Username, string Password, IWebDriver driver, string Org = null, string Study = null, string State = null) { GenericFunctions.Type(Username, "Username", driver); GenericFunctions.Type(Password, "Password", driver); GenericFunctions.ClickOnButton("login-submit-button", driver); Console.WriteLine("Org is " + Org); }
//[Test] public void WhiteBeltTraining() { _startUp.driver.Navigate().GoToUrl("https://test.itc.excointouch.com/"); GenericFunctions.CheckTextIsOnPage("Enter your username and password:"******"Reports", _startUp.driver); GenericFunctions.CheckTextIsOnPage("Username", _startUp.driver); GenericFunctions.Type("abrown", "UserName", _startUp.driver); GenericFunctions.Type("Password", "Password", _startUp.driver); GenericFunctions.ClickOnButton("logonBtn", _startUp.driver); GenericFunctions.SelectFromList("DEMO1", "studyId", _startUp.driver); GenericFunctions.CheckTextIsOnPage("Subject Enrolment", _startUp.driver); GenericFunctions.ClickOnLink("Reporting", _startUp.driver); }
public static void ITC_Invalid(string IDORPASS, IWebDriver driver) { driver.Navigate().GoToUrl(GenericFunctions.goAndGet("UIUXURL")); GenericFunctions.CheckWindowTitle("Exco Intouch Online Services", driver); GenericFunctions.CheckTextIsOnPage("Online Services", driver); GenericFunctions.CheckTextIsOnPage("Enter your username and password:"******"Username", driver); GenericFunctions.CheckTextIsOnPage("Password", driver); GenericFunctions.Type((IDORPASS == "Username" ? "INVALIDUSERNAME" : GenericFunctions.goAndGet("USERNAME")), "UserName", driver); GenericFunctions.Type((IDORPASS == "Password" ? "INVALIDPASSWORD" : GenericFunctions.goAndGet("PASSWORD")), "Password", driver); GenericFunctions.ClickOnButton("logonBtn", driver); GenericFunctions.CheckTextIsOnPage("Login was unsuccessful. Please correct the errors and try again.", driver); GenericFunctions.CheckTextIsOnPage("Your login attempt was not successful. Please try again", driver); }
public static void ITC_EditSubject(int SubjectID, IWebDriver driver) { string StudyName = GenericFunctions.goAndGet("STUDYID"); string SiteName = GenericFunctions.goAndGet("SITEID"); GenericFunctions.ClickOnButton("editBtn", driver); GenericFunctions.Wait(5); Functions.Reporting.ReportScreenshot("Edit_", driver); GenericFunctions.Clear("SubjectEMail", driver); GenericFunctions.Type(SubjectID + "@email-modified.com", "SubjectEMail", driver); //ClickElement(driver.FindElement(By.XPath("//*[@id=\"patientEditSaveButton\"]/span"))); GenericFunctions.ClickElement(driver.FindElement(By.XPath("//*[@id=\"patientEditSaveButton\"]")), driver); GenericFunctions.Wait(20); var InputtedSecretQuestion = "In what city or town does your nearest sibling live?"; var getSecretQuestion = driver.FindElement(By.Id("Patient_SecurityQuestion")).GetAttribute("value"); //var getSecretQuestion = driver.FindElement(By.Id("SecurityQuestionDropDownList")).GetAttribute("value"); var InputtedSecretQuestionAnswer = "Nottingham"; var getSecretQuestionAnswer = driver.FindElement(By.Id("Patient_SecurityQuestionAnswer")).GetAttribute("value"); if (getSecretQuestion.Equals(InputtedSecretQuestion) && (getSecretQuestionAnswer.Equals(InputtedSecretQuestionAnswer))) { GenericFunctions.ReportTheTestPassed("The secret question (" + getSecretQuestion + ") and secret answer (" + getSecretQuestionAnswer + ") are correct "); _startUp.TestPasses++; _startUp.Passes++; } else { GenericFunctions.ReportTheTestFailed("The secret question is incorrect. The expected question is: " + InputtedSecretQuestion + "The actual question is: " + getSecretQuestion); GenericFunctions.ReportTheTestFailed("The secret question answer is incorrect. The expected question answer is: " + InputtedSecretQuestionAnswer + "The actual question is: " + getSecretQuestionAnswer); _startUp.TestFails++; _startUp.Fails++; } GenericFunctions.Wait(2); GenericFunctions.ClickOnLink("Subject Administration", driver); GenericFunctions.Wait(5); Functions.Reporting.ReportScreenshot("Edit", driver); }
public static int ITC_EnrolSubject(IWebDriver driver) { var studyName = GenericFunctions.goAndGet("STUDYID"); var siteName = GenericFunctions.goAndGet("SITEID"); var subjMob = GenericFunctions.goAndGet("SUBJECTPHONE"); var subjectId = (_dbActions.CountSubjects(driver) == 0 ? Convert.ToInt32(GenericFunctions.goAndGet("SITEPREFIX") + "0001") : _dbActions.GetLatestSubjectId(studyName, siteName, driver)); GenericFunctions.ClickOnText("enrolmentLink", driver); GenericFunctions.Wait(5); GenericFunctions.SelectDropDownByText(siteName, "siteId", driver); GenericFunctions.Wait(5); //GenericFunctions.Type("English", "patientLanguageDropDown", driver); GenericFunctions.Type("" + subjectId, "userIdentifier", driver); GenericFunctions.Type(subjectId + "*****@*****.**", "SubjectEMail", driver); GenericFunctions.Type(subjMob, "SubjectMSISDN", driver); //GenericFunctions.Type("7700910000", "SubjectMSISDN", driver); GenericFunctions.Wait(5); var myDate = DateTime.Today.AddHours(23); datePicker(driver); //ItcTimePicker(2,myDate,driver); GenericFunctions.Type("In what city or town does your nearest sibling live?", "SecurityQuestionDropDownList", driver); GenericFunctions.Type("Nottingham", "Patient_SecurityQuestionAnswer", driver); Functions.Reporting.ReportScreenshot("Reg", driver);; //GenericFunctions.Wait(5); GenericFunctions.waitforElement("submitBtn", driver); GenericFunctions.ClickOnButton("submitBtn", driver); GenericFunctions.Wait(2); GenericFunctions.CheckTextIsOnPage(subjectId + " has been successfully enrolled in the study.", driver); Functions.Reporting.ReportScreenshot("Enrol", driver); return(subjectId); }
public static void ITC_Login(IWebDriver driver) { string username = GenericFunctions.goAndGet("USERNAME"); string password = GenericFunctions.goAndGet("PASSWORD"); string studyName = GenericFunctions.goAndGet("STUDYID"); // Login driver.Navigate().GoToUrl(GenericFunctions.goAndGet("UIUXURL")); GenericFunctions.CheckWindowTitle("Exco Intouch Online Services", driver); GenericFunctions.CheckTextIsOnPage("Online Services", driver); GenericFunctions.CheckTextIsOnPage("Enter your username and password:"******"Username", driver); GenericFunctions.CheckTextIsOnPage("Password", driver); GenericFunctions.CheckTextIsOnPage("Knowledge Centre", driver); GenericFunctions.Type(username, "UserName", driver); GenericFunctions.Type(password, "Password", driver); Functions.Reporting.ReportScreenshot("Log", driver); GenericFunctions.ClickOnButton("logonBtn", driver); CheckPageText(driver); }
//[Test] public void WhiteBeltTest() { _startUp.driver.Navigate().GoToUrl("https://test.reactintouch.com"); GenericFunctions.ClickOnButton("ctl00_middlecontent_Login1_LoginButton", _startUp.driver); }