public EditWorkItemPage EditTitle(string title) { var uiTitle = new HtmlEdit(browser); uiTitle.SearchProperties.Add(HtmlControl.PropertyNames.Id, EditWorkItemPageConst.EDIT_TITLE_TEXTBOX_ID); uiTitle.Find(); uiTitle.SetProperty(HtmlEdit.PropertyNames.Text, title); return(this); }
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 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_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); }