Skip to content

Instantly share code, notes, and snippets.

@BodieLeonard
Last active November 24, 2015 20:23
Show Gist options
  • Select an option

  • Save BodieLeonard/c34b821d720b22a5817c to your computer and use it in GitHub Desktop.

Select an option

Save BodieLeonard/c34b821d720b22a5817c to your computer and use it in GitHub Desktop.
var person = {
fname:"David"
,lname:"Lutchko"
,add:"4520 Emperor Dr"
,city:"Fort Worth"
,state:"TX"
,zip:"76119"
,user:"jb_bl@ot.com"
,pass:"LetTheGoodTimesRoll360"
,vpass:"LetTheGoodTimesRoll360"
,secret:"1"
,secretAnswer:"Gold"
,ss1:"896"
,ss2:"58"
,ss3:"4996"
,dobm:"1"
,dobd:"1"
,doby:"1961"
},
answers = [
"Oakdale"
,"Lake"
,"None of the above"
,"Los Angeles"
,"None of the above"
,"Best Buy"
,"101 Pharr"
,"Chattanooga"
,"Crafts And More"
,"Chino"
,"Kennesaw"
,"None of the above"
,"Hamilton"
,"1999"
,"5555551111"
,"Chattanooga"
,"Hillsborough"
,"Kennesaw"
,"Kennesaw"
,"Cobb"
,"Hamilton"
],
questions = [
"Which of these cities are you associated with?"
,"In 1999, what county did you live in?"
,"Which of the following hunting or fishing licenses do you have or have you had in the past?"
,"In what county do you live?"
,"In 2001 you applied for a hunting or fishing license in which of the following states?"
,"From the following list, select one of your current or previous employers."
,"Which of the following addresses belongs to a business you are currently or previously associated with?"
,"From the following list, select the city in which you lived in 2007"
,"Which of these businesses are you associated with?"
,"From the following list, select the city in which you lived in 1999"
,"Which of these cities are you associated with?"
,"In which of the following states have you had a driver's license?"
,"In 2002, what county did you live in?"
,"What year did you graduate from high school?"
,"Which of these phone numbers have you ever used previously?"
,"From the following list, select the city in which you lived in 2002"
,"In 1995, what county did you live in?"
,"Which of these cities are you associated with?"
,"From the following list, select the city in which you lived in 2005"
,"In 2005, what county did you live in?"
,"In 2003, what county did you live in?"
],
ele = {
fname:"#firstname, #CreditReportForm_tbFirstName_tb"
,lname:"#lastname, #CreditReportForm_tbLastName_tb"
,add:"#CreditReportForm_tbAddressSt_tb"
,city:"#CreditReportForm_tbAddressCity_tb"
,state:"#CreditReportForm_ddlAddressState_ddlState"
,zip:"#zipcode, #CreditReportForm_tbAddressZipCode_tb"
,user:"#email, #CreditReportForm_tbEmail_tb"
,pass:"#CreditReportForm_tbPassword_tb"
,vpass:"#CreditReportForm_tbPasswordVerify_tb"
,secret:"#CreditReportForm_ddlSecretQuestion_ddlQuestions"
,secretAnswer:"#CreditReportForm_tbSecretAnswer_tb"
,submitDemographics:".lp-button, #CreditReportForm_btnSubmitPage1"
,ssfull:"#ssn-field"
,ss1:"#CreditReportForm_tbSSN_tbSSN1"
,ss2:"#CreditReportForm_tbSSN_tbSSN2"
,ss3:"#CreditReportForm_tbSSN_tbSSN3"
,dobm:"#CreditReportForm_tbDOB_Month"
,dobd:"#CreditReportForm_tbDOB_Day"
,doby:"#CreditReportForm_tbDOB_YearDropDown"
,submitSS:"#CreditReportForm_btnSubmitPageN"
,ccNameOnCard:"#CreditReportForm_tbCreditCardUserName_tb"
,q1:"#question1"
,q2:"#question2"
,q3:"#question3"
,dobfull:"#dob-field"
,stolencard:"[for='CreditReportForm_customerMarketingDataQuestionAnswer_Answers_1'"
,submitQ:"#CreditReportForm_btnSubmitPageQ"
}
// if username exists fill out the user info
if($(ele.fname)){
$(ele.fname).val(person.fname);
$(ele.lname).val(person.lname);
$(ele.add).val(person.add);
$(ele.city).val(person.city);
$(ele.state).val(person.state);
$(ele.zip).val(person.zip);
$(ele.user).val(person.user);
$(ele.pass).val(person.pass);
$(ele.vpass).val(person.vpass);
$(ele.secret).val(person.secret);
$(ele.secretAnswer).val(person.secretAnswer);
}
if($(ele.stolencard)){
$(ele.stolencard).trigger("click");
}
// auto submit the user demographic form
if($(ele.submitDemographics)){
$(ele.submitDemographics).trigger("click");
}
// user social security form submit
if($(ele.ss1)){
$(ele.ss1).val(person.ss1);
$(ele.ss2).val(person.ss2);
$(ele.ss3).val(person.ss3);
$(ele.dobm).val(person.dobm);
$(ele.dobd).val(person.dobd);
$(ele.doby).val(person.doby);
}
if($(ele.ssfull)){
$(ele.ssfull).val(person.ss1+person.ss2+person.ss3);
}
if($(ele.dobfull)){
$(ele.dobfull).val(person.dobm+"/"+person.dobd+"/"+person.doby);
$(ele.dobfull).trigger('click');
}
// trigger submit for social security form
if($(ele.submitSS)){
$(ele.submitSS).trigger("click");
}
// enter credit info
if($(ele.ccNameOnCard)){
$(ele.ccNameOnCard).val(person.fname + " " +person.lname);
}
if($(ele.q1)){
// first select None of the above for all answers
$('.answer').find('label:contains("None of the above")').trigger('click')
$.each( questions, function( index, value ){
$('p:contains('+value+')').parent().next('.answer').find('label:contains('+answers[index]+')').trigger('click')
});
//$(ele.submitQ).trigger('click');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment