public static void ClassInitialize(TestContext context) { Playback.Initialize(); PersonalInformation1.PopulateInCollection(@"C:\Users\SHYM005\Documents\Visual Studio 2013\Projects\eRegistration_Seg1Prospect\DataSheet.xlsx"); UsernamePasswordTD.PopulateInCollection(@"C:\Users\SHYM005\Documents\Visual Studio 2013\Projects\eRegistration_Seg1Prospect\DataSheet.xlsx"); var bw = BrowserWindow.Launch(new Uri("https://sqa.registration.kellyservices.com/Abacus/LoginForm.aspx?JScript=1")); bw.Maximized = true; bw.CloseOnPlaybackCleanup = false; bw.WaitForControlExist(30000); }
public static void Referal2eRegistration() { //Create BrowserWindow BrowserWindow Browind = new BrowserWindow(); //wait for control ready Browind.WaitForControlReady(1000); // Referral pane Browind.SearchProperties[UITestControl.PropertyNames.Name] = "Referrals"; //Progress Meter HtmlCustom progress = new HtmlCustom(Browind); progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter"; bool availabilty = (bool)progress.GetProperty(HtmlCustom.PropertyNames.Exists); string workflowEvent = PersonalInformation1.ReadData(1, "WORKFLOW"); if (workflowEvent == "S1PROSPECT") { Assert.IsTrue(availabilty, "Progress Meter is not showing"); HtmlSpan bar = new HtmlSpan(Browind); bar.SearchProperties[HtmlSpan.PropertyNames.Id] = "meterlabel"; string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText); Assert.AreEqual(percentage, "60%"); } else { Assert.IsFalse(availabilty, "Progress Meter is showing"); } //Save And Continue button HtmlControl SaveCont = new HtmlControl(Browind); SaveCont.SearchProperties[HtmlButton.PropertyNames.Id] = "ForwardButton_button"; //Click button Save And Continue Assert.IsTrue(SaveCont.Enabled); Mouse.Click(SaveCont); Browind.WaitForControlReady(1000); }
public static void SelfIdentificationSurvey1() { //Create browserwindow BrowserWindow browind = new BrowserWindow(); browind.SearchProperties[UITestControl.PropertyNames.Name] = "Self-Identification Survey"; Mouse.MoveScrollWheel(-120); //Button "Save And Continue" HtmlInputButton SaveNContinue = new HtmlInputButton(browind); SaveNContinue.SearchProperties[HtmlButton.PropertyNames.Id] = "ForwardButton_button"; // Progress Meter HtmlCustom progress = new HtmlCustom(browind); progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter"; bool availabilty = (bool)progress.GetProperty(HtmlCustom.PropertyNames.Exists); string workflowEvent = PersonalInformation1.ReadData(1, "WORKFLOW"); if (workflowEvent == "S1PROSPECT") { Assert.IsTrue(availabilty, "Progress Meter is not showing"); HtmlSpan bar = new HtmlSpan(browind); bar.SearchProperties[HtmlSpan.PropertyNames.Id] = "meterlabel"; string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText); Assert.AreEqual(percentage, "70%"); } else { Assert.IsFalse(availabilty, "Progress Meter is showing"); } //Click Save and Continue button Mouse.Click(SaveNContinue); browind.WaitForControlReady(2000); }
public static void eReg_WorkExperiance() { //Create browserwindow BrowserWindow browind = new BrowserWindow(); browind.SearchProperties[UITestControl.PropertyNames.Name] = "Work Experience"; // Is this employer a staffing company? HtmlComboBox empstaff = new HtmlComboBox(browind); empstaff.SearchProperties[HtmlComboBox.PropertyNames.Id] = "Employer1_staffingBox"; //empstaff.DrawHighlight(); //Employer (If you worked through a staffing company, enter the Staffing Company name as the Employer) HtmlEdit employer = new HtmlEdit(browind); employer.SearchProperties[HtmlEdit.PropertyNames.Id] = "Employer1_name"; //employer.DrawHighlight(); //Current or Former Employer? HtmlComboBox currentemp = new HtmlComboBox(browind); currentemp.SearchProperties[HtmlComboBox.PropertyNames.Id] = "Employer1_type"; //currentemp.DrawHighlight(); //Job Title HtmlEdit jobtitle = new HtmlEdit(browind); jobtitle.SearchProperties[HtmlEdit.PropertyNames.Id] = "Employer1_jobtitle"; //jobtitle.DrawHighlight(); //Pay Rate/Salary xx.xx HtmlEdit empsal = new HtmlEdit(browind); empsal.SearchProperties[HtmlEdit.PropertyNames.Id] = "Employer1_salary"; //empsal.DrawHighlight(); //Pay Frequency HtmlComboBox emprate = new HtmlComboBox(browind); emprate.SearchProperties[HtmlComboBox.PropertyNames.Id] = "Employer1_rate"; // emprate.DrawHighlight(); //Start Date mm/yyyy HtmlEdit empstart = new HtmlEdit(browind); empstart.SearchProperties[HtmlEdit.PropertyNames.Id] = "Employer1_start"; //empstart.DrawHighlight(); //End Date mm/yyyy HtmlEdit empend = new HtmlEdit(browind); empend.SearchProperties[HtmlEdit.PropertyNames.Id] = "Employer1_end"; //empend.DrawHighlight(); //Supervisor/Manager Name HtmlEdit supename = new HtmlEdit(browind); supename.SearchProperties[HtmlEdit.PropertyNames.Id] = "Employer1_supename"; //supename.DrawHighlight(); //Mouse.MoveScrollWheel(-100); //Supervisor/Manager Title HtmlEdit suptitle = new HtmlEdit(browind); suptitle.SearchProperties[HtmlEdit.PropertyNames.Id] = "Employer1_supetitle"; //suptitle.DrawHighlight(); //Address HtmlEdit empadd = new HtmlEdit(browind); empadd.SearchProperties[HtmlEdit.PropertyNames.Id] = "Employer1_address"; //empadd.DrawHighlight(); //City HtmlEdit empcity = new HtmlEdit(browind); empcity.SearchProperties[HtmlEdit.PropertyNames.Id] = "Employer1_city"; //empcity.DrawHighlight(); //State/Prov. HtmlComboBox empstate = new HtmlComboBox(browind); empstate.SearchProperties[HtmlComboBox.PropertyNames.Id] = "Employer1_state"; // empstate.DrawHighlight(); //Postal/ZIP Code HtmlEdit empzip = new HtmlEdit(browind); empzip.SearchProperties[HtmlEdit.PropertyNames.Id] = "Employer1_zip"; //empzip.DrawHighlight(); //Country HtmlComboBox empcountry = new HtmlComboBox(browind); empcountry.SearchProperties[HtmlComboBox.PropertyNames.Id] = "Employer1_country"; //empcountry.DrawHighlight(); //Area Code HtmlEdit areacode = new HtmlEdit(browind); areacode.SearchProperties[HtmlEdit.PropertyNames.Id] = "Employer1_phone_areacode"; // areacode.DrawHighlight(); //Phone HtmlEdit empphone = new HtmlEdit(browind); empphone.SearchProperties[HtmlEdit.PropertyNames.Id] = "Employer1_phone"; //empphone.DrawHighlight(); //Ext. HtmlEdit empext = new HtmlEdit(browind); empext.SearchProperties[HtmlEdit.PropertyNames.Id] = "Employer1_ext"; //empext.DrawHighlight(); //Job Duties (2000 characters max) HtmlEdit duties = new HtmlEdit(browind); duties.SearchProperties[HtmlEdit.PropertyNames.Id] = "Employer1_duties"; duties.SearchProperties[HtmlEdit.PropertyNames.TagName] = "TEXTAREA"; //duties.DrawHighlight(); //Reason for leaving? HtmlEdit leaving = new HtmlEdit(browind); leaving.SearchProperties[HtmlEdit.PropertyNames.Id] = "Employer1_leaving"; //leaving.DrawHighlight(); // Verify any WorkExperience is exist //Click on Delete HtmlHyperlink empdel = new HtmlHyperlink(browind); empdel.SearchProperties[HtmlHyperlink.PropertyNames.InnerText] = "Delete"; while (empdel.TryFind()) { Mouse.MoveScrollWheel(-100); Mouse.Click(empdel); browind.WaitForControlReady(200); } //Fill up mandatory field and click "Add and Update" button empstaff.SetProperty(HtmlComboBox.PropertyNames.SelectedItem, "No"); employer.SetProperty(HtmlEdit.PropertyNames.Text, "Kelly Services"); currentemp.SetProperty(HtmlComboBox.PropertyNames.SelectedItem, "Current Employer"); jobtitle.SetProperty(HtmlEdit.PropertyNames.Text, "Senior QA Analyst"); empsal.SetProperty(HtmlEdit.PropertyNames.Text, "4000.00"); emprate.SetProperty(HtmlComboBox.PropertyNames.SelectedItem, "Monthly"); empstart.SetProperty(HtmlEdit.PropertyNames.Text, "01/2006"); empend.SetProperty(HtmlEdit.PropertyNames.Text, "08/2012"); empcity.SetProperty(HtmlEdit.PropertyNames.Text, "Detroit"); empstate.SetProperty(HtmlComboBox.PropertyNames.SelectedItem, "Michigan"); //Click on Add and Update HtmlInputButton addupdate = new HtmlInputButton(browind); addupdate.SearchProperties[HtmlInputButton.PropertyNames.Id] = "SaveRecordButton_button"; addupdate.DrawHighlight(); Mouse.Click(addupdate); /*****************/ /* Progress Meter*/ /*****************/ HtmlCustom progress = new HtmlCustom(browind); progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter"; progress.DrawHighlight(); bool availabilty = (bool)progress.GetProperty(HtmlCustom.PropertyNames.Exists); string workflowEvent = PersonalInformation1.ReadData(1, "WORKFLOW"); if (workflowEvent == "S1PROSPECT") { Assert.IsTrue(availabilty, "Progress Meter is not showing"); HtmlSpan bar = new HtmlSpan(browind); bar.SearchProperties[HtmlSpan.PropertyNames.Id] = "meterlabel"; bar.DrawHighlight(); string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText); Assert.AreEqual(percentage, "45%"); } else { Assert.IsFalse(availabilty, "Progress Meter is showing"); } //Button "Save And Continue" HtmlInputButton SaveNContinue = new HtmlInputButton(browind); SaveNContinue.SearchProperties[HtmlInputButton.PropertyNames.Id] = "ForwardButton_button"; SaveNContinue.DrawHighlight(); Mouse.Click(SaveNContinue); }
public static void Ereg_Release4Reference() { //Create BrowserWindow BrowserWindow browind = new BrowserWindow(); //Agreement Pane browind.WaitForControlReady(20000); browind.SearchProperties[UITestControl.PropertyNames.Name] = "Release for Reference Checks and Verification of Information"; //check checkbox HtmlCheckBox chkBox = new HtmlCheckBox(browind); chkBox.SearchProperties[HtmlCheckBox.PropertyNames.Id] = "ack3_agree"; chkBox.DrawHighlight(); //Button Save And Continue HtmlControl SaveCont = new HtmlControl(browind); SaveCont.SearchProperties[HtmlButton.PropertyNames.Id] = "ForwardButton_button"; SaveCont.DrawHighlight(); //chkBox.DrawHighlight(); if (chkBox.Checked == false) { //Verify SaveNContinue button is unable Assert.IsFalse(SaveCont.Enabled); chkBox.SetProperty(HtmlCheckBox.PropertyNames.Checked, true); } else { Assert.IsTrue(SaveCont.Enabled); } // Progress Meter HtmlCustom progress = new HtmlCustom(browind); progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter"; bool availabilty = (bool)progress.GetProperty(HtmlCustom.PropertyNames.Exists); string workflowEvent = PersonalInformation1.ReadData(1, "WORKFLOW"); if (workflowEvent == "S1PROSPECT") { Assert.IsTrue(availabilty, "Progress Meter is not showing"); HtmlSpan bar = new HtmlSpan(browind); bar.SearchProperties[HtmlSpan.PropertyNames.Id] = "meterlabel"; string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText); Assert.AreEqual(percentage, "95%"); } else { Assert.IsFalse(availabilty, "Progress Meter is showing"); } //Click Save And Continue Mouse.Click(SaveCont); browind.WaitForControlReady(2000); }
public static void EmergencyContactInformation() { BrowserWindow browind = new BrowserWindow(); browind.SearchProperties[UITestControl.PropertyNames.Name] = "Emergency Contact Information"; /*****************/ /*Primary Contact*/ /*****************/ HtmlEdit firstname = new HtmlEdit(browind); firstname.SearchProperties[HtmlEdit.PropertyNames.Id] = "emergnam1"; string fn = (string)firstname.GetProperty(HtmlEdit.PropertyNames.Text); HtmlEdit middlename = new HtmlEdit(browind); middlename.SearchProperties[HtmlEdit.PropertyNames.Id] = "emergnam_mid1"; HtmlEdit lastname = new HtmlEdit(browind); lastname.SearchProperties[HtmlEdit.PropertyNames.Id] = "emergnam_last1"; string ln = (string)lastname.GetProperty(HtmlEdit.PropertyNames.Text); Mouse.MoveScrollWheel(-100); /***********/ /*Telephone*/ /***********/ HtmlEdit homeArea = new HtmlEdit(browind); homeArea.SearchProperties[HtmlEdit.PropertyNames.Id] = "emerghphon1_areacode"; string ha = (string)homeArea.GetProperty(HtmlEdit.PropertyNames.Text); HtmlEdit homephone = new HtmlEdit(browind); homephone.SearchProperties[HtmlEdit.PropertyNames.Id] = "emerghphon1"; string hp = (string)homephone.GetProperty(HtmlEdit.PropertyNames.Text); HtmlEdit workAreaCode = new HtmlEdit(browind); workAreaCode.SearchProperties[HtmlEdit.PropertyNames.Id] = "emergwphone1_areacode"; HtmlEdit workPhone = new HtmlEdit(browind); workPhone.SearchProperties[HtmlEdit.PropertyNames.Id] = "emergwphone1"; HtmlEdit CellAreaCode = new HtmlEdit(browind); CellAreaCode.SearchProperties[HtmlEdit.PropertyNames.Id] = "emergcphone1_areacode"; HtmlEdit CellPhone = new HtmlEdit(browind); CellPhone.SearchProperties[HtmlEdit.PropertyNames.Id] = "emergcphone1"; //Button "Save And Continue" HtmlInputButton SaveNContinue = new HtmlInputButton(browind); SaveNContinue.SearchProperties[HtmlInputButton.PropertyNames.Id] = "ForwardButton_button"; //Verify button "Save And Continue" is enable to click if mandatory field is not filled if (fn == "" || ln == "" || ha == "" || hp == "") { Console.WriteLine("Save N Continue button is inactive"); Assert.IsFalse(SaveNContinue.Enabled); } //Fill the form if (fn == "") { firstname.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "Emer_FirstName")); } if (ln == "") { lastname.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "Emer_LastName")); } Mouse.MoveScrollWheel(-100); if (ha == "") { homeArea.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "Emer_HomeAreaCode")); } if (hp == "") { homephone.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "Emer_HomePhone")); } /*****************/ /* Progress Meter*/ /*****************/ HtmlCustom progress = new HtmlCustom(browind); progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter"; bool availabilty = (bool)progress.GetProperty(HtmlCustom.PropertyNames.Exists); string workflowEvent = PersonalInformation1.ReadData(1, "WORKFLOW"); if (workflowEvent == "S1PROSPECT") { Assert.IsTrue(availabilty, "Progress Meter is not showing"); HtmlSpan bar = new HtmlSpan(browind); bar.SearchProperties[HtmlSpan.PropertyNames.Id] = "meterlabel"; string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText); Assert.AreEqual(percentage, "25%"); } else { Assert.IsFalse(availabilty, "Progress Meter is showing"); } //Click Save and Continue button Mouse.Click(SaveNContinue); browind.WaitForControlReady(2000); }
public static void paycheck_Stub() { //Create BrowserWindow BrowserWindow browind = new BrowserWindow(); browind.SearchProperties[UITestControl.PropertyNames.Name] = "Personal Information"; /********************/ /*Period of Resident*/ /********************/ HtmlEdit since = new HtmlEdit(browind); since.SearchProperties[HtmlEdit.PropertyNames.Id] = "current_from"; //Get data from eReg string eRegSinceDate = (string)since.GetProperty(HtmlEdit.PropertyNames.Text); /******************************/ /* Button "Save And Continue" */ /******************************/ HtmlInputButton btnSaveNCont = new HtmlInputButton(browind); btnSaveNCont.SearchProperties[HtmlInputButton.PropertyNames.Id] = "ForwardButton_button"; //Verify if button Save and Continue is disable if mandatory field is empty if (eRegSinceDate == "") { Assert.IsFalse(btnSaveNCont.Enabled); } if (eRegSinceDate == "") { //Get data from KSN/Excel string KSNSinceDate = PersonalInformation1.ReadData(1, "RESIDENTPERIOD"); if (KSNSinceDate == "") { since.SetProperty(HtmlEdit.PropertyNames.Text, "01/1990"); } else { since.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "RESIDENTPERIOD")); } } Mouse.MoveScrollWheel(-100); /***********************/ /*Paycheck/Stub Address*/ /***********************/ //Checkbox HtmlCheckBox chk = new HtmlCheckBox(browind); chk.SearchProperties[HtmlCheckBox.PropertyNames.Id] = "paycheck_current"; if (chk.Checked == false) { chk.SetProperty(HtmlCheckBox.PropertyNames.Checked, true); } //Verify if the address is disable //Address HtmlEdit add = new HtmlEdit(browind); add.SearchProperties[HtmlEdit.PropertyNames.Id] = "Address_pay_clone"; Assert.IsFalse(add.Enabled); HtmlEdit apt = new HtmlEdit(browind); apt.SearchProperties[HtmlEdit.PropertyNames.Id] = "AptSuite_pay_clone"; Assert.IsFalse(apt.Enabled); HtmlEdit ct = new HtmlEdit(browind); ct.SearchProperties[HtmlEdit.PropertyNames.Id] = "city_pay_clone"; Assert.IsFalse(ct.Enabled); HtmlComboBox st = new HtmlComboBox(browind); st.SearchProperties[HtmlComboBox.PropertyNames.Id] = "state_pay_clone"; Assert.IsFalse(st.Enabled); HtmlEdit postal = new HtmlEdit(browind); postal.SearchProperties[HtmlEdit.PropertyNames.Id] = "zip_pay_clone"; Assert.IsFalse(postal.Enabled); HtmlEdit z4 = new HtmlEdit(browind); z4.SearchProperties[HtmlEdit.PropertyNames.Id] = "zip_four_pay_clone"; Assert.IsFalse(z4.Enabled); HtmlEdit county = new HtmlEdit(browind); county.SearchProperties[HtmlEdit.PropertyNames.Id] = "county_pay_clone"; Assert.IsFalse(county.Enabled); HtmlComboBox country = new HtmlComboBox(browind); country.SearchProperties[HtmlComboBox.PropertyNames.Id] = "country_pay_clone"; Assert.IsFalse(country.Enabled); HtmlEdit from = new HtmlEdit(browind); from.SearchProperties[HtmlEdit.PropertyNames.Id] = "pay_from_clone"; Assert.IsFalse(from.Enabled); HtmlEdit to = new HtmlEdit(browind); to.SearchProperties[HtmlEdit.PropertyNames.Id] = "pay_to_clone"; Assert.IsFalse(to.Enabled); /****************/ /*Progress Meter*/ /****************/ HtmlCustom progress = new HtmlCustom(browind); progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter"; bool availabilty = (bool)progress.GetProperty(HtmlCustom.PropertyNames.Exists); string workflowEvent = PersonalInformation1.ReadData(1, "WORKFLOW"); if (workflowEvent == "S1PROSPECT") { Assert.IsTrue(availabilty, "Progress Meter is not showing"); HtmlSpan bar = new HtmlSpan(browind); bar.SearchProperties[HtmlSpan.PropertyNames.Id] = "meterlabel"; string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText); Assert.AreEqual(percentage, "15%"); } else { Assert.IsFalse(availabilty, "Progress Meter is showing"); } Assert.IsTrue(btnSaveNCont.Enabled); Mouse.Click(btnSaveNCont); browind.WaitForControlReady(2000); }
public static void eReg_EncryptionConsent() { //*****************/ //Create browserwindow /*****************/ BrowserWindow browind = new BrowserWindow(); browind.SearchProperties[UITestControl.PropertyNames.Name] = "Encryption Consent"; //Verify References pane is available HtmlControl EncryptionConsentPane = new HtmlControl(browind); EncryptionConsentPane.FilterProperties[HtmlDiv.PropertyNames.InnerText] = "Encryption Consent"; // CheckBox I have read, understand, and agree to the policy above. //check checkbox HtmlCheckBox checkBox = new HtmlCheckBox(browind); checkBox.SearchProperties[HtmlCheckBox.PropertyNames.Id] = "encrypt_consent_ack"; checkBox.DrawHighlight(); Mouse.Click(checkBox); //chkBox.DrawHighlight(); if (checkBox.Checked == true) { //Verify SaveNContinue button is Enable Assert.IsTrue(checkBox.Enabled); checkBox.SetProperty(HtmlCheckBox.PropertyNames.Checked, true); Mouse.Click(checkBox); } else { Assert.IsTrue(checkBox.Enabled, "I have read, understand, and agree to the policy above"); } /*****************/ /* Progress Meter*/ /*****************/ HtmlCustom progress = new HtmlCustom(browind); progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter"; progress.DrawHighlight(); bool availabilty = (bool)progress.GetProperty(HtmlCustom.PropertyNames.Exists); string workflowEvent = PersonalInformation1.ReadData(1, "WORKFLOW"); if (workflowEvent == "S1PROSPECT") { Assert.IsTrue(availabilty, "Progress Meter is not showing"); HtmlSpan bar = new HtmlSpan(browind); bar.SearchProperties[HtmlSpan.PropertyNames.Id] = "progressmeterdiv"; bar.DrawHighlight(); string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText); Assert.AreEqual(percentage, "95%"); } else { Assert.IsFalse(availabilty, "Progress Meter is showing"); } //Click button Save And Continue HtmlSpan SaveAndContinue = new HtmlSpan(browind); SaveAndContinue.SearchProperties[HtmlSpan.PropertyNames.Id] = "ForwardButton_button"; // SaveAndCountinue.DrawHighlight(); Mouse.Click(SaveAndContinue); browind.WaitForControlReady(2000); }
public static void eReg_Preferences() { //Create browserwindow BrowserWindow browind = new BrowserWindow(); browind.SearchProperties[UITestControl.PropertyNames.Name] = "Preferences"; /*****************/ /*Contact Methods*/ /*****************/ HtmlSpan ContactMethods = new HtmlSpan(browind); ContactMethods.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Contact Methods"; /***************/ /*Work Schedule*/ /***************/ HtmlSpan WorkSchedule = new HtmlSpan(browind); WorkSchedule.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Work Schedule"; Mouse.MoveScrollWheel(-100); /********/ /*Shifts*/ /********/ HtmlSpan Sh = new HtmlSpan(browind); Sh.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Shifts"; /*****************/ /* Progress Meter*/ /*****************/ HtmlCustom progress = new HtmlCustom(browind); progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter"; bool availabilty = (bool)progress.GetProperty(HtmlCustom.PropertyNames.Exists); string workflowEvent = PersonalInformation1.ReadData(1, "WORKFLOW"); if (workflowEvent == "S1PROSPECT") { Assert.IsTrue(availabilty, "Progress Meter is not showing"); HtmlSpan bar = new HtmlSpan(browind); bar.SearchProperties[HtmlSpan.PropertyNames.Id] = "meterlabel"; string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText); Assert.AreEqual(percentage, "35%"); } else { Assert.IsFalse(availabilty, "Progress Meter is showing"); } //Button "Save And Continue" -- Inactive HtmlInputButton SaveNContinue = new HtmlInputButton(browind); SaveNContinue.SearchProperties[HtmlInputButton.PropertyNames.Id] = "ForwardButton_button"; Mouse.Click(SaveNContinue); browind.WaitForControlReady(2000); }
public static void eReg_EducationHistory() { //Create browserwindow BrowserWindow browind = new BrowserWindow(); browind.SearchProperties[UITestControl.PropertyNames.Name] = "Education History"; /********************/ /*School/Institution*/ /********************/ //Education Level HtmlComboBox eduLvl = new HtmlComboBox(browind); eduLvl.SearchProperties[HtmlComboBox.PropertyNames.Id] = "School1_edu_level_code"; string eduLevel = (string)eduLvl.GetProperty(HtmlComboBox.PropertyNames.SelectedItem); //Education Level Explanation (only if Other) HtmlTextArea edulvlexp = new HtmlTextArea(browind); edulvlexp.SearchProperties[HtmlTextArea.PropertyNames.Id] = "School1_edu_level_code_explain"; //Attended/Graduated School As (provide Legal First and Last Name only) HtmlEdit AttendedName = new HtmlEdit(browind); AttendedName.SearchProperties[HtmlEdit.PropertyNames.Id] = "School1_attended_name"; string name = (string)AttendedName.GetProperty(HtmlEdit.PropertyNames.Text); //School/Institution Name (specify if a satellite campus or online) HtmlEdit School = new HtmlEdit(browind); School.SearchProperties[HtmlEdit.PropertyNames.Id] = "School1"; string schoolname = (string)School.GetProperty(HtmlEdit.PropertyNames.Text); //City HtmlEdit ct = new HtmlEdit(browind); ct.SearchProperties[HtmlEdit.PropertyNames.Id] = "School1_city"; string schoolcity = (string)ct.GetProperty(HtmlEdit.PropertyNames.Text); //State/Prov. HtmlComboBox prov = new HtmlComboBox(browind); prov.SearchProperties[HtmlComboBox.PropertyNames.Id] = "School1_state"; string schoolstate = (string)prov.GetProperty(HtmlComboBox.PropertyNames.SelectedItem); //Country HtmlComboBox ctry = new HtmlComboBox(browind); ctry.SearchProperties[HtmlComboBox.PropertyNames.Id] = "School1_country"; string schoolCountry = (string)ctry.GetProperty(HtmlComboBox.PropertyNames.SelectedItem); //Date attended from yyyy HtmlEdit From = new HtmlEdit(browind); From.SearchProperties[HtmlEdit.PropertyNames.Id] = "School1_from"; string schoolfrom = (string)From.GetProperty(HtmlEdit.PropertyNames.Text); //Date attended to yyyy HtmlEdit dateto = new HtmlEdit(browind); dateto.SearchProperties[HtmlEdit.PropertyNames.Id] = "School1_to"; //Status HtmlComboBox status = new HtmlComboBox(browind); status.SearchProperties[HtmlComboBox.PropertyNames.Id] = "School1_status"; //Expected Completion/Graduation Date mm/dd/yyyy HtmlEdit GraduationDate = new HtmlEdit(browind); GraduationDate.SearchProperties[HtmlEdit.PropertyNames.Id] = "School1_graduate"; //GPA HtmlEdit GPA = new HtmlEdit(browind); GPA.SearchProperties[HtmlEdit.PropertyNames.Id] = "School1_GPA"; //Discipline HtmlComboBox Disc = new HtmlComboBox(browind); Disc.SearchProperties[HtmlComboBox.PropertyNames.Id] = "School1_Discipline"; string discipline = (string)Disc.GetProperty(HtmlComboBox.PropertyNames.SelectedItem); //Button "Save And Continue" HtmlInputButton SaveNContinue = new HtmlInputButton(browind); SaveNContinue.SearchProperties[HtmlInputButton.PropertyNames.Id] = "ForwardButton_button"; /*****************/ /* Progress Meter*/ /*****************/ HtmlCustom progress = new HtmlCustom(browind); progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter"; bool availabilty = (bool)progress.GetProperty(HtmlCustom.PropertyNames.Exists); string workflowEvent = PersonalInformation1.ReadData(1, "WORKFLOW"); if (workflowEvent == "S1PROSPECT") { Assert.IsTrue(availabilty, "Progress Meter is not showing"); HtmlSpan bar = new HtmlSpan(browind); bar.SearchProperties[HtmlSpan.PropertyNames.Id] = "meterlabel"; string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText); Assert.AreEqual(percentage, "40%"); } else { Assert.IsFalse(availabilty, "Progress Meter is showing"); } HtmlHyperlink del = new HtmlHyperlink(browind); del.SearchProperties[HtmlHyperlink.PropertyNames.InnerText] = "Delete"; while (del.TryFind()) { Mouse.Click(del); browind.WaitForControlReady(200); } //Fill in mandatory field eduLvl.SetProperty(HtmlComboBox.PropertyNames.SelectedItem, PersonalInformation1.ReadData(1, "EducationLevel")); AttendedName.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "EducationAttendedName")); School.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "EducationSchoolName")); ct.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "EducationCity")); prov.SetProperty(HtmlComboBox.PropertyNames.SelectedItem, PersonalInformation1.ReadData(1, "EducationState")); From.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "EducationAttendedFrom")); Mouse.MoveScrollWheel(-100); status.SetProperty(HtmlComboBox.PropertyNames.SelectedItem, PersonalInformation1.ReadData(1, "EducationStatus")); string selectedstatus = (string)status.GetProperty(HtmlComboBox.PropertyNames.SelectedItem); if (selectedstatus == "Completed/Graduated") { GraduationDate.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "GraduationDate")); } Disc.SetProperty(HtmlComboBox.PropertyNames.SelectedItem, PersonalInformation1.ReadData(1, "EducationDiscipline")); Mouse.MoveScrollWheel(-200); //Click "Save N Continue" button Mouse.Click(SaveNContinue); browind.WaitForControlReady(500); }
public static void personalInformation() { //Create BrowserWindow BrowserWindow Browind = new BrowserWindow(); Browind.SearchProperties[UITestControl.PropertyNames.Name] = "Personal Information"; //Verify Personal Information pane is available HtmlControl PersonalInformationPane = new HtmlControl(Browind); PersonalInformationPane.FilterProperties[HtmlDiv.PropertyNames.InnerText] = "Personal Information"; /*******************/ /* Personal Detail */ /*******************/ //Name section - FirstName HtmlControl FirstName = new HtmlControl(Browind); FirstName.SearchProperties[HtmlEdit.PropertyNames.Id] = "first_name"; //Compare FirstName between eReg & KSN string eRegFN = (string)FirstName.GetProperty(HtmlEdit.PropertyNames.Text); string KSNFn = PersonalInformation1.ReadData(1, "FIRSTNAME"); //Name section - MiddleName HtmlControl MiddleName = new HtmlControl(Browind); MiddleName.SearchProperties[HtmlEdit.PropertyNames.Id] = "middle_name"; //Compare Middle Name between KSN & eReg string eRegMN = (string)MiddleName.GetProperty(HtmlEdit.PropertyNames.Text); string KSNMn = PersonalInformation1.ReadData(1, "MIDDLENAME"); //Name section - LastName HtmlControl LastName = new HtmlControl(Browind); LastName.SearchProperties[HtmlEdit.PropertyNames.Id] = "last_name"; //Compare Last Name between KSN & eReg string eRegLN = (string)LastName.GetProperty(HtmlEdit.PropertyNames.Text); string KSNLn = PersonalInformation1.ReadData(1, "LASTNAME"); //Name section - PreferredName HtmlControl PreferredName = new HtmlControl(Browind); PreferredName.SearchProperties[HtmlEdit.PropertyNames.Id] = "prefname"; //Compare Preferred Name between KSN & eReg string eRegPN = (string)PreferredName.GetProperty(HtmlEdit.PropertyNames.Text); string KSNPn = PersonalInformation1.ReadData(1, "PREFERREDNAME"); //Name section - Social Security # HtmlControl SSNumber = new HtmlControl(Browind); SSNumber.SearchProperties[HtmlEdit.PropertyNames.Name] = "ssn"; //Get Social Security # from KSN string eRegTaxID = (string)SSNumber.GetProperty(HtmlEdit.PropertyNames.Text); string KSNTaxID = PersonalInformation1.ReadData(1, "TAXID"); //Name section - Social Security #-Re-type HtmlControl SSNumber2 = new HtmlControl(Browind); SSNumber2.SearchProperties[HtmlEdit.PropertyNames.Id] = "ssn_verify"; string eRegTaxIDVer = (string)SSNumber2.GetProperty(HtmlEdit.PropertyNames.Text); string TaxIDVer = PersonalInformation1.ReadData(1, "TAXID"); /********************/ /* Personal Address */ /********************/ //Address HtmlControl Add1 = new HtmlControl(Browind); Add1.SearchProperties[HtmlEdit.PropertyNames.Id] = "Address"; //Compare Address between KSN & eReg string eRegAdd1 = (string)Add1.GetProperty(HtmlEdit.PropertyNames.Text); string KSNAdd1 = PersonalInformation1.ReadData(1, "ADDRESS1"); // Apt./Lot # HtmlControl Add2 = new HtmlControl(Browind); Add2.SearchProperties[HtmlEdit.PropertyNames.Id] = "AptSuite"; //Compare Address between KSN & eReg string eRegAdd2 = (string)Add2.GetProperty(HtmlEdit.PropertyNames.Text); string KSNAdd2 = PersonalInformation1.ReadData(1, "ADDRESS2"); //City HtmlControl ct = new HtmlControl(Browind); ct.SearchProperties[HtmlEdit.PropertyNames.Id] = "city"; //Compare city between KSN & eReg string eRegCt = (string)ct.GetProperty(HtmlEdit.PropertyNames.Text); string KSNCt = PersonalInformation1.ReadData(1, "CITY"); //State HtmlComboBox st = new HtmlComboBox(Browind); st.SearchProperties[HtmlComboBox.PropertyNames.Id] = "state"; //Compare State between KSN & eReg string eRegSt = (string)st.GetProperty(HtmlComboBox.PropertyNames.SelectedItem); string KSNSt = PersonalInformation1.ReadData(1, "ESTATE"); //Zip HtmlEdit zp = new HtmlEdit(Browind); zp.SearchProperties[HtmlEdit.PropertyNames.Id] = "zip"; //Compare Zip between KSN & ereg string eRegZip = (string)zp.GetProperty(HtmlEdit.PropertyNames.Text); string KSNZip = PersonalInformation1.ReadData(1, "ZIP"); // Zip Last 4 digit HtmlEdit zp4 = new HtmlEdit(Browind); zp4.SearchProperties[HtmlEdit.PropertyNames.Id] = "zip_four"; //Compare Zip between KSN & ereg string eRegZip4 = (string)zp4.GetProperty(HtmlEdit.PropertyNames.Text); string KSNZip4 = PersonalInformation1.ReadData(1, "ZIP4"); //County HtmlEdit cty = new HtmlEdit(Browind); cty.SearchProperties[HtmlEdit.PropertyNames.Id] = "county"; //Compare Zip between KSN & ereg string eRegcty = (string)cty.GetProperty(HtmlEdit.PropertyNames.Text); string KSNcty = PersonalInformation1.ReadData(1, "COUNTY"); //Country HtmlComboBox crty = new HtmlComboBox(Browind); crty.SearchProperties[HtmlComboBox.PropertyNames.Id] = "country"; //Compare State between KSN & eReg string eRegcrty = (string)crty.GetProperty(HtmlComboBox.PropertyNames.SelectedItem); string KSNcrty = PersonalInformation1.ReadData(1, "COUNTRY"); /***************************/ /* Personal Contact Number */ /***************************/ // Primary Phone Area Code HtmlEdit areacode = new HtmlEdit(Browind); areacode.SearchProperties[HtmlEdit.PropertyNames.Id] = "phone_areacode"; //Compare phone area code between KSN & eReg string eRegAreaCode1 = (string)areacode.GetProperty(HtmlEdit.PropertyNames.Text); string KSNAreaCode1 = PersonalInformation1.ReadData(1, "HOMEAREACODE"); //Primary Phone HtmlEdit primaryphone = new HtmlEdit(Browind); primaryphone.SearchProperties[HtmlEdit.PropertyNames.Id] = "phone"; //Compare Primary Phone number between KSN & eReg string eRegPhone1 = (string)primaryphone.GetProperty(HtmlEdit.PropertyNames.Text); string KSNPhone1 = PersonalInformation1.ReadData(1, "HOMEPHONENUMBER"); //Secondary Phone Area Code HtmlEdit AreaCode2 = new HtmlEdit(Browind); AreaCode2.SearchProperties[HtmlEdit.PropertyNames.Id] = "mobilephone_areacode"; //Compare Second Phone number between KSN & eReg string eRegAreaCode2 = (string)AreaCode2.GetProperty(HtmlEdit.PropertyNames.Text); string KSNAreaCode2 = PersonalInformation1.ReadData(1, "CELLAREACODE"); //Secondary Phone HtmlEdit phone2 = new HtmlEdit(Browind); phone2.SearchProperties[HtmlEdit.PropertyNames.Id] = "mobilephone"; //Compare Second Phone number between KSN & eReg string eRegphone2 = (string)phone2.GetProperty(HtmlEdit.PropertyNames.Text); string KSNphone2 = PersonalInformation1.ReadData(1, "CELLAREANUMBER"); //Primary Email Address HtmlEdit email = new HtmlEdit(Browind); email.SearchProperties[HtmlEdit.PropertyNames.Id] = "EmpEmail"; //Compare emailAddress between KSN & eReg string eRegemail = (string)email.GetProperty(HtmlEdit.PropertyNames.Text); string KSNemail = PersonalInformation1.ReadData(1, "EMAILADDRESS"); // Alternate Email Address HtmlEdit email2 = new HtmlEdit(Browind); email2.SearchProperties[HtmlEdit.PropertyNames.Id] = "altemail"; //Compare Alternate Email Address between KSN & eReg string eRegemail2 = (string)email2.GetProperty(HtmlEdit.PropertyNames.Text); string KSNemail2 = PersonalInformation1.ReadData(1, "ALT_EMAILADDRESS"); // Preferred Method of Contact HtmlComboBox ContactMethod = new HtmlComboBox(Browind); ContactMethod.SearchProperties[HtmlComboBox.PropertyNames.Id] = "PrefContact"; //Get data from eReg and KSN string eRegCM = (string)ContactMethod.GetProperty(HtmlComboBox.PropertyNames.SelectedItem); string KSNCM = PersonalInformation1.ReadData(1, "PREFERMETHOD"); /******************************/ /* Button "Save And Continue" */ /******************************/ HtmlInputButton btnSaveNCont = new HtmlInputButton(Browind); btnSaveNCont.SearchProperties[HtmlInputButton.PropertyNames.Id] = "ForwardButton_button"; //If Mandatory field is null, verify SaveNContinue button is unable if (eRegFN == "" || eRegLN == "" || eRegTaxID == "" || eRegTaxIDVer == "" || eRegAdd1 == "" || eRegCt == "" || eRegSt == "" || eRegZip == "" || eRegcty == "" || eRegcrty == "" || eRegAreaCode1 == "" || eRegPhone1 == "" || eRegemail == "" || eRegCM == "") { Assert.IsFalse(btnSaveNCont.Enabled); } //Fill up Personal Information // if eRegFN != KSNFn, then insert KSNFn if (eRegFN != KSNFn) { Mouse.DoubleClick(FirstName); FirstName.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "FIRSTNAME")); } // if eRegMN != KSNMn, then insert KSNMn if (eRegMN != KSNMn) { Mouse.DoubleClick(MiddleName); MiddleName.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "MIDDLENAME")); } // if eRegLN != KSNLn, then insert KSNLn if (eRegLN != KSNLn) { Mouse.DoubleClick(LastName); LastName.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "LASTNAME")); } // if eRegPN != KSNPn, then insert KSNPn if (eRegPN != KSNPn) { Mouse.DoubleClick(PreferredName); PreferredName.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "PREFERREDNAME")); } if (KSNTaxID == "") { Keyboard.SendKeys(SSNumber, "123121234"); } else { Keyboard.SendKeys(SSNumber, KSNTaxID); } Keyboard.SendKeys("{Tab}"); //Pop Up window handler WinWindow pop = new WinWindow(null); pop.SearchProperties[WinWindow.PropertyNames.Name] = "Message from webpage"; Mouse.Click(pop); while (pop.Exists) { // Click "OK" button WinButton btnOK = new WinButton(pop); btnOK.SearchProperties[WinButton.PropertyNames.Name] = "OK"; btnOK.TechnologyName = "MSAA"; Mouse.Click(btnOK); } if (KSNTaxID == "") { Keyboard.SendKeys(SSNumber2, "123121234"); } else { Keyboard.SendKeys(SSNumber2, TaxIDVer); } // if eRegAdd1 != KSNAdd1, then insert KSNAdd1 if (eRegAdd1 != KSNAdd1) { Mouse.DoubleClick(Add1); Add1.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "ADDRESS1")); } // if eRegAdd2 != KSNAdd2, then insert KSNAdd2 if (eRegAdd2 != KSNAdd2) { Mouse.DoubleClick(Add2); Add2.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "ADDRESS2")); } //Mouse scroll to bottom page Mouse.MoveScrollWheel(-50); // if eRegCt != KSNCt, then insert KSNCt if (eRegCt != KSNCt) { Mouse.DoubleClick(ct); ct.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "CITY")); } //if eRegSt != KSNSt, then insert KSNSt if (eRegSt != KSNSt) { st.SetProperty(HtmlComboBox.PropertyNames.SelectedItem, PersonalInformation1.ReadData(1, "ESTATE")); } //if eRegZip != KSNZip, then insert KSNZip if (eRegZip != KSNZip) { zp.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "ZIP")); } //if eRegZip4 != KSNZip4, then insert KSNZip4 if (eRegZip4 != KSNZip4) { zp4.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "ZIP4")); } //if eRegcty != KSNcty, then insert KSNcty if (eRegcty != KSNcty) { cty.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "COUNTY")); } //if eRegcrty != KSNcrty, then insert KSNcrty if (eRegcrty != KSNcrty) { crty.SetProperty(HtmlComboBox.PropertyNames.SelectedItem, PersonalInformation1.ReadData(1, "COUNTRY")); } if (eRegAreaCode1 == "") { if (KSNAreaCode1 == "") { areacode.SetProperty(HtmlEdit.PropertyNames.Text, "999"); } else { areacode.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "HOMEAREACODE")); } } if (eRegPhone1 == "") { if (KSNPhone1 == "") { areacode.SetProperty(HtmlEdit.PropertyNames.Text, "12345678"); } else { areacode.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "HOMEPHONENUMBER")); } } if (eRegAreaCode2 != KSNAreaCode2) { AreaCode2.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "CELLAREACODE")); } if (eRegphone2 != KSNphone2) { phone2.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "CELLAREANUMBER")); } if (eRegemail == "") { email.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "EMAILADDRESS")); } if (eRegemail2 != KSNemail2) { email2.SetProperty(HtmlEdit.PropertyNames.Text, PersonalInformation1.ReadData(1, "ALT_EMAILADDRESS")); } if (eRegCM == "") { if (KSNCM == "") { ContactMethod.SetProperty(HtmlComboBox.PropertyNames.SelectedItem, "Cell Phone"); } else { ContactMethod.SetProperty(HtmlComboBox.PropertyNames.SelectedItem, PersonalInformation1.ReadData(1, "PREFERMETHOD")); } } /*****************/ /* Progress Meter*/ /*****************/ HtmlCustom progress = new HtmlCustom(Browind); progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter"; bool availabilty = (bool)progress.GetProperty(HtmlCustom.PropertyNames.Exists); string workflowEvent = PersonalInformation1.ReadData(1, "WORKFLOW"); if (workflowEvent == "S1PROSPECT") { Assert.IsTrue(availabilty, "Progress Meter is not showing"); HtmlSpan bar = new HtmlSpan(Browind); bar.SearchProperties[HtmlSpan.PropertyNames.Id] = "meterlabel"; string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText); Assert.AreEqual(percentage, "10%"); } else { Assert.IsFalse(availabilty, "Progress Meter is showing"); } //Click button Save And Continue Assert.IsTrue(btnSaveNCont.Enabled); Mouse.Click(btnSaveNCont); Browind.WaitForControlReady(2000); }
public static void eReg_Reference() { /*****************/ //Create browserwindow /*****************/ BrowserWindow browind = new BrowserWindow(); browind.SearchProperties[UITestControl.PropertyNames.Name] = "References"; //Verify References pane is available HtmlControl ReferencesPane = new HtmlControl(browind); ReferencesPane.FilterProperties[HtmlDiv.PropertyNames.InnerText] = "References"; // References 1 /*References1 Name*/ HtmlSpan Reference1Name = new HtmlSpan(browind); Reference1Name.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_name"; Reference1Name.DrawHighlight(); //Reference1 Type HtmlComboBox Ref1type = new HtmlComboBox(browind); Ref1type.SearchProperties[HtmlComboBox.PropertyNames.Id] = "Ref1_type"; Ref1type.DrawHighlight(); // string ReferenceType = (string)Ref1type.GetProperty(HtmlComboBox.PropertyNames.SelectedItem); //Ref1 Current Title HtmlSpan RefTitle = new HtmlSpan(browind); RefTitle.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_title"; RefTitle.DrawHighlight(); //Ref1 Company Name HtmlSpan Ref1CompanyName = new HtmlSpan(browind); Ref1CompanyName.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_company"; Ref1CompanyName.DrawHighlight(); //Ref1 Location (City, State/Prov, and Country) HtmlSpan RefLocation = new HtmlSpan(browind); RefLocation.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_location"; RefLocation.DrawHighlight(); //Ref1Area Code HtmlSpan RefAreaCode = new HtmlSpan(browind); RefAreaCode.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_phone_areacode"; RefAreaCode.DrawHighlight(); //Ref1 Phone HtmlSpan Ref1Phone = new HtmlSpan(browind); Ref1Phone.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_phone"; Ref1Phone.DrawHighlight(); //Ref1 Phone Ext HtmlSpan Ref1PhoneExt = new HtmlSpan(browind); Ref1PhoneExt.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_ext"; Ref1PhoneExt.DrawHighlight(); //Ref1 Fax No HtmlSpan Ref1FaxNo = new HtmlSpan(browind); Ref1FaxNo.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_fax"; Ref1FaxNo.DrawHighlight(); //Ref1 Email Address HtmlSpan Ref1EmailAddress = new HtmlSpan(browind); Ref1EmailAddress.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_email"; Ref1EmailAddress.DrawHighlight(); //******************* // References 2 //******************* /*References2 Name*/ HtmlSpan Reference2Name = new HtmlSpan(browind); Reference2Name.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_name"; Reference2Name.DrawHighlight(); //Reference2 Type HtmlComboBox Ref2type = new HtmlComboBox(browind); Ref2type.SearchProperties[HtmlComboBox.PropertyNames.Id] = "Ref2_type"; Ref2type.DrawHighlight(); // string eRegstate = (string)Ref2type.GetProperty(HtmlComboBox.PropertyNames.SelectedItem); //Ref2 Current Title HtmlSpan Ref2Title = new HtmlSpan(browind); Ref2Title.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_title"; Ref2Title.DrawHighlight(); //Ref2 Company Name HtmlSpan Ref2CompanyName = new HtmlSpan(browind); Ref2CompanyName.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_company"; Ref2CompanyName.DrawHighlight(); //Ref2 Location (City, State/Prov, and Country) HtmlSpan Ref2Location = new HtmlSpan(browind); Ref2Location.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_location"; Ref2Location.DrawHighlight(); //Ref2 Area Code HtmlSpan Ref2AreaCode = new HtmlSpan(browind); Ref2AreaCode.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_phone_areacode"; Ref2AreaCode.DrawHighlight(); //Ref2 Phone HtmlSpan Ref2Phone = new HtmlSpan(browind); Ref2Phone.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_phone"; Ref2Phone.DrawHighlight(); //Ref2 Phone Ext HtmlSpan Ref2PhoneExt = new HtmlSpan(browind); Ref2PhoneExt.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_ext"; Ref2PhoneExt.DrawHighlight(); //Ref2 Fax No HtmlSpan Ref2FaxNo = new HtmlSpan(browind); Ref2FaxNo.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_fax"; Ref2FaxNo.DrawHighlight(); //Ref2 Email Address HtmlSpan Ref2EmailAddress = new HtmlSpan(browind); Ref2EmailAddress.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_email"; Ref2EmailAddress.DrawHighlight(); //******************* // References 3 //******************* /*References3 Name*/ HtmlSpan Reference3Name = new HtmlSpan(browind); Reference3Name.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_name"; Reference1Name.DrawHighlight(); //Reference3 Type HtmlComboBox Ref3type = new HtmlComboBox(browind); Ref3type.SearchProperties[HtmlComboBox.PropertyNames.Id] = "Ref3_type"; Ref3type.DrawHighlight(); // string eRegstate = (string)Ref3type.GetProperty(HtmlComboBox.PropertyNames.SelectedItem); //Ref3 Current Title HtmlSpan Ref3Title = new HtmlSpan(browind); Ref3Title.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_title"; Ref3Title.DrawHighlight(); //Ref3 Company Name HtmlSpan Ref3CompanyName = new HtmlSpan(browind); Ref3CompanyName.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_company"; Ref3CompanyName.DrawHighlight(); //Ref3 Location (City, State/Prov, and Country) HtmlSpan Ref3Location = new HtmlSpan(browind); Ref3Location.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_location"; Ref3Location.DrawHighlight(); //Ref3 Area Code HtmlSpan Ref3AreaCode = new HtmlSpan(browind); Ref3AreaCode.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_phone_areacode"; Ref3AreaCode.DrawHighlight(); //Ref3 Phone HtmlSpan Ref3Phone = new HtmlSpan(browind); Ref3Phone.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_phone"; Ref3Phone.DrawHighlight(); //Ref3 Phone Ext HtmlSpan Ref3PhoneExt = new HtmlSpan(browind); Ref3PhoneExt.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_ext"; Ref3PhoneExt.DrawHighlight(); //Ref3 Fax No HtmlSpan Ref3FaxNo = new HtmlSpan(browind); Ref3FaxNo.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_fax"; Ref3FaxNo.DrawHighlight(); //Ref3 Email Address HtmlSpan Ref3EmailAddress = new HtmlSpan(browind); Ref3EmailAddress.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_email"; Ref3EmailAddress.DrawHighlight(); /*****************/ /* Progress Meter*/ /*****************/ HtmlCustom progress = new HtmlCustom(browind); progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter"; progress.DrawHighlight(); bool availabilty = (bool)progress.GetProperty(HtmlCustom.PropertyNames.Exists); string workflowEvent = PersonalInformation1.ReadData(1, "WORKFLOW"); if (workflowEvent == "S1PROSPECT") { Assert.IsTrue(availabilty, "Progress Meter is not showing"); HtmlSpan bar = new HtmlSpan(browind); bar.SearchProperties[HtmlSpan.PropertyNames.Id] = "meterdiv"; bar.DrawHighlight(); string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText); Assert.AreEqual(percentage, "55%"); } else { Assert.IsFalse(availabilty, "Progress Meter is showing"); } //Click button Save And Continue HtmlSpan SaveAndCountinue = new HtmlSpan(browind); SaveAndCountinue.SearchProperties[HtmlSpan.PropertyNames.Id] = "ForwardButton_button"; SaveAndCountinue.DrawHighlight(); Mouse.Click(SaveAndCountinue); browind.WaitForControlReady(2000); }
public static void stateOfEmployee() { //Create browserwindow BrowserWindow browind = new BrowserWindow(); browind.SearchProperties[UITestControl.PropertyNames.Name] = "Personal Information"; //State of Employment (i.e., the state in which you expect to work) HtmlComboBox state = new HtmlComboBox(browind); state.SearchProperties[HtmlComboBox.PropertyNames.Id] = "BGInfo_StateWorkIn"; string eRegstate = (string)state.GetProperty(HtmlComboBox.PropertyNames.SelectedItem); //Are you authorized to work in the United States HtmlComboBox authorization = new HtmlComboBox(browind); authorization.SearchProperties[HtmlComboBox.PropertyNames.Id] = "workUS"; string eRegauthorization = (string)authorization.GetProperty(HtmlComboBox.PropertyNames.SelectedItem); //Are You Under the Age of 18? HtmlComboBox age18 = new HtmlComboBox(browind); age18.SearchProperties[HtmlComboBox.PropertyNames.Id] = "under18"; string eRegage18 = (string)age18.GetProperty(HtmlComboBox.PropertyNames.SelectedItem); //Button "Save And Continue" -- Inactive HtmlInputButton SaveNContinue = new HtmlInputButton(browind); SaveNContinue.SearchProperties[HtmlInputButton.PropertyNames.Id] = "ForwardButton_button"; if (eRegstate == "" || eRegauthorization == "" || eRegage18 == "") { Assert.IsFalse(SaveNContinue.Enabled); } /*****************/ /* Progress Meter*/ /*****************/ HtmlCustom progress = new HtmlCustom(browind); progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter"; bool availabilty = (bool)progress.GetProperty(HtmlCustom.PropertyNames.Exists); string workflowEvent = PersonalInformation1.ReadData(1, "WORKFLOW"); if (workflowEvent == "S1PROSPECT") { Assert.IsTrue(availabilty, "Progress Meter is not showing"); HtmlSpan bar = new HtmlSpan(browind); bar.SearchProperties[HtmlSpan.PropertyNames.Id] = "meterlabel"; string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText); Assert.AreEqual(percentage, "30%"); } else { Assert.IsFalse(availabilty, "Progress Meter is showing"); } //Fill in Mandatory Field state.SetProperty(HtmlComboBox.PropertyNames.SelectedItem, PersonalInformation1.ReadData(1, "PersonalInformation_StateOfEmployee")); authorization.SetProperty(HtmlComboBox.PropertyNames.SelectedItem, PersonalInformation1.ReadData(1, "PersonalInformation_Authorization")); age18.SetProperty(HtmlComboBox.PropertyNames.SelectedItem, PersonalInformation1.ReadData(1, "PersonalInformation_Age18")); //Click Save And Continue button Mouse.Click(SaveNContinue); browind.WaitForControlReady(2000); }
public static void workExperienceExmpt_SaveNContinue() { //Create BrowserWindow BrowserWindow browind = new BrowserWindow(); //Work Experience Exmpt pane browind.WaitForControlReady(20000); browind.SearchProperties[UITestControl.PropertyNames.Name] = "Work Experience Exempt"; //check checkbox HtmlCheckBox chkBox = new HtmlCheckBox(browind); chkBox.SearchProperties[HtmlCheckBox.PropertyNames.Id] = "Employer1_minMonths_claim"; //Button Save And Continue HtmlControl SaveCont = new HtmlControl(browind); SaveCont.SearchProperties[HtmlButton.PropertyNames.Id] = "ForwardButton_button"; if (chkBox.Checked == false) { //Verify SaveNContinue button is unable Assert.IsFalse(SaveCont.Enabled); chkBox.SetProperty(HtmlCheckBox.PropertyNames.Checked, true); } else { Assert.IsTrue(SaveCont.Enabled); } // Progress Meter HtmlCustom progress = new HtmlCustom(browind); progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter"; bool availabilty = (bool)progress.GetProperty(HtmlCustom.PropertyNames.Exists); string workflowEvent = PersonalInformation1.ReadData(1, "WORKFLOW"); if (workflowEvent == "S1PROSPECT") { Assert.IsTrue(availabilty, "Progress Meter is not showing"); HtmlSpan bar = new HtmlSpan(browind); bar.SearchProperties[HtmlSpan.PropertyNames.Id] = "meterlabel"; string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText); //Assert.AreEqual(percentage, "55%"); Assert.AreEqual(percentage, "50%"); } else { Assert.IsFalse(availabilty, "Progress Meter is showing"); } //Click Save And Continue Mouse.Click(SaveCont); browind.WaitForControlReady(2000); }
public static void S1AddressHistory() { //Create browser window BrowserWindow browind = new BrowserWindow(); browind.SearchProperties[UITestControl.PropertyNames.Name] = "Address History"; //Address HtmlEdit add = new HtmlEdit(browind); add.SearchProperties[HtmlEdit.PropertyNames.Id] = "Address1"; //Apt./Box No. HtmlEdit apt = new HtmlEdit(browind); apt.SearchProperties[HtmlEdit.PropertyNames.Id] = "AptSuite1"; //City HtmlEdit ct = new HtmlEdit(browind); ct.SearchProperties[HtmlEdit.PropertyNames.Id] = "city1"; //State/Prov. HtmlComboBox st = new HtmlComboBox(browind); st.SearchProperties[HtmlComboBox.PropertyNames.Id] = "state1"; //Postal/ZIP Code HtmlEdit zp = new HtmlEdit(browind); zp.SearchProperties[HtmlEdit.PropertyNames.Id] = "zip1"; //Zip (last four digits) HtmlEdit zp4 = new HtmlEdit(browind); zp4.SearchProperties[HtmlEdit.PropertyNames.Id] = "zip_four1"; //County HtmlEdit cty = new HtmlEdit(browind); cty.SearchProperties[HtmlEdit.PropertyNames.Id] = "county1"; //Country HtmlComboBox country = new HtmlComboBox(browind); country.SearchProperties[HtmlComboBox.PropertyNames.Id] = "country1"; //From mm/yyyy HtmlEdit fr = new HtmlEdit(browind); fr.SearchProperties[HtmlEdit.PropertyNames.Id] = "1_from"; //To mm/yyyy HtmlEdit to = new HtmlEdit(browind); to.SearchProperties[HtmlEdit.PropertyNames.Id] = "1_to"; //Mouse scroll to bottom page Mouse.MoveScrollWheel(-200); /*****************/ /* Progress Meter*/ /*****************/ HtmlCustom progress = new HtmlCustom(browind); progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter"; bool availabilty = (bool)progress.GetProperty(HtmlCustom.PropertyNames.Exists); string workflowEvent = PersonalInformation1.ReadData(1, "WORKFLOW"); if (workflowEvent == "S1PROSPECT") { Assert.IsTrue(availabilty, "Progress Meter is not showing"); HtmlSpan bar = new HtmlSpan(browind); bar.SearchProperties[HtmlSpan.PropertyNames.Id] = "meterlabel"; string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText); Assert.AreEqual(percentage, "20%"); } else { Assert.IsFalse(availabilty, "Progress Meter is showing"); } Mouse.MoveScrollWheel(-200); /******************************/ /* Button "Save And Continue" */ /******************************/ HtmlInputButton btnSaveNCont = new HtmlInputButton(browind); btnSaveNCont.SearchProperties[HtmlInputButton.PropertyNames.Id] = "ForwardButton_button"; //Verify if there is any existing address history //If yes, click Continue and Save button //while there is error(s) return, //fixed the error(s) //else No, click Continue And Save button btnSaveNCont.SetFocus(); Mouse.Click(btnSaveNCont); browind.WaitForControlReady(2000); }