public void ClaimantRegistrationTest(IWebDriver driver, Dictionary <string, string> inputDataCollection, string testCasePath, string inputDriverName) { string baseUrl = ConfigurationManager.AppSettings["BaseUrl"]; driver.Navigate().GoToUrl(baseUrl); driver.Manage().Window.Maximize(); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); //************************************************Start Flow************************************************// //Navigate to Claimant Registration SeleniumDriverObject.SaveScreenShot(inputDriverName, driver, testCasePath, "Registration Option.jpg"); driver.FindElement(By.Id("btn_ClaimantRegistration")).Click(); //Claimant SeleniumDriverObject.ExplicitWaitForPageLoad(driver, By.Id("txt_Ssn"), TimeSpan.FromSeconds(30)); driver.FindElement(By.Id("txt_Ssn")).Clear(); driver.FindElement(By.Id("txt_Ssn")).SendKeys(inputDataCollection["SSN"]); driver.FindElement(By.Id("txt_RetypeSsn")).Clear(); driver.FindElement(By.Id("txt_RetypeSsn")).SendKeys(inputDataCollection["SSN"]); driver.FindElement(By.Id("txt_BirthDt")).Clear(); driver.FindElement(By.Id("txt_BirthDt")).SendKeys(inputDataCollection["DOB"]); if (inputDataCollection["Gender"].ToLower() == "male") { driver.FindElement(By.XPath("//div[@id='radio_Gender']/div[2]/label")).Click(); } else { driver.FindElement(By.XPath("//div[@id='radio_Gender']/div[1]/label")).Click(); } driver.FindElement(By.Id("txt_FirstNa")).Clear(); driver.FindElement(By.Id("txt_FirstNa")).SendKeys(inputDataCollection["FirstName"]); driver.FindElement(By.Id("txt_MddlInitNa")).Clear(); driver.FindElement(By.Id("txt_MddlInitNa")).SendKeys(inputDataCollection["MiddleInitial"]); driver.FindElement(By.Id("txt_LastNa")).Clear(); driver.FindElement(By.Id("txt_LastNa")).SendKeys(inputDataCollection["LastName"]); driver.FindElement(By.Id("txt_NameSuffix")).Clear(); driver.FindElement(By.Id("txt_NameSuffix")).SendKeys(inputDataCollection["Suffix"]); driver.FindElement(By.Id("txt_DmvNu")).Clear(); driver.FindElement(By.Id("txt_DmvNu")).SendKeys(inputDataCollection["DLNumber"]); new SelectElement(driver.FindElement(By.Id("slct_DmvStateCd"))).SelectByText("IssuedByState"); //District of Columbia new SelectElement(driver.FindElement(By.Id("slct_EthnCd"))).SelectByText("EthnicHeritage"); // new SelectElement(driver.FindElement(By.Id("slct_RaceCd"))).SelectByText("Race"); //American Indian/Alaskan Native SeleniumDriverObject.SaveScreenShot(inputDriverName, driver, testCasePath, "Claimant Authentication.jpg"); driver.FindElement(By.Id("btn_Next")).Click(); //Mailing Address //driver.FindElement(By.Id("B_F")).SendKeys(""); SeleniumDriverObject.ExplicitWaitForPageLoad(driver, By.Id("txt_Mailing_Addr1"), TimeSpan.FromSeconds(30)); driver.FindElement(By.Id("txt_Mailing_Addr1")).Clear(); driver.FindElement(By.Id("txt_Mailing_Addr1")).SendKeys(inputDataCollection["AddressLine1"]); driver.FindElement(By.Id("txt_Mailing_Addr2")).Clear(); driver.FindElement(By.Id("txt_Mailing_Addr2")).SendKeys(inputDataCollection["AddressLine2"]); driver.FindElement(By.Id("txt_Mailing_City")).Clear(); driver.FindElement(By.Id("txt_Mailing_City")).SendKeys(inputDataCollection["City"]); new SelectElement(driver.FindElement(By.Id("slct_Mailing_StateCd"))).SelectByText("IssuedByState"); //Washington driver.FindElement(By.Id("txt_Mailing_Zip")).Clear(); driver.FindElement(By.Id("txt_Mailing_Zip")).SendKeys(inputDataCollection["ZipCode"]); new SelectElement(driver.FindElement(By.Id("slct_Mailing_CountryCd"))).SelectByText("Country"); //United States of America //Residential Address driver.FindElement(By.Id("chk_SameasResidential")).Click(); //Telephone Numbers driver.FindElement(By.Id("txt_TelNu")).SendKeys(inputDataCollection["HomeTelephoneNumber"]); //Correspondence Preference driver.FindElement(By.XPath("//div[@id='rd_EmailPrefIn']/div[2]/label")).Click(); driver.FindElement(By.Id("txt_Email")).SendKeys(inputDataCollection["EmailAddress"]); driver.FindElement(By.Id("txt_RetypeEmail")).SendKeys(inputDataCollection["EmailAddress"]); new SelectElement(driver.FindElement(By.Id("slct_PrefLanguage1Cd"))).SelectByText("PreferredLanguage"); //English SeleniumDriverObject.SaveScreenShot(inputDriverName, driver, testCasePath, "General Information.jpg"); driver.FindElement(By.Id("btn_Next")).Click(); //Set Password SeleniumDriverObject.ExplicitWaitForPageLoad(driver, By.Id("txt_Password"), TimeSpan.FromSeconds(30)); driver.FindElement(By.Id("txt_Password")).SendKeys(inputDataCollection["Password"]); driver.FindElement(By.Id("txt_RetypePassword")).SendKeys(inputDataCollection["Password"]); new SelectElement(driver.FindElement(By.Id("txt_SecurityQuestion"))).SelectByText("What was the name of your first pet?"); driver.FindElement(By.Id("txt_SecurityAnswer")).SendKeys("Flipper"); driver.FindElement(By.Id("txt_RetypeSecurityAnswer")).SendKeys("Flipper"); SeleniumDriverObject.SaveScreenShot(inputDriverName, driver, testCasePath, "Set Password.jpg"); driver.FindElement(By.Id("btn_Submit")).Click(); //Click on Login button SeleniumDriverObject.ExplicitWaitForPageLoad(driver, By.Id("btn_Login"), TimeSpan.FromSeconds(30)); SeleniumDriverObject.SaveScreenShot(inputDriverName, driver, testCasePath, "Confirmation.jpg"); driver.FindElement(By.Id("btn_Login")).Click(); //Enter User id and Password driver.FindElement(By.Id("txt_userName")).SendKeys(inputDataCollection["UserID"]); driver.FindElement(By.Id("txt_password")).SendKeys(inputDataCollection["Password"]); SeleniumDriverObject.ExplicitWaitForPageLoad(driver, By.Id("btn_Login"), TimeSpan.FromSeconds(30)); SeleniumDriverObject.SaveScreenShot(inputDriverName, driver, testCasePath, "Claimant Login.jpg"); driver.FindElement(By.Id("btn_Login")).Click(); }
public void MedicalProviderRegistrationTest(IWebDriver driver, Dictionary <string, string> inputDataCollection, string testCasePath, string inputDriverName) { string baseUrl = ConfigurationManager.AppSettings["BaseUrl"]; driver.Navigate().GoToUrl(baseUrl); driver.Manage().Window.Maximize(); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); //-----------------Registration Option(s)--------------------------- SeleniumDriverObject.SaveScreenShot(inputDriverName, driver, testCasePath, "Registration Option.jpg"); //Click Physician/Practitioner Registration driver.FindElement(By.Id("btn_MPRegistration")).Click(); //-----------------Physician / Practitioner: Account Verification Information Personal Info----------------------------- SeleniumDriverObject.ExplicitWaitForPageLoad(driver, By.Id("txt_FirstNa"), TimeSpan.FromSeconds(30)); //Enter FirstName driver.FindElement(By.Id("txt_FirstNa")).Clear(); driver.FindElement(By.Id("txt_FirstNa")).SendKeys(inputDataCollection["FirstName"]); //Enter LastName driver.FindElement(By.Id("txt_LastNa")).Clear(); driver.FindElement(By.Id("txt_LastNa")).SendKeys(inputDataCollection["LastName"]); Thread.Sleep(3000); //Enter DateOfBirth driver.FindElement(By.Id("txt_BirthDt")).Clear(); driver.FindElement(By.Id("txt_BirthDt")).SendKeys(inputDataCollection["DateOfBirth"]); Thread.Sleep(3000); //Enter Last Four Digits of Social Security Number driver.FindElement(By.Id("txt_SsnLast4")).Clear(); driver.FindElement(By.Id("txt_SsnLast4")).SendKeys(inputDataCollection["Last Four Digits of SSN"]); //Enter Driver License Number driver.FindElement(By.Id("txt_DmvNu")).Clear(); driver.FindElement(By.Id("txt_DmvNu")).SendKeys(inputDataCollection["Driver License Number"]); //Enter Re-type Driver License Number driver.FindElement(By.Id("txt_RetypeDmvNu")).Clear(); driver.FindElement(By.Id("txt_RetypeDmvNu")).SendKeys(inputDataCollection["Driver License Number"]); //Select Issued By State new SelectElement(driver.FindElement(By.Id("slct_DmvStateCd"))).SelectByText(inputDataCollection["Issued By State"]); //Select License Type new SelectElement(driver.FindElement(By.Id("slct_LicTypeCd"))).SelectByText(inputDataCollection["License Type"]); //Enter License Expiration Date driver.FindElement(By.Id("txt_LicExpDt")).Clear(); driver.FindElement(By.Id("txt_LicExpDt")).SendKeys(inputDataCollection["License Expiration Date"]); //Enter Physician/Practitioner License Number driver.FindElement(By.Id("txt_LicNu")).Clear(); driver.FindElement(By.Id("txt_LicNu")).SendKeys(inputDataCollection["Physician/Practitioner License Number"]); SeleniumDriverObject.SaveScreenShot(inputDriverName, driver, testCasePath, "Ref1 Physician Practitioner Account Verification Information.jpg"); //Click Next driver.FindElement(By.Id("btn_Next")).Click(); //-----------------Physician / Practitioner: Account Verification Information Contact Info----------------------------- SeleniumDriverObject.ExplicitWaitForPageLoad(driver, By.Id("txt_mlAddr1"), TimeSpan.FromSeconds(30)); //Enter Address Line 1 driver.FindElement(By.Id("txt_mlAddr1")).Clear(); driver.FindElement(By.Id("txt_mlAddr1")).SendKeys(inputDataCollection["Address Line 1"]); //Enter City driver.FindElement(By.Id("txt_mlCity")).Clear(); driver.FindElement(By.Id("txt_mlCity")).SendKeys(inputDataCollection["City"]); //Select State new SelectElement(driver.FindElement(By.Id("slct_mlStateCd"))).SelectByText(inputDataCollection["State"]); //Enter Zip/Postal Code driver.FindElement(By.Id("txt_mlZip")).Clear(); driver.FindElement(By.Id("txt_mlZip")).SendKeys(inputDataCollection["Zip/Postal Code"]); //Select Country //new SelectElement(driver.FindElement(By.Id("C_N"))).SelectByText(inputDataCollection["Country"]); //Enter Phone driver.FindElement(By.Id("txt_telNu")).Clear(); driver.FindElement(By.Id("txt_telNu")).SendKeys(inputDataCollection["Phone"]); //Select Yes - When possible, would you like to receive message from us electronically? driver.FindElement(By.XPath("/html/body/div[1]/div[2]/form/div/div/div/div/div[2]/div[3]/div/div/div/div[2]/div[1]/div/div/div/div/div[2]/label/span")).Click(); //Enter E-mail Address driver.FindElement(By.Id("txt_Email")).Clear(); driver.FindElement(By.Id("txt_Email")).SendKeys(inputDataCollection["E-mail Address"]); //Enter Re-type E-mail Address driver.FindElement(By.Id("txt_RetypeEmail")).Clear(); driver.FindElement(By.Id("txt_RetypeEmail")).SendKeys(inputDataCollection["E-mail Address"]); SeleniumDriverObject.SaveScreenShot(inputDriverName, driver, testCasePath, "Ref2 Physician Practitioner Account Verification Information.jpg"); //Click Next driver.FindElement(By.Id("btn_Next")).Click(); //------------------------Set Password------------------------------------- SeleniumDriverObject.ExplicitWaitForPageLoad(driver, By.Id("txt_Password"), TimeSpan.FromSeconds(30)); //Enter New Password driver.FindElement(By.Id("txt_Password")).Clear(); driver.FindElement(By.Id("txt_Password")).SendKeys(inputDataCollection["New Password"]); //Enter Confirm Password driver.FindElement(By.Id("txt_RetypePassword")).Clear(); driver.FindElement(By.Id("txt_RetypePassword")).SendKeys(inputDataCollection["New Password"]); //Select Security Question new SelectElement(driver.FindElement(By.Id("txt_SecurityQuestion"))).SelectByText(inputDataCollection["Security Question"]); //Enter Security Answer driver.FindElement(By.Id("txt_SecurityAnswer")).Clear(); driver.FindElement(By.Id("txt_SecurityAnswer")).SendKeys(inputDataCollection["Security Answer"]); //Enter Confirm Security Answer driver.FindElement(By.Id("txt_RetypeSecurityAnswer")).Clear(); driver.FindElement(By.Id("txt_RetypeSecurityAnswer")).SendKeys(inputDataCollection["Security Answer"]); SeleniumDriverObject.SaveScreenShot(inputDriverName, driver, testCasePath, "Ref3 Set Password.jpg"); //Click Submit driver.FindElement(By.Id("btn_Next")).Click(); //-------------------------Account Setup Confirmation--------------------------------- SeleniumDriverObject.ExplicitWaitForPageLoad(driver, By.Id("btn_Login"), TimeSpan.FromSeconds(30)); SeleniumDriverObject.SaveScreenShot(inputDriverName, driver, testCasePath, "Ref4 Account Setup Confirmation.jpg"); //Click Login driver.FindElement(By.Id("btn_Login")).Click(); //Login Screen //Enter Username driver.FindElement(By.Id("txt_UserName")).Clear(); driver.FindElement(By.Id("txt_UserName")).SendKeys(inputDataCollection["Physician/Practitioner License Number"]); //Enter Password driver.FindElement(By.Id("txt_Password")).Clear(); driver.FindElement(By.Id("txt_Password")).SendKeys(inputDataCollection["New Password"]); SeleniumDriverObject.SaveScreenShot(inputDriverName, driver, testCasePath, "MP Login.jpg"); //Click Login driver.FindElement(By.Id("btn_Login")).Click(); Thread.Sleep(3000); //Home SeleniumDriverObject.SaveScreenShot(inputDriverName, driver, testCasePath, "MP Home.jpg"); }
public void MedicalProviderRegistrationTest(IWebDriver driver, Dictionary <string, string> inputDataCollection, string testCasePath, string inputDriverName) { driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); //-----------------Registration Option(s)--------------------------- SeleniumDriverObject.SaveScreenShot(inputDriverName, driver, testCasePath, "Registration Option.jpg"); //Click Physician/Practitioner Registration driver.FindElement(By.Id("C_P")).Click(); //-----------------Physician / Practitioner: Account Verification Information----------------------------- SeleniumDriverObject.ExplicitWaitForPageLoad(driver, By.Id("D_K"), TimeSpan.FromSeconds(30)); //Enter FirstName driver.FindElement(By.Id("D_K")).Clear(); driver.FindElement(By.Id("D_K")).SendKeys(inputDataCollection["FirstName"]); //Enter LastName driver.FindElement(By.Id("D_P")).Clear(); driver.FindElement(By.Id("D_P")).SendKeys(inputDataCollection["LastName"]); //Enter DateOfBirth driver.FindElement(By.Id("D_T")).Clear(); driver.FindElement(By.Id("D_T")).SendKeys(inputDataCollection["DateOfBirth"]); //Enter Last Four Digits of Social Security Number driver.FindElement(By.Id("D_W")).Clear(); driver.FindElement(By.Id("D_W")).SendKeys(inputDataCollection["Last Four Digits of SSN"]); //Enter Driver License Number driver.FindElement(By.Id("D_Z")).Clear(); driver.FindElement(By.Id("D_Z")).SendKeys(inputDataCollection["Driver License Number"]); //Enter Re-type Driver License Number driver.FindElement(By.Id("D_c")).Clear(); driver.FindElement(By.Id("D_c")).SendKeys(inputDataCollection["Driver License Number"]); //Select Issued By State new SelectElement(driver.FindElement(By.Id("D_f"))).SelectByText(inputDataCollection["Issued By State"]); //Select License Type new SelectElement(driver.FindElement(By.Id("D_h"))).SelectByText(inputDataCollection["License Type"]); //Enter Physician/Practitioner License Number driver.FindElement(By.Id("D_k")).Clear(); driver.FindElement(By.Id("D_k")).SendKeys(inputDataCollection["Physician/Practitioner License Number"]); //Enter License Expiration Date driver.FindElement(By.Id("D_m")).Clear(); driver.FindElement(By.Id("D_m")).SendKeys(inputDataCollection["License Expiration Date"]); //Enter Address Line 1 driver.FindElement(By.Id("D_w")).Clear(); driver.FindElement(By.Id("D_w")).SendKeys(inputDataCollection["Address Line 1"]); //Enter City driver.FindElement(By.Id("D_BC")).Clear(); driver.FindElement(By.Id("D_BC")).SendKeys(inputDataCollection["City"]); //Select State new SelectElement(driver.FindElement(By.Id("D_BF"))).SelectByText(inputDataCollection["State"]); //Enter Zip/Postal Code driver.FindElement(By.Id("D_BH")).Clear(); driver.FindElement(By.Id("D_BH")).SendKeys(inputDataCollection["Zip/Postal Code"]); //Select Country //new SelectElement(driver.FindElement(By.Id("D_BK"))).SelectByText(inputDataCollection["Country"]); //Enter Phone driver.FindElement(By.Id("D_BM")).Clear(); driver.FindElement(By.Id("D_BM")).SendKeys(inputDataCollection["Phone"]); //Select Yes - When possible, would you like to receive message from us electronically? driver.FindElement(By.XPath("/html/body/div[1]/div[2]/form/div/div/div/div/div[2]/div[5]/div/div/div/div[2]/div[1]/div/div/div/div/div[2]/label/span")).Click(); //Enter E-mail Address driver.FindElement(By.Id("D_BS")).Clear(); driver.FindElement(By.Id("D_BS")).SendKeys(inputDataCollection["E-mail Address"]); //Enter Re-type E-mail Address driver.FindElement(By.Id("D_BT")).Clear(); driver.FindElement(By.Id("D_BT")).SendKeys(inputDataCollection["E-mail Address"]); SeleniumDriverObject.SaveScreenShot(inputDriverName, driver, testCasePath, "Ref1 Physician Practitioner Account Verification Information.jpg"); //Click Next driver.FindElement(By.Id("D_BX")).Click(); //------------------------Set Password------------------------------------- SeleniumDriverObject.ExplicitWaitForPageLoad(driver, By.Id("D_F"), TimeSpan.FromSeconds(30)); //Enter New Password driver.FindElement(By.Id("D_F")).Clear(); driver.FindElement(By.Id("D_F")).SendKeys(inputDataCollection["New Password"]); //Enter Confirm Password driver.FindElement(By.Id("D_G")).Clear(); driver.FindElement(By.Id("D_G")).SendKeys(inputDataCollection["New Password"]); //Select Security Question new SelectElement(driver.FindElement(By.Id("D_H"))).SelectByText(inputDataCollection["Security Question"]); //Enter Security Answer driver.FindElement(By.Id("D_J")).Clear(); driver.FindElement(By.Id("D_J")).SendKeys(inputDataCollection["Security Answer"]); //Enter Confirm Security Answer driver.FindElement(By.Id("D_K")).Clear(); driver.FindElement(By.Id("D_K")).SendKeys(inputDataCollection["Security Answer"]); SeleniumDriverObject.SaveScreenShot(inputDriverName, driver, testCasePath, "Ref2 Set Password.jpg"); //Click Submit driver.FindElement(By.Id("D_N")).Click(); //-------------------------Account Setup Confirmation--------------------------------- SeleniumDriverObject.ExplicitWaitForPageLoad(driver, By.Id("D_G"), TimeSpan.FromSeconds(30)); SeleniumDriverObject.SaveScreenShot(inputDriverName, driver, testCasePath, "Ref3 Account Setup Confirmation.jpg"); //Click Login driver.FindElement(By.Id("D_G")).Click(); }