sfdc_se 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/sfdc_se.rb +194 -0
- data/lib/sfdc_se/general/general.rb +78 -0
- data/lib/sfdc_se/pages/page_deliverability.rb +56 -0
- data/lib/sfdc_se/pages/page_emailalerts.rb +332 -0
- data/lib/sfdc_se/pages/page_fieldupdates.rb +499 -0
- data/lib/sfdc_se/pages/page_homepagelayouts.rb +128 -0
- data/lib/sfdc_se/pages/page_passwordsecuritysetting.rb +61 -0
- data/lib/sfdc_se/pages/page_personalinformation.rb +18 -0
- data/lib/sfdc_se/pages/page_profiles.rb +780 -0
- data/lib/sfdc_se/pages/page_renametabslabels.rb +1215 -0
- data/lib/sfdc_se/pages/page_setup.rb +321 -0
- data/lib/sfdc_se/pages/page_sharingsettings.rb +264 -0
- data/lib/sfdc_se/pages/page_template.rb +18 -0
- data/lib/sfdc_se/pages/page_translate.rb +451 -0
- data/lib/sfdc_se/version.rb +3 -0
- metadata +106 -0
@@ -0,0 +1,1215 @@
|
|
1
|
+
# ----------------------------------------------
|
2
|
+
# - Page: Rename Tabs and Labels
|
3
|
+
# ----------------------------------------------
|
4
|
+
|
5
|
+
module SfdcSe
|
6
|
+
class Driver
|
7
|
+
|
8
|
+
# -----------------------------
|
9
|
+
# get_RenameTabsLabels_Language
|
10
|
+
# => returns all the elements for the Translate Language dropdown
|
11
|
+
#
|
12
|
+
def get_RenameTabsLabels_Language
|
13
|
+
return @driver.find_elements(:xpath => "//div[@class='renameTabsLanguageSelect']/select/option")
|
14
|
+
end
|
15
|
+
# -----------------------------
|
16
|
+
|
17
|
+
# -----------------------------
|
18
|
+
# get_RenameTabsLabels_StandardTable
|
19
|
+
# => returns all the elements for the Rename Tabs and Labels Standard Tabs Table
|
20
|
+
def get_RenameTabsLabels_StandardTable
|
21
|
+
# return @driver.find_elements(:xpath => "//table[@class='list'][1]/tbody/tr")
|
22
|
+
return @driver.find_elements(:xpath => "//form[@id='thisform']/div[2]/div[1]/div/div[2]/table[@class='list']/tbody/tr")
|
23
|
+
end
|
24
|
+
# -----------------------------
|
25
|
+
|
26
|
+
# -----------------------------
|
27
|
+
# get_RenameTabsLabels_CustomTable
|
28
|
+
# => returns all the elements for the Rename Tabs and Labels Custom Tabs Table
|
29
|
+
def get_RenameTabsLabels_CustomTable
|
30
|
+
# return @driver.find_elements(:xpath => "//table[@class='list'][2]/tbody/tr")
|
31
|
+
return @driver.find_elements(:xpath => "//form[@id='thisform']/div[3]/div[1]/div/div[2]/table[@class='list']/tbody/tr")
|
32
|
+
# /html/body/div/div[2]/table/tbody/tr/td[2]/form/div[3]/div[1]/div/div[2]/table
|
33
|
+
end
|
34
|
+
# -----------------------------
|
35
|
+
|
36
|
+
# -----------------------------
|
37
|
+
# get_RenameTabsLabels_StandardTable_Step1_Subtable
|
38
|
+
# => sSubTableName
|
39
|
+
# => returns all the elements for the Raname Tabs and Labels Standard Sub Table
|
40
|
+
def get_RenameTabsLabels_StandardTable_Step1_Subtable(sSubTableName)
|
41
|
+
return @driver.find_elements(:xpath => "//h3[contains(.,'#{sSubTableName}')]/../following-sibling::div[1]/table/tbody/tr")
|
42
|
+
end
|
43
|
+
# -----------------------------
|
44
|
+
|
45
|
+
# -----------------------------
|
46
|
+
# get_RenameTabsLabels_StandardTable_Step1
|
47
|
+
# => returns all the elements for the Rename Tabs and Labels Standard Tabs Table
|
48
|
+
def get_RenameTabsLabels_StandardTable_Step1
|
49
|
+
return @driver.find_elements(:xpath => "//table[@class='detailList']/tbody/tr")
|
50
|
+
end
|
51
|
+
# -----------------------------
|
52
|
+
|
53
|
+
# -----------------------------
|
54
|
+
# get_RenameTabsLabels_StandardTable_Step2_StandardField
|
55
|
+
# => returns all the elements for the Rename Tabs and Labels Standard Tabs Table
|
56
|
+
def get_RenameTabsLabels_StandardTable_Step2_StandardField
|
57
|
+
# return @driver.find_elements(:xpath => "//table[@class='list']/tbody/tr")
|
58
|
+
return @driver.find_elements(:xpath => "//div[@class='listRelatedObject setupBlock'][1]/div/div[2]/table/tbody/tr")
|
59
|
+
# return @driver.find_elements(:xpath => "/html/body/div/div[2]/table/tbody/tr/td[2]/form/div/div[2]/div[4]/div[2]/div/div[2]/table/tbody/tr")
|
60
|
+
end
|
61
|
+
# -----------------------------
|
62
|
+
|
63
|
+
# -----------------------------
|
64
|
+
# get_RenameTabsLabels_StandardTable_Step2_OtherLabels
|
65
|
+
# => returns all the elements for the Rename Tabs and Labels Other Labels Table
|
66
|
+
def get_RenameTabsLabels_StandardTable_Step2_OtherLabels
|
67
|
+
# return @driver.find_elements(:xpath => "//table[@class='list']/tbody/tr")
|
68
|
+
return @driver.find_elements(:xpath => "//div[@class='listRelatedObject setupBlock'][2]/div/div[2]/table/tbody/tr")
|
69
|
+
# /html/body/div/div[2]/table/tbody/tr/td[2]/form/div/div[2]/div[4]/div[4]/div/div[2]/table/tbody/tr[1]
|
70
|
+
end
|
71
|
+
# -----------------------------
|
72
|
+
|
73
|
+
# -----------------------------
|
74
|
+
# set_RenameTabsLabels_Language
|
75
|
+
# => sLanguage = string value of the Language option to select
|
76
|
+
# => Return = true or false
|
77
|
+
# => true = setting of view were successful
|
78
|
+
# => false = setting of view had an error
|
79
|
+
#
|
80
|
+
def set_RenameTabsLabels_Language(sLanguage)
|
81
|
+
blnReturn=false
|
82
|
+
|
83
|
+
begin
|
84
|
+
get_RenameTabsLabels_Language.each do |option|
|
85
|
+
if option.text == sLanguage
|
86
|
+
option.click unless option.selected?
|
87
|
+
blnReturn=true
|
88
|
+
sleep(3)
|
89
|
+
break
|
90
|
+
end
|
91
|
+
end
|
92
|
+
rescue
|
93
|
+
puts $!
|
94
|
+
puts $@
|
95
|
+
end
|
96
|
+
return blnReturn
|
97
|
+
end
|
98
|
+
# -----------------------------
|
99
|
+
|
100
|
+
# -----------------------------
|
101
|
+
# click_Edit_RenameTabsLabels
|
102
|
+
# => sTabName = string value of the Tab Name to click Edit
|
103
|
+
# => Return = true or false
|
104
|
+
# => true = value was found and 'edit' clicked
|
105
|
+
# => false =value was not found or had an error
|
106
|
+
#
|
107
|
+
def click_Edit_RenameTabsLabels(sTabName)
|
108
|
+
blnEdit=false
|
109
|
+
sFoundIn='empty'
|
110
|
+
|
111
|
+
r=0
|
112
|
+
puts "Standard Rows: #{get_RenameTabsLabels_StandardTable.length}"
|
113
|
+
while r < get_RenameTabsLabels_StandardTable.length
|
114
|
+
$stdout.flush
|
115
|
+
print "\r#{r} of #{get_RenameTabsLabels_StandardTable.length} - Standard:: #{get_RenameTabsLabels_StandardTable[r].find_element(:xpath => "./th[1]").text}"
|
116
|
+
if get_RenameTabsLabels_StandardTable[r].find_element(:xpath => "./th[1]").text == sTabName
|
117
|
+
get_RenameTabsLabels_StandardTable[r].find_element(:xpath => "./td[1]/a[1]").click
|
118
|
+
sleep(5)
|
119
|
+
sFoundIn='standard'
|
120
|
+
blnEdit=true
|
121
|
+
break
|
122
|
+
end
|
123
|
+
r+=1
|
124
|
+
end
|
125
|
+
|
126
|
+
r=0
|
127
|
+
puts ""
|
128
|
+
puts "Custom Rows: #{get_RenameTabsLabels_CustomTable.length}"
|
129
|
+
while r < get_RenameTabsLabels_CustomTable.length
|
130
|
+
print "\r#{r} of #{get_RenameTabsLabels_CustomTable.length} - Custom:: #{get_RenameTabsLabels_CustomTable[r].find_element(:xpath => "./th[1]").text}"
|
131
|
+
if get_RenameTabsLabels_CustomTable[r].find_element(:xpath => "./th[1]").text == sTabName
|
132
|
+
get_RenameTabsLabels_CustomTable[r].find_element(:xpath => "./td[1]/a[1]").click
|
133
|
+
sleep(5)
|
134
|
+
sFoundIn='custom'
|
135
|
+
blnEdit=true
|
136
|
+
break
|
137
|
+
end
|
138
|
+
r+=1
|
139
|
+
end
|
140
|
+
|
141
|
+
print "\r #{blnEdit}, #{sFoundIn}"
|
142
|
+
return blnEdit, sFoundIn
|
143
|
+
end
|
144
|
+
# -----------------------------
|
145
|
+
|
146
|
+
# -----------------------------
|
147
|
+
# click_Btn_RenameTabslabels_Cancel
|
148
|
+
# => Clicks the 'Cancel' button within the Rename Tabs and Labels
|
149
|
+
def click_Btn_RenameTabslabels_Cancel
|
150
|
+
|
151
|
+
@driver.find_element(:xpath => "//div[@class='pbTopButtons']/input[@class='btnCancel']").click
|
152
|
+
end
|
153
|
+
# -----------------------------
|
154
|
+
|
155
|
+
# -----------------------------
|
156
|
+
# click_Btn_RenameTabslabels_Save
|
157
|
+
# => Clicks the 'Save' button within the Rename Tabs and Labels
|
158
|
+
def click_Btn_RenameTabslabels_Save
|
159
|
+
@driver.find_element(:xpath => "//div[@class='pbTopButtons']/input[@class='btn' and @title='Save']").click
|
160
|
+
end
|
161
|
+
# -----------------------------
|
162
|
+
|
163
|
+
# -----------------------------
|
164
|
+
# click_Btn_RenameTabslabels_Next
|
165
|
+
# => Clicks the 'Next' button within the Rename Tabs and Labels
|
166
|
+
def click_Btn_RenameTabslabels_Next
|
167
|
+
@driver.find_element(:xpath => "//div[@class='pbTopButtons']/input[@class='btn' and @title='Next']").click
|
168
|
+
end
|
169
|
+
# -----------------------------
|
170
|
+
|
171
|
+
# -----------------------------
|
172
|
+
# get_RenameTabsLabels_Standard
|
173
|
+
# => Return = Hash {Key= Field Name/Type, Value=Field Value}
|
174
|
+
#
|
175
|
+
def get_RenameTabsLabels_Standard
|
176
|
+
response=Hash.new
|
177
|
+
# -- Step 1 of 2
|
178
|
+
case get_RenameTabsLabels_StandardTable_Step1[1].find_element(:xpath => "./td[2]").text
|
179
|
+
when "English", "English (UK)"
|
180
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
181
|
+
case idx
|
182
|
+
when 0,1
|
183
|
+
response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
184
|
+
when 2,3
|
185
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
186
|
+
when 4
|
187
|
+
response[row.find_element(:xpath => "./td[1]/label").text] = !row.find_element(:xpath => "./td[2]/input").attribute("checked").nil?
|
188
|
+
end
|
189
|
+
end
|
190
|
+
when "Indonesian"
|
191
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
192
|
+
case idx
|
193
|
+
when 0,1
|
194
|
+
response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
195
|
+
when 2,3
|
196
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
197
|
+
end
|
198
|
+
end
|
199
|
+
when "German"
|
200
|
+
# - Get Tab, Language, Gender
|
201
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
202
|
+
case idx
|
203
|
+
when 0,1
|
204
|
+
response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
205
|
+
when 2
|
206
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
# - Get Sub Table information
|
211
|
+
aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative']
|
212
|
+
aSubTables.each do |s|
|
213
|
+
subresponse=Hash.new
|
214
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
215
|
+
subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
216
|
+
end
|
217
|
+
response[s]=subresponse
|
218
|
+
end
|
219
|
+
when "Romanian"
|
220
|
+
# - Get Tab, Language, Gender
|
221
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
222
|
+
case idx
|
223
|
+
when 0,1
|
224
|
+
response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
225
|
+
when 2
|
226
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
# - Get Sub Table information
|
231
|
+
aSubTables=['Nominative', 'Dative']
|
232
|
+
aSubTables.each do |s|
|
233
|
+
subresponse=Hash.new
|
234
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
235
|
+
subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
236
|
+
end
|
237
|
+
response[s]=subresponse
|
238
|
+
end
|
239
|
+
when "Spanish", "Portuguese (Brazilian)", "Dutch", "Spanish (Mexican)", "Bulgarian", "Portuguese (European)"
|
240
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
241
|
+
case idx
|
242
|
+
when 0,1
|
243
|
+
response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
244
|
+
when 2
|
245
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
246
|
+
when 3,4
|
247
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
248
|
+
end
|
249
|
+
end
|
250
|
+
when "French"
|
251
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
252
|
+
case idx
|
253
|
+
when 0,1
|
254
|
+
response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
255
|
+
when 2
|
256
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
257
|
+
when 3,4
|
258
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
259
|
+
when 5
|
260
|
+
response[row.find_element(:xpath => "./td[1]/label").text] = !row.find_element(:xpath => "./td[2]/input").attribute("checked").nil?
|
261
|
+
end
|
262
|
+
end
|
263
|
+
when "Italian"
|
264
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
265
|
+
case idx
|
266
|
+
when 0,1
|
267
|
+
response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
268
|
+
when 2
|
269
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
270
|
+
when 3,4
|
271
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
272
|
+
when 5
|
273
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
274
|
+
end
|
275
|
+
end
|
276
|
+
when "Japanese", "Korean", "Chinese (Traditional)", "Chinese (Simplified)", "Thai", "Vietnamese"
|
277
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
278
|
+
case idx
|
279
|
+
when 0,1
|
280
|
+
response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
281
|
+
when 2
|
282
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
283
|
+
end
|
284
|
+
end
|
285
|
+
when "Swedish", "Danish", "Norwegian", "Hebrew", "Arabic"
|
286
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
287
|
+
case idx
|
288
|
+
when 0,1
|
289
|
+
response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
290
|
+
when 2
|
291
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
292
|
+
else
|
293
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
294
|
+
end
|
295
|
+
end
|
296
|
+
when "Finnish"
|
297
|
+
# - Get Tab, Language
|
298
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
299
|
+
case idx
|
300
|
+
when 0,1
|
301
|
+
response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
302
|
+
end
|
303
|
+
break if idx > 1
|
304
|
+
end
|
305
|
+
|
306
|
+
# - Get Sub section information
|
307
|
+
aSubTables=['Nominative', 'Genitive', 'Inessive', 'Elative', 'Illative', 'Adessive', 'Ablative', 'Allative', 'Essive', 'Translative', 'Partitive']
|
308
|
+
aSubTables.each do |s|
|
309
|
+
subresponse=Hash.new
|
310
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
311
|
+
subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
312
|
+
end
|
313
|
+
response[s]=subresponse
|
314
|
+
end
|
315
|
+
when "Russian"
|
316
|
+
# - Get Tab, Language, Gender
|
317
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
318
|
+
case idx
|
319
|
+
when 0,1
|
320
|
+
response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
321
|
+
when 2
|
322
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
323
|
+
end
|
324
|
+
end
|
325
|
+
|
326
|
+
# - Get Sub section information
|
327
|
+
aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative', 'Instrumental', 'Prepositional']
|
328
|
+
aSubTables.each do |s|
|
329
|
+
subresponse=Hash.new
|
330
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
331
|
+
subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
332
|
+
end
|
333
|
+
response[s]=subresponse
|
334
|
+
end
|
335
|
+
when "Hungarian"
|
336
|
+
# - Get Tab, Language
|
337
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
338
|
+
case idx
|
339
|
+
when 0,1
|
340
|
+
response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
341
|
+
end
|
342
|
+
break if idx > 1
|
343
|
+
end
|
344
|
+
|
345
|
+
# - Get Sub section information
|
346
|
+
aSubTables=['Nominative', 'Accusative', 'Dative', 'Inessive', 'Elative', 'Illative', 'Ablative', 'Allative', 'Translative', 'Instrumental', 'Sublative', 'Superessive', 'Delative', 'Causal-Final', 'Essive-Formal', 'Terminative']
|
347
|
+
aSubTables.each do |s|
|
348
|
+
subresponse=Hash.new
|
349
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
350
|
+
subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
351
|
+
end
|
352
|
+
response[s]=subresponse
|
353
|
+
end
|
354
|
+
|
355
|
+
# - Get final Sub section information that has checkbox in the last row
|
356
|
+
subresponse=Hash.new
|
357
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable('Distributive').each_with_index do |row, idx|
|
358
|
+
if idx < 6
|
359
|
+
subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
360
|
+
else
|
361
|
+
subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = !row.find_element(:xpath => "./td[2]/input").attribute("checked").nil?
|
362
|
+
end
|
363
|
+
end
|
364
|
+
response['Distributive']=subresponse
|
365
|
+
when "Polish", "Czech", "Ukrainian", "Slovene"
|
366
|
+
# - Get Tab, Language, Gender
|
367
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
368
|
+
case idx
|
369
|
+
when 0,1
|
370
|
+
response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
371
|
+
when 2
|
372
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
373
|
+
end
|
374
|
+
end
|
375
|
+
|
376
|
+
# - Get Sub section information
|
377
|
+
aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative', 'Instrumental', 'Locative', 'Vocative']
|
378
|
+
aSubTables.each do |s|
|
379
|
+
subresponse=Hash.new
|
380
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
381
|
+
subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
382
|
+
end
|
383
|
+
response[s]=subresponse
|
384
|
+
end
|
385
|
+
when "Turkish"
|
386
|
+
# - Get Tab, Language
|
387
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
388
|
+
case idx
|
389
|
+
when 0,1
|
390
|
+
response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
391
|
+
end
|
392
|
+
break if idx > 1
|
393
|
+
end
|
394
|
+
|
395
|
+
# - Get Sub section information
|
396
|
+
aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative', 'Ablative', 'Locative']
|
397
|
+
aSubTables.each do |s|
|
398
|
+
subresponse=Hash.new
|
399
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
400
|
+
subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
401
|
+
end
|
402
|
+
response[s]=subresponse
|
403
|
+
end
|
404
|
+
when "Greek"
|
405
|
+
# - Get Tab, Language, Gender
|
406
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
407
|
+
case idx
|
408
|
+
when 0,1
|
409
|
+
response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
410
|
+
when 2
|
411
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
412
|
+
end
|
413
|
+
end
|
414
|
+
|
415
|
+
# - Get Sub section information
|
416
|
+
aSubTables=['Nominative', 'Accusative', 'Genitive', 'Vocative']
|
417
|
+
aSubTables.each do |s|
|
418
|
+
subresponse=Hash.new
|
419
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
420
|
+
subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
421
|
+
end
|
422
|
+
response[s]=subresponse
|
423
|
+
end
|
424
|
+
when "Slovak", "Croatian"
|
425
|
+
# - Get Tab, Language, Gender
|
426
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
427
|
+
case idx
|
428
|
+
when 0,1
|
429
|
+
response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
430
|
+
when 2
|
431
|
+
response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
432
|
+
end
|
433
|
+
end
|
434
|
+
|
435
|
+
# - Get Sub section information
|
436
|
+
aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative', 'Instrumental', 'Locative']
|
437
|
+
aSubTables.each do |s|
|
438
|
+
subresponse=Hash.new
|
439
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
440
|
+
subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
441
|
+
end
|
442
|
+
response[s]=subresponse
|
443
|
+
end
|
444
|
+
end
|
445
|
+
|
446
|
+
# -- Click Next to get to Step 2
|
447
|
+
click_Btn_RenameTabslabels_Next
|
448
|
+
|
449
|
+
# -- Step 2 of 2
|
450
|
+
# --- Standard Field Labels Table
|
451
|
+
# puts "Step2: Standard Field Labels: #{get_RenameTabsLabels_StandardTable_Step2_StandardField.length}"
|
452
|
+
@driver.manage.timeouts.implicit_wait = 0
|
453
|
+
aStep2Headers=[]
|
454
|
+
iStep2HeaderCount=0
|
455
|
+
iTableCount=1
|
456
|
+
hStep2RowResponse=Hash.new
|
457
|
+
srowFieldLabel=''
|
458
|
+
|
459
|
+
while iTableCount < 3
|
460
|
+
if iTableCount == 1
|
461
|
+
aTable=get_RenameTabsLabels_StandardTable_Step2_StandardField
|
462
|
+
else
|
463
|
+
aTable=get_RenameTabsLabels_StandardTable_Step2_OtherLabels
|
464
|
+
end
|
465
|
+
|
466
|
+
# puts "iTableCount: #{iTableCount}; Table Count: #{aTable.size}"
|
467
|
+
aTable.each_with_index do |row, idx|
|
468
|
+
hStep2SubRowResp=Hash.new
|
469
|
+
|
470
|
+
# puts "Row: #{idx}"
|
471
|
+
|
472
|
+
if idx == 0
|
473
|
+
iStep2HeaderCount = row.find_elements(:xpath => "./th").length
|
474
|
+
row.find_elements(:xpath => "./th").each do |subrow|
|
475
|
+
aStep2Headers.push(subrow.text)
|
476
|
+
end
|
477
|
+
else
|
478
|
+
case iStep2HeaderCount
|
479
|
+
when 2
|
480
|
+
# - Find countries that have only two Step 2 Header Columns
|
481
|
+
srowFieldLabel=row.find_element(:xpath => "./th").text
|
482
|
+
hStep2SubRowResp[aStep2Headers[1]]=row.find_element(:xpath => "./td[1]/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
|
483
|
+
when 3
|
484
|
+
# - Find countries that have only three Step 2 Header Columns
|
485
|
+
srowFieldLabel=row.find_element(:xpath => "./th").text
|
486
|
+
hStep2SubRowResp[aStep2Headers[1]]=row.find_element(:xpath => "./td[1]/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
|
487
|
+
hStep2SubRowResp[aStep2Headers[2]]=row.find_element(:xpath => "./td[2]/input").attribute("value") unless row.find_elements(:xpath => "./td[2]//*").size == 0
|
488
|
+
when 4
|
489
|
+
# - Find countries that have only four Step 2 Header Columns
|
490
|
+
srowFieldLabel=row.find_element(:xpath => "./th").text
|
491
|
+
hStep2SubRowResp[aStep2Headers[1]]=row.find_element(:xpath => "./td[1]/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
|
492
|
+
hStep2SubRowResp[aStep2Headers[2]]=row.find_element(:xpath => "./td[2]/input").attribute("value") unless row.find_elements(:xpath => "./td[2]//*").size == 0
|
493
|
+
if row.find_element(:xpath => "./td[3]").attribute("class") == " dataCell booleanColumn"
|
494
|
+
# - get checkbox value
|
495
|
+
hStep2SubRowResp[aStep2Headers[3]] = !row.find_element(:xpath => "./td[3]/input").attribute("checked").nil?
|
496
|
+
else
|
497
|
+
# - Get gender value
|
498
|
+
hStep2SubRowResp[aStep2Headers[3]] = row.find_element(:xpath => "./td[3]/select/option[@selected='selected']").text unless row.find_elements(:xpath => "./td[3]//*").size == 0
|
499
|
+
end
|
500
|
+
when 5
|
501
|
+
# - Find countries that have only five Step 2 Header Columns
|
502
|
+
srowFieldLabel=row.find_element(:xpath => "./th").text
|
503
|
+
hStep2SubRowResp[aStep2Headers[1]]=row.find_element(:xpath => "./td[1]/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
|
504
|
+
hStep2SubRowResp[aStep2Headers[2]]=row.find_element(:xpath => "./td[2]/input").attribute("value") unless row.find_elements(:xpath => "./td[2]//*").size == 0
|
505
|
+
hStep2SubRowResp[aStep2Headers[3]]=row.find_element(:xpath => "./td[3]/select/option[@selected='selected']").text unless row.find_elements(:xpath => "./td[3]//*").size == 0
|
506
|
+
if row.find_element(:xpath => "./td[4]").attribute("class") == " dataCell booleanColumn"
|
507
|
+
# - get checkbox value
|
508
|
+
hStep2SubRowResp[aStep2Headers[4]] = !row.find_element(:xpath => "./td[4]/input").attribute("checked").nil?
|
509
|
+
else
|
510
|
+
# - Get gender value
|
511
|
+
hStep2SubRowResp[aStep2Headers[4]] = row.find_element(:xpath => "./td[4]/select/option[@selected='selected']").text unless row.find_elements(:xpath => "./td[4]//*").size == 0
|
512
|
+
end
|
513
|
+
end
|
514
|
+
|
515
|
+
hStep2RowResponse[srowFieldLabel]=hStep2SubRowResp
|
516
|
+
end
|
517
|
+
end
|
518
|
+
|
519
|
+
if iTableCount == 1
|
520
|
+
response['Standard Field Labels'] = hStep2RowResponse
|
521
|
+
else
|
522
|
+
response['Other Labels'] = hStep2RowResponse
|
523
|
+
end
|
524
|
+
|
525
|
+
iTableCount +=1
|
526
|
+
end
|
527
|
+
|
528
|
+
# -- Step 2 Other Labels
|
529
|
+
# puts "Step2: Other Labels Row Count: #{get_RenameTabsLabels_StandardTable_Step2_OtherLabels.size}"
|
530
|
+
|
531
|
+
@driver.manage.timeouts.implicit_wait = @implicitWait
|
532
|
+
|
533
|
+
|
534
|
+
return response
|
535
|
+
end
|
536
|
+
# -----------------------------
|
537
|
+
|
538
|
+
# -----------------------------
|
539
|
+
# set_RenameTabsLabels_Standard
|
540
|
+
# => Return = Hash {Key= Field Name/Type, Value=Field Value}
|
541
|
+
#
|
542
|
+
def set_RenameTabsLabels_Standard(hValueSet)
|
543
|
+
blnReturn=false
|
544
|
+
|
545
|
+
# -- Step 1 of 2
|
546
|
+
case get_RenameTabsLabels_StandardTable_Step1[1].find_element(:xpath => "./td[2]").text
|
547
|
+
when "English", "English (UK)"
|
548
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
549
|
+
case idx
|
550
|
+
when 0,1
|
551
|
+
# response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
552
|
+
when 2,3
|
553
|
+
if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
554
|
+
row.find_element(:xpath => "./td[2]/div/input").clear()
|
555
|
+
row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
556
|
+
blnReturn=true
|
557
|
+
end
|
558
|
+
|
559
|
+
# puts "Value for #{row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")}: #{hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]}"
|
560
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
561
|
+
when 4
|
562
|
+
if !((!row.find_element(:xpath => "./td[2]/input").attribute("checked").nil?).to_s == hValueSet[row.find_element(:xpath => "./td[1]/label").text].to_s)
|
563
|
+
row.find_element(:xpath => "./td[2]/input").click
|
564
|
+
blnReturn=true
|
565
|
+
end
|
566
|
+
|
567
|
+
# response[row.find_element(:xpath => "./td[1]/label").text] = !row.find_element(:xpath => "./td[2]/input").attribute("checked").nil?
|
568
|
+
end
|
569
|
+
end
|
570
|
+
when "Indonesian"
|
571
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
572
|
+
case idx
|
573
|
+
when 0,1
|
574
|
+
# response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
575
|
+
when 2,3
|
576
|
+
if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
577
|
+
row.find_element(:xpath => "./td[2]/div/input").clear()
|
578
|
+
row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
579
|
+
blnReturn=true
|
580
|
+
end
|
581
|
+
|
582
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
583
|
+
end
|
584
|
+
end
|
585
|
+
when "German"
|
586
|
+
# - Get Tab, Language, Gender
|
587
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
588
|
+
case idx
|
589
|
+
when 0,1
|
590
|
+
# response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
591
|
+
when 2
|
592
|
+
if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
593
|
+
row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
|
594
|
+
if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
|
595
|
+
option.click
|
596
|
+
blnReturn=true
|
597
|
+
sleep(3)
|
598
|
+
break
|
599
|
+
end
|
600
|
+
end
|
601
|
+
end
|
602
|
+
|
603
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
604
|
+
end
|
605
|
+
end
|
606
|
+
|
607
|
+
# - Get Sub Table information
|
608
|
+
aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative']
|
609
|
+
aSubTables.each do |s|
|
610
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
611
|
+
if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
612
|
+
row.find_element(:xpath => "./td[2]/div/input").clear()
|
613
|
+
row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
614
|
+
blnReturn=true
|
615
|
+
end
|
616
|
+
|
617
|
+
# subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
618
|
+
end
|
619
|
+
end
|
620
|
+
when "Romanian"
|
621
|
+
# - Get Tab, Language, Gender
|
622
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
623
|
+
case idx
|
624
|
+
when 0,1
|
625
|
+
# response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
626
|
+
when 2
|
627
|
+
if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
628
|
+
row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
|
629
|
+
if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
|
630
|
+
option.click
|
631
|
+
blnReturn=true
|
632
|
+
sleep(3)
|
633
|
+
break
|
634
|
+
end
|
635
|
+
end
|
636
|
+
end
|
637
|
+
|
638
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
639
|
+
end
|
640
|
+
end
|
641
|
+
|
642
|
+
# - Get Sub Table information
|
643
|
+
aSubTables=['Nominative', 'Dative']
|
644
|
+
aSubTables.each do |s|
|
645
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
646
|
+
if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
647
|
+
row.find_element(:xpath => "./td[2]/div/input").clear()
|
648
|
+
row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
649
|
+
blnReturn=true
|
650
|
+
end
|
651
|
+
|
652
|
+
# subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
653
|
+
end
|
654
|
+
end
|
655
|
+
when "Spanish", "Portuguese (Brazilian)", "Dutch", "Spanish (Mexican)", "Bulgarian", "Portuguese (European)"
|
656
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
657
|
+
case idx
|
658
|
+
when 0,1
|
659
|
+
# response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
660
|
+
when 2
|
661
|
+
if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
662
|
+
row.find_elements(:xpath => "./td[2]/div/select/option").eah do |option|
|
663
|
+
if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
|
664
|
+
option.click
|
665
|
+
blnReturn=true
|
666
|
+
break
|
667
|
+
end
|
668
|
+
end
|
669
|
+
end
|
670
|
+
|
671
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
672
|
+
when 3,4
|
673
|
+
if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
674
|
+
row.find_element(:xpath => "./td[2]/div/input").clear()
|
675
|
+
row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
676
|
+
blnReturn=true
|
677
|
+
end
|
678
|
+
|
679
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
680
|
+
end
|
681
|
+
end
|
682
|
+
when "French"
|
683
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
684
|
+
case idx
|
685
|
+
when 0,1
|
686
|
+
# response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
687
|
+
when 2
|
688
|
+
if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
689
|
+
row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
|
690
|
+
if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
|
691
|
+
option.click
|
692
|
+
blnReturn=true
|
693
|
+
break
|
694
|
+
end
|
695
|
+
end
|
696
|
+
end
|
697
|
+
|
698
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
699
|
+
when 3,4
|
700
|
+
if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
701
|
+
row.find_element(:xpath => "./td[2]/div/input").clear
|
702
|
+
row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
703
|
+
blnReturn=true
|
704
|
+
end
|
705
|
+
|
706
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
707
|
+
when 5
|
708
|
+
if !((!row.find_element(:xpath => "./td[2]/input").attribute("checked").nil?).to_s == hValueSet[row.find_element(:xpath => "./td[1]/label").text].to_s)
|
709
|
+
row.find_element(:xpath => "./td[2]/input").click
|
710
|
+
blnReturn=true
|
711
|
+
end
|
712
|
+
|
713
|
+
# response[row.find_element(:xpath => "./td[1]/label").text] = !row.find_element(:xpath => "./td[2]/input").attribute("checked").nil?
|
714
|
+
end
|
715
|
+
end
|
716
|
+
when "Italian"
|
717
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
718
|
+
case idx
|
719
|
+
when 0,1
|
720
|
+
# response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
721
|
+
when 2
|
722
|
+
if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
723
|
+
row.find_elements(:xpath => "./td[2]/div/select/option]").each do |option|
|
724
|
+
if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
|
725
|
+
option.click
|
726
|
+
blnReturn=true
|
727
|
+
break
|
728
|
+
end
|
729
|
+
end
|
730
|
+
end
|
731
|
+
|
732
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
733
|
+
when 3,4
|
734
|
+
if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
735
|
+
row.find_element(:xpath => "./td[2]/div/input").clear()
|
736
|
+
row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
737
|
+
blnReturn=true
|
738
|
+
end
|
739
|
+
|
740
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
741
|
+
when 5
|
742
|
+
if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
743
|
+
row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
|
744
|
+
if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
|
745
|
+
option.click
|
746
|
+
blnReturn=true
|
747
|
+
break
|
748
|
+
end
|
749
|
+
end
|
750
|
+
end
|
751
|
+
|
752
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
753
|
+
end
|
754
|
+
end
|
755
|
+
when "Japanese", "Korean", "Chinese (Traditional)", "Chinese (Simplified)", "Thai", "Vietnamese"
|
756
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
757
|
+
case idx
|
758
|
+
when 0,1
|
759
|
+
# response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
760
|
+
when 2
|
761
|
+
if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
762
|
+
row.find_element(:xpath => "./td[2]/div/input").clear()
|
763
|
+
row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
764
|
+
blnReturn=true
|
765
|
+
end
|
766
|
+
|
767
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
768
|
+
end
|
769
|
+
end
|
770
|
+
when "Swedish", "Danish", "Norwegian", "Hebrew", "Arabic"
|
771
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
772
|
+
case idx
|
773
|
+
when 0,1
|
774
|
+
# response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
775
|
+
when 2
|
776
|
+
if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
777
|
+
row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
|
778
|
+
if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
|
779
|
+
option.click
|
780
|
+
blnReturn=true
|
781
|
+
break
|
782
|
+
end
|
783
|
+
end
|
784
|
+
end
|
785
|
+
|
786
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
787
|
+
else
|
788
|
+
if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
789
|
+
row.find_element(:xpath => "./td[2]/div/input").clear()
|
790
|
+
row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
791
|
+
blnReturn=true
|
792
|
+
end
|
793
|
+
|
794
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
795
|
+
end
|
796
|
+
end
|
797
|
+
when "Finnish"
|
798
|
+
# - Get Tab, Language
|
799
|
+
# get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
800
|
+
# case idx
|
801
|
+
# when 0,1
|
802
|
+
# response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
803
|
+
# end
|
804
|
+
# break if idx > 1
|
805
|
+
# end
|
806
|
+
|
807
|
+
# - Get Sub section information
|
808
|
+
aSubTables=['Nominative', 'Genitive', 'Inessive', 'Elative', 'Illative', 'Adessive', 'Ablative', 'Allative', 'Essive', 'Translative', 'Partitive']
|
809
|
+
aSubTables.each do |s|
|
810
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
811
|
+
if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
812
|
+
row.find_element(:xpath => "./td[2]/div/input").clear()
|
813
|
+
row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
814
|
+
blnReturn=true
|
815
|
+
end
|
816
|
+
|
817
|
+
# subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
818
|
+
end
|
819
|
+
end
|
820
|
+
when "Russian"
|
821
|
+
# - Get Tab, Language, Gender
|
822
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
823
|
+
case idx
|
824
|
+
when 0,1
|
825
|
+
# response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
826
|
+
when 2
|
827
|
+
if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
828
|
+
row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
|
829
|
+
if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
|
830
|
+
option.click
|
831
|
+
blnReturn=true
|
832
|
+
break
|
833
|
+
end
|
834
|
+
end
|
835
|
+
end
|
836
|
+
|
837
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
838
|
+
end
|
839
|
+
end
|
840
|
+
|
841
|
+
# - Get Sub section information
|
842
|
+
aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative', 'Instrumental', 'Prepositional']
|
843
|
+
aSubTables.each do |s|
|
844
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
845
|
+
if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
846
|
+
row.find_element(:xpath => "./td[2]/div/input").clear()
|
847
|
+
row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
848
|
+
blnReturn=true
|
849
|
+
end
|
850
|
+
|
851
|
+
# subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
852
|
+
end
|
853
|
+
end
|
854
|
+
when "Hungarian"
|
855
|
+
# - Get Tab, Language
|
856
|
+
# get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
857
|
+
# case idx
|
858
|
+
# when 0,1
|
859
|
+
# response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
860
|
+
# end
|
861
|
+
# break if idx > 1
|
862
|
+
# end
|
863
|
+
|
864
|
+
# - Get Sub section information
|
865
|
+
aSubTables=['Nominative', 'Accusative', 'Dative', 'Inessive', 'Elative', 'Illative', 'Ablative', 'Allative', 'Translative', 'Instrumental', 'Sublative', 'Superessive', 'Delative', 'Causal-Final', 'Essive-Formal', 'Terminative']
|
866
|
+
aSubTables.each do |s|
|
867
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
868
|
+
if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
869
|
+
row.find_element(:xpath => "./td[2]/div/input").clear()
|
870
|
+
row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
871
|
+
blnReturn=true
|
872
|
+
end
|
873
|
+
|
874
|
+
# subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
875
|
+
end
|
876
|
+
end
|
877
|
+
|
878
|
+
# - Get final Sub section information that has checkbox in the last row
|
879
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable('Distributive').each_with_index do |row, idx|
|
880
|
+
if idx < 6
|
881
|
+
if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet['Distributive'][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
882
|
+
row.find_element(:xpath => "./td[2]/div/input").clear()
|
883
|
+
row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet['Distributive'][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
884
|
+
blnReturn=true
|
885
|
+
end
|
886
|
+
|
887
|
+
# subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
888
|
+
else
|
889
|
+
if !((!row.find_element(:xpath => "./td[2]/input").attribute("checked").nil?).to_s == hValueSet['Distributive'][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")].to_s)
|
890
|
+
row.find_element(:xpath => "./td[2]/input").click
|
891
|
+
blnReturn=true
|
892
|
+
end
|
893
|
+
|
894
|
+
# subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = !row.find_element(:xpath => "./td[2]/input").attribute("checked").nil?
|
895
|
+
end
|
896
|
+
end
|
897
|
+
when "Polish", "Czech", "Ukrainian", "Slovene"
|
898
|
+
# - Get Tab, Language, Gender
|
899
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
900
|
+
case idx
|
901
|
+
when 0,1
|
902
|
+
# response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
903
|
+
when 2
|
904
|
+
if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
905
|
+
row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
|
906
|
+
if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
|
907
|
+
option.click
|
908
|
+
blnReturn=true
|
909
|
+
break
|
910
|
+
end
|
911
|
+
end
|
912
|
+
end
|
913
|
+
|
914
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
915
|
+
end
|
916
|
+
end
|
917
|
+
|
918
|
+
# - Get Sub section information
|
919
|
+
aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative', 'Instrumental', 'Locative', 'Vocative']
|
920
|
+
aSubTables.each do |s|
|
921
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
922
|
+
if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
923
|
+
row.find_element(:xpath => "./td[2]/div/input").clear()
|
924
|
+
row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
925
|
+
blnReturn=true
|
926
|
+
end
|
927
|
+
|
928
|
+
# subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
929
|
+
end
|
930
|
+
end
|
931
|
+
when "Turkish"
|
932
|
+
# - Get Tab, Language
|
933
|
+
# get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
934
|
+
# case idx
|
935
|
+
# when 0,1
|
936
|
+
# response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
937
|
+
# end
|
938
|
+
# break if idx > 1
|
939
|
+
# end
|
940
|
+
|
941
|
+
# - Get Sub section information
|
942
|
+
aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative', 'Ablative', 'Locative']
|
943
|
+
aSubTables.each do |s|
|
944
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
945
|
+
if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
946
|
+
row.find_element(:xpath => "./td[2]/div/input").clear()
|
947
|
+
row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
948
|
+
blnReturn=true
|
949
|
+
end
|
950
|
+
|
951
|
+
# subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
952
|
+
end
|
953
|
+
end
|
954
|
+
when "Greek"
|
955
|
+
# - Get Tab, Language, Gender
|
956
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
957
|
+
case idx
|
958
|
+
when 0,1
|
959
|
+
# response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
960
|
+
when 2
|
961
|
+
if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
962
|
+
row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
|
963
|
+
if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
|
964
|
+
option.click
|
965
|
+
blnReturn=true
|
966
|
+
break
|
967
|
+
end
|
968
|
+
end
|
969
|
+
end
|
970
|
+
|
971
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
972
|
+
end
|
973
|
+
end
|
974
|
+
|
975
|
+
# - Get Sub section information
|
976
|
+
aSubTables=['Nominative', 'Accusative', 'Genitive', 'Vocative']
|
977
|
+
aSubTables.each do |s|
|
978
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
979
|
+
if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
980
|
+
row.find_element(:xpath => "./td[2]/div/input").clear()
|
981
|
+
row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
982
|
+
blnReturn=true
|
983
|
+
end
|
984
|
+
|
985
|
+
# subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
986
|
+
end
|
987
|
+
end
|
988
|
+
when "Slovak", "Croatian"
|
989
|
+
# - Get Tab, Language, Gender
|
990
|
+
get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
|
991
|
+
case idx
|
992
|
+
when 0,1
|
993
|
+
# response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
|
994
|
+
when 2
|
995
|
+
if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
996
|
+
row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
|
997
|
+
if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
|
998
|
+
option.click
|
999
|
+
blnReturn=true
|
1000
|
+
break
|
1001
|
+
end
|
1002
|
+
end
|
1003
|
+
end
|
1004
|
+
|
1005
|
+
# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
|
1006
|
+
end
|
1007
|
+
end
|
1008
|
+
|
1009
|
+
# - Get Sub section information
|
1010
|
+
aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative', 'Instrumental', 'Locative']
|
1011
|
+
aSubTables.each do |s|
|
1012
|
+
get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
|
1013
|
+
if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
1014
|
+
row.find_element(:xpath => "./td[2]/div/input").clear()
|
1015
|
+
row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
|
1016
|
+
blnReturn=true
|
1017
|
+
end
|
1018
|
+
|
1019
|
+
# subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
|
1020
|
+
end
|
1021
|
+
end
|
1022
|
+
end
|
1023
|
+
|
1024
|
+
# -- Click Next to get to Step 2
|
1025
|
+
click_Btn_RenameTabslabels_Next
|
1026
|
+
|
1027
|
+
# -- Step 2 of 2
|
1028
|
+
# --- Standard Field Labels Table
|
1029
|
+
@driver.manage.timeouts.implicit_wait = 0
|
1030
|
+
aStep2Headers=[]
|
1031
|
+
iStep2HeaderCount=0
|
1032
|
+
iTableCount=1
|
1033
|
+
srowFieldLabel=''
|
1034
|
+
sTableType=''
|
1035
|
+
|
1036
|
+
while iTableCount < 3
|
1037
|
+
if iTableCount == 1
|
1038
|
+
aTable=get_RenameTabsLabels_StandardTable_Step2_StandardField
|
1039
|
+
sTableType='Standard Field Labels'
|
1040
|
+
else
|
1041
|
+
aTable=get_RenameTabsLabels_StandardTable_Step2_OtherLabels
|
1042
|
+
sTableType='Other Labels'
|
1043
|
+
end
|
1044
|
+
|
1045
|
+
aTable.each_with_index do |row, idx|
|
1046
|
+
if idx == 0
|
1047
|
+
iStep2HeaderCount = row.find_elements(:xpath => "./th").length
|
1048
|
+
row.find_elements(:xpath => "./th").each do |subrow|
|
1049
|
+
aStep2Headers.push(subrow.text)
|
1050
|
+
end
|
1051
|
+
else
|
1052
|
+
case iStep2HeaderCount
|
1053
|
+
when 2
|
1054
|
+
# - Find countries that have only two Step 2 Header Columns
|
1055
|
+
if row.find_elements(:xpath => "./td[1]//*").size > 0
|
1056
|
+
if !(row.find_element(:xpath => "./td[1]/input").attribute("value") == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[1]])
|
1057
|
+
row.find_element(:xpath => "./td[1]/input").clear()
|
1058
|
+
row.find_element(:xpath => "./td[1]/input").send_keys(hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[1]])
|
1059
|
+
blnReturn=true
|
1060
|
+
end
|
1061
|
+
end
|
1062
|
+
|
1063
|
+
# srowFieldLabel=row.find_element(:xpath => "./th").text
|
1064
|
+
# hStep2SubRowResp[aStep2Headers[1]]=row.find_element(:xpath => "./td[1]/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
|
1065
|
+
when 3
|
1066
|
+
# - Find countries that have only three Step 3 Header Columns
|
1067
|
+
if row.find_elements(:xpath => "./td[1]//*").size > 0
|
1068
|
+
if !(row.find_element(:xpath => "./td[1]/input").attribute("value") == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[1]])
|
1069
|
+
row.find_element(:xpath => "./td[1]/input").clear()
|
1070
|
+
row.find_element(:xpath => "./td[1]/input").send_keys(hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[1]])
|
1071
|
+
blnReturn=true
|
1072
|
+
end
|
1073
|
+
end
|
1074
|
+
|
1075
|
+
if row.find_elements(:xpath => "./td[2]//*").size > 0
|
1076
|
+
if !(row.find_element(:xpath => "./td[2]/input").attribute("value") == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[2]])
|
1077
|
+
row.find_element(:xpath => "./td[2]/input").clear()
|
1078
|
+
row.find_element(:xpath => "./td[2]/input").send_keys(hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[2]])
|
1079
|
+
end
|
1080
|
+
end
|
1081
|
+
|
1082
|
+
# srowFieldLabel=row.find_element(:xpath => "./th").text
|
1083
|
+
# hStep2SubRowResp[aStep2Headers[1]]=row.find_element(:xpath => "./td[1]/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
|
1084
|
+
# hStep2SubRowResp[aStep2Headers[2]]=row.find_element(:xpath => "./td[2]/input").attribute("value") unless row.find_elements(:xpath => "./td[2]//*").size == 0
|
1085
|
+
when 4
|
1086
|
+
# - Find countries that have only four Step 4 Header Columns
|
1087
|
+
if row.find_elements(:xpath => "./td[1]//*").size > 0
|
1088
|
+
if !(row.find_element(:xpath => "./td[1]/input").attribute("value") == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[1]])
|
1089
|
+
row.find_element(:xpath => "./td[1]/input").clear()
|
1090
|
+
row.find_element(:xpath => "./td[1]/input").send_keys(hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[1]])
|
1091
|
+
blnReturn=true
|
1092
|
+
end
|
1093
|
+
end
|
1094
|
+
|
1095
|
+
if row.find_elements(:xpath => "./td[2]//*").size > 0
|
1096
|
+
if !(row.find_element(:xpath => "./td[2]/input").attribute("value") == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[2]])
|
1097
|
+
row.find_element(:xpath => "./td[2]/input").clear()
|
1098
|
+
row.find_element(:xpath => "./td[2]/input").send_keys(hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[2]])
|
1099
|
+
blnReturn=true
|
1100
|
+
end
|
1101
|
+
end
|
1102
|
+
|
1103
|
+
if row.find_element(:xpath => "./td[3]").attribute("class") == " dataCell booleanColumn"
|
1104
|
+
# - get checkbox value
|
1105
|
+
if !((!row.find_element(:xpath => "./td[3]/input").attribute("checked").nil?).to_s == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[3]].to_s)
|
1106
|
+
row.find_element(:xpath => "./td[3]/input").click
|
1107
|
+
blnReturn=true
|
1108
|
+
end
|
1109
|
+
# hStep2SubRowResp[aStep2Headers[3]] = !row.find_element(:xpath => "./td[3]/input").attribute("checked").nil?
|
1110
|
+
else
|
1111
|
+
# - Get gender value
|
1112
|
+
if row.find_elements(:xpath => "./td[3]//*").size > 0
|
1113
|
+
if !(row.find_element(:xpath => "./td[3]/select/option[@selected='selected']").text == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[3]])
|
1114
|
+
row.find_elements(:xpath => "./td[3]/select/option").each do |option|
|
1115
|
+
if option.text == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[3]]
|
1116
|
+
option.click
|
1117
|
+
blnReturn=true
|
1118
|
+
break
|
1119
|
+
end
|
1120
|
+
end
|
1121
|
+
end
|
1122
|
+
end
|
1123
|
+
# hStep2SubRowResp[aStep2Headers[3]] = row.find_element(:xpath => "./td[3]/select/option[@selected='selected']").text unless row.find_elements(:xpath => "./td[3]//*").size == 0
|
1124
|
+
end
|
1125
|
+
|
1126
|
+
# srowFieldLabel=row.find_element(:xpath => "./th").text
|
1127
|
+
# hStep2SubRowResp[aStep2Headers[1]]=row.find_element(:xpath => "./td[1]/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
|
1128
|
+
# hStep2SubRowResp[aStep2Headers[2]]=row.find_element(:xpath => "./td[2]/input").attribute("value") unless row.find_elements(:xpath => "./td[2]//*").size == 0
|
1129
|
+
# if row.find_element(:xpath => "./td[3]").attribute("class") == " dataCell booleanColumn"
|
1130
|
+
# # - get checkbox value
|
1131
|
+
# hStep2SubRowResp[aStep2Headers[3]] = !row.find_element(:xpath => "./td[3]/input").attribute("checked").nil?
|
1132
|
+
# else
|
1133
|
+
# # - Get gender value
|
1134
|
+
# hStep2SubRowResp[aStep2Headers[3]] = row.find_element(:xpath => "./td[3]/select/option[@selected='selected']").text unless row.find_elements(:xpath => "./td[3]//*").size == 0
|
1135
|
+
# end
|
1136
|
+
when 5
|
1137
|
+
# - Find countries that have only five Step 5 Header Columns
|
1138
|
+
# - ############################## HERE ##############################
|
1139
|
+
if row.find_elements(:xpath => "./td[1]//*").size > 0
|
1140
|
+
if !(row.find_element(:xpath => "./td[1]/input").attribute("value") == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[1]])
|
1141
|
+
row.find_element(:xpath => "./td[1]/input").clear()
|
1142
|
+
row.find_element(:xpath => "./td[1]/input").send_keys(hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[1]])
|
1143
|
+
blnReturn=true
|
1144
|
+
end
|
1145
|
+
end
|
1146
|
+
|
1147
|
+
if row.find_elements(:xpath => "./td[2]//*").size > 0
|
1148
|
+
if !(row.find_element(:xpath => "./td[2]/input").attribute("value") == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[2]])
|
1149
|
+
row.find_element(:xpath => "./td[2]/input").clear()
|
1150
|
+
row.find_element(:xpath => "./td[2]/input").send_keys(hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[2]])
|
1151
|
+
blnReturn=true
|
1152
|
+
end
|
1153
|
+
end
|
1154
|
+
|
1155
|
+
if row.find_elements(:xpath => "./td[3]//*").size > 0
|
1156
|
+
if !(row.find_element(:xpath => "./td[3]/select/option[@selected='selected']").text == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[3]])
|
1157
|
+
row.find_elements(:xpath => "./td[3]/select/option").each do |option|
|
1158
|
+
if option.text == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[3]]
|
1159
|
+
option.click
|
1160
|
+
blnReturn=true
|
1161
|
+
break
|
1162
|
+
end
|
1163
|
+
end
|
1164
|
+
end
|
1165
|
+
end
|
1166
|
+
|
1167
|
+
if row.find_element(:xpath => "./td[4]").attribute("class") == " dataCell booleanColumn"
|
1168
|
+
# - get checkbox value
|
1169
|
+
if !((!row.find_element(:xpath => "./td[4]/input").attribute("checked").nil? ).to_s == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[4]].to_s)
|
1170
|
+
row.find_element(:xpath => "./td[4]/input").click
|
1171
|
+
blnReturn=true
|
1172
|
+
end
|
1173
|
+
# hStep2SubRowResp[aStep2Headers[4]] = !row.find_element(:xpath => "./td[4]/input").attribute("checked").nil?
|
1174
|
+
else
|
1175
|
+
# - Get gender value
|
1176
|
+
if row.find_elements(:xpath => "./td[4]//*").size > 0
|
1177
|
+
if !(row.find_element(:xpath => "./td[4]/select/option[@selected='selected']").text == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[4]])
|
1178
|
+
row.find_elements(:xpath => "./td[4]/select/option").each do |option|
|
1179
|
+
if option.text == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[4]]
|
1180
|
+
option.click
|
1181
|
+
blnReturn=true
|
1182
|
+
break
|
1183
|
+
end
|
1184
|
+
end
|
1185
|
+
end
|
1186
|
+
end
|
1187
|
+
# hStep2SubRowResp[aStep2Headers[4]] = row.find_element(:xpath => "./td[4]/select/option[@selected='selected']").text unless row.find_elements(:xpath => "./td[4]//*").size == 0
|
1188
|
+
end
|
1189
|
+
|
1190
|
+
# srowFieldLabel=row.find_element(:xpath => "./th").text
|
1191
|
+
# hStep2SubRowResp[aStep2Headers[1]]=row.find_element(:xpath => "./td[1]/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
|
1192
|
+
# hStep2SubRowResp[aStep2Headers[2]]=row.find_element(:xpath => "./td[2]/input").attribute("value") unless row.find_elements(:xpath => "./td[2]//*").size == 0
|
1193
|
+
# hStep2SubRowResp[aStep2Headers[3]]=row.find_element(:xpath => "./td[3]/select/option[@selected='selected']").text unless row.find_elements(:xpath => "./td[3]//*").size == 0
|
1194
|
+
# if row.find_element(:xpath => "./td[4]").attribute("class") == " dataCell booleanColumn"
|
1195
|
+
# # - get checkbox value
|
1196
|
+
# hStep2SubRowResp[aStep2Headers[4]] = !row.find_element(:xpath => "./td[4]/input").attribute("checked").nil?
|
1197
|
+
# else
|
1198
|
+
# # - Get gender value
|
1199
|
+
# hStep2SubRowResp[aStep2Headers[4]] = row.find_element(:xpath => "./td[4]/select/option[@selected='selected']").text unless row.find_elements(:xpath => "./td[4]//*").size == 0
|
1200
|
+
# end
|
1201
|
+
end
|
1202
|
+
end
|
1203
|
+
end
|
1204
|
+
|
1205
|
+
iTableCount +=1
|
1206
|
+
end
|
1207
|
+
|
1208
|
+
@driver.manage.timeouts.implicit_wait = @implicitWait
|
1209
|
+
|
1210
|
+
return blnReturn
|
1211
|
+
end
|
1212
|
+
# -----------------------------
|
1213
|
+
|
1214
|
+
end
|
1215
|
+
end
|