forked from rpeng220/kaleidoscope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaleo.js
231 lines (221 loc) · 16.3 KB
/
taleo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
var changeevent = new Event('change', {
bubbles: true,
});
function tryvalue(id, stringval) {
if (document.getElementById(id)) {
document.getElementById(id).value = stringval;
}
}
function dateselect(id, dateval) {
var dateele = document.getElementById(id);
if (document.getElementById(id)) {
dateele.value = dateval;
dateele.dispatchEvent(inputevent2);
dateele.dispatchEvent(changeevent);
}
}
function taleoLogin() {
document.getElementById("dialogTemplate-dialogForm-login-name1").value = PROFILE.username;
document.getElementById("dialogTemplate-dialogForm-login-password").value = PROFILE.password;
document.getElementById("dialogTemplate-dialogForm-login-defaultCmd").click();
setTimeout(function() {
if (document.getElementById('dialogTemplate-dialogForm-login-errorMessageTitle')) {
document.getElementById("dialogTemplate-dialogForm-login-register").click();
waitForElement("[id=dialogTemplate-dialogForm-userName]").then(function() {
document.getElementById("dialogTemplate-dialogForm-userName").value = PROFILE.username;
document.getElementById("dialogTemplate-dialogForm-password").value = PROFILE.password;
if (document.getElementById('dialogTemplate-dialogForm-passwordConfirm')) {
document.getElementById('dialogTemplate-dialogForm-passwordConfirm').value = PROFILE.password;
}
document.getElementById('dialogTemplate-dialogForm-email').value = PROFILE.email;
setTimeout(function() { document.getElementById('dialogTemplate-dialogForm-defaultCmd').click();}, 1000);
});
}
}, 2000);
}
function taleoRegister() {
waitForElement("[id='dialogTemplate-dialogForm-userName']").then(function() {
document.getElementById("dialogTemplate-dialogForm-userName").value = PROFILE.username;
document.getElementById("dialogTemplate-dialogForm-password").value = PROFILE.password;
if (document.getElementById('dialogTemplate-dialogForm-passwordConfirm')) {
document.getElementById('dialogTemplate-dialogForm-passwordConfirm').value = PROFILE.password;
}
document.getElementById('dialogTemplate-dialogForm-email').value = PROFILE.email;
setTimeout(function() { document.getElementById('dialogTemplate-dialogForm-defaultCmd').click();}, 1000);
});
}
function taleoSecurity() {
waitForElement("[id='dialogTemplate-dialogForm-j_id_id18pc6-0-question']").then(function() {
document.getElementById('dialogTemplate-dialogForm-j_id_id18pc6-0-question').value = PROFILE.question;
document.getElementById('dialogTemplate-dialogForm-j_id_id18pc6-0-answer').value = PROFILE.answer;
});
}
function taleoPersonalinfo() {
var x = 0;
if (document.getElementById("et-ef-content-ftf-gp-j_id_id16pc9-page_1-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_FirstName")) {
x = 1;
}
if (document.getElementById("et-ef-content-ftf-gp-j_id_id16pc9-page_2-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_FirstName")) {
x = 2;
}
document.getElementById("et-ef-content-ftf-gp-j_id_id16pc9-page_" + x + "-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_FirstName").value = PROFILE.first_name;
document.getElementById("et-ef-content-ftf-gp-j_id_id16pc9-page_" + x + "-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_LastName").value = PROFILE.last_name;
document.getElementById("et-ef-content-ftf-gp-j_id_id16pc9-page_" + x + "-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_Address").value = PROFILE.street_address;
document.getElementById("et-ef-content-ftf-gp-j_id_id16pc9-page_" + x + "-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_City").value = PROFILE.city;
document.getElementById("et-ef-content-ftf-gp-j_id_id16pc9-page_" + x + "-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_ZipCode").value = PROFILE.zip_code;
var cellphone = document.getElementById("et-ef-content-ftf-gp-j_id_id16pc9-page_" + x + "-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_MobilePhone");
var homephone = document.getElementById("et-ef-content-ftf-gp-j_id_id16pc9-page_" + x + "-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_HomePhone");
if (document.getElementById("et-ef-content-ftf-gp-j_id_id16pc9-page_" + x + "-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_PreferredPhone")) {
document.getElementById("et-ef-content-ftf-gp-j_id_id16pc9-page_" + x + "-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_PreferredPhone").value = 1;
}
if (homephone) {
homephone.value = PROFILE.phone;
} else if (cellphone) {
cellphone.value = PROFILE.phone;
}
var countryselect = document.getElementById("et-ef-content-ftf-gp-j_id_id16pc9-page_" + x + "-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_ResidenceLocation-0");
countryselect.value = document.evaluate('//*[@id="et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_ResidenceLocation-0"]//option[contains(text(), "United States")]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(0).value;
countryselect.dispatchEvent(inputevent2);
countryselect.dispatchEvent(changeevent);
setTimeout(function() {
var stateselect = document.getElementById("et-ef-content-ftf-gp-j_id_id16pc9-page_" + x + "-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_ResidenceLocation-1");
stateselect.value = document.evaluate('//*[@id="et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_ResidenceLocation-1"]//option[contains(text(), "' + PROFILE.state + '")]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(0).value;
stateselect.dispatchEvent(inputevent2);
stateselect.dispatchEvent(changeevent);
setTimeout(function() {
completeNotification();
}, 1900)
}, 800);
}
function taleoExperience() {
taleoflag = true;
var x = '0';
var y = '0';
var z = '0';
if (document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_1-we-wei-0-frm-dv_cs_experience_Employer')) {
x = '1';
if (document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_0-csef-efi-0-frm-dv_cs_education_Program')) {
y = '0';
z = '2';
} else {
y = '2';
z = '0';
}
} else if (document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_2-we-wei-0-frm-dv_cs_experience_Employer')) {
x = '2';
if (document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_1-csef-efi-0-frm-dv_cs_education_Program')) {
y = '1';
z = '0';
} else {
y = '0';
z = '1';
}
} else {
if (document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_1-csef-efi-0-frm-dv_cs_education_Program')) {
y = '1';
z = '2';
} else {
y = '2';
z = '1';
}
}
if (PROFILE.employer2 != "" && document.getElementById("et-ef-content-ftf-gp-j_id_id16pc9-page_" + x + "-we-wei-1-frm-dv_cs_experience_Employer") == null) {
alert("Due to page restrictions you may have to click autofill multiple times after each autofill complete notification for your multiple previous work experiences.");
}
document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-0-frm-dv_cs_experience_Employer').value = PROFILE.employer1;
tryvalue('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-0-frm-dv_cs_experience_Responsibility', PROFILE.job_desc1);
tryvalue('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-0-frm-dv_cs_experience_JobFunction', PROFILE.job_title1);
tryvalue('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-0-frm-dv_cs_experience_UDFExperience_JobTitleUDF', PROFILE.job_title1);
tryvalue('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-0-frm-dv_cs_experience_UDFExperience_Title', PROFILE.job_title1);
if (PROFILE.current_job1 == true && document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-0-frm:dv_cs_experience_CurrentEmployer')) {
document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-0-frm:dv_cs_experience_CurrentEmployer').click();
}
dateselect('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-0-frm-dv_cs_experience_BeginDate.month', PROFILE.job_start_month1 - 1);
dateselect('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-0-frm-dv_cs_experience_BeginDate.year', PROFILE.job_start_year1);
dateselect('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-0-frm-dv_cs_experience_EndDate.month', PROFILE.job_end_month1 - 1);
dateselect('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-0-frm-dv_cs_experience_EndDate.year', PROFILE.job_end_year1);
if (PROFILE.employer2 != "") {
if (document.getElementById("et-ef-content-ftf-gp-j_id_id16pc9-page_" + x + "-we-wei-1-frm-dv_cs_experience_Employer") == null) {
sessionStorage.setItem("reloading", "true");
document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-lblAddWorkExperience').click();
}
setTimeout(function() {
document.getElementById("et-ef-content-ftf-gp-j_id_id16pc9-page_" + x + "-we-wei-1-frm-dv_cs_experience_Employer").value = PROFILE.employer2;
tryvalue('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-1-frm-dv_cs_experience_Responsibility', PROFILE.job_desc2);
tryvalue('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-1-frm-dv_cs_experience_JobFunction', PROFILE.job_title2);
tryvalue('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-1-frm-dv_cs_experience_UDFExperience_JobTitleUDF', PROFILE.job_title2);
tryvalue('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-1-frm-dv_cs_experience_UDFExperience_Title', PROFILE.job_title2);
if (PROFILE.current_job2 == true && document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-1-frm:dv_cs_experience_CurrentEmployer')) {
document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-1-frm:dv_cs_experience_CurrentEmployer').click();
}
dateselect('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-1-frm-dv_cs_experience_BeginDate.month', PROFILE.job_start_month2 - 1);
dateselect('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-1-frm-dv_cs_experience_BeginDate.year', PROFILE.job_start_year2);
dateselect('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-1-frm-dv_cs_experience_EndDate.month', PROFILE.job_end_month2 - 1);
dateselect('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-1-frm-dv_cs_experience_EndDate.year', PROFILE.job_end_year2);
}, 5000);
}
if (PROFILE.employer3 != "") {
document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-lblAddWorkExperience').click();
setTimeout(function () {
document.getElementById("et-ef-content-ftf-gp-j_id_id16pc9-page_" + x + "-we-wei-0-frm-dv_cs_experience_Employer").value = PROFILE.employer3;
tryvalue('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-2-frm-dv_cs_experience_Responsibility', PROFILE.job_desc3);
tryvalue('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-2-frm-dv_cs_experience_JobFunction', PROFILE.job_title3);
tryvalue('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-2-frm-dv_cs_experience_UDFExperience_JobTitleUDF', PROFILE.job_title3);
tryvalue('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-2-frm-dv_cs_experience_UDFExperience_Title', PROFILE.job_title3);
if (PROFILE.current_job3 == true && document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-2-frm:dv_cs_experience_CurrentEmployer')) {
document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-2-frm:dv_cs_experience_CurrentEmployer').click();
}
dateselect('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-2-frm-dv_cs_experience_BeginDate.month', PROFILE.job_start_month3 - 1);
dateselect('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-2-frm-dv_cs_experience_BeginDate.year', PROFILE.job_start_year3);
dateselect('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-2-frm-dv_cs_experience_EndDate.month', PROFILE.job_end_month3 - 1);
dateselect('et-ef-content-ftf-gp-j_id_id16pc9-page_' + x + '-we-wei-2-frm-dv_cs_experience_EndDate.year', PROFILE.job_end_year3);
}, 5000);
}
if (document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_' + y + '-csef-efi-0-frm-dv_cs_education_Institution')) {
tryvalue('et-ef-content-ftf-gp-j_id_id16pc9-page_' + y + '-csef-efi-0-frm-dv_cs_education_Institution', PROFILE.university);
} else {
document.evaluate("//*[contains(text(), 'University')]//following::input[1]", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(0).value = PROFILE.university;
}
tryvalue('et-ef-content-ftf-gp-j_id_id16pc9-page_' + y + '-csef-efi-0-frm-dv_cs_education_OtherInstitutionCity', PROFILE.uni_city);
tryvalue('et-ef-content-ftf-gp-j_id_id16pc9-page_' + y + '-csef-efi-0-frm-dv_cs_education_Program', PROFILE.major);
tryvalue('et-ef-content-ftf-gp-j_id_id16pc9-page_' + y + '-csef-efi-0-frm-dv_cs_education_gpa', PROFILE.gpa);
tryvalue('et-ef-content-ftf-gp-j_id_id16pc9-page_' + y + '-csef-efi-0-frm-dv_cs_education_gpaRange', '4');
var degreeselect = document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_' + y + '-csef-efi-0-frm-dv_cs_education_StudyLevel')
degreeselect.value = document.evaluate('//*[@id="et-ef-content-ftf-gp-j_id_id16pc9-page_' + y + '-csef-efi-0-frm-dv_cs_education_StudyLevel"]//option[contains(text(), "' + PROFILE.degree + '")]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(0).value;
degreeselect.dispatchEvent(inputevent2);
degreeselect.dispatchEvent(changeevent);
dateselect('et-ef-content-ftf-gp-j_id_id16pc9-page_' + y + '-csef-efi-0-frm-dv_cs_education_startDate.month', PROFILE.uni_start_month - 1);
dateselect('et-ef-content-ftf-gp-j_id_id16pc9-page_' + y + '-csef-efi-0-frm-dv_cs_education_startDate.year', PROFILE.uni_start_year);
dateselect('et-ef-content-ftf-gp-j_id_id16pc9-page_' + y + '-csef-efi-0-frm-dv_cs_education_graduationDate.month', PROFILE.grad_month - 1);
dateselect('et-ef-content-ftf-gp-j_id_id16pc9-page_' + y + '-csef-efi-0-frm-dv_cs_education_graduationDate.year', PROFILE.grad_year);
setTimeout(function() {
taleoflag = false;
completeNotification();
}, 3000)
}
function taleo() {
if (document.getElementById("dialogTemplate-dialogForm-login-password")) {
return taleoLogin();
}
if (existsxpath('//*[contains(text(), "New User Registration")]')) {
return taleoRegister();
}
if (existsxpath('//*[contains(text(), "Security Question")]')) {
return taleoSecurity();
}
if (document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_0-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_FirstName') || document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_1-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_FirstName') || document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_2-cpi-cfrmsub-frm-dv_cs_candidate_personal_info_FirstName') ) {
return taleoPersonalinfo();
}
if (document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_0-we-wei-0-frm-dv_cs_experience_Employer') || document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_1-we-wei-0-frm-dv_cs_experience_Employer') || document.getElementById('et-ef-content-ftf-gp-j_id_id16pc9-page_2-we-wei-0-frm-dv_cs_experience_Employer')) {
return taleoExperience();
} else {
var clickelement;
if (document.getElementById("et-ef-content-ftf-saveContinueCmdBottom")) {
clickelement = document.getElementById("et-ef-content-ftf-saveContinueCmdBottom");
}
if (document.getElementById("editTemplateMultipart-editForm-content-ftf-saveContinueCmdBottom")) {
clickelement = document.getElementById("editTemplateMultipart-editForm-content-ftf-saveContinueCmdBottom");
}
return;
}
}