Class: SfdcSe::Driver

Inherits:
Object
  • Object
show all
Defined in:
lib/sfdc_se.rb,
lib/sfdc_se/general/general.rb,
lib/sfdc_se/pages/page_setup.rb,
lib/sfdc_se/pages/page_profiles.rb,
lib/sfdc_se/pages/page_translate.rb,
lib/sfdc_se/pages/page_emailalerts.rb,
lib/sfdc_se/pages/page_fieldupdates.rb,
lib/sfdc_se/pages/page_deliverability.rb,
lib/sfdc_se/pages/page_homepagelayouts.rb,
lib/sfdc_se/pages/page_sharingsettings.rb,
lib/sfdc_se/pages/page_renametabslabels.rb,
lib/sfdc_se/pages/page_personalinformation.rb,
lib/sfdc_se/pages/page_passwordsecuritysetting.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Driver

> :explicitWaitSec = the time out for explicit waits in secs; 30 sec default value



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/sfdc_se.rb', line 29

def initialize(opts = {})
	@browser=opts[:browserName] || 'firefox'.to_sym
	if @browser.is_a? String
		@browser.to_sym
	end

	@implicitWait=opts[:implicitWaitSec] || 30
	if !@implicitWait.is_a?(Numeric)
		@implicitWait.to_i
	end

   @explicitWait=opts[:explicitWaitSec] || 30
   if !@explicitWait.is_a?(Numeric)
     @explicitWait.to_i
   end

	@driver = Selenium::WebDriver.for @browser
	@driver.manage.window.maximize
 @driver.manage.timeouts.implicit_wait = @implicitWait
 setExplicitWait @explicitWait
 return @driver
end

Instance Method Details

#click_Btn_ChangePasswordObject


click_Btn_ChangePassword



55
56
57
# File 'lib/sfdc_se/pages/page_passwordsecuritysetting.rb', line 55

def click_Btn_ChangePassword
	@driver.find_element(:id => 'password-button').click
end

#click_Btn_Deliverability_SaveObject

click_Btn_DeliverabilitySave

> Clicks the ‘save’ button and waits for the Success text message to be displayed



12
13
14
15
16
17
# File 'lib/sfdc_se/pages/page_deliverability.rb', line 12

def click_Btn_Deliverability_Save
  # -- Clicks the 'Save' button
  @driver.find_element(:id => "thePage:theForm:editBlock:buttons:saveBtn").click
  # -- Waits for the confirmation that the save was successful
  wait.until{@driver.find_element(:id => "thePage:theForm:successText").displayed?}
end

#click_Btn_EmailAlertContinueObject


click_btn_EmailAlertContinue

> Clicks the ‘Continue’ button on the Email Alerts page



12
13
14
# File 'lib/sfdc_se/pages/page_emailalerts.rb', line 12

def click_Btn_EmailAlertContinue
	@driver.find_element(:xpath => "//input[@class='btn' and @title='Continue']").click
end

#click_btn_EmailAlertEditSaveObject


click_btn_EmailAlertEditSave

> Clicks the ‘Save’ button on the Email Alerts Edit page



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/sfdc_se/pages/page_emailalerts.rb', line 30

def click_btn_EmailAlertEditSave
  # - Click the Save button and handle Alert if prompted; always Accept.
  @driver.find_element(:xpath => "//td[@id='topButtonRow']/input[@class='btn' and @title='Save']").click
  sMsg=""
  a=@driver.switch_to.alert rescue "Exception happened"
  if !(a == "Exception happened")
    sMsg= "Accepting Alert: #{a.text}"
    a.accept
  end
  
  # - Click the 'Bread Crumb' link to return to full Email Alert List View
  @driver.find_element(:xpath => "//div[@class='ptBreadcrumb']/a").click

  # - Return Text from Alert, if present
  return sMsg
end

#click_btn_EmailAlertsEditCancelObject


click_btn_EmailAlertsEditCancel

> Clicks the ‘Cancle’ button on the Email Alerts Edit page



21
22
23
# File 'lib/sfdc_se/pages/page_emailalerts.rb', line 21

def click_btn_EmailAlertsEditCancel
	@driver.find_element(:xpath => "//td[@id='bottomButtonRow']/input[@class='btn' and @title='Cancel']").click
end

#click_btn_EmailAlertsNewObject


click_btn_EmailAlertsNew

> Clicks the ‘New Email Alert’ button on the Email Alerts page



52
53
54
# File 'lib/sfdc_se/pages/page_emailalerts.rb', line 52

def click_btn_EmailAlertsNew
  @driver.find_element(:xpath => "//input[@class='btn' and @title='New Email Alert']").click
end

#click_btn_FieldUpdatesContinueObject


click_btn_FieldUpdatesContinue

> Clicks the ‘Continue’ button on the Field Updates page



12
13
14
15
16
# File 'lib/sfdc_se/pages/page_fieldupdates.rb', line 12

def click_btn_FieldUpdatesContinue
   sleep(3)
	@driver.find_element(:xpath => "//input[@class='btn' and @title='Continue']").click
   sleep(3)
end

#click_btn_FieldUpdatesEditCancelObject


click_btn_FieldUpdatesEditCancel

> Clicks the ‘Cancel’ button on the Field Updates Edit page



23
24
25
# File 'lib/sfdc_se/pages/page_fieldupdates.rb', line 23

def click_btn_FieldUpdatesEditCancel
	@driver.find_element(:xpath => "//td[@id='bottomButtonRow']/input[@class='btn' and @title='Cancel']").click
end

#click_btn_FieldUpdatesEditNewObject


click_btn_FieldUpdatesEditNew

> Clicks the ‘New’ button on the Field Updates Edit page



32
33
34
# File 'lib/sfdc_se/pages/page_fieldupdates.rb', line 32

def click_btn_FieldUpdatesEditNew
  @driver.find_element(:xpath => "//input[@class='btn' and @title='New Field Update']").click
end

#click_btn_FieldUpdatesEditSaveObject


click_btn_FieldUpdatesEditSave

> Clicks the ‘Save’ button on the Field Updates Edit page



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/sfdc_se/pages/page_fieldupdates.rb', line 41

def click_btn_FieldUpdatesEditSave
  @driver.find_element(:xpath => "//td[@id='topButtonRow']/input[@class='btn' and @title='Save']").click

  sMsg=""
  a=@driver.switch_to.alert rescue "Exception happened"
  if !(a == "Exception happened")
    sMsg= "Accepting Alert: #{a.text}"
    a.accept
  end

  # - Click the 'Bread Crumb' link to return to full Email Alert List View
  @driver.find_element(:xpath => "//div[@class='ptBreadcrumb']/a").click

  return sMsg
end

#click_Btn_HomePageLayouts_EditAssignmentObject


click_Btn_HomePageLayouts_EditAssignment



21
22
23
24
# File 'lib/sfdc_se/pages/page_homepagelayouts.rb', line 21

def click_Btn_HomePageLayouts_EditAssignment
  @driver.find_element(:xpath => "//input[@title = 'Edit Assignment']").click
  sleep(3)
end

#click_Btn_HomePageLayouts_PageLayoutAssignmentObject


click_Btn_HomePageLayouts_PageLayoutAssignment

> Clicks the ‘Home Page Layouts’ button



13
14
15
16
# File 'lib/sfdc_se/pages/page_homepagelayouts.rb', line 13

def click_Btn_HomePageLayouts_PageLayoutAssignment
@driver.find_element(:xpath => "//input[@title='Page Layout Assignment']").click
  sleep(3)
end

#click_Btn_HomePageLayouts_saveObject


click_Btn_HomePageLayouts_save



29
30
31
32
# File 'lib/sfdc_se/pages/page_homepagelayouts.rb', line 29

def click_Btn_HomePageLayouts_save
  @driver.find_element(:xpath => "//td[@id = 'topButtonRow']/input[@title='Save']").click
  return @driver.find_element(:xpath => "//input[@title = 'Edit Assignment']").displayed?
end

#click_btn_Profiles_ApexClassAccess_AddObject

click_btn_Profiles_ApexClassAccess_Add



144
145
146
# File 'lib/sfdc_se/pages/page_profiles.rb', line 144

def click_btn_Profiles_ApexClassAccess_Add
  @driver.find_element(:xpath => "//img[@class='rightArrowIcon' and @title='Add']").click
end

#click_btn_Profiles_ApexClassAccess_CancelObject


click_btn_Profiles_ApexClassAccess_Cancel



185
186
187
# File 'lib/sfdc_se/pages/page_profiles.rb', line 185

def click_btn_Profiles_ApexClassAccess_Cancel
  @driver.find_element(:xpath => "//input[@class='btn' and @title='Cancel']").click
end

#click_btn_Profiles_ApexClassAccess_SaveObject


click_btn_Profiles_ApexClassAccess_Save



178
179
180
# File 'lib/sfdc_se/pages/page_profiles.rb', line 178

def click_btn_Profiles_ApexClassAccess_Save
  @driver.find_element(:xpath => "//input[@class='btn' and @title='Save']").click
end

#click_btn_Profiles_CancelObject


click_btn_Profiles_Cancel



137
138
139
# File 'lib/sfdc_se/pages/page_profiles.rb', line 137

def click_btn_Profiles_Cancel
  @driver.find_element(:xpath => "//input[@class='btn' and @title='Cancel']").click
end

#click_btn_Profiles_EditObject


click_btn_Profiles_Edit



114
115
116
# File 'lib/sfdc_se/pages/page_profiles.rb', line 114

def click_btn_Profiles_Edit
  @driver.find_element(:xpath => "//input[@class='btn' and @title='Edit']").click
end

#click_btn_Profiles_SaveObject


click_btn_Profiles_Save



121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/sfdc_se/pages/page_profiles.rb', line 121

def click_btn_Profiles_Save
  @driver.find_element(:xpath => "//input[@class='btn' and @title='Save']").click

  sMsg=""
  a=@driver.switch_to.alert rescue "Exception happened"
  if !(a == "Exception happened")
    sMsg= "Accepting Alert: #{a.text}"
    a.accept
  end

  return sMsg
end

#click_Btn_RenameTabslabels_CancelObject


click_Btn_RenameTabslabels_Cancel

> Clicks the ‘Cancel’ button within the Rename Tabs and Labels



149
150
151
152
# File 'lib/sfdc_se/pages/page_renametabslabels.rb', line 149

def click_Btn_RenameTabslabels_Cancel
	
  @driver.find_element(:xpath => "//div[@class='pbTopButtons']/input[@class='btnCancel']").click
end

#click_Btn_RenameTabslabels_NextObject


click_Btn_RenameTabslabels_Next

> Clicks the ‘Next’ button within the Rename Tabs and Labels



166
167
168
# File 'lib/sfdc_se/pages/page_renametabslabels.rb', line 166

def click_Btn_RenameTabslabels_Next
	@driver.find_element(:xpath => "//div[@class='pbTopButtons']/input[@class='btn' and @title='Next']").click
end

#click_Btn_RenameTabslabels_SaveObject


click_Btn_RenameTabslabels_Save

> Clicks the ‘Save’ button within the Rename Tabs and Labels



158
159
160
# File 'lib/sfdc_se/pages/page_renametabslabels.rb', line 158

def click_Btn_RenameTabslabels_Save
  @driver.find_element(:xpath => "//div[@class='pbTopButtons']/input[@class='btn' and @title='Save']").click
end

#click_Btn_SharingSettingsAccess_EditObject


click_Btn_SharingSettingsAccess_Edit

> clicks the Edit button on the Sharing Setting Access Page



36
37
38
# File 'lib/sfdc_se/pages/page_sharingsettings.rb', line 36

def click_Btn_SharingSettingsAccess_Edit
  @driver.find_element(:xpath => "//input[@title = 'Edit' and @class='btn']").click
end

#click_Btn_SharingSettingsAccess_SaveObject


click_Btn_SharingSettingsAccess_Save

> clicks the Save button on the Sharing Setting Access Page



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/sfdc_se/pages/page_sharingsettings.rb', line 45

def click_Btn_SharingSettingsAccess_Save
  sMsg=""
  @driver.find_element(:xpath => "//input[@title = 'Save' and @class='btn']").click

  a= @driver.switch_to.alert rescue "Exception happened"
  if !(a == "Exception happened")
    if a.text.include? "All sharing rules will be recalculated based on the new defaults"
      sMsg= "Accepting Alert: #{a.text}"
      a.accept
    else
      sMsg= "NOT Accepting Alert: #{a.text}"
      a.dismiss
    end
  end
  return sMsg
end

#click_Btn_SharingSettingsAccess_SavePrompt_OKObject


click_Btn_SharingSettingsAccess_SavePrompt_OK

> clicks the Save button on the Sharing Setting Access Page



67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/sfdc_se/pages/page_sharingsettings.rb', line 67

def click_Btn_SharingSettingsAccess_SavePrompt_OK
  cWindowHandle=@driver.window_handle
  puts "Current Window Handle: #{cWindowHandle}"
  puts "Open Windoes of browser: #{@driver.window_handles}"
  @driver.window_handles.each do |win|
    if !(win == cWindowHandle)
      @driver.switch_to(win)
      @driver.action.send_keys("\n").perform
      @driver.switch_to(cWindowHandle)
    end
  end
  
end

#click_btn_Translate_SaveObject


click_btn_Translate_Save



65
66
67
68
# File 'lib/sfdc_se/pages/page_translate.rb', line 65

def click_btn_Translate_Save
  @driver.find_element(:xpath => "//table[@id = 'saveBtn']/tbody/tr[2]/td[2]/em/button").click
  sleep(5)
end

#click_Continue_verifyUsernameObject


click_Continue_verifyUsername

> url = path to which the browser will navigate to



78
79
80
81
82
# File 'lib/sfdc_se.rb', line 78

def click_Continue_verifyUsername
  if @driver.find_elements(:id => 'thePage:inputForm:continue').size > 0
    @driver.find_element(:id => 'thePage:inputForm:continue').click
  end
end

#click_Create_iconObject


click_Create_icon

> Clicks the arrow icon for Create from the Setup Menu



115
116
117
# File 'lib/sfdc_se/pages/page_setup.rb', line 115

def click_Create_icon
	@driver.find_element(:id => "DevTools_icon").click if @driver.find_element(:xpath => "//div[@id='DevTools']/a/img").attribute("title").include? "Expand"
end

#click_CustomizeObject


click_Customize

> Clicks the link for Customize from the Setup Menu



69
70
71
# File 'lib/sfdc_se/pages/page_setup.rb', line 69

def click_Customize
	@driver.find_element(:link_text => "Customize").click
end

#click_Customize_iconObject


click_Customize_icon

> Clicks the arrow icon for Customize from the Setup Menu



60
61
62
# File 'lib/sfdc_se/pages/page_setup.rb', line 60

def click_Customize_icon
	@driver.find_element(:id => "Customize_icon").click if @driver.find_element(:id => "Customize").attribute("class") == "parent"
end

#click_Edit_EmailAlertsTable(sDescriptionName) ⇒ Object


click_Edit_EmailAlertsTable

> sDescriptionName = string value of the Email Alert to click Edit

> Return = true or false

> true = value was found and ‘edit’ clicked

> false =value was not found or had an error



114
115
116
117
118
119
120
121
122
123
124
# File 'lib/sfdc_se/pages/page_emailalerts.rb', line 114

def click_Edit_EmailAlertsTable(sDescriptionName)
	blnEdit=false
	get_EmailAlertsTable.each do |row|
		if row.find_element(:xpath => "./th[1]").text == sDescriptionName
			row.find_element(:xpath => "./td[1]/a[1]").click
			blnEdit=true
			break
		end
	end
	return blnEdit
end

#click_Edit_FieldUpdatesTable(sDescriptionName) ⇒ Object

click_Edit_FieldUpdatesTable

> sDescriptionName = string value of the Field Updates to click Edit

> Return = true or false

> true = value was found and ‘edit’ clicked

> false =value was not found or had an error



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/sfdc_se/pages/page_fieldupdates.rb', line 131

def click_Edit_FieldUpdatesTable(sDescriptionName)
  blnEdit=false
  aDescriptionName=sDescriptionName.split("|")
  
  r=0
  while r < get_FieldUpdatesTable.length
    if get_FieldUpdatesTable[r].find_element(:xpath => "./th[1]").text == aDescriptionName[0]
      get_FieldUpdatesTable[r].find_element(:xpath => "./td[1]/a[1]").click
      if get_FieldUpdatesEdit_IdentificationTable[1].find_element(:xpath => "./td[2]/div/input").attribute("value") == aDescriptionName[1]
        blnEdit=true
        break
      else
        click_btn_FieldUpdatesEditCancel
      end
    end
    r+=1
  end

  return blnEdit
end

#click_Edit_RenameTabsLabels(sTabName) ⇒ Object

click_Edit_RenameTabsLabels

> sTabName = string value of the Tab Name to click Edit

> Return = true or false

> true = value was found and ‘edit’ clicked

> false =value was not found or had an error



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
# File 'lib/sfdc_se/pages/page_renametabslabels.rb', line 107

def click_Edit_RenameTabsLabels(sTabName)
  blnEdit=false
  sFoundIn='empty'
  
  r=0
  puts "Standard Rows: #{get_RenameTabsLabels_StandardTable.length}"
  while r < get_RenameTabsLabels_StandardTable.length
    $stdout.flush
    print "\r#{r} of #{get_RenameTabsLabels_StandardTable.length} - Standard:: #{get_RenameTabsLabels_StandardTable[r].find_element(:xpath => "./th[1]").text}"
  	if get_RenameTabsLabels_StandardTable[r].find_element(:xpath => "./th[1]").text == sTabName
    	get_RenameTabsLabels_StandardTable[r].find_element(:xpath => "./td[1]/a[1]").click
      sleep(5)
      sFoundIn='standard'
      blnEdit=true
      break
    end
    r+=1
  end

  r=0
  puts ""
  puts "Custom Rows: #{get_RenameTabsLabels_CustomTable.length}"
  while r < get_RenameTabsLabels_CustomTable.length
    print "\r#{r} of #{get_RenameTabsLabels_CustomTable.length} - Custom:: #{get_RenameTabsLabels_CustomTable[r].find_element(:xpath => "./th[1]").text}"
    if get_RenameTabsLabels_CustomTable[r].find_element(:xpath => "./th[1]").text == sTabName
      get_RenameTabsLabels_CustomTable[r].find_element(:xpath => "./td[1]/a[1]").click
      sleep(5)
      sFoundIn='custom'
      blnEdit=true
      break
    end
    r+=1
  end

  print "\r #{blnEdit}, #{sFoundIn}"
  return blnEdit, sFoundIn
end

#click_EmailAdministration_DeliverabilityObject


click_EmailAdministration_Deliverability

> Clicks the Deliverability link under Email Administration from the Setup Menu



247
248
249
250
# File 'lib/sfdc_se/pages/page_setup.rb', line 247

def click_EmailAdministration_Deliverability
	# -- Click the 'Deliverability' from the Setup Nav Bar
	@driver.find_element(:id => 'OrgEmailSettings_font').click
end

#click_EmailAdministration_iconObject


click_EmailAdministration_icon

> Clicks the arrow icon for Email Administration from the Setup Menu



237
238
239
240
# File 'lib/sfdc_se/pages/page_setup.rb', line 237

def click_EmailAdministration_icon
 		# -- Click the 'arrow icon' for Email Administration from Setup Nav Bar
	@driver.find_element(:id => 'EmailAdmin_icon').click if @driver.find_element(:id => 'EmailAdmin').attribute("class") == "parent"
end

#click_EmailAlertsObject


click_EmailAlerts

> Clicks the link for Email Alerts from the Setup Menu



133
134
135
# File 'lib/sfdc_se/pages/page_setup.rb', line 133

def click_EmailAlerts
	@driver.find_element(:id => "WorkflowEmails_font").click
end

#click_FieldUpdatesObject


click_FieldUpdates

> Clicks the link for Field Updates from the Setup Menu



142
143
144
# File 'lib/sfdc_se/pages/page_setup.rb', line 142

def click_FieldUpdates
	@driver.find_element(:id => "WorkflowFieldUpdates_font").click
end

#click_HomeObject


click_Home

> Clicks the link for Home from the Setup Menu



87
88
89
# File 'lib/sfdc_se/pages/page_setup.rb', line 87

def click_Home
	@driver.find_element(:id => "Home_font").click
end

#click_Home_iconObject


click_Home_icon

> Clicks the arrow icon for Home from the Setup Menu



78
79
80
# File 'lib/sfdc_se/pages/page_setup.rb', line 78

def click_Home_icon
	@driver.find_element(:id => "Home_icon").click if @driver.find_element(:id => "Home").attribute("class") == "parent"
end

#click_HomePageLayoutsObject


click_HomePageLayouts

> Clicks the link for Home Page Layouts from the Setup Menu



96
97
98
# File 'lib/sfdc_se/pages/page_setup.rb', line 96

def click_HomePageLayouts
	@driver.find_element(:id => "HomePageLayouts_font").click
end

#click_ManageUsers_arrowObject


click_ManageUsers_arrow

> Clicks the arrow icon for Manage Users from the Setup Menu



208
209
210
# File 'lib/sfdc_se/pages/page_setup.rb', line 208

def click_ManageUsers_arrow
 		@driver.find_element(:id => 'Users_icon').click if @driver.find_element(:xpath => "//a[@id='Users_icon']/img").attribute("title").include? "Expand"
end

#click_Manageusers_ProfilesObject

click_Manageusers_Profiles

> Clicks the Profiles link under Manager Users from the Setup Menu



217
218
219
220
# File 'lib/sfdc_se/pages/page_setup.rb', line 217

def click_Manageusers_Profiles
 		# -- Click the 'arrow icon' for Manage Users from Setup Nav Bar
	@driver.find_element(:id => 'EnhancedProfiles_font').click
end

#click_MyPersonalInformationObject


click_MyPersonalInformation

> Clicks the link for ‘My Personal Information’ from the Setup Menu



25
26
27
# File 'lib/sfdc_se/pages/page_setup.rb', line 25

def click_MyPersonalInformation
	@driver.find_element(:id => 'PersonalInfo_font').click
end

#click_MyPersonalInformation_iconObject


click_MyPersonalInformation_icon

> Clicks the arrow icon for ‘My Personal Information’ from the Setup Menu



17
18
19
# File 'lib/sfdc_se/pages/page_setup.rb', line 17

def click_MyPersonalInformation_icon
	@driver.find_element(:id => 'PersonalInfo_icon').click if @driver.find_element(:id => 'PersonalInfo').attribute("class") == "parent"
end

#click_MyPersonalInformation_PersonalInformationObject


click_MyPersonalInformation_PersonalInformation

> Clicks the Personal Information link under My Personal Information from the Setup Menu



33
34
35
# File 'lib/sfdc_se/pages/page_setup.rb', line 33

def click_MyPersonalInformation_PersonalInformation
	@driver.find_element(:id => 'PersonalInformation_font').click
end

#click_Profiles_ApexClassAccess_EditObject


click_Profiles_ApexClassAccess_Edit

> clicks the ‘edit’ button within the Apex Class Access section



161
162
163
164
165
# File 'lib/sfdc_se/pages/page_profiles.rb', line 161

def click_Profiles_ApexClassAccess_Edit
  @driver.find_element(:xpath => "//h3[contains(.,'Enabled Apex Class Access')]/../following-sibling::td[1]/input[@class='btn' and @title='Edit']").click
  # @driver.find_element(:xpath => "//div[@class='ptBreadcrumb']/a").click
  # @wait.until{@driver.find_element(:xpath => "//input[@class='btn' and @title='New Profile']")}
end

#click_Profiles_breadcrumbObject


click_Profiles_breadcrumb

> clicks the ‘Back to List: Profiles’ Breadcrumb link



152
153
154
155
# File 'lib/sfdc_se/pages/page_profiles.rb', line 152

def click_Profiles_breadcrumb
  @driver.find_element(:xpath => "//div[@class='ptBreadcrumb']/a").click
  @wait.until{@driver.find_element(:xpath => "//input[@class='btn' and @title='New Profile']")}
end

#click_Profiles_VisualforcePageAccess_EditObject


click_Profiles_VisualforcePageAccess_Edit

> clicks the ‘edit’ button within the Visualforce Page Access section



171
172
173
# File 'lib/sfdc_se/pages/page_profiles.rb', line 171

def click_Profiles_VisualforcePageAccess_Edit
  @driver.find_element(:xpath => "//h3[contains(.,'Enabled Visualforce Page Access')]/../following-sibling::td[1]/input[@class='btn' and @title='Edit']").click
end

#click_RenameTabsLabels_TabNamesLabelsObject


click_RenameTabsLabels_TabNamesLabels

> Clicks the link for Rename Tabs and Labels from the Setup Menu



182
183
184
# File 'lib/sfdc_se/pages/page_setup.rb', line 182

def click_RenameTabsLabels_TabNamesLabels
	@driver.find_element(:id => "RenameTab_font").click
end

#click_SecurityControls_arrowObject


click_SecurityControls_arrow

> Clicks the arrow icon for Security Controls under Administrative Setup from the Setup Menu



267
268
269
# File 'lib/sfdc_se/pages/page_setup.rb', line 267

def click_SecurityControls_arrow
	@driver.find_element(:id => 'Security_icon').click if @driver.find_element(:id => 'Security').attribute("class") == "parent"
end

#click_SharingSettings_SecurityControlsObject


click_SharingSettings_SecurityControls

> Clicks the Sharing Settings link under Security Controls from the Setup Menu



276
277
278
# File 'lib/sfdc_se/pages/page_setup.rb', line 276

def click_SharingSettings_SecurityControls
	@driver.find_element(:id => 'SecuritySharing_font').click
end

#click_TabNamesLabels_arrowObject


click_TabNamesLabels_arrow

> Clicks the arrow icon for Tab Names and Labels from the Setup Menu



173
174
175
# File 'lib/sfdc_se/pages/page_setup.rb', line 173

def click_TabNamesLabels_arrow
	@driver.find_element(:id => "Tab_icon").click if @driver.find_element(:id => "Tab").attribute("class") == "parent"
end

#click_Translate_TranslationWorkbenchObject


click_Translate_TranslationWorkbench

> Clicks the Translate link under Translation Workbench from the Setup Menu



305
306
307
# File 'lib/sfdc_se/pages/page_setup.rb', line 305

def click_Translate_TranslationWorkbench
	@driver.find_element(:id => 'LabelWorkbenchTranslate_font').click
end

#click_TranslationWorkbench_arrowObject


click_TranslationWorkbench_arrow

> Clicks the arrow icon for Translations Workbench under Administrative Setup from the Setup Menu



295
296
297
298
# File 'lib/sfdc_se/pages/page_setup.rb', line 295

def click_TranslationWorkbench_arrow
	# @driver.find_element(:id => 'LabelWorkbench_icon').click if @driver.find_element(:id => 'LabelWorkbench').attribute("class") == "parent"
	@driver.find_element(:id => 'LabelWorkbench_icon').click if @driver.find_element(:xpath => "//a[@id='LabelWorkbench_icon']/img").attribute("title").include? "Expand"
end

#click_WorkflowApprovals_iconObject


click_WorkflowApprovals_icon

> Clicks the arrow icon for Workflow & Approvals from the Setup Menu



124
125
126
# File 'lib/sfdc_se/pages/page_setup.rb', line 124

def click_WorkflowApprovals_icon
	@driver.find_element(:id => "Workflow_icon").click if @driver.find_element(:xpath => "//a[@id='Workflow_icon']/img").attribute("title").include? "Expand"
end

#closeObject


close



101
102
103
# File 'lib/sfdc_se.rb', line 101

def close
	@driver.quit
end

#convert_LanguageAbbreviation(sLanguageAbbrevation) ⇒ Object


Translation Abbreviation Converter



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
# File 'lib/sfdc_se.rb', line 117

def convert_LanguageAbbreviation(sLanguageAbbrevation)
  case sLanguageAbbrevation
  when "zh_CN"
    return "Chinese (Simplified)"
  when "zh_TW"
    return "Chinese (Traditional)"
  when "da"
    return "Danish"
  when "nl_NL"
    return "Dutch"
  when "en_US"
    return "English"
  when "fi"
    return "Finnish"
  when "fr"
    return "French"
  when "de"
    return "German"
  when "it"
    return "Italian"
  when "ja"
    return "Japanese"
  when "ko"
    return "Korean"
  when "no"
    return "Norwegian"
  when "pt_BR"
    return "Portuguese (Brazilian)"
  when "ru"
    return "Russian"
  when "es"
    return "Spanish"
  when "es_MX"
    return "Spanish (Mexican)"
  when "sv"
    return "Swedish"
  when "th"
    return "Thai"
  when "ar"
    return "Arabic"
  when "bg"
    return "Bulgarian"
  when "hr"
    return "Croatian"
  when "cs"
    return "Czech"
  when "en_GB"
    return "English (UK)"
  when "el"
    return "Greek"
  when "iw"
    return "Hebrew"
  when "hu"
    return "Hungarian"
  when "in"
    return "Indonesian"
  when "pl"
    return "Polish"
  when "pt_PT"
    return "Portuguese (European)"
  when "ro"
    return "Romanian"
  when "sk"
    return "Slovak"
  when "sl"
    return "Slovene"
  when "tr"
    return "Turkish"
  when "uk"
    return "Ukrainian"
  when "vi"
    return "Vietnamese"
  end
end

#get_btn_Translate_CustomReportType_FieldLabel_NextObject


get_btn_Translate_CustomReportType_FieldLabel_Next

> returns the element for the Translate Custom Report Type - Field Label Next button



57
58
59
# File 'lib/sfdc_se/pages/page_translate.rb', line 57

def get_btn_Translate_CustomReportType_FieldLabel_Next
	return @driver.find_element(:xpath => "//table[@id='nextTextBtn']/tbody/tr[2]/td[2]/em/button")
end

#get_CurrentSelection_Devliverability_AccessLevelObject


get_CurrentSelection_AccessLevel

> returns the currently selected value



30
31
32
33
34
35
36
37
38
# File 'lib/sfdc_se/pages/page_deliverability.rb', line 30

def get_CurrentSelection_Devliverability_AccessLevel
  # -- Deliverability > Access  to Send Email > Access Level
  options=get_elements_Devliverability_AccessLevel
  options.each do |option|
    if option.selected?
      return option.text
    end
  end
end

#get_elements_Devliverability_AccessLevelObject


get_elements_AccessLevel

> returns all the elements for the Access Level dropdown



22
23
24
# File 'lib/sfdc_se/pages/page_deliverability.rb', line 22

def get_elements_Devliverability_AccessLevel
  return @driver.find_elements(:xpath => "//td[@class='data2Col  first  last ']/select/option")
end

#get_elements_HomePageLayouts_Profiles_tableObject


get_elements_HomePageLayouts_Profiles_table



37
38
39
# File 'lib/sfdc_se/pages/page_homepagelayouts.rb', line 37

def get_elements_HomePageLayouts_Profiles_table
  return @driver.find_elements(:xpath => "//table[@class='detailList']/tbody/tr")
end

#get_elements_Profiles_tableObject

get_elements_Profiles_table

> returns all the elements for the Profiles table



19
20
21
# File 'lib/sfdc_se/pages/page_profiles.rb', line 19

def get_elements_Profiles_table
  return @driver.find_elements(:xpath => "//table[@class='x-grid3-row-table']/tbody/tr")
end

#get_EmailAlert_ConfigurationObject


get_EmailAlert_Configuration

> Return = Hash Field Name/Type, Value=Field Value



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
# File 'lib/sfdc_se/pages/page_emailalerts.rb', line 131

def get_EmailAlert_Configuration
	response=Hash.new
	get_EmailAlertsEditTable.each_with_index do |row, idx|
		case idx
		when 0,1
	# 0 = Description, 1 = Uniique Name
			response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/div/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
		when 2
			# - 2 = Object
			response[row.find_element(:xpath => "./td[1]").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]").text
		when 4, 7, 8
			# - 4,7 = Blank Row, 8 = Text, no configurable item
			# - Do nothing, row not required
		when 3
			# - 3 = Email Template
			response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/div/span/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
		when 5
			# - 5 = Recipient Type
			$sSearchOpt=row.find_element(:xpath => "./td[2]/div/select/option[@selected='']").text
			$sForField=row.find_element(:xpath => "./td[2]/div/input[@id='searchValue_userFilter']").attribute("value")
			response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]="#{$sSearchOpt};#{$sForField}"
		when 6
			# - 6 = Recipents
			# - Get Selected Recipients
			$aSelected=[]
			row.find_elements(:xpath => "./td[2]/div/table/tbody/tr/td[3]/select/option").each do |sr|
				$aSelected.push(sr.text)
			end
			response[row.find_element(:xpath => "./td[1]").text.gsub("*\n", "")]=$aSelected
		when 9
			# - 9 = Additional Emails
			response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/textarea").text
		when 10
			# - 10 = From Email Address
			response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
		when 11
			# - 11 = Checkbox; Make this address the default From email address for this object's email alerts
			row.find_element(:xpath => "./td[2]/input").attribute("checked").nil? ? response[row.find_element(:xpath => "./td[2]/label").text]="false" : response[row.find_element(:xpath => "./td[2]/label").text]=row.find_element(:xpath => "./td[2]/input").attribute("checked")
			# response[row.find_element(:xpath => "./td[2]/label").text]=row.find_element(:xpath => "./td[2]/input").attribute("value")
		end
	end
	return response
end

#get_EmailAlertsEditTableObject

get_EmailAlertsEditTable

> returns all the elements for the Email Alerts Edit Table



77
78
79
# File 'lib/sfdc_se/pages/page_emailalerts.rb', line 77

def get_EmailAlertsEditTable
	return @driver.find_elements(:xpath => "//table[@class='detailList']/tbody/tr")
end

#get_EmailAlertsTableObject

get_EmailAlertsTable

> returns all the elements for the Email Alerts Table



69
70
71
# File 'lib/sfdc_se/pages/page_emailalerts.rb', line 69

def get_EmailAlertsTable
	return @driver.find_elements(:xpath => "//table[@class='list']/tbody/tr")
end

#get_EmailAlertsViewOptionsObject

get_EmailAlertsView_Options

> returns all the elements for the Email Alerts dropdown



61
62
63
# File 'lib/sfdc_se/pages/page_emailalerts.rb', line 61

def get_EmailAlertsViewOptions
	return @driver.find_elements(:xpath => "//select[@id='fcf' and @title='View:']/option")
end

#get_FieldUpdates_ConfigurationObject


get_FieldUpdates_Configuration

> Return = Hash Field Name/Type, Value=Field Value



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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/sfdc_se/pages/page_fieldupdates.rb', line 158

def get_FieldUpdates_Configuration
	response=Hash.new

	# - Get 'Identification' section of the Field Update page
	get_FieldUpdatesEdit_IdentificationTable.each_with_index do |row, idx|
		case idx
		when 0,1
			# - 0=Name, 1=Unique Name
			response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/div/input").attribute("value")
		when 2
			# - 2=Description
			response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/textarea").text
		when 3,4
			# - 3=Object, 4=Field to Update
			response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]").text
		when 5
			# - 5=Field Data Type
			response[row.find_element(:xpath => "./td[1]").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]").text
		when 6
			# - 6=Re-evaluate Workflow Rules after Field Change; Checkbox
			row.find_element(:xpath => "./td[2]/input").attribute("checked").nil? ? response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]="false" : response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/input").attribute("checked")
			# response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/input").attribute("value")
		end
	end

	# - Determine the 'Specify New Field Value' section and get configuration
	case response["Field Data Type"]
	when "Picklist"
		# - Picklist Options added to hash
		get_FieldUpdatesEdit_SpecifyNewFieldValueTable.each do |row|
			row.find_elements(:xpath => "./td[2]/ul/li").each_with_index do |radiobtns, idx|
				case idx
				when 0,1
           response[radiobtns.find_element(:xpath => "./label").text] = (!radiobtns.find_element(:xpath => "./input").attribute("checked").nil? ).to_s

					# if radiobtns.find_element(:xpath => "./input").selected?
					# 	response[row.find_element(:xpath => "./td[2]/h5").text]=radiobtns.find_element(:xpath => "./label").text
					# end
				when 2
           response[radiobtns.find_element(:xpath => "./div/label").text] = [(!radiobtns.find_element(:xpath => "./div/input").attribute("checked").nil?).to_s, radiobtns.find_element(:xpath => "./div/span/select/option[@selected='selected']").text]

					# if radiobtns.find_element(:xpath => "./div/input").selected?
					# 	response[row.find_element(:xpath => "./td[2]/h5").text]="#{radiobtns.find_element(:xpath => "./div/label").text};#{radiobtns.find_element(:xpath => "./div/span/select/option[@selected='selected']").text}"
					# end
				end
			end
		end
	when "Record Type"
		# - Record Type dropdrown added to hash
		response[get_FieldUpdatesEdit_SpecifyNewFieldValueTable[1].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=get_FieldUpdatesEdit_SpecifyNewFieldValueTable[1].find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
	when "Date/Time", "Text", "Text Area", "Date", "Currency", "Phone", "Number", "Long Text Area", "Email", "Fax"
		# - Date Options added to hash; Text Options added to hash
		get_FieldUpdatesEdit_SpecifyNewFieldValueTable.each do |row|
			row.find_elements(:xpath => "./td[2]/ul/li").each_with_index do |radiobtns, idx|
				case idx
				when 0
           response[radiobtns.find_element(:xpath => "./label").text.gsub("*\n", "")] = (!radiobtns.find_element(:xpath => "./input").attribute("checked").nil?).to_s

					# if radiobtns.find_element(:xpath => "./input").selected?
					# 	response[row.find_element(:xpath => "./td[2]/h5").text]=radiobtns.find_element(:xpath => "./label").text
					# end
				when 1
           response[radiobtns.find_element(:xpath => "./div/label").text.gsub("*\n", "")] = [(!radiobtns.find_element(:xpath => "./div/input").attribute("checked").nil?).to_s, radiobtns.find_element(:xpath => "./div/div/div[2]/table/tbody/tr/td/div/textarea").text]

					# if radiobtns.find_element(:xpath => "./div/input").selected?
					# 	response[row.find_element(:xpath => "./td[2]/h5").text]="#{radiobtns.find_element(:xpath => "./div/label").text.gsub("*\n", "")};#{radiobtns.find_element(:xpath => "./div/div/div[2]/table/tbody/tr/td/div/textarea").text}"
					# end
				end
			end
		end
	when "Checkbox"
		get_FieldUpdatesEdit_SpecifyNewFieldValueTable.each do |row|
			row.find_elements(:xpath => "./td[2]/ul/li").each_with_index do |radiobtns, idx|
         response[radiobtns.find_element(:xpath => "./label").text.gsub("*\n", "")] = (!radiobtns.find_element(:xpath => "./input").attribute("checked").nil?).to_s

				# response[row.find_element(:xpath => "./td[2]/h5").text]=radiobtns.find_element(:xpath => "./label").text.gsub("*\n", "") if radiobtns.find_element(:xpath => "./input").attribute("checked")
			end
		end
   when "Lookup"
     get_FieldUpdatesEdit_SpecifyNewFieldValueTable.each_with_index do |row, idx|
       case idx
       when 0
         # - Do nothing, blank row
       when 1
         # - Text Box (Lookup) Field
         response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/span/input").attribute("value")
       when 2
         # - Checkbox
         response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = (!row.find_element(:xpath => "./td[2]/input").attribute("checked").nil?).to_s
      end
    end
	end

	return response
end

#get_FieldUpdatesEdit_IdentificationTableObject

get_FieldUpdatesEdit_IdentificationTable

> returns all the elements for the Field Updates Edit Identification Table



70
71
72
# File 'lib/sfdc_se/pages/page_fieldupdates.rb', line 70

def get_FieldUpdatesEdit_IdentificationTable
	return @driver.find_elements(:xpath => "//h3[contains(.,'Identification')]/../following-sibling::div[1]/table/tbody/tr")
end

#get_FieldUpdatesEdit_SpecifyNewFieldValueTableObject

get_FieldUpdatesEdit_SpecifyNewFieldValueTable

> returns all the elements for the Field Updates Edit Specify New Field Value Table



78
79
80
# File 'lib/sfdc_se/pages/page_fieldupdates.rb', line 78

def get_FieldUpdatesEdit_SpecifyNewFieldValueTable
	return @driver.find_elements(:xpath => "//h3[contains(.,'Specify New Field Value')]/../following-sibling::div[1]/table/tbody/tr")
end

#get_FieldUpdatesTableObject

get_FieldUpdatesTable

> returns all the elements for the Field Updates Table



86
87
88
# File 'lib/sfdc_se/pages/page_fieldupdates.rb', line 86

def get_FieldUpdatesTable
	return @driver.find_elements(:xpath => "//table[@class='list']/tbody/tr")
end

#get_FieldUpdatesViewOptionsObject

get_FieldUpdatesViewOptions

> returns all the elements for the Field Updates dropdown



62
63
64
# File 'lib/sfdc_se/pages/page_fieldupdates.rb', line 62

def get_FieldUpdatesViewOptions
	return @driver.find_elements(:xpath => "//select[@id='fcf' and @title='View:']/option")
end

#get_HomePageLayouts_Profile_AssignmentsObject


get_HomePageLayouts_Profile_Assignments

> Returns a hash; Key = Profile Name, Value = Page Layout Assignment



45
46
47
48
49
50
51
# File 'lib/sfdc_se/pages/page_homepagelayouts.rb', line 45

def get_HomePageLayouts_Profile_Assignments
  hProfiles=Hash.new
  get_elements_HomePageLayouts_Profiles_table.each do |row|
    hProfiles[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
  end
  return hProfiles
end

#get_LocaleSidKey(blnSandbox, sUserName, sPassword) ⇒ Object

get_LocaleSidKey(blnSandbox, sUserName, sPassword)

> Returns the Org LocaleSidKey



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/sfdc_se/general/general.rb', line 30

def get_LocaleSidKey(blnSandbox, sUserName, sPassword)

  ENV['http_proxy']='http://webproxy.merck.com:8080'
  ENV['https_proxy']='https://webproxy.merck.com:8080'

	client=restforce_client({:sandbox => blnSandbox, :username => sUserName, :password => sPassword})
	resp_SOQL=client.query("SELECT LocaleSidKey FROM User WHERE Username = '#{sUserName}'")
	if resp_SOQL.size == 1
		resp_SOQL.each do |r|
			return r['LocaleSidKey']
		end
	end

  ENV.delete('HTTP_PROXY')
  ENV.delete('HTTPS_PROXY')
end

#get_PersonalInformation_usernameObject


get_PersonalInformation_username

> Returns the Username value



13
14
15
# File 'lib/sfdc_se/pages/page_personalinformation.rb', line 13

def get_PersonalInformation_username
  return @driver.find_element(:xpath => "//table[@class='detailList']/tbody/tr[4]/td[2]").text
end

#get_Profile_VisualforcePageAccess_EnabledSelectObject

get_Profile_VisualforcePageAccess_EnabledSelect

> returns all the options for the Availalble Apex Classes



106
107
108
# File 'lib/sfdc_se/pages/page_profiles.rb', line 106

def get_Profile_VisualforcePageAccess_EnabledSelect
    return @driver.find_elements(:xpath => "//select[@id='duel_select_1']/option")
end

#get_Profiles_AdministrativePermissionsObject

get_Profiles_AdministrativePermissions

> Returns a hash; Key = Permission Name, Value = Checked/Unchecked



244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/sfdc_se/pages/page_profiles.rb', line 244

def get_Profiles_AdministrativePermissions
	begin
		@aPAP=Hash.new
     if get_Profiles_CustomProfile_CheckboxValue
 			get_Profiles_AdministrativePermissions_table.each do |i|
 				@aPAP[i.find_element(:xpath => "./td[1]").text]=i.find_element(:xpath => "./td[2]/img").attribute("alt")
 				@aPAP[i.find_element(:xpath => "./td[3]").text]=i.find_element(:xpath => "./td[4]/img").attribute("alt") unless i.find_element(:xpath => "./td[3]").attribute("class") == "labelCol last empty"
 			end
     end
		return @aPAP
	rescue
		puts $!
    puts $@
	end
end

#get_Profiles_AdministrativePermissions_tableObject


get_Profiles_AdministrativePermissions_table

> returns all the elements for the Profiles Administravite Permissions table



27
28
29
# File 'lib/sfdc_se/pages/page_profiles.rb', line 27

def get_Profiles_AdministrativePermissions_table
   	return @driver.find_elements(:xpath => "//h3[contains(.,'Administrative Permissions')]/../following-sibling::div[1]/table/tbody/tr")
end

#get_Profiles_ApexClassAccessObject


get_Profiles_ApexClassAccess

> Returns an Array; [ApexClassAccess1, ApexClassAccess2]



656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
# File 'lib/sfdc_se/pages/page_profiles.rb', line 656

def get_Profiles_ApexClassAccess
  @driver.manage.timeouts.implicit_wait = 0
  begin
    aResponse=[]
    if get_Profiles_CustomProfile_CheckboxValue
      puts "Apex Class Access Row Count: #{get_Profiles_ApexClassAccess_table.size}"
      get_Profiles_ApexClassAccess_table.each do |row|
        # puts "Row Class Value: #{row.attribute("class")}"
        aResponse.push(row.find_element(:xpath => "./th[1]/a").text) unless row.attribute('class')=='headerRow'
      end
    end

    @driver.manage.timeouts.implicit_wait = @implicitWait
    return aResponse
  rescue
    puts $!
    puts $@
  ensure
    @driver.manage.timeouts.implicit_wait = @implicitWait
  end
end

#get_Profiles_ApexClassAccess_AvailableSelectObject

get_Profiles_ApexClassAccess_AvailableSelect

> returns all the options for the Availalble Apex Classes



98
99
100
# File 'lib/sfdc_se/pages/page_profiles.rb', line 98

def get_Profiles_ApexClassAccess_AvailableSelect
    return @driver.find_elements(:xpath => "//select[@id='duel_select_0']/option")
end

#get_Profiles_ApexClassAccess_tableObject

get_Profiles_ApexClassAccess_table

> returns all the elements for the Profiles Apex Class Access table



82
83
84
# File 'lib/sfdc_se/pages/page_profiles.rb', line 82

def get_Profiles_ApexClassAccess_table
    return @driver.find_elements(:xpath => "//h3[contains(.,'Enabled Apex Class Access')]/../../../../../following-sibling::div[1]/table/tbody/tr")
end

#get_Profiles_CustomObjectPermissionsObject


get_Profiles_CustomObjectPermissions

> Returns an Nested Hash; Name =>{Key = Header Name, Value = Checked/Unchecked}



544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
# File 'lib/sfdc_se/pages/page_profiles.rb', line 544

def get_Profiles_CustomObjectPermissions
  @driver.manage.timeouts.implicit_wait = 0
  begin
    @aCOP_Headers=[]
    response_hash = Hash.new {|h,k| h[k] = Hash.new(&h.default_proc) }
    
    if get_Profiles_CustomProfile_CheckboxValue
      get_Profiles_CustomObjectPermissions_table.each_with_index do |row, index|
        if index == 0
          row.find_elements(:xpath => "./td[2]/table/tbody/tr[2]/th").each do |header|
            @aCOP_Headers.push(header.text.strip! || header.text)
          end
        else
          # -- Left Column of Table
          $tempObjectName_Left=row.find_element(:xpath => "./th[1]").text
          row.find_elements(:xpath => "./td[1]/table/tbody/tr/td").each_with_index do |hv, idx|
            # puts "Main Table Index: #{index}; Left Column Index: #{idx}"
            print "\rMain Table Index: #{index}; Left Column Index: #{idx}"
            response_hash[$tempObjectName_Left][@aCOP_Headers[idx]]=hv.find_element(:xpath => "./img").attribute("alt") unless hv.find_elements(:xpath => ".//*").size == 0
          end
          
          # -- Right Column of Table
          if row.find_element(:xpath => "./td[2]").attribute("class") != "labelCol last empty"
            $tempObjectName_Right=row.find_element(:xpath => "./th[2]").text
            row.find_elements(:xpath => "./td[2]/table/tbody/tr/td").each_with_index do |hv, idx|
              if hv.find_elements(:xpath => ".//*").size != 0
                # puts "Main Table Index: #{index}; Right Column Index: #{idx}"
                print "\rMain Table Index: #{index}; Right Column Index: #{idx}"
                response_hash[$tempObjectName_Right][@aCOP_Headers[idx]]=hv.find_element(:xpath => "./img").attribute("alt") #unless hv.find_elements(:xpath => ".//*").size == 0
              end
            end
          end
        end
      end
    end
    @driver.manage.timeouts.implicit_wait = @implicitWait
    return response_hash
  rescue
    puts $!
    puts $@
  ensure
    puts " "
    @driver.manage.timeouts.implicit_wait = @implicitWait
  end
end

#get_Profiles_CustomObjectPermissions_tableObject

get_Profiles_CusomObjectPermissions_table

> returns all the elements for the Profiles Custom Object Permissions table



51
52
53
# File 'lib/sfdc_se/pages/page_profiles.rb', line 51

def get_Profiles_CustomObjectPermissions_table
    return @driver.find_elements(:xpath => "//h3[contains(.,'Custom Object Permissions')]/../following-sibling::div[1]/table/tbody/tr")
end

#get_Profiles_CustomProfile_CheckboxValueObject


get_Profiles_CustomProfile_CheckboxValue

> Returns true/false

True = Custom Profile Checkbox is checked
False = Custom Profile Checkbox is NOT checked


74
75
76
# File 'lib/sfdc_se/pages/page_profiles.rb', line 74

def get_Profiles_CustomProfile_CheckboxValue
  return @driver.find_element(:xpath => "//td[contains(.,'Custom Profile')]/following-sibling::td/img").attribute("title")=='Checked' ? true : false
end

#get_Profiles_GeneralUserPermissionsObject

get_Profiles_GeneralUserPermissions

> Returns a hash; Key = Permission Name, Value = Checked/Unchecked



301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# File 'lib/sfdc_se/pages/page_profiles.rb', line 301

def get_Profiles_GeneralUserPermissions
	begin
		@aConfig=Hash.new
     if get_Profiles_CustomProfile_CheckboxValue
 			get_Profiles_GeneralUserPermissions_table.each do |row|
 				@aConfig[row.find_element(:xpath => "./td[1]").text]=row.find_element(:xpath => "./td[2]/img").attribute("alt")
 				@aConfig[row.find_element(:xpath => "./td[3]").text]=row.find_element(:xpath => "./td[4]/img").attribute("alt") unless row.find_element(:xpath => "./td[3]").attribute("class") == "labelCol last empty"
 			end
     end
		return @aConfig
	rescue
		puts $!
    puts $@
	end
end

#get_Profiles_GeneralUserPermissions_tableObject

get_Profiles_GeneralUserPermissions_table

> returns all the elements for the Profiles General User Permissions table



35
36
37
# File 'lib/sfdc_se/pages/page_profiles.rb', line 35

def get_Profiles_GeneralUserPermissions_table
   	return @driver.find_elements(:xpath => "//h3[contains(.,'General User Permissions')]/../following-sibling::div[1]/table/tbody/tr")
end

#get_Profiles_StandardObjectPermissionsObject

get_Profiles_StandardObjectPermissions

> Returns an Nested Hash; Name =>{Key = Header Name, Value = Checked/Unchecked}



437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
# File 'lib/sfdc_se/pages/page_profiles.rb', line 437

def get_Profiles_StandardObjectPermissions
	@driver.manage.timeouts.implicit_wait = 0
   begin
		@aSOP_Headers=[]
		response_hash = Hash.new {|h,k| h[k] = Hash.new(&h.default_proc) }
		
     if get_Profiles_CustomProfile_CheckboxValue
 			get_Profiles_StandardObjectPermissions_table.each_with_index do |row, index|
 				if index == 0
 					row.find_elements(:xpath => "./td[2]/table/tbody/tr[2]/th").each do |header|
 						@aSOP_Headers.push(header.text.strip! || header.text)
 					end
 				else
  				# -- Left Column of Table
           $tempObjectName_Left=row.find_element(:xpath => "./th[1]").text
  				row.find_elements(:xpath => "./td[1]/table/tbody/tr/td").each_with_index do |hv, idx|
  					response_hash[$tempObjectName_Left][@aSOP_Headers[idx]]=hv.find_element(:xpath => "./img").attribute("alt") unless hv.find_elements(:xpath => ".//*").size == 0
  				end
  				
  				# -- Right Column of Table
           if row.find_element(:xpath => "./td[2]").attribute("class") != "labelCol last empty"
             $tempObjectName_Right=row.find_element(:xpath => "./th[2]").text
             row.find_elements(:xpath => "./td[2]/table/tbody/tr/td").each_with_index do |hv, idx|
               if hv.find_elements(:xpath => ".//*").size != 0
                 response_hash[$tempObjectName_Right][@aSOP_Headers[idx]]=hv.find_element(:xpath => "./img").attribute("alt") unless hv.find_elements(:xpath => ".//*").size == 0
               end
             end
           end
  			end
 			end
     end
     @driver.manage.timeouts.implicit_wait = @implicitWait
		return response_hash
	rescue
		puts $!
    puts $@
   ensure
     @driver.manage.timeouts.implicit_wait = @implicitWait
	end
end

#get_Profiles_StandardObjectPermissions_tableObject

get_Profiles_StandardObjectPermissions_table

> returns all the elements for the Profiles Standard Object Permissions table



43
44
45
# File 'lib/sfdc_se/pages/page_profiles.rb', line 43

def get_Profiles_StandardObjectPermissions_table
   	return @driver.find_elements(:xpath => "//h3[contains(.,'Standard Object Permissions')]/../following-sibling::div[1]/table/tbody/tr")
end

#get_Profiles_TabSettingsObject

get_Profiles_TabSettings

> Returns a hash; Key = Tab Name, Value = Default On; Default Off; Tab Hidden



372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# File 'lib/sfdc_se/pages/page_profiles.rb', line 372

def get_Profiles_TabSettings
	begin
		@hConfig=Hash.new
		if !get_Profiles_TabSettings_table.nil?
			get_Profiles_TabSettings_table.each do |row|
				next if row.attribute("class") == "detailRow"
				@hConfig[row.find_element(:xpath => "./td[1]").text]=row.find_element(:xpath => "./td[2]").text
				@hConfig[row.find_element(:xpath => "./td[3]").text]=row.find_element(:xpath => "./td[4]").text unless row.find_element(:xpath => "./td[3]").attribute("class") == "labelCol last empty"
			end
			return @hConfig
		end
	rescue
		puts $!
    puts $@
	end
end

#get_Profiles_TabSettings_tableObject

get_Profiles_TabSettings_table

> returns all the elements for the Profiles Tab Settings table



59
60
61
62
63
64
65
66
# File 'lib/sfdc_se/pages/page_profiles.rb', line 59

def get_Profiles_TabSettings_table
	if !@driver.find_elements(:xpath => "//h3[contains(.,'Tab Settings')]").nil?
 	@aStandardTable=@driver.find_elements(:xpath => "//h3[contains(.,'Tab Settings')]/../following-sibling::div[1]/table/tbody/tr")
 	@aCustomTable=@driver.find_elements(:xpath => "//h3[contains(.,'Tab Settings')]/../following-sibling::div[2]/table/tbody/tr")
 	@aStandardTable.push *@aCustomTable
 	return @aStandardTable
 end
end

#get_Profiles_VisualforcePageAccessObject


get_Profiles_VisualforcePageAccess

> Returns an Array; [VfPageAccess1, VfPageAccess2]



715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
# File 'lib/sfdc_se/pages/page_profiles.rb', line 715

def get_Profiles_VisualforcePageAccess
  @driver.manage.timeouts.implicit_wait = 0
  begin
    aResponse=[]
    puts "Visualforce Page Access Row Count: #{get_Profiles_VisualforcePageAccess_table.size}"
    get_Profiles_VisualforcePageAccess_table.each do |row|
      aResponse.push(row.find_element(:xpath => "./th[1]/a").text) unless row.attribute('class')=='headerRow'
    end
  
    @driver.manage.timeouts.implicit_wait = @implicitWait
    return aResponse
  rescue
    puts $!
    puts $@
  ensure
    @driver.manage.timeouts.implicit_wait = @implicitWait
  end
end

#get_Profiles_VisualforcePageAccess_tableObject

get_Profiles_VisualforcePageAccess_table

> returns all the elements for the Profiles Visualforce Page Access table



90
91
92
# File 'lib/sfdc_se/pages/page_profiles.rb', line 90

def get_Profiles_VisualforcePageAccess_table
    return @driver.find_elements(:xpath => "//h3[contains(.,'Enabled Visualforce Page Access')]/../../../../../following-sibling::div[1]/table/tbody/tr")
end

#get_ProfileViewOptionsObject

get_ProfileViewOptions

> returns all the elements for the Profiles View dropdown



11
12
13
# File 'lib/sfdc_se/pages/page_profiles.rb', line 11

def get_ProfileViewOptions
	return @driver.find_elements(:xpath => "//form/div[1]/div/select/option")
end

#get_RenameTabsLabels_CustomTableObject


get_RenameTabsLabels_CustomTable

> returns all the elements for the Rename Tabs and Labels Custom Tabs Table



29
30
31
32
33
# File 'lib/sfdc_se/pages/page_renametabslabels.rb', line 29

def get_RenameTabsLabels_CustomTable
  # return @driver.find_elements(:xpath => "//table[@class='list'][2]/tbody/tr")
  return @driver.find_elements(:xpath => "//form[@id='thisform']/div[3]/div[1]/div/div[2]/table[@class='list']/tbody/tr")
  # /html/body/div/div[2]/table/tbody/tr/td[2]/form/div[3]/div[1]/div/div[2]/table
end

#get_RenameTabsLabels_LanguageObject


get_RenameTabsLabels_Language

> returns all the elements for the Translate Language dropdown



12
13
14
# File 'lib/sfdc_se/pages/page_renametabslabels.rb', line 12

def get_RenameTabsLabels_Language
		return @driver.find_elements(:xpath => "//div[@class='renameTabsLanguageSelect']/select/option")
end

#get_RenameTabsLabels_StandardObject

get_RenameTabsLabels_Standard

> Return = Hash Field Name/Type, Value=Field Value



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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'lib/sfdc_se/pages/page_renametabslabels.rb', line 175

def get_RenameTabsLabels_Standard
	response=Hash.new
	# -- Step 1 of 2
	case get_RenameTabsLabels_StandardTable_Step1[1].find_element(:xpath => "./td[2]").text
	when "English", "English (UK)"
		get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
			case idx
			when 0,1
				response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
			when 2,3
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
			when 4
				response[row.find_element(:xpath => "./td[1]/label").text] = !row.find_element(:xpath => "./td[2]/input").attribute("checked").nil? 
			end
		end
	when "Indonesian"
		get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
			case idx
			when 0,1
				response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
			when 2,3
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
			end
		end
	when "German"
		# - Get Tab, Language, Gender
		get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
			case idx
			when 0,1
				response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
			when 2
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
			end
		end

		# - Get Sub Table information
		aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative']
		aSubTables.each do |s|
			subresponse=Hash.new
			get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
				subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
			end
			response[s]=subresponse
		end
	when "Romanian"
		# - Get Tab, Language, Gender
		get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
			case idx
			when 0,1
				response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
			when 2
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
			end
		end

		# - Get Sub Table information
		aSubTables=['Nominative', 'Dative']
		aSubTables.each do |s|
			subresponse=Hash.new
			get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
				subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
			end
			response[s]=subresponse
		end
	when "Spanish", "Portuguese (Brazilian)", "Dutch", "Spanish (Mexican)", "Bulgarian", "Portuguese (European)"
		get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
			case idx
			when 0,1
				response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
			when 2
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
			when 3,4
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
			end
		end
	when "French"
		get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
			case idx
			when 0,1
				response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
			when 2
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
			when 3,4
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
			when 5
				response[row.find_element(:xpath => "./td[1]/label").text] = !row.find_element(:xpath => "./td[2]/input").attribute("checked").nil? 	
			end
		end
	when "Italian"
		get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
			case idx
			when 0,1
				response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
			when 2
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
			when 3,4
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
			when 5
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text	
			end
		end
	when "Japanese", "Korean", "Chinese (Traditional)", "Chinese (Simplified)", "Thai", "Vietnamese"
		get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
			case idx
			when 0,1
				response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
			when 2
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
			end
		end
	when "Swedish", "Danish", "Norwegian", "Hebrew", "Arabic"
		get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
			case idx
			when 0,1
				response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
			when 2
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text	
			else
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
			end
		end
	when "Finnish"
		# - Get Tab, Language
		get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
			case idx
			when 0,1
				response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
			end
			break if idx > 1
		end
		
		# - Get Sub section information
		aSubTables=['Nominative', 'Genitive', 'Inessive', 'Elative', 'Illative', 'Adessive', 'Ablative', 'Allative', 'Essive', 'Translative', 'Partitive']
		aSubTables.each do |s|
			subresponse=Hash.new
			get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
				subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
			end
			response[s]=subresponse
		end
	when "Russian"
		# - Get Tab, Language, Gender
		get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
			case idx
			when 0,1
				response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
			when 2
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
			end
		end

		# - Get Sub section information
		aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative', 'Instrumental', 'Prepositional']
		aSubTables.each do |s|
			subresponse=Hash.new
			get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
				subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
			end
			response[s]=subresponse
		end
	when "Hungarian"
		# - Get Tab, Language
		get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
			case idx
			when 0,1
				response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
			end
			break if idx > 1
		end
		
		# - Get Sub section information
		aSubTables=['Nominative', 'Accusative', 'Dative', 'Inessive', 'Elative', 'Illative', 'Ablative', 'Allative', 'Translative', 'Instrumental', 'Sublative', 'Superessive', 'Delative', 'Causal-Final', 'Essive-Formal', 'Terminative']
		aSubTables.each do |s|
			subresponse=Hash.new
			get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
				subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
			end
			response[s]=subresponse
		end

		# - Get final Sub section information that has checkbox in the last row
		subresponse=Hash.new
		get_RenameTabsLabels_StandardTable_Step1_Subtable('Distributive').each_with_index do |row, idx|
			if idx < 6
				subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
			else
				subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = !row.find_element(:xpath => "./td[2]/input").attribute("checked").nil?
			end
		end
		response['Distributive']=subresponse
	when "Polish", "Czech", "Ukrainian", "Slovene"
		# - Get Tab, Language, Gender
		get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
			case idx
			when 0,1
				response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
			when 2
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
			end
		end

		# - Get Sub section information
		aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative', 'Instrumental', 'Locative', 'Vocative']
		aSubTables.each do |s|
			subresponse=Hash.new
			get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
				subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
			end
			response[s]=subresponse
		end
	when "Turkish"
		# - Get Tab, Language
		get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
			case idx
			when 0,1
				response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
			end
			break if idx > 1
		end
		
		# - Get Sub section information
		aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative', 'Ablative', 'Locative']
		aSubTables.each do |s|
			subresponse=Hash.new
			get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
				subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
			end
			response[s]=subresponse
		end
	when "Greek"
		# - Get Tab, Language, Gender
		get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
			case idx
			when 0,1
				response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
			when 2
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
			end
		end
		
		# - Get Sub section information
		aSubTables=['Nominative', 'Accusative', 'Genitive', 'Vocative']
		aSubTables.each do |s|
			subresponse=Hash.new
			get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
				subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
			end
			response[s]=subresponse
		end
	when "Slovak", "Croatian"
		# - Get Tab, Language, Gender
		get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
			case idx
			when 0,1
				response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
			when 2
				response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
			end
		end
		
		# - Get Sub section information
		aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative', 'Instrumental', 'Locative']
		aSubTables.each do |s|
			subresponse=Hash.new
			get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
				subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
			end
			response[s]=subresponse
		end
	end

	# -- Click Next to get to Step 2
	click_Btn_RenameTabslabels_Next

	# -- Step 2 of 2
	# --- Standard Field Labels Table
	# puts "Step2: Standard Field Labels: #{get_RenameTabsLabels_StandardTable_Step2_StandardField.length}"
	@driver.manage.timeouts.implicit_wait = 0
	aStep2Headers=[]
	iStep2HeaderCount=0
	iTableCount=1
	hStep2RowResponse=Hash.new
	srowFieldLabel=''

	while iTableCount < 3
		if iTableCount == 1 
			aTable=get_RenameTabsLabels_StandardTable_Step2_StandardField
		else
			aTable=get_RenameTabsLabels_StandardTable_Step2_OtherLabels
		end

		# puts "iTableCount: #{iTableCount}; Table Count: #{aTable.size}"
		aTable.each_with_index do |row, idx|
			hStep2SubRowResp=Hash.new

			# puts "Row: #{idx}"
			
			if idx == 0
				iStep2HeaderCount = row.find_elements(:xpath => "./th").length
				row.find_elements(:xpath => "./th").each do |subrow|
					aStep2Headers.push(subrow.text)
				end
			else
				case iStep2HeaderCount
				when 2
					# - Find countries that have only two Step 2 Header Columns
					srowFieldLabel=row.find_element(:xpath => "./th").text
					hStep2SubRowResp[aStep2Headers[1]]=row.find_element(:xpath => "./td[1]/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
				when 3
					# - Find countries that have only three Step 2 Header Columns
					srowFieldLabel=row.find_element(:xpath => "./th").text
					hStep2SubRowResp[aStep2Headers[1]]=row.find_element(:xpath => "./td[1]/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
					hStep2SubRowResp[aStep2Headers[2]]=row.find_element(:xpath => "./td[2]/input").attribute("value") unless row.find_elements(:xpath => "./td[2]//*").size == 0
				when 4
					# - Find countries that have only four Step 2 Header Columns
					srowFieldLabel=row.find_element(:xpath => "./th").text
					hStep2SubRowResp[aStep2Headers[1]]=row.find_element(:xpath => "./td[1]/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
					hStep2SubRowResp[aStep2Headers[2]]=row.find_element(:xpath => "./td[2]/input").attribute("value") unless row.find_elements(:xpath => "./td[2]//*").size == 0
					if row.find_element(:xpath => "./td[3]").attribute("class") == " dataCell  booleanColumn"
						# - get checkbox value
						hStep2SubRowResp[aStep2Headers[3]] = !row.find_element(:xpath => "./td[3]/input").attribute("checked").nil? 
					else
						# - Get gender value
						hStep2SubRowResp[aStep2Headers[3]] = row.find_element(:xpath => "./td[3]/select/option[@selected='selected']").text unless row.find_elements(:xpath => "./td[3]//*").size == 0
					end
				when 5
					# - Find countries that have only five Step 2 Header Columns
					srowFieldLabel=row.find_element(:xpath => "./th").text
					hStep2SubRowResp[aStep2Headers[1]]=row.find_element(:xpath => "./td[1]/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
					hStep2SubRowResp[aStep2Headers[2]]=row.find_element(:xpath => "./td[2]/input").attribute("value") unless row.find_elements(:xpath => "./td[2]//*").size == 0
					hStep2SubRowResp[aStep2Headers[3]]=row.find_element(:xpath => "./td[3]/select/option[@selected='selected']").text unless row.find_elements(:xpath => "./td[3]//*").size == 0
					if row.find_element(:xpath => "./td[4]").attribute("class") == " dataCell  booleanColumn"
						# - get checkbox value
						hStep2SubRowResp[aStep2Headers[4]] = !row.find_element(:xpath => "./td[4]/input").attribute("checked").nil? 
					else
						# - Get gender value
						hStep2SubRowResp[aStep2Headers[4]] = row.find_element(:xpath => "./td[4]/select/option[@selected='selected']").text unless row.find_elements(:xpath => "./td[4]//*").size == 0
					end
				end

				hStep2RowResponse[srowFieldLabel]=hStep2SubRowResp
			end
		end

		if iTableCount == 1
			response['Standard Field Labels'] = hStep2RowResponse
		else
			response['Other Labels'] = hStep2RowResponse
		end

		iTableCount +=1
	end

	# -- Step 2 Other Labels
	# puts "Step2: Other Labels Row Count: #{get_RenameTabsLabels_StandardTable_Step2_OtherLabels.size}"

	@driver.manage.timeouts.implicit_wait = @implicitWait
	

	return response
end

#get_RenameTabsLabels_StandardTableObject

get_RenameTabsLabels_StandardTable

> returns all the elements for the Rename Tabs and Labels Standard Tabs Table



20
21
22
23
# File 'lib/sfdc_se/pages/page_renametabslabels.rb', line 20

def get_RenameTabsLabels_StandardTable
# return @driver.find_elements(:xpath => "//table[@class='list'][1]/tbody/tr")
  return @driver.find_elements(:xpath => "//form[@id='thisform']/div[2]/div[1]/div/div[2]/table[@class='list']/tbody/tr")
end

#get_RenameTabsLabels_StandardTable_Step1Object

get_RenameTabsLabels_StandardTable_Step1

> returns all the elements for the Rename Tabs and Labels Standard Tabs Table



48
49
50
# File 'lib/sfdc_se/pages/page_renametabslabels.rb', line 48

def get_RenameTabsLabels_StandardTable_Step1
	return @driver.find_elements(:xpath => "//table[@class='detailList']/tbody/tr")
end

#get_RenameTabsLabels_StandardTable_Step1_Subtable(sSubTableName) ⇒ Object

get_RenameTabsLabels_StandardTable_Step1_Subtable

> sSubTableName

> returns all the elements for the Raname Tabs and Labels Standard Sub Table



40
41
42
# File 'lib/sfdc_se/pages/page_renametabslabels.rb', line 40

def get_RenameTabsLabels_StandardTable_Step1_Subtable(sSubTableName)
	return @driver.find_elements(:xpath => "//h3[contains(.,'#{sSubTableName}')]/../following-sibling::div[1]/table/tbody/tr")
end

#get_RenameTabsLabels_StandardTable_Step2_OtherLabelsObject

get_RenameTabsLabels_StandardTable_Step2_OtherLabels

> returns all the elements for the Rename Tabs and Labels Other Labels Table



66
67
68
69
70
# File 'lib/sfdc_se/pages/page_renametabslabels.rb', line 66

def get_RenameTabsLabels_StandardTable_Step2_OtherLabels
	# return @driver.find_elements(:xpath => "//table[@class='list']/tbody/tr")
	return @driver.find_elements(:xpath => "//div[@class='listRelatedObject setupBlock'][2]/div/div[2]/table/tbody/tr")
											# /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]
end

#get_RenameTabsLabels_StandardTable_Step2_StandardFieldObject

get_RenameTabsLabels_StandardTable_Step2_StandardField

> returns all the elements for the Rename Tabs and Labels Standard Tabs Table



56
57
58
59
60
# File 'lib/sfdc_se/pages/page_renametabslabels.rb', line 56

def get_RenameTabsLabels_StandardTable_Step2_StandardField
	# return @driver.find_elements(:xpath => "//table[@class='list']/tbody/tr")
	return @driver.find_elements(:xpath => "//div[@class='listRelatedObject setupBlock'][1]/div/div[2]/table/tbody/tr")
	# 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")
end

#get_SharingSettingAccessTableObject

get_SharingSettingAccessTable

> returns all the elements for the Sharing Settings Access Table



19
20
21
# File 'lib/sfdc_se/pages/page_sharingsettings.rb', line 19

def get_SharingSettingAccessTable
	return @driver.find_elements(:xpath => "//table[@class='list']/tbody/tr")
end

#get_SharingSettingAccessTable_EditObject


get_SharingSettingAccessTable_Edit

> returns all the elements for the Sharing Settings Access Table



27
28
29
# File 'lib/sfdc_se/pages/page_sharingsettings.rb', line 27

def get_SharingSettingAccessTable_Edit
  return @driver.find_elements(:xpath => "//table[@class='detailList']/tbody/tr")
end

#get_SharingSettingOptionsObject

get_SharingSettingOptions

> returns all the elements for the Sharing Settings dropdown



11
12
13
# File 'lib/sfdc_se/pages/page_sharingsettings.rb', line 11

def get_SharingSettingOptions
	return @driver.find_elements(:xpath => "//select[@id='st']/option")
end

#get_SharingSettingsAccess(sObjName) ⇒ Object


> sObjName = string value of the sharing setting object to return

> Return = Hash of column values for indicated object name



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/sfdc_se/pages/page_sharingsettings.rb', line 113

def get_SharingSettingsAccess(sObjName)
	$accessHeaders=[]
	response=Hash.new

	get_SharingSettingAccessTable.each_with_index do |row, index|
		if index == 0
			# - Get headers
			row.find_elements(:xpath => "./th").each do |h|
				$accessHeaders.push(h.text)
			end
		else
			# - Get Values for matching Object Name
			if row.find_element(:xpath => "./th").text == sObjName
				response[$accessHeaders[1]]=row.find_element(:xpath => "./td[1]").text
				response[$accessHeaders[2]]=row.find_element(:xpath => "./td[2]").text
				response[$accessHeaders[3]]=row.find_element(:xpath => "./td/img").attribute("title") unless row.find_elements(:xpath => "./td[3]//*").size == 0
				break
			end
		end
	end

	return response
end

#get_Translate_AspectObject


get_Translate_Aspect

> returns all the elements for the Translate Aspect dropdown



39
40
41
# File 'lib/sfdc_se/pages/page_translate.rb', line 39

def get_Translate_Aspect
		return @driver.find_elements(:xpath => "//div[@id='twb:theForm:filterBlock:filterPageBlock']/div/table/tbody/tr[4]/td/span/select/option")
end

#get_Translate_CustomReportType_FieldLabel_rowsObject


get_Translate_CustomReportType_FieldLabel_rows

> returns all the elements for the Translate Custom Report Type - Field Label rows



48
49
50
# File 'lib/sfdc_se/pages/page_translate.rb', line 48

def get_Translate_CustomReportType_FieldLabel_rows
 		return @driver.find_elements(:xpath => "//div[@id='gridID']/div[1]/div[2]/div[1]/div[1]/div[2]/div/div")
end

#get_Translate_CustomReportTypeEntityObject


get_Translate_CustomReportTypeEntity

> returns all the elements for the Translate Custom Report Type Entity dropdown



30
31
32
# File 'lib/sfdc_se/pages/page_translate.rb', line 30

def get_Translate_CustomReportTypeEntity
		return @driver.find_elements(:xpath => "//div[@id='twb:theForm:filterBlock:filterPageBlock']/div/table/tbody/tr[3]/td/span/select/option")
end

#get_Translate_LanguageObject


get_Translate_Language

> returns all the elements for the Translate Language dropdown



12
13
14
# File 'lib/sfdc_se/pages/page_translate.rb', line 12

def get_Translate_Language
		return @driver.find_elements(:xpath => "//div[@id='twb:theForm:filterBlock:filterPageBlock']/div/table/tbody/tr[1]/td/span/select/option")
end

#get_Translate_SetupComponentObject


get_Translate_SetupComponent

> returns all the elements for the Translate Setup Comonent dropdown



21
22
23
# File 'lib/sfdc_se/pages/page_translate.rb', line 21

def get_Translate_SetupComponent
		return @driver.find_elements(:xpath => "//div[@id='twb:theForm:filterBlock:filterPageBlock']/div/table/tbody/tr[2]/td/span/select/option")
end

#get_Translation_CustomReportType_Description(sCustomReportTypeName) ⇒ Object


get_Translation_CustomReportType_Description

> Return = Hash Field Name/Type, Value=Field Value



249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/sfdc_se/pages/page_translate.rb', line 249

def get_Translation_CustomReportType_Description(sCustomReportTypeName)
	response=Hash.new
	blnFound=false
	idx=0

	until (@driver.find_element(:id => 'pageNumField').attribute("value").to_i == @driver.find_element(:id => 'totalPages').text.to_i and idx==@driver.find_element(:id => 'totalPages').text.to_i) or blnFound==true
		r=0
		while r < get_Translate_CustomReportType_FieldLabel_rows.length
			if get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[1]/div").text == sCustomReportTypeName
				response["translation"]=get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[2]/div").text
				# response["out of Date"]=get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[4]/div/div/input").selected? #attribute("checked")
				blnFound=true
				break
			end
			r+=1
		end
		idx+=1
		if blnFound==false
 		get_btn_Translate_CustomReportType_FieldLabel_Next.click unless @driver.find_element(:id => 'pageNumField').attribute("value").to_i == @driver.find_element(:id => 'totalPages').text.to_i
 		sleep(5)
 	end
	end
	
	return response
end

#get_Translation_CustomReportType_FieldLabel(sCustomReportTypeName) ⇒ Object


get_Translation_CustomReportType_FieldLabel

> Return = Hash Field Name/Type, Value=Field Value



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
# File 'lib/sfdc_se/pages/page_translate.rb', line 183

def get_Translation_CustomReportType_FieldLabel(sCustomReportTypeName)
	response=Hash.new
	blnFound=false
	idx=0

	until (@driver.find_element(:id => 'pageNumField').attribute("value").to_i == @driver.find_element(:id => 'totalPages').text.to_i and idx==@driver.find_element(:id => 'totalPages').text.to_i) or blnFound==true
		r=0
		while r < get_Translate_CustomReportType_FieldLabel_rows.length
			if get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[1]/div").text == sCustomReportTypeName
				response["translation"]=get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[2]/div").text
				# response["out of Date"]=get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[4]/div/div/input").selected? #attribute("checked")
				blnFound=true
				break
			end
			r+=1
		end
		idx+=1
		if blnFound==false
 		get_btn_Translate_CustomReportType_FieldLabel_Next.click unless @driver.find_element(:id => 'pageNumField').attribute("value").to_i == @driver.find_element(:id => 'totalPages').text.to_i
 		sleep(5)
 	end
	end

	return response
end

#get_Translation_CustomReportType_LayoutSection(sMasterLayoutSection, sCustomReportTypeName) ⇒ Object


get_Translation_CustomReportType_LayoutSection

> Return = Hash Field Name/Type, Value=Field Value



319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/sfdc_se/pages/page_translate.rb', line 319

def get_Translation_CustomReportType_LayoutSection(sMasterLayoutSection, sCustomReportTypeName)
	response=Hash.new
	blnFound=false
	idx=0

	until (@driver.find_element(:id => 'pageNumField').attribute("value").to_i == @driver.find_element(:id => 'totalPages').text.to_i and idx==@driver.find_element(:id => 'totalPages').text.to_i) or blnFound==true
		r=0
		while r < get_Translate_CustomReportType_FieldLabel_rows.length
			if get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[1]/div").text == sMasterLayoutSection and get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[3]/div").text == sCustomReportTypeName
				response["translation"]=get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[2]/div").text
				# response["out of Date"]=get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[4]/div/div/input").selected? #attribute("checked")
				blnFound=true
				break
			end
			r+=1
		end
		idx+=1
		if blnFound==false
 		get_btn_Translate_CustomReportType_FieldLabel_Next.click unless @driver.find_element(:id => 'pageNumField').attribute("value").to_i == @driver.find_element(:id => 'totalPages').text.to_i
 		sleep(5)
 	end
	end
	
	return response
end

#get_Translation_RecordType(sMasterRecordTypeLabel) ⇒ Object


get_Translation_RecordType

> Return = Hash Field Name/Type, Value=Field Value



385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
# File 'lib/sfdc_se/pages/page_translate.rb', line 385

def get_Translation_RecordType(sMasterRecordTypeLabel)
	response=Hash.new
	blnFound=false
	idx=0

	until (@driver.find_element(:id => 'pageNumField').attribute("value").to_i == @driver.find_element(:id => 'totalPages').text.to_i and idx==@driver.find_element(:id => 'totalPages').text.to_i) or blnFound==true
		r=0
		while r < get_Translate_CustomReportType_FieldLabel_rows.length
			if get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[1]/div").text == sMasterRecordTypeLabel
				response["translation"]=get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[2]/div").text
				# response["out of Date"]=get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[4]/div/div/input").selected? #attribute("checked")
				blnFound=true
				break
			end
			r+=1
		end
		idx+=1
		if blnFound==false
 		get_btn_Translate_CustomReportType_FieldLabel_Next.click unless @driver.find_element(:id => 'pageNumField').attribute("value").to_i == @driver.find_element(:id => 'totalPages').text.to_i
 		sleep(5)
 	end
	end
	
	return response
end

navigate_Create_WorkflowApprovals_EmailAlerts

> Navigates to the Create > Workflow & Approvals > Email Alerts from the Setup Menu



151
152
153
154
155
# File 'lib/sfdc_se/pages/page_setup.rb', line 151

def navigate_Create_WorkflowApprovals_EmailAlerts
	click_Create_icon
	click_WorkflowApprovals_icon
	click_EmailAlerts
end

navigate_Create_WorkflowApprovals_FieldUpdates

> Navigates to the Create > Workflow & Approvals > Field Updates from the Setup Menu



162
163
164
165
166
# File 'lib/sfdc_se/pages/page_setup.rb', line 162

def navigate_Create_WorkflowApprovals_FieldUpdates
	click_Create_icon
	click_WorkflowApprovals_icon
	click_FieldUpdates
end

navigate_Customize_Home_HomePageLayouts



104
105
106
107
108
# File 'lib/sfdc_se/pages/page_setup.rb', line 104

def navigate_Customize_Home_HomePageLayouts
	click_Customize_icon
	click_Home_icon
	click_HomePageLayouts
end

navigate_Customize_TabNamesLabels_RenameTabsLabels

> Navigates to the Customize > Tab Names and Labels > Rename Tabs and Labels from the Setup Menu



191
192
193
194
195
# File 'lib/sfdc_se/pages/page_setup.rb', line 191

def navigate_Customize_TabNamesLabels_RenameTabsLabels
	click_Customize_icon
	click_TabNamesLabels_arrow
	click_RenameTabsLabels_TabNamesLabels
end

navigate_EmailAdministration_Deliverability

> Navigates to the Email Administration Deliverability page



257
258
259
260
# File 'lib/sfdc_se/pages/page_setup.rb', line 257

def navigate_EmailAdministration_Deliverability
	click_EmailAdministration_icon
	click_EmailAdministration_Deliverability
end

navigate_ManageUsers_Profiles

> Navigates to the Manage Users Profiles page



227
228
229
230
# File 'lib/sfdc_se/pages/page_setup.rb', line 227

def navigate_ManageUsers_Profiles
	click_ManageUsers_arrow
	click_Manageusers_Profiles
end

navigate_MyPersonalInformation_PersonalInformation

> Navigates to the Personal Information page



41
42
43
44
# File 'lib/sfdc_se/pages/page_setup.rb', line 41

def navigate_MyPersonalInformation_PersonalInformation
	click_MyPersonalInformation_icon
	click_MyPersonalInformation_PersonalInformation
end

navigate_SecurityControls_SharingSettings

> Navigates to the Security Control > Sharing Settings page



285
286
287
288
# File 'lib/sfdc_se/pages/page_setup.rb', line 285

def navigate_SecurityControls_SharingSettings
	click_SecurityControls_arrow
	click_SharingSettings_SecurityControls
end

navigate_to

> url = path to which the browser will navigate to



70
71
72
# File 'lib/sfdc_se.rb', line 70

def navigate_to(url)
	@driver.navigate.to url
end

navigate_to_setup

> Navigates to the Setup section/page of SFDC



88
89
90
91
# File 'lib/sfdc_se.rb', line 88

def navigate_to_setup
	@driver.find_element(:id => 'userNavLabel').click
 @driver.find_element(:link_text => 'Setup').click
end

navigate_TranslationWorkbench_Translate

> Navigates to Translation Workbench > Translate from the Setup Menu



314
315
316
317
# File 'lib/sfdc_se/pages/page_setup.rb', line 314

def navigate_TranslationWorkbench_Translate
	click_TranslationWorkbench_arrow
	click_Translate_TranslationWorkbench
end

#raw_login(username, password, host) ⇒ Object




9
10
11
12
13
14
15
16
17
18
# File 'lib/sfdc_se/general/general.rb', line 9

def (username, password, host)
  binding = RForce::Binding.new %{https://#{host}/services/Soap/u/36.0}
  resp = binding.( username, password )
  server_url = resp[:loginResponse][:result][:serverUrl]
  uri = URI(server_url)
  {
    :instance_url => %{#{uri.scheme}://#{uri.host}},
    :oauth_token => resp[:loginResponse][:result][:sessionId]
  }
end

#reset_PasswordSecurityQuestion(sCurentPassword, sNewPassword, sAnswer) ⇒ Object


reset_PasswordSecurityQuestion



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/sfdc_se/pages/page_passwordsecuritysetting.rb', line 10

def reset_PasswordSecurityQuestion(sCurentPassword, sNewPassword, sAnswer)
	blnEdit=false

	if @driver.find_elements(:id => 'currentpassword').size > 0
		set_CurrentPasswordField(sCurentPassword)
		set_NewPasswordField(sNewPassword)
		set_ConfirmPasswordField(sNewPassword)
		set_AnswerField(sAnswer)
		click_Btn_ChangePassword
		blnEdit=true
	end
	return blnEdit
end

#restforce_client(options) ⇒ Object




22
23
24
# File 'lib/sfdc_se/general/general.rb', line 22

def restforce_client(options)
  Restforce.new( (options[:username], options[:password], (options[:sandbox] ? 'test.salesforce.com' : 'login.salesforce.com') ).merge(:api_version => '36.0') )
end

#save_screenshot(filename) ⇒ Object


take screenshot



95
96
97
# File 'lib/sfdc_se.rb', line 95

def save_screenshot(filename)
	@driver.save_screenshot(filename)
end

#select_Profile(sProfileName) ⇒ Object


select_Profile

> sProfileName = String value of the profile name to select

> Return = true or false

> true = Profile successfully selected

> false = Profile selection had an error



221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/sfdc_se/pages/page_profiles.rb', line 221

def select_Profile(sProfileName)
	blnValue=false
	begin
		get_elements_Profiles_table.each do |row|
			tableProfile=row.find_element(:xpath => "./td[4]").text
			if tableProfile==sProfileName
				row.find_element(:xpath => "./td[4]/div/a").click
				blnValue=true
				return blnValue
			end
		end
	rescue
       puts $!
       puts $@
       blnValue = false
	end
	return blnValue
end

#set_AnswerField(sAnswer) ⇒ Object


set_AnswerField(sAnswer)



48
49
50
# File 'lib/sfdc_se/pages/page_passwordsecuritysetting.rb', line 48

def set_AnswerField(sAnswer)
	@driver.find_element(:id => 'answer').send_keys(sAnswer)
end

#set_ConfirmPasswordField(sPWD) ⇒ Object


set_ConfirmPasswordField(sPWD)



41
42
43
# File 'lib/sfdc_se/pages/page_passwordsecuritysetting.rb', line 41

def set_ConfirmPasswordField(sPWD)
	@driver.find_element(:id => 'confirmpassword').send_keys(sPWD)
end

#set_CurrentPasswordField(sPWD) ⇒ Object


set_CurrentPasswordField(sPWD)



27
28
29
# File 'lib/sfdc_se/pages/page_passwordsecuritysetting.rb', line 27

def set_CurrentPasswordField(sPWD)
	@driver.find_element(:id => 'currentpassword').send_keys(sPWD)
end

#set_EmailAlert_Configuration(sObjName, hObjValues, addnew = false) ⇒ Object


set_EmailAlert_Configuration

> sObjName = string value of the object to set

> hObjValues = Email Alert Field Hash Value

> addnew = Boolean, defaults to false unless true is passed

- Set to true to create a new Email Alert (rather then adjusting the configuration of an existing one)

> return = true/false

- True = Email Alert Configuration was updated
- False = Email Alert Configration was NOT updated


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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/sfdc_se/pages/page_emailalerts.rb', line 187

def set_EmailAlert_Configuration(sObjName, hObjValues, addnew=false)
  addnew=false unless addnew==true
  blnUpdateReturn=false
  r=0

  while r < get_EmailAlertsEditTable.length
    case r
    when 0,1
    # 0 = Description, 1 = Uniique Name
      if !(hObjValues[sObjName][get_EmailAlertsEditTable[r].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] == get_EmailAlertsEditTable[r].find_element(:xpath => "./td[2]/div/input").attribute("value"))
        get_EmailAlertsEditTable[r].find_element(:xpath => "./td[2]/div/input").send_keys(hObjValues[sObjName][get_EmailAlertsEditTable[r].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
        blnUpdateReturn=true
      end
    when 2
      # - 2 = Object - Not configurable
      if addnew
        get_EmailAlertsEditTable[r].find_elements(:xpath => "./td[2]/div/select/option").each do |option|
          if option.text == hObjValues[sObjName][get_EmailAlertsEditTable[r].find_element(:xpath => "./td[1]").text.gsub("*\n", "")]
            option.click unless option.selected?
            break
          end
        end
      end
    when 4, 7, 8
      # - 4,7 = Blank Row, 8 = Text, no configurable item
      # - Do nothing, row not required
    when 3
      # - 3 = Email Template
      if !(hObjValues[sObjName][get_EmailAlertsEditTable[r].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] == get_EmailAlertsEditTable[r].find_element(:xpath => "./td[2]/div/span/input").attribute("value"))
        get_EmailAlertsEditTable[r].find_element(:xpath => "./td[2]/div/span/input").send_keys(hObjValues[sObjName][get_EmailAlertsEditTable[r].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
        blnUpdateReturn=true
      end
    when 5
      # - 5 = Recipient Type - Not a configurable item, used for Selected Recipients section
      $precedRow=get_EmailAlertsEditTable[r]
    when 6
      # - 6 = Recipents
      #-Gets current Selected Recipents list
      $aSelected=[]
      get_EmailAlertsEditTable[r].find_elements(:xpath => "./td[2]/div/table/tbody/tr/td[3]/select/option").each do |sr|
        $aSelected.push(sr.text)
      end

      #-Returns the Recipents that need to be added to the Selected List
      aAddRecipents=hObjValues[sObjName][get_EmailAlertsEditTable[r].find_element(:xpath => "./td[1]").text.gsub("*\n", "")]-$aSelected
      if aAddRecipents.size > 0
        # - Add Required Recipents
        aAddRecipents.each do |adduser|
          searchItem=""
          searchName=""

          case 
          when adduser.include?(": ")
            searchItem=adduser[0..(adduser.index(": ")-1)]
            searchItem="Public Groups" if adduser[0..(adduser.index(": ")-1)] == "Group"
            searchName=adduser[(adduser.index(": ")+2)..-1]
          when adduser == "Account Owner"
            searchItem=adduser
            searchName=adduser
          when adduser.include?("Creator")
            searchItem="Creator"
            searchName=adduser
          when adduser == "Lead or Contact Owner"
            searchItem="Related Lead or Contact Owner"
            searchName=adduser
          when adduser.include?("Owner")
            searchItem="Owner"
            searchName=adduser
          end

          if !searchItem.nil?
            $precedRow.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
                if option.text == searchItem
                  #-Recipient Type Search Option selection
                  option.click unless option.selected?
                  
                  #-Recipient 'For' textbox, to narrow down 'Available Recipients' list
                  $precedRow.find_element(:xpath => "./td[2]/div/input[@type='text' and @id='searchValue_userFilter']").clear()
                  $precedRow.find_element(:xpath => "./td[2]/div/input[@type='text' and @id='searchValue_userFilter']").send_keys(searchName)
                  $precedRow.find_element(:xpath => "./td[2]/div/input[@class='btn' and @title='Find']").click

                  #-Select and move to right, Recipient (from Avialable list)
                  get_EmailAlertsEditTable[r].find_elements(:xpath => "./td[2]/div/table/tbody/tr/td[1]/select/option").each do |option|
                    if option.text == adduser
                      option.click
                    end
                  end
                  get_EmailAlertsEditTable[r].find_element(:xpath => "./td[2]/div/table/tbody/tr/td[2]/div[2]/a").click
                end
            end
          end
        end

        blnUpdateReturn=true
      end
      
      #-Returns the Recipents that need to be removed from the current Selected List
      aRemoveRecipents=$aSelected-hObjValues[sObjName][get_EmailAlertsEditTable[r].find_element(:xpath => "./td[1]").text.gsub("*\n", "")]
      aRemoveRecipents=aRemoveRecipents-["--None--"]
      if aRemoveRecipents.size > 0
        aRemoveRecipents.each do |removeRecipient|
          get_EmailAlertsEditTable[r].find_elements(:xpath => "./td[2]/div/table/tbody/tr/td[3]/select/option").each do |option|
            if option.text == removeRecipient
              option.click unless option.selected?
            end
          end
          get_EmailAlertsEditTable[r].find_element(:xpath => "./td[2]/div/table/tbody/tr/td[2]/div[3]/a").click
        end
        puts "Recipents to Remove: #{aRemoveRecipents}"
        blnUpdateReturn=true
      end

    when 9
      # - 9 = Additional Emails
      if !(hObjValues[sObjName][get_EmailAlertsEditTable[r].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] == get_EmailAlertsEditTable[r].find_element(:xpath => "./td[2]/textarea").text)
        get_EmailAlertsEditTable[r].find_element(:xpath => "./td[2]/textarea").send_keys(hObjValues[sObjName][get_EmailAlertsEditTable[r].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
        blnUpdateReturn=true
      end
    when 10
      # - 10 = From Email Address
      if !(hObjValues[sObjName][get_EmailAlertsEditTable[r].find_element(:xpath => "./td[1]/label")] == get_EmailAlertsEditTable[r].find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text)
        get_EmailAlertsEditTable[r].find_elements(:xpath => "./td[2]/div/select/option").each do |option|
          if option.text == hObjValues[sObjName][get_EmailAlertsEditTable[r].find_element(:xpath => "./td[1]/label")]
            option.click unless option.selected?
            blnUpdateReturn=true
          end
        end
      end

    when 11
      # - 11 = Checkbox; Make this address the default From email address for this object's email alerts
      checkboxStatus=get_EmailAlertsEditTable[r].find_element(:xpath => "./td[2]/input").attribute("checked").nil? ? "false" : "true"
      if !(hObjValues[sObjName][get_EmailAlertsEditTable[r].find_element(:xpath => "./td[2]/label").text] == checkboxStatus)
        get_EmailAlertsEditTable[r].find_element(:xpath => "./td[2]/input").click
        blnUpdateReturn=true
      end
    end
    r+=1
  end

  return blnUpdateReturn
end

#set_EmailAlerts_View(sViewName) ⇒ Object

set_EmailAlerts_View

> sViewName = string value of the Sharing Setting option to select

> Return = true or false

> true = setting of view were successful

> false = setting of view had an error



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/sfdc_se/pages/page_emailalerts.rb', line 89

def set_EmailAlerts_View(sViewName)
	blnViewSet=false
	begin
		get_EmailAlertsViewOptions.each do |option|
			if option.text == sViewName
				option.click unless option.selected?
				blnViewSet=true
				return blnViewSet
			end
		end
	rescue
		puts $!
  	puts $@
	end
	return blnViewSet
end

#set_FieldUpdates_Configuration(sObjName, hObjValues, addnew = false) ⇒ Object


set_FieldUpdates_Configuration

> sObjName = string value of the object to set

> hObjValues = Values to set, Hash Value

> addnew = Boolean, defaults to false unless true is passed

- Set to true to create a new Email Alert (rather then adjusting the configuration of an existing one)

> return = true/false

- True = Configuration was updated
- False = Configration was NOT updated


265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
# File 'lib/sfdc_se/pages/page_fieldupdates.rb', line 265

def set_FieldUpdates_Configuration(sObjName, hObjValues, addnew=false)
  addnew=false unless addnew==true
  blnUpdateReturn=false
  r=0
  @driver.manage.timeouts.implicit_wait = 0

  # - Get 'Identification' section of the Field Update page
  while r < get_FieldUpdatesEdit_IdentificationTable.length
  # get_FieldUpdatesEdit_IdentificationTable.each_with_index do |row, idx|
    case r
    when 0,1
      # - 0=Name, 1=Unique Name
      if !(hObjValues[sObjName][get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] == get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[2]/div/input").attribute("value"))
        get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[2]/div/input").clear()
        get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[2]/div/input").send_keys(hObjValues[sObjName][get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
        puts "Updated Field: #{get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")}"
        blnUpdateReturn=true
      end

      # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/div/input").attribute("value")
    when 2
      # - 2=Description
      if !(hObjValues[sObjName][get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] == get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[2]/textarea").text)
        get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[2]/textarea").clear()
        get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[2]/textarea").send_keys(hObjValues[sObjName][get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
        puts "Updated Field: #{get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")}"
        blnUpdateReturn=true
      end

      # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/textarea").text
    when 3,4
      # - 3=Object, 4=Field to Update
      # - Object
      if addnew
        if get_FieldUpdatesEdit_IdentificationTable[r].find_elements(:xpath => "./td[1]//*").size == 0
          # - Row has multiple dropdown selections
          aFieldToUpdate=hObjValues[sObjName][get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[1]").text.gsub("*\n", "")].split(": ")
          aFieldToUpdate.each_with_index do |aFieldSelection, idx|
            if idx == 0
              aDropdownLists=get_FieldUpdatesEdit_IdentificationTable[r].find_elements(:xpath => "./td[2]/div/select[#{idx+1}]/option")
            else
              aDropdownLists=get_FieldUpdatesEdit_IdentificationTable[r].find_elements(:xpath => "./td[2]/div/select[#{idx+1}]/optgroup/option")
            end
            aDropdownLists.each do |option|
              if option.text == aFieldSelection
                option.click unless option.selected?
                sleep(5)
                puts "Updated Field: #{aFieldSelection}"
                blnUpdateReturn=true
                break
              end
            end
          end
        else
          # - Row has single dropdown seletion
          get_FieldUpdatesEdit_IdentificationTable[r].find_elements(:xpath => "./td[2]/div/select/option").each do |option|
            if option.text == hObjValues[sObjName][get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
              option.click unless option.selected?
              sleep(5)
              puts "Updated Field: #{get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")}"
              blnUpdateReturn=true
              break
            end
          end
        end
      end

      # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]").text
    when 5
      # - 5=Field Data Type
      $sFldDataType=get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[2]").text

      # response[row.find_element(:xpath => "./td[1]").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]").text
    when 6
      # - 6=Re-evaluate Workflow Rules after Field Change; Checkbox
      checkboxStatus=get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[2]/input").attribute("checked").nil? ? "false" : "true"
      if !(hObjValues[sObjName][get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] == checkboxStatus)
        get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[2]/input").click
        puts "Updated Field: #{get_FieldUpdatesEdit_IdentificationTable[r].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")}"
        blnUpdateReturn=true
      end

      # row.find_element(:xpath => "./td[2]/input").attribute("checked").nil? ? response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]="false" : response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/input").attribute("checked")
      # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/input").attribute("value")
    end

    r+=1
  end

  # - Determine the 'Specify New Field Value' section and set configuration
  case $sFldDataType
  when "Picklist"
    # - Picklist Options added to hash
    get_FieldUpdatesEdit_SpecifyNewFieldValueTable.each do |row|
      row.find_elements(:xpath => "./td[2]/ul/li").each_with_index do |radiobtns, idx|
        case idx
        when 0,1
          if !(hObjValues[sObjName][radiobtns.find_element(:xpath => "./label").text.gsub("*\n", "")] == (!radiobtns.find_element(:xpath => "./input").attribute("checked").nil?).to_s)
            radiobtns.find_element(:xpath => "./input").click
            puts "Updated Field: #{radiobtns.find_element(:xpath => "./label").text.gsub("*\n", "")}"
            blnUpdateReturn=true
          end

          # response[radiobtns.find_element(:xpath => "./label").text] = (!radiobtns.find_element(:xpath => "./input").attribute("checked").nil? ).to_s

          # if radiobtns.find_element(:xpath => "./input").selected?
          #   response[row.find_element(:xpath => "./td[2]/h5").text]=radiobtns.find_element(:xpath => "./label").text
          # end
        when 2
          if !(hObjValues[sObjName][radiobtns.find_element(:xpath => "./div/label").text.gsub("*\n", "")][0] == (!radiobtns.find_element(:xpath => "./div/input").attribute("checked").nil?).to_s)
            radiobtns.find_element(:xpath => "./div/input").click
            radiobtns.find_elements(:xpath => "./div/span/select/option").each do |option|
              if option.text == hObjValues[sObjName][radiobtns.find_element(:xpath => "./div/label").text.gsub("*\n", "")][1]
                puts "Updated Dropdown Value To: #{option.text}" unless option.selected?
                option.click unless option.selected?
              end
            end
            puts "Updated Field: #{radiobtns.find_element(:xpath => "./div/label").text.gsub("*\n", "")}"
            blnUpdateReturn=true
          end

          # response[radiobtns.find_element(:xpath => "./div/label").text] = [(!radiobtns.find_element(:xpath => "./div/input").attribute("checked").nil?).to_s, radiobtns.find_element(:xpath => "./div/span/select/option[@selected='selected']").text]

          # if radiobtns.find_element(:xpath => "./div/input").selected?
          #   response[row.find_element(:xpath => "./td[2]/h5").text]="#{radiobtns.find_element(:xpath => "./div/label").text};#{radiobtns.find_element(:xpath => "./div/span/select/option[@selected='selected']").text}"
          # end
        end
      end
    end
  when "Record Type"
    # - Record Type dropdrown added to hash
    if !(hObjValues[sObjName][get_FieldUpdatesEdit_SpecifyNewFieldValueTable[1].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] == get_FieldUpdatesEdit_SpecifyNewFieldValueTable[1].find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text)
      get_FieldUpdatesEdit_SpecifyNewFieldValueTable[1].find_elements(:xpath => "./td[2]/div/select/option").each do |option|
        if option.text == hObjValues[sObjName][get_FieldUpdatesEdit_SpecifyNewFieldValueTable[1].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
          puts "Updated Dropdown Value To: #{option.text}" unless option.selected?
          option.click unless option.selected?
          blnUpdateReturn=true
        end
      end
    end

    # response[get_FieldUpdatesEdit_SpecifyNewFieldValueTable[1].find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=get_FieldUpdatesEdit_SpecifyNewFieldValueTable[1].find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
  when "Date/Time", "Text", "Text Area", "Date", "Currency", "Phone", "Number", "Long Text Area", "Email", "Fax"
    # - Date Options added to hash; Text Options added to hash
    get_FieldUpdatesEdit_SpecifyNewFieldValueTable.each do |row|
      row.find_elements(:xpath => "./td[2]/ul/li").each_with_index do |radiobtns, idx|
        case idx
        when 0
          if !(hObjValues[sObjName][radiobtns.find_element(:xpath => "./label").text.gsub("*\n", "")] == (!radiobtns.find_element(:xpath => "./input").attribute("checked").nil?).to_s)
            radiobtns.find_element(:xpath => "./input").click
            puts "Updated Field: #{radiobtns.find_element(:xpath => "./label").text.gsub("*\n", "")}"
            blnUpdateReturn=true
          end

          # response[radiobtns.find_element(:xpath => "./label").text.gsub("*\n", "")] = (!radiobtns.find_element(:xpath => "./input").attribute("checked").nil?).to_s

          # if radiobtns.find_element(:xpath => "./input").selected?
          #   response[row.find_element(:xpath => "./td[2]/h5").text]=radiobtns.find_element(:xpath => "./label").text
          # end
        when 1
          #- Validate Radio Button and then Dropdown Value
          if !(hObjValues[sObjName][radiobtns.find_element(:xpath => "./div/label").text.gsub("*\n", "")][0] == (!radiobtns.find_element(:xpath => "./div/input").attribute("checked").nil?).to_s)
            radiobtns.find_element(:xpath => "./div/input").click
            puts "Upated Field: #{radiobtns.find_element(:xpath => "./div/label").text.gsub("*\n", "")}"
            blnUpdateReturn=true
          end
          if !radiobtns.find_element(:xpath => "./div/input").attribute("checked").nil?
            puts "Formula Value - JSON: #{hObjValues[sObjName][radiobtns.find_element(:xpath => "./div/label").text.gsub("*\n", "")][1]}"
            if !(hObjValues[sObjName][radiobtns.find_element(:xpath => "./div/label").text.gsub("*\n", "")][1] == radiobtns.find_element(:xpath => "./div/div/div[2]/table/tbody/tr/td/div/textarea").text)
              radiobtns.find_element(:xpath => "./div/div/div[2]/table/tbody/tr/td/div/textarea").clear()
              radiobtns.find_element(:xpath => "./div/div/div[2]/table/tbody/tr/td/div/textarea").send_keys(hObjValues[sObjName][radiobtns.find_element(:xpath => "./div/label").text.gsub("*\n", "")][1])
              puts "Updated Text/Formula To : #{hObjValues[sObjName][radiobtns.find_element(:xpath => "./div/label").text.gsub("*\n", "")][1]}"
              blnUpdateReturn=true
            end
          end

          # response[radiobtns.find_element(:xpath => "./div/label").text.gsub("*\n", "")] = [(!radiobtns.find_element(:xpath => "./div/input").attribute("checked").nil?).to_s, radiobtns.find_element(:xpath => "./div/div/div[2]/table/tbody/tr/td/div/textarea").text]

          # if radiobtns.find_element(:xpath => "./div/input").selected?
          #   response[row.find_element(:xpath => "./td[2]/h5").text]="#{radiobtns.find_element(:xpath => "./div/label").text.gsub("*\n", "")};#{radiobtns.find_element(:xpath => "./div/div/div[2]/table/tbody/tr/td/div/textarea").text}"
          # end
        end
      end
    end
  when "Checkbox"
    get_FieldUpdatesEdit_SpecifyNewFieldValueTable.each do |row|
      row.find_elements(:xpath => "./td[2]/ul/li").each do |radiobtns|
        if !(hObjValues[sObjName][radiobtns.find_element(:xpath => "./label").text.gsub("*\n", "")] == (!radiobtns.find_element(:xpath => "./input").attribute("checked").nil?).to_s)
          radiobtns.find_element(:xpath => "./input").attribute("checked").click
          puts "Updated Field: #{radiobtns.find_element(:xpath => "./label").text.gsub("*\n", "")}"
          blnUpdateReturn=true
        end

        # response[radiobtns.find_element(:xpath => "./label").text.gsub("*\n", "")] = (!radiobtns.find_element(:xpath => "./input").attribute("checked").nil?).to_s

        # response[row.find_element(:xpath => "./td[2]/h5").text]=radiobtns.find_element(:xpath => "./label").text.gsub("*\n", "") if radiobtns.find_element(:xpath => "./input").attribute("checked")
      end
    end
  when "Lookup"
    get_FieldUpdatesEdit_SpecifyNewFieldValueTable.each_with_index do |row, idx|
      case idx
      when 0
        # - Do nothing, blank row
      when 1
        # - Text Box (Lookup) Field
        # -########################################
        if !(hObjValues[sObjName][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] == row.find_element(:xpath => "./td[2]/div/span/input").attribute("value"))
          row.find_element(:xpath => "./td[2]/div/span/input").clear()
          row.find_element(:xpath => "./td[2]/div/span/input").send_keys(hObjValues[sObjName][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          puts "Updated Field: #{row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")}"
          blnUpdateReturn=true
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/span/input").attribute("value")
      when 2
        # - Checkbox
        if !(hObjValues[sObjName][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] == (!row.find_element(:xpath => "./td[2]/input").attribute("checked").nil?).to_s)
          row.find_element(:xpath => "./td[2]/input").click
          puts "Update Field: #{row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")}"
          blnUpdateReturn=true
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = (!row.find_element(:xpath => "./td[2]/input").attribute("checked").nil?).to_s
     end
    end
  end

  # return response
  @driver.manage.timeouts.implicit_wait = @implicitWait
  return blnUpdateReturn
end

#set_FieldUpdates_View(sViewName) ⇒ Object

set_EmailAlerts_View

> sViewName = string value of the Sharing Setting option to select

> Return = true or false

> true = setting of view were successful

> false = setting of view had an error



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/sfdc_se/pages/page_fieldupdates.rb', line 99

def set_FieldUpdates_View(sViewName)
	blnViewSet=false
	begin
     get_EmailAlertsViewOptions.each do |option|
			if option.text == sViewName
				option.click unless option.selected?
				blnViewSet=true
				# return blnViewSet
         break
			end
		end

     # - TODO: Add logic to get all rows on one page
     currentURL=@driver.current_url
     puts "Current URL: #{currentURL}"
     currentURL=@driver.current_url[0..(@drivercurrent_url.index("rowsperpage=")+12)] & "1000" if currentURL.include?("rowsperpage=")
     puts "Updated URL: #{currentURL}"
   rescue
		puts $!
  	puts $@
	end
	return blnViewSet
end

#set_HomePageLayout_Profile_Assignments(sProfile, sAssignment) ⇒ Object


set_HomePageLayout_Profile_Assignments2

> sProfile = String for profile to check/set

> sAssignment = String for Assigment value

> Return = true or false

> true = setting of value was successfull

> false = setting had an error or values was already set correctly



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
# File 'lib/sfdc_se/pages/page_homepagelayouts.rb', line 62

def set_HomePageLayout_Profile_Assignments(hProfileAssignments)
  blnChangedValue=false
  begin
    get_elements_HomePageLayouts_Profiles_table.each do |row|
      strProfile=row.find_element(:xpath => "./td[1]").text
      if strProfile[0] == "*"
        strProfile=strProfile[1..-1]
      end
      
      if hProfileAssignments.has_key? (strProfile)
        # check if current value is already set to assignment, if not set
        options=row.find_elements(:xpath => "./td[2]/div/select/option")

        options.each do |option|
          if option.selected?
            $strCurrentlySelected = option.text
          end
        end

        if hProfileAssignments[strProfile] != $strCurrentlySelected
          options.each do |option|
            if option.text == hProfileAssignments[strProfile]
              option.click
              blnChangedValue=true
            end
          end
        end
      end
    end
  rescue
    puts $!
    puts $@
    blnChangedValue = false
  end
  return blnChangedValue
end

#set_LocaleSidKey(blnSandbox, sUserName, sPassword, sLocaleSidKey) ⇒ Object

> Returns true or false



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/sfdc_se/general/general.rb', line 51

def set_LocaleSidKey(blnSandbox, sUserName, sPassword, sLocaleSidKey)
     ENV['http_proxy']='http://webproxy.merck.com:8080'
     ENV['https_proxy']='https://webproxy.merck.com:8080'

   	blnRep=false

   	client=restforce_client({:sandbox => blnSandbox, :username => sUserName, :password => sPassword})
   	resp_SOQL=client.query("SELECT Id,LocaleSidKey FROM User WHERE Username = '#{sUserName}'")

   	if resp_SOQL.size > 0
   		resp_SOQL.each do |r|
   			if r['LocaleSidKey'] != sLocaleSidKey
   				client.update('User', Id: r['Id'], LocaleSidKey: sLocaleSidKey) ? blnRep=true : blnRep=false
   			elsif r['LocaleSidKey'] == sLocaleSidKey
   				blnRep=true
   			end
     		end
   	end

     ENV.delete('HTTP_PROXY')
     ENV.delete('HTTPS_PROXY')
     
   	return blnRep
end

#set_NewPasswordField(sPWD) ⇒ Object


set_NewPasswordField(sPWD)



34
35
36
# File 'lib/sfdc_se/pages/page_passwordsecuritysetting.rb', line 34

def set_NewPasswordField(sPWD)
	@driver.find_element(:id => 'newpassword').send_keys(sPWD)
end

#set_Profile_View(sViewName) ⇒ Object

set_Profile_View

> sViewName = string value of the view name to select

> Return = true or false

> true = setting of view were successful

> false = setting of view had an error



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/sfdc_se/pages/page_profiles.rb', line 197

def set_Profile_View(sViewName)
	blnViewSet=false
	begin
		get_ProfileViewOptions.each do |option|
			if option.text == sViewName
				option.click unless option.selected?
				blnViewSet=true
				return blnViewSet
			end
		end
	rescue
		puts $!
     puts $@
	end
	return blnViewSet
end

#set_Profiles_AdministrativePermissions(hValues) ⇒ Object


set_Profiles_AdministrativePermissions

> hValues = an input Hash of the values to set per profile

> Returns true/false



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/sfdc_se/pages/page_profiles.rb', line 266

def set_Profiles_AdministrativePermissions(hValues)
  @driver.manage.timeouts.implicit_wait = 0
  blnReturn=false

  get_Profiles_AdministrativePermissions_table.each do |i|
    # - Left hand column
    if i.find_elements(:xpath => "./td[2]/img").size == 0
      sOrgSetting = i.find_element(:xpath => "./td[2]/input").selected? ? "Checked" : "Not Checked"
      if !(sOrgSetting==hValues[i.find_element(:xpath => "./td[1]").text.gsub("*\n", "")])
        i.find_element(:xpath => "./td[2]/input").click
        blnReturn=true
      end
    end

    # - Right hand column
    if i.find_elements(:xpath => "./td[4]/img").size == 0 and i.find_element(:xpath => "./td[3]").attribute("class") != "labelCol last empty"
      sOrgSetting = i.find_element(:xpath => "./td[4]/input").selected? ? "Checked" : "Not Checked"
      if !(sOrgSetting==hValues[i.find_element(:xpath => "./td[3]").text.gsub("*\n", "")])
        i.find_element(:xpath => "./td[4]/input").click
        blnReturn=true
      end
    end

  end

  @driver.manage.timeouts.implicit_wait = @implicitWait

  return blnReturn
end

#set_Profiles_ApexClassAccess(hValues) ⇒ Object


set_Profiles_ApexClassAccess

> hValues = Hash of the values to be set for the indicated Profile/Section

> Returns true/false



684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
# File 'lib/sfdc_se/pages/page_profiles.rb', line 684

def set_Profiles_ApexClassAccess(hValues)
  @driver.manage.timeouts.implicit_wait = 0
  blnReturn=false
  begin
    hValues.each do |value|
      options=get_Profiles_ApexClassAccess_AvailableSelect
      options.each do |option_s|
        if option_s.text == value
          option_s.click
          click_btn_Profiles_ApexClassAccess_Add
          blnReturn=true
          break
        end
      end
    end

    @driver.manage.timeouts.implicit_wait = @implicitWait
    return blnReturn
  rescue
    puts $!
    puts $@
  ensure
    @driver.manage.timeouts.implicit_wait = @implicitWait
  end
end

#set_Profiles_CustomObjectPermissions(hValues) ⇒ Object


set_Profiles_CustomObjectPermissions

> hValues = Hash of the values to be set for the indicated Profile/Section

> Returns true/false



596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
# File 'lib/sfdc_se/pages/page_profiles.rb', line 596

def set_Profiles_CustomObjectPermissions(hValues)
  @driver.manage.timeouts.implicit_wait = 0
  @aCOP_Headers=[]
  blnReturn=false

  get_Profiles_CustomObjectPermissions_table.each_with_index do |row, index|
    if index == 0
      row.find_elements(:xpath => "./td[2]/table/tbody/tr[2]/th").each do |header|
        @aCOP_Headers.push(header.text)
      end
    else
      # -- Left Column of Table
      row.find_elements(:xpath => "./td[1]/table/tbody/tr/td").each_with_index do |hv, idx|
        if hv.find_elements(:xpath => ".//*").size > 0
          sOrgSetting = hv.find_element(:xpath => "./input").selected? ? "Checked" : "Not Checked"
          print "Row/Index: #{index}; Label: #{row.find_element(:xpath => "./th[1]").text}; Hash Include True/False: #{hValues.include?(row.find_element(:xpath => "./th[1]").text)}\r"
          if hValues.include?(row.find_element(:xpath => "./th[1]").text)
            if !(sOrgSetting == hValues[row.find_element(:xpath => "./th[1]").text][@aCOP_Headers[idx]])
              hv.find_element(:xpath => "./input").click
              sMsg=""
              a=@driver.switch_to.alert rescue "Exception happened"
              if !(a == "Exception happened")
                sMsg= "Accepting Alert: #{a.text}"
                a.accept
              end
              blnReturn=true
            end
          end
        end
      end
      # -- Right Column of Table
      if row.find_element(:xpath => "./td[2]").attribute("class") != "labelCol last empty"
        row.find_elements(:xpath => "./td[2]/table/tbody/tr/td").each_with_index do |hv, idx|
          if hv.find_elements(:xpath => ".//*").size > 0
            sOrgSetting = hv.find_element(:xpath => "./input").selected? ? "Checked" : "Not Checked"
            if !(sOrgSetting == hValues[row.find_element(:xpath => "./th[2]").text][@aCOP_Headers[idx]])
              hv.find_element(:xpath => "./input").click
              sMsg=""
              a=@driver.switch_to.alert rescue "Exception happened"
              if !(a == "Exception happened")
                sMsg= "Accepting Alert: #{a.text}"
                a.accept
              end
              blnReturn=true
            end
          end
        end
      end
    end
  end
  @driver.manage.timeouts.implicit_wait = @implicitWait
  print "\n"
  return blnReturn
end

#set_Profiles_GeneralUserPermissions(hValues) ⇒ Object


set_Profiles_GeneralUserPermissions

> Returns a hash; Key = Permission Name, Value = Checked/Unchecked



322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/sfdc_se/pages/page_profiles.rb', line 322

def set_Profiles_GeneralUserPermissions(hValues)
  @driver.manage.timeouts.implicit_wait = 0
  blnReturn=false

  get_Profiles_GeneralUserPermissions_table.each do |row|

    # - Left Hand Column
    if row.find_elements(:xpath => "./td[2]/img").size == 0
      sOrgSetting = row.find_element(:xpath => "./td[2]/input").selected? ? "Checked" : "Not Checked"
      if !(sOrgSetting==hValues[row.find_element(:xpath => "./td[1]").text.gsub("*\n", "")])
        row.find_element(:xpath => "./td[2]/input").click
        blnReturn=true
      end
    end

    # - Right Hand Column
    if row.find_elements(:xpath => "./td[4]/img").size == 0 and row.find_element(:xpath => "./td[3]").attribute("class") != "labelCol last empty"
      sOrgSetting = row.find_element(:xpath => "./td[4]/input").selected? ? "Checked" : "Not Checked"
      if !(sOrgSetting==hValues[row.find_element(:xpath => "./td[3]").text.gsub("*\n", "")])
        row.find_element(:xpath => "./td[4]/input").click
        blnReturn=true
      end
    end
  end

  # begin
  #   @aConfig=Hash.new
  #   #-TODO: Check if profile is CustomProfile (if not return blank hash)
  #   if get_Profiles_CustomProfile_CheckboxValue
  #     get_Profiles_GeneralUserPermissions_table.each do |row|
  #       @aConfig[row.find_element(:xpath => "./td[1]").text]=row.find_element(:xpath => "./td[2]/img").attribute("alt")
  #       @aConfig[row.find_element(:xpath => "./td[3]").text]=row.find_element(:xpath => "./td[4]/img").attribute("alt") unless row.find_element(:xpath => "./td[3]").attribute("class") == "labelCol last empty"
  #     end
  #   end
  #   return @aConfig
  # rescue
  #   puts $!
  #   puts $@
  # end

  @driver.manage.timeouts.implicit_wait = @implicitWait

  return blnReturn
end

#set_Profiles_StandardObjectPermissions(hValues) ⇒ Object


set_Profiles_StandardObjectPermissions

> hValues = Hash of the values to be set for the indicated Profile/Section

> Returns true/false



484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
# File 'lib/sfdc_se/pages/page_profiles.rb', line 484

def set_Profiles_StandardObjectPermissions(hValues)
  @driver.manage.timeouts.implicit_wait = 0
  blnReturn=false
  @aSOP_Headers=[]

  get_Profiles_StandardObjectPermissions_table.each_with_index do |row, index|
    next if index < 2
    if index == 2
      row.find_elements(:xpath => "./td[2]/table/tbody/tr[2]/th").each do |header|
        @aSOP_Headers.push(header.text)
      end
    else
      # -- Left Column of Table
      row.find_elements(:xpath => "./td[1]/table/tbody/tr/td").each_with_index do |hv, idx|
        if hv.find_elements(:xpath => ".//*").size > 0
          sOrgSetting = hv.find_element(:xpath => "./input").selected? ? "Checked" : "Not Checked"
          if !(sOrgSetting == hValues[row.find_element(:xpath => "./th[1]").text][@aSOP_Headers[idx]])
            hv.find_element(:xpath => "./input").click
            sMsg=""
            a=@driver.switch_to.alert rescue "Exception happened"
            if !(a == "Exception happened")
              sMsg= "Accepting Alert: #{a.text}"
              a.accept
            end
            blnReturn=true
          end
        end
      end          

      # -- Right Column of Table
      if row.find_element(:xpath => "./td[2]").attribute("class") != "labelCol last empty"
        row.find_elements(:xpath => "./td[2]/table/tbody/tr/td").each_with_index do |hv, idx|
          if hv.find_elements(:xpath => ".//*").size > 0
            sOrgSetting = hv.find_element(:xpath => "./input").selected? ? "Checked" : "Not Checked"
            if !(sOrgSetting == hValues[row.find_element(:xpath => "./th[2]").text][@aSOP_Headers[idx]])
              hv.find_element(:xpath => "./input").click
              sMsg=""
              a=@driver.switch_to.alert rescue "Exception happened"
              if !(a == "Exception happened")
                sMsg= "Accepting Alert: #{a.text}"
                a.accept
              end
              blnReturn=true
            end
          end
        end
      end

    end
  end

  @driver.manage.timeouts.implicit_wait = @implicitWait
  return blnReturn
end

#set_Profiles_TabSettings(hProfileValues) ⇒ Object


set_Profiles_TabSettings

> hProfileValues = Hash of the values to be set for the indicated Profile/Section

> Returns true/false



395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
# File 'lib/sfdc_se/pages/page_profiles.rb', line 395

def set_Profiles_TabSettings(hProfileValues)
  blnReturn=false
  begin
    if !get_Profiles_TabSettings_table.nil?
      get_Profiles_TabSettings_table.each do |row|
        next if row.attribute("class") == "detailRow"

        if row.find_elements(:xpath => "./td[2]//*").size > 0
          if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hProfileValues[row.find_element(:xpath => "./td[1]").text.gsub("*\n", "")])
            row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
              if option.text == hProfileValues[row.find_element(:xpath => "./td[1]").text.gsub("*\n", "")]
                option.click
                blnReturn=true
              end
            end
          end
        end

        if (row.find_element(:xpath => "./td[3]").attribute("class") != "labelCol last empty") and (row.find_elements(:xpath => "./td[4]//*").size > 0)
          if !(row.find_element(:xpath => "./td[4]/div/select/option[@selected='selected']").text == hProfileValues[row.find_element(:xpath => "./td[3]").text.gsub("*\n", "")])
            row.find_elements(:xpath => "./td[4]/div/select/option").each do |option|
              if option.text == hProfileValues[row.find_element(:xpath => "./td[3]").text.gsub("*\n", "")]
                option.click
                blnReturn=true
              end
            end
          end
        end
      end
      return blnReturn
    end
  rescue
    puts $!
    puts $@
  end
end

#set_Profiles_VisualforcePageAccess(hValues) ⇒ Object


set_Profiles_VisualforcePageAccess

> hValues = Hash of the values to be set for the indicated Profile/Section

> Returns true/false



740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
# File 'lib/sfdc_se/pages/page_profiles.rb', line 740

def set_Profiles_VisualforcePageAccess(hValues)
  @driver.manage.timeouts.implicit_wait = 0
  blnReturn=false
  begin
    # -- Remove already 'enabled' VF Pages from hValues
    hValues.each do |value|
      options=get_Profile_VisualforcePageAccess_EnabledSelect
      options.each do |option_es|
        if option_es.text == value
          hValues=hValues - [value]
          break
        end
      end
    end
    puts "hValue Count after looking at enabled list: #{hValues.size}"

    hValues.each do |value|
      options=get_Profiles_ApexClassAccess_AvailableSelect
      options.each do |option_s|
        if option_s.text == value
          option_s.click
          click_btn_Profiles_ApexClassAccess_Add
          blnReturn=true
          break
        end
      end
    end

    @driver.manage.timeouts.implicit_wait = @implicitWait
    return blnReturn
  rescue
    puts $!
    puts $@
  ensure
    @driver.manage.timeouts.implicit_wait = @implicitWait
  end
end

#set_RenameTabsLabels_Language(sLanguage) ⇒ Object

> Return = true or false

> true = setting of view were successful

> false = setting of view had an error



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/sfdc_se/pages/page_renametabslabels.rb', line 80

def set_RenameTabsLabels_Language(sLanguage)
  	blnReturn=false

  	begin
		get_RenameTabsLabels_Language.each do |option|
			if option.text == sLanguage
				option.click unless option.selected?
				blnReturn=true
				sleep(3)
				break
			end
		end
	rescue
		puts $!
  	puts $@
	end
	return blnReturn
end

#set_RenameTabsLabels_Standard(hValueSet) ⇒ Object


set_RenameTabsLabels_Standard

> Return = Hash Field Name/Type, Value=Field Value



542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
# File 'lib/sfdc_se/pages/page_renametabslabels.rb', line 542

def set_RenameTabsLabels_Standard(hValueSet)
  blnReturn=false
  
  # -- Step 1 of 2
  case get_RenameTabsLabels_StandardTable_Step1[1].find_element(:xpath => "./td[2]").text
  when "English", "English (UK)"
    get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
      case idx
      when 0,1
        # response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
      when 2,3
        if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_element(:xpath => "./td[2]/div/input").clear()
          row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          blnReturn=true
        end             

        # puts "Value for #{row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")}: #{hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]}"
        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
      when 4
        if !((!row.find_element(:xpath => "./td[2]/input").attribute("checked").nil?).to_s == hValueSet[row.find_element(:xpath => "./td[1]/label").text].to_s)
          row.find_element(:xpath => "./td[2]/input").click
          blnReturn=true
        end

        # response[row.find_element(:xpath => "./td[1]/label").text] = !row.find_element(:xpath => "./td[2]/input").attribute("checked").nil? 
      end
    end
  when "Indonesian"
    get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
      case idx
      when 0,1
        # response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
      when 2,3
        if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_element(:xpath => "./td[2]/div/input").clear()
          row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          blnReturn=true
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
      end
    end
  when "German"
    # - Get Tab, Language, Gender
    get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
      case idx
      when 0,1
        # response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
      when 2
        if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
            if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
              option.click
              blnReturn=true
              sleep(3)
              break
            end
          end
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
      end
    end

    # - Get Sub Table information
    aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative']
    aSubTables.each do |s|
      get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
        if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_element(:xpath => "./td[2]/div/input").clear()
          row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          blnReturn=true
        end

        # subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
      end
    end
  when "Romanian"
    # - Get Tab, Language, Gender
    get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
      case idx
      when 0,1
        # response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
      when 2
        if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
            if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
              option.click
              blnReturn=true
              sleep(3)
              break
            end
          end
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
      end
    end

    # - Get Sub Table information
    aSubTables=['Nominative', 'Dative']
    aSubTables.each do |s|
      get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
        if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_element(:xpath => "./td[2]/div/input").clear()
          row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          blnReturn=true
        end

        # subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
      end
    end
  when "Spanish", "Portuguese (Brazilian)", "Dutch", "Spanish (Mexican)", "Bulgarian", "Portuguese (European)"
    get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
      case idx
      when 0,1
        # response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
      when 2
        if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_elements(:xpath => "./td[2]/div/select/option").eah do |option|
            if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
              option.click
              blnReturn=true
              break
            end
          end
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
      when 3,4
        if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_element(:xpath => "./td[2]/div/input").clear()
          row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          blnReturn=true
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
      end
    end
  when "French"
    get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
      case idx
      when 0,1
        # response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
      when 2
        if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
            if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
              option.click
              blnReturn=true
              break
            end
          end
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
      when 3,4
        if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_element(:xpath => "./td[2]/div/input").clear
          row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          blnReturn=true
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
      when 5
        if !((!row.find_element(:xpath => "./td[2]/input").attribute("checked").nil?).to_s == hValueSet[row.find_element(:xpath => "./td[1]/label").text].to_s)
          row.find_element(:xpath => "./td[2]/input").click
          blnReturn=true
        end

        # response[row.find_element(:xpath => "./td[1]/label").text] = !row.find_element(:xpath => "./td[2]/input").attribute("checked").nil?   
      end
    end
  when "Italian"
    get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
      case idx
      when 0,1
        # response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
      when 2
        if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_elements(:xpath => "./td[2]/div/select/option]").each do |option|
            if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
              option.click
              blnReturn=true
              break
            end
          end
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]=row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
      when 3,4
        if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_element(:xpath => "./td[2]/div/input").clear()
          row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          blnReturn=true
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
      when 5
        if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
            if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
              option.click
              blnReturn=true
              break
            end
          end
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text 
      end
    end
  when "Japanese", "Korean", "Chinese (Traditional)", "Chinese (Simplified)", "Thai", "Vietnamese"
    get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
      case idx
      when 0,1
        # response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
      when 2
        if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_element(:xpath => "./td[2]/div/input").clear()
          row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          blnReturn=true
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
      end
    end
  when "Swedish", "Danish", "Norwegian", "Hebrew", "Arabic"
    get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
      case idx
      when 0,1
        # response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
      when 2
        if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
            if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
              option.click
              blnReturn=true
              break
            end
          end
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text 
      else
        if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_element(:xpath => "./td[2]/div/input").clear()
          row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          blnReturn=true
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
      end
    end
  when "Finnish"
    # - Get Tab, Language
    # get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
    #   case idx
    #   when 0,1
    #     response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
    #   end
    #   break if idx > 1
    # end
    
    # - Get Sub section information
    aSubTables=['Nominative', 'Genitive', 'Inessive', 'Elative', 'Illative', 'Adessive', 'Ablative', 'Allative', 'Essive', 'Translative', 'Partitive']
    aSubTables.each do |s|
      get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
        if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]) 
          row.find_element(:xpath => "./td[2]/div/input").clear()
          row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          blnReturn=true
        end

        # subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
      end
    end
  when "Russian"
    # - Get Tab, Language, Gender
    get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
      case idx
      when 0,1
        # response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
      when 2
        if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
            if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
              option.click
              blnReturn=true
              break
            end
          end
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
      end
    end

    # - Get Sub section information
    aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative', 'Instrumental', 'Prepositional']
    aSubTables.each do |s|
      get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
        if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_element(:xpath => "./td[2]/div/input").clear()
          row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          blnReturn=true
        end

        # subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
      end
    end
  when "Hungarian"
    # - Get Tab, Language
    # get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
    #   case idx
    #   when 0,1
    #     response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
    #   end
    #   break if idx > 1
    # end
    
    # - Get Sub section information
    aSubTables=['Nominative', 'Accusative', 'Dative', 'Inessive', 'Elative', 'Illative', 'Ablative', 'Allative', 'Translative', 'Instrumental', 'Sublative', 'Superessive', 'Delative', 'Causal-Final', 'Essive-Formal', 'Terminative']
    aSubTables.each do |s|
      get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
        if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_element(:xpath => "./td[2]/div/input").clear()
          row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          blnReturn=true
        end

        # subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
      end
    end

    # - Get final Sub section information that has checkbox in the last row
    get_RenameTabsLabels_StandardTable_Step1_Subtable('Distributive').each_with_index do |row, idx|
      if idx < 6
        if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet['Distributive'][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_element(:xpath => "./td[2]/div/input").clear()
          row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet['Distributive'][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          blnReturn=true
        end

        # subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
      else
        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)
          row.find_element(:xpath => "./td[2]/input").click
          blnReturn=true
        end

        # subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = !row.find_element(:xpath => "./td[2]/input").attribute("checked").nil?
      end
    end
  when "Polish", "Czech", "Ukrainian", "Slovene"
    # - Get Tab, Language, Gender
    get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
      case idx
      when 0,1
        # response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
      when 2
        if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
            if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
              option.click
              blnReturn=true
              break
            end
          end
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
      end
    end

    # - Get Sub section information
    aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative', 'Instrumental', 'Locative', 'Vocative']
    aSubTables.each do |s|
      get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
        if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_element(:xpath => "./td[2]/div/input").clear()
          row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          blnReturn=true
        end

        # subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
      end
    end
  when "Turkish"
    # - Get Tab, Language
    # get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
    #   case idx
    #   when 0,1
    #     response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
    #   end
    #   break if idx > 1
    # end
    
    # - Get Sub section information
    aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative', 'Ablative', 'Locative']
    aSubTables.each do |s|
      get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
        if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_element(:xpath => "./td[2]/div/input").clear()
          row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          blnReturn=true
        end

        # subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
      end
    end
  when "Greek"
    # - Get Tab, Language, Gender
    get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
      case idx
      when 0,1
        # response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
      when 2
        if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
            if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
              option.click
              blnReturn=true
              break
            end
          end
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
      end
    end
    
    # - Get Sub section information
    aSubTables=['Nominative', 'Accusative', 'Genitive', 'Vocative']
    aSubTables.each do |s|
      get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
        if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_element(:xpath => "./td[2]/div/input").clear()
          row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          blnReturn=true
        end

        # subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
      end
    end
  when "Slovak", "Croatian"
    # - Get Tab, Language, Gender
    get_RenameTabsLabels_StandardTable_Step1.each_with_index do |row, idx|
      case idx
      when 0,1
        # response[row.find_element(:xpath => "./td[1]").text] = row.find_element(:xpath => "./td[2]").text
      when 2
        if !(row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_elements(:xpath => "./td[2]/div/select/option").each do |option|
            if option.text == hValueSet[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")]
              option.click
              blnReturn=true
              break
            end
          end
        end

        # response[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/select/option[@selected='selected']").text
      end
    end
    
    # - Get Sub section information
    aSubTables=['Nominative', 'Accusative', 'Genitive', 'Dative', 'Instrumental', 'Locative']
    aSubTables.each do |s|
      get_RenameTabsLabels_StandardTable_Step1_Subtable(s).each do |row|
        if !(row.find_element(:xpath => "./td[2]/div/input").attribute("value") == hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          row.find_element(:xpath => "./td[2]/div/input").clear()
          row.find_element(:xpath => "./td[2]/div/input").send_keys(hValueSet[s][row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")])
          blnReturn=true
        end

        # subresponse[row.find_element(:xpath => "./td[1]/label").text.gsub("*\n", "")] = row.find_element(:xpath => "./td[2]/div/input").attribute("value")
      end
    end
  end

  # -- Click Next to get to Step 2
  click_Btn_RenameTabslabels_Next

  # -- Step 2 of 2
  # --- Standard Field Labels Table
  @driver.manage.timeouts.implicit_wait = 0
  aStep2Headers=[]
  iStep2HeaderCount=0
  iTableCount=1
  srowFieldLabel=''
  sTableType=''

  while iTableCount < 3
    if iTableCount == 1 
      aTable=get_RenameTabsLabels_StandardTable_Step2_StandardField
      sTableType='Standard Field Labels'
    else
      aTable=get_RenameTabsLabels_StandardTable_Step2_OtherLabels
      sTableType='Other Labels'
    end

    aTable.each_with_index do |row, idx|
      if idx == 0
        iStep2HeaderCount = row.find_elements(:xpath => "./th").length
        row.find_elements(:xpath => "./th").each do |subrow|
          aStep2Headers.push(subrow.text)
        end
      else
        case iStep2HeaderCount
        when 2
          # - Find countries that have only two Step 2 Header Columns
          if row.find_elements(:xpath => "./td[1]//*").size > 0
            if !(row.find_element(:xpath => "./td[1]/input").attribute("value") == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[1]])
              row.find_element(:xpath => "./td[1]/input").clear()
              row.find_element(:xpath => "./td[1]/input").send_keys(hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[1]])
              blnReturn=true
            end
          end

          # srowFieldLabel=row.find_element(:xpath => "./th").text
          # hStep2SubRowResp[aStep2Headers[1]]=row.find_element(:xpath => "./td[1]/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
        when 3
          # - Find countries that have only three Step 3 Header Columns
          if row.find_elements(:xpath => "./td[1]//*").size > 0
            if !(row.find_element(:xpath => "./td[1]/input").attribute("value") == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[1]])
              row.find_element(:xpath => "./td[1]/input").clear()
              row.find_element(:xpath => "./td[1]/input").send_keys(hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[1]])
              blnReturn=true
            end
          end

          if row.find_elements(:xpath => "./td[2]//*").size > 0
            if !(row.find_element(:xpath => "./td[2]/input").attribute("value") == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[2]])
              row.find_element(:xpath => "./td[2]/input").clear()
              row.find_element(:xpath => "./td[2]/input").send_keys(hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[2]])
            end
          end

          # srowFieldLabel=row.find_element(:xpath => "./th").text
          # hStep2SubRowResp[aStep2Headers[1]]=row.find_element(:xpath => "./td[1]/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
          # hStep2SubRowResp[aStep2Headers[2]]=row.find_element(:xpath => "./td[2]/input").attribute("value") unless row.find_elements(:xpath => "./td[2]//*").size == 0
        when 4
          # - Find countries that have only four Step 4 Header Columns
          if row.find_elements(:xpath => "./td[1]//*").size > 0
            if !(row.find_element(:xpath => "./td[1]/input").attribute("value") == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[1]])
              row.find_element(:xpath => "./td[1]/input").clear()
              row.find_element(:xpath => "./td[1]/input").send_keys(hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[1]])
              blnReturn=true
            end
          end

          if row.find_elements(:xpath => "./td[2]//*").size > 0
            if !(row.find_element(:xpath => "./td[2]/input").attribute("value") == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[2]])
              row.find_element(:xpath => "./td[2]/input").clear()
              row.find_element(:xpath => "./td[2]/input").send_keys(hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[2]])
              blnReturn=true
            end
          end

          if row.find_element(:xpath => "./td[3]").attribute("class") == " dataCell  booleanColumn"
            # - get checkbox value
            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)
              row.find_element(:xpath => "./td[3]/input").click
              blnReturn=true
            end
            # hStep2SubRowResp[aStep2Headers[3]] = !row.find_element(:xpath => "./td[3]/input").attribute("checked").nil? 
          else
            # - Get gender value
            if row.find_elements(:xpath => "./td[3]//*").size > 0
              if !(row.find_element(:xpath => "./td[3]/select/option[@selected='selected']").text == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[3]])
                row.find_elements(:xpath => "./td[3]/select/option").each do |option|
                  if option.text == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[3]]
                    option.click
                    blnReturn=true
                    break
                  end
                end
              end
            end
            # hStep2SubRowResp[aStep2Headers[3]] = row.find_element(:xpath => "./td[3]/select/option[@selected='selected']").text unless row.find_elements(:xpath => "./td[3]//*").size == 0
          end

          # srowFieldLabel=row.find_element(:xpath => "./th").text
          # hStep2SubRowResp[aStep2Headers[1]]=row.find_element(:xpath => "./td[1]/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
          # hStep2SubRowResp[aStep2Headers[2]]=row.find_element(:xpath => "./td[2]/input").attribute("value") unless row.find_elements(:xpath => "./td[2]//*").size == 0
          # if row.find_element(:xpath => "./td[3]").attribute("class") == " dataCell  booleanColumn"
          #   # - get checkbox value
          #   hStep2SubRowResp[aStep2Headers[3]] = !row.find_element(:xpath => "./td[3]/input").attribute("checked").nil? 
          # else
          #   # - Get gender value
          #   hStep2SubRowResp[aStep2Headers[3]] = row.find_element(:xpath => "./td[3]/select/option[@selected='selected']").text unless row.find_elements(:xpath => "./td[3]//*").size == 0
          # end
        when 5
          # - Find countries that have only five Step 5 Header Columns
          # - ############################## HERE ##############################
          if row.find_elements(:xpath => "./td[1]//*").size > 0
            if !(row.find_element(:xpath => "./td[1]/input").attribute("value") == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[1]])
              row.find_element(:xpath => "./td[1]/input").clear()
              row.find_element(:xpath => "./td[1]/input").send_keys(hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[1]])
              blnReturn=true
            end
          end

          if row.find_elements(:xpath => "./td[2]//*").size > 0
            if !(row.find_element(:xpath => "./td[2]/input").attribute("value") == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[2]])
              row.find_element(:xpath => "./td[2]/input").clear()
              row.find_element(:xpath => "./td[2]/input").send_keys(hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[2]])
              blnReturn=true
            end
          end

          if row.find_elements(:xpath => "./td[3]//*").size > 0 
            if !(row.find_element(:xpath => "./td[3]/select/option[@selected='selected']").text == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[3]])
              row.find_elements(:xpath => "./td[3]/select/option").each do |option|
                if option.text == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[3]]
                  option.click
                  blnReturn=true
                  break
                end
              end
            end
          end

          if row.find_element(:xpath => "./td[4]").attribute("class") == " dataCell  booleanColumn"
            # - get checkbox value
            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)
              row.find_element(:xpath => "./td[4]/input").click
              blnReturn=true
            end
            # hStep2SubRowResp[aStep2Headers[4]] = !row.find_element(:xpath => "./td[4]/input").attribute("checked").nil? 
          else
            # - Get gender value
            if row.find_elements(:xpath => "./td[4]//*").size > 0
              if !(row.find_element(:xpath => "./td[4]/select/option[@selected='selected']").text == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[4]])
                row.find_elements(:xpath => "./td[4]/select/option").each do |option|
                  if option.text == hValueSet[sTableType][row.find_element(:xpath => "./th").text][aStep2Headers[4]]
                    option.click
                    blnReturn=true
                    break
                  end
                end
              end
            end
            # hStep2SubRowResp[aStep2Headers[4]] = row.find_element(:xpath => "./td[4]/select/option[@selected='selected']").text unless row.find_elements(:xpath => "./td[4]//*").size == 0
          end

          # srowFieldLabel=row.find_element(:xpath => "./th").text
          # hStep2SubRowResp[aStep2Headers[1]]=row.find_element(:xpath => "./td[1]/input").attribute("value") unless row.find_elements(:xpath => "./td[1]//*").size == 0
          # hStep2SubRowResp[aStep2Headers[2]]=row.find_element(:xpath => "./td[2]/input").attribute("value") unless row.find_elements(:xpath => "./td[2]//*").size == 0
          # hStep2SubRowResp[aStep2Headers[3]]=row.find_element(:xpath => "./td[3]/select/option[@selected='selected']").text unless row.find_elements(:xpath => "./td[3]//*").size == 0
          # if row.find_element(:xpath => "./td[4]").attribute("class") == " dataCell  booleanColumn"
          #   # - get checkbox value
          #   hStep2SubRowResp[aStep2Headers[4]] = !row.find_element(:xpath => "./td[4]/input").attribute("checked").nil? 
          # else
          #   # - Get gender value
          #   hStep2SubRowResp[aStep2Headers[4]] = row.find_element(:xpath => "./td[4]/select/option[@selected='selected']").text unless row.find_elements(:xpath => "./td[4]//*").size == 0
          # end
        end
      end
    end

    iTableCount +=1
  end

  @driver.manage.timeouts.implicit_wait = @implicitWait
  
  return blnReturn
end

#set_selection_Devliverability_AccessLevel(value) ⇒ Object


set_selection_AccessLevel

> value = string of the value to select in the dropdown

> returns the selected value



45
46
47
48
49
50
51
52
53
# File 'lib/sfdc_se/pages/page_deliverability.rb', line 45

def set_selection_Devliverability_AccessLevel(value)
  options=get_elements_Devliverability_AccessLevel
  options.each do |option_s|
    if option_s.text == value
      option_s.click
      return option_s.text
    end
  end
end

#set_SharingSetting_View(sViewName) ⇒ Object

set_SharingSetting_View

> sViewName = string value of the Sharing Setting option to select

> Return = true or false

> true = setting of view were successful

> false = setting of view had an error



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/sfdc_se/pages/page_sharingsettings.rb', line 91

def set_SharingSetting_View(sViewName)
	blnViewSet=false
	begin
		get_SharingSettingOptions.each do |option|
			if option.text == sViewName
				option.click unless option.selected?
				blnViewSet=true
				return blnViewSet
			end
		end
	rescue
		puts $!
  	puts $@
	end
	return blnViewSet
end

#set_SharingSettingAccess_Edit(sObjName, hObjValues) ⇒ Object


> sObjName = string value of the sharing setting object to return

> hOjbValues = Hash of the values to verify for the sObjName

> Return = true/false

- True if values match
- False if values do not match


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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/sfdc_se/pages/page_sharingsettings.rb', line 198

def set_SharingSettingAccess_Edit(sObjName, hObjValues)
  @driver.manage.timeouts.implicit_wait = 0
  blnUpdateSuccessful=false
  $accessHeaders=[]

  # - Perform Update Actions
  get_SharingSettingAccessTable_Edit.each_with_index do |row, index|
    if index == 0
      # - Get headers
      row.find_elements(:xpath => "./th").each do |h|
        $accessHeaders.push(h.text)
      end
    else
        # - Perform Updates to columns
        if row.find_element(:xpath => "./td[1]").text == sObjName
          # - Column: Default Internal Access (dropdown selection)
          if row.find_elements(:xpath => "./td[2]//*").size > 0
            if !(hObjValues[sObjName][$accessHeaders[1]]==row.find_element(:xpath => "./td[2]/select/option[@selected='selected']").text)
              row.find_elements(:xpath => "./td[2]/select/option").each do |option|
                if option.text == hObjValues[sObjName][$accessHeaders[1]]
                  option.click unless option.selected?
                  # puts "-- ** Set Default Internal Access **"
                  blnUpdateSuccessful=true
                end
              end
            end
          end

          # - Column: Default External Access (dropdown selection)
          if row.find_elements(:xpath => "./td[3]//*").size > 0
            if !(hObjValues[sObjName][$accessHeaders[2]]==row.find_element(:xpath => "./td[3]/select/option[@selected='selected']").text)
              row.find_elements(:xpath => "./td[3]/select/option").each do |option|
                if option.text == hObjValues[sObjName][$accessHeaders[1]]
                  option.click unless option.selected?
                  # puts "-- ** Set Default External Access **"
                  blnUpdateSuccessful=true
                end
              end
            end
          end

          # - Grant Access Using Hierarchies (checkbox)
          if row.find_element(:xpath => "./td[4]/input").attribute("disabled").nil?
            # puts "Checkbox Not Disabled"
            if (hObjValues[sObjName][$accessHeaders[3]]) == "Checked"
              row.find_element(:xpath => "./td[4]/input[@type='checkbox']").click unless !row.find_element(:xpath => "./td[4]/input").attribute("checked").nil?
              blnUpdateSuccessful=true
            else
              row.find_element(:xpath => "./td[4]/input[@type='checkbox']").click unless row.find_element(:xpath => "./td[4]/input").attribute("checked").nil?
              blnUpdateSuccessful=true
            end
          # else
          #   puts "Checkbox Disabled"
          end
          
          break
        end
    end
  end

  @driver.manage.timeouts.implicit_wait = @implicitWait
  return blnUpdateSuccessful
end

#set_Translation_Aspect(sAspect) ⇒ Object

> Return = true or false

> true = setting of view were successful

> false = setting of view had an error



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/sfdc_se/pages/page_translate.rb', line 159

def set_Translation_Aspect(sAspect)
  	blnReturn=false

  	begin
		get_Translate_Aspect.each do |option|
			if option.text == sAspect
				option.click unless option.selected?
				blnReturn=true
				sleep(3)
				break
			end
		end
	rescue
		puts $!
  	puts $@
	end
	return blnReturn
end

#set_Translation_CustomReportType_Description(sCustomReportTypeName, sTranslationValue) ⇒ Object


set_Translation_CustomReportType_Description

> Return = true/false



280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/sfdc_se/pages/page_translate.rb', line 280

def set_Translation_CustomReportType_Description(sCustomReportTypeName, sTranslationValue)
  blnReturn=false
  blnFound=false
  idx=0

  until (@driver.find_element(:id => 'pageNumField').attribute("value").to_i == @driver.find_element(:id => 'totalPages').text.to_i and idx==@driver.find_element(:id => 'totalPages').text.to_i) or blnFound==true
    r=0
    while r < get_Translate_CustomReportType_FieldLabel_rows.length
      if get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[1]/div").text == sCustomReportTypeName
        if !(get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[2]/div").text == sTranslationValue)
          @driver.action.double_click(get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[2]/div")).perform
          @driver.find_element(:id => "txtEdField").clear()
          @driver.find_element(:id => "txtEdField").send_keys(sTranslationValue)
          blnReturn=true
        end

        # response["translation"]=get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[2]/div").text
        # response["out of Date"]=get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[4]/div/div/input").selected? #attribute("checked")
        blnFound=true
        break
      end
      r+=1
    end
    idx+=1
    if blnFound==false
      get_btn_Translate_CustomReportType_FieldLabel_Next.click unless @driver.find_element(:id => 'pageNumField').attribute("value").to_i == @driver.find_element(:id => 'totalPages').text.to_i
      sleep(5)
    end
  end
  
  return blnReturn
  # return response
end

#set_Translation_CustomReportType_FieldLabel(sCustomReportTypeName, sTranslationValue) ⇒ Object


set_Translation_CustomReportType_FieldLabel

> Return = true/false



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/sfdc_se/pages/page_translate.rb', line 214

def set_Translation_CustomReportType_FieldLabel(sCustomReportTypeName, sTranslationValue)
  blnReturn=false
  blnFound=false
  idx=0

  until (@driver.find_element(:id => 'pageNumField').attribute("value").to_i == @driver.find_element(:id => 'totalPages').text.to_i and idx==@driver.find_element(:id => 'totalPages').text.to_i) or blnFound==true
    r=0
    while r < get_Translate_CustomReportType_FieldLabel_rows.length
      if get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[1]/div").text == sCustomReportTypeName
        if !(get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[2]/div").text == sTranslationValue)
          @driver.action.double_click(get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[2]/div")).perform
          @driver.find_element(:id => "txtEdField").clear()
          @driver.find_element(:id => "txtEdField").send_keys(sTranslationValue)
          blnReturn=true
        end
        blnFound=true
        break
      end
      r+=1
    end
    idx+=1
    if blnFound==false
      get_btn_Translate_CustomReportType_FieldLabel_Next.click unless @driver.find_element(:id => 'pageNumField').attribute("value").to_i == @driver.find_element(:id => 'totalPages').text.to_i
      sleep(5)
    end
  end

  return blnReturn
end

#set_Translation_CustomReportType_LayoutSection(sMasterLayoutSection, sCustomReportTypeName, sTranslationValue) ⇒ Object


set_Translation_CustomReportType_LayoutSection

> Return = true / false



350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# File 'lib/sfdc_se/pages/page_translate.rb', line 350

def set_Translation_CustomReportType_LayoutSection(sMasterLayoutSection, sCustomReportTypeName, sTranslationValue)
  blnReturn=false
  blnFound=false
  idx=0

  until (@driver.find_element(:id => 'pageNumField').attribute("value").to_i == @driver.find_element(:id => 'totalPages').text.to_i and idx==@driver.find_element(:id => 'totalPages').text.to_i) or blnFound==true
    r=0
    while r < get_Translate_CustomReportType_FieldLabel_rows.length
      if get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[1]/div").text == sMasterLayoutSection and get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[3]/div").text == sCustomReportTypeName
        if !(get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[2]/div").text == sTranslationValue)
          @driver.action.double_click(get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[2]/div")).perform
          @driver.find_element(:id => "txtEdField").clear()
          @driver.find_element(:id => "txtEdField").send_keys(sTranslationValue)
          blnReturn=true
        end
        blnFound=true
        break
      end
      r+=1
    end
    idx+=1
    if blnFound==false
      get_btn_Translate_CustomReportType_FieldLabel_Next.click unless @driver.find_element(:id => 'pageNumField').attribute("value").to_i == @driver.find_element(:id => 'totalPages').text.to_i
      sleep(5)
    end
  end
  
  return blnReturn
end

#set_Translation_CustomReportTypeEntity(sEntityType) ⇒ Object

> Return = true or false

> true = setting of view were successful

> false = setting of view had an error



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/sfdc_se/pages/page_translate.rb', line 132

def set_Translation_CustomReportTypeEntity(sEntityType)
  	blnReturn=false

  	begin
		get_Translate_CustomReportTypeEntity.each do |option|
			if option.text == sEntityType
				option.click unless option.selected?
				blnReturn=true
				sleep(3)
				break
			end
		end
	rescue
		puts $!
  	puts $@
	end
	return blnReturn
end

#set_Translation_Language(sLanguage) ⇒ Object

> Return = true or false

> true = setting of view were successful

> false = setting of view had an error



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/sfdc_se/pages/page_translate.rb', line 78

def set_Translation_Language(sLanguage)
  	blnReturn=false

  	begin
		get_Translate_Language.each do |option|
			if option.text == sLanguage
				option.click unless option.selected?
				blnReturn=true
				sleep(3)
				break
			end
		end
	rescue
		puts $!
  	puts $@
	end
	return blnReturn
end

#set_Translation_RecordType(sMasterRecordTypeLabel, sTranslationValue) ⇒ Object


set_Translation_RecordType

> Return = true/ false



416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
# File 'lib/sfdc_se/pages/page_translate.rb', line 416

def set_Translation_RecordType(sMasterRecordTypeLabel, sTranslationValue)
  blnReturn=false
  blnFound=false
  idx=0

  until (@driver.find_element(:id => 'pageNumField').attribute("value").to_i == @driver.find_element(:id => 'totalPages').text.to_i and idx==@driver.find_element(:id => 'totalPages').text.to_i) or blnFound==true
    r=0
    while r < get_Translate_CustomReportType_FieldLabel_rows.length
      if get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[1]/div").text == sMasterRecordTypeLabel
        if !(get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[2]/div").text == sTranslationValue)
          @driver.action.double_click(get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[2]/div")).perform
          @driver.find_element(:id => "txtEdField").clear()
          @driver.find_element(:id => "txtEdField").send_keys(sTranslationValue)
          blnReturn=true
        end

        # response["translation"]=get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[2]/div").text
        # response["out of Date"]=get_Translate_CustomReportType_FieldLabel_rows[r].find_element(:xpath => "./table/tbody/tr/td[4]/div/div/input").selected? #attribute("checked")
        blnFound=true
        break
      end
      r+=1
    end
    idx+=1
    if blnFound==false
      get_btn_Translate_CustomReportType_FieldLabel_Next.click unless @driver.find_element(:id => 'pageNumField').attribute("value").to_i == @driver.find_element(:id => 'totalPages').text.to_i
      sleep(5)
    end
  end
  
  return blnReturn
end

#set_Translation_SetupComponent(sComponentName) ⇒ Object

> Return = true or false

> true = setting of view were successful

> false = setting of view had an error



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/sfdc_se/pages/page_translate.rb', line 105

def set_Translation_SetupComponent(sComponentName)
  	blnReturn=false

  	begin
		get_Translate_SetupComponent.each do |option|
			if option.text == sComponentName
				option.click unless option.selected?
				blnReturn=true
				sleep(3)
				break
			end
		end
	rescue
		puts $!
  	puts $@
	end
	return blnReturn
end

#setExplicitWait(secs) ⇒ Object


setExplicitWait

> used to set the explicit waits in secs

> secs = timeout in secs



57
58
59
60
61
62
63
64
# File 'lib/sfdc_se.rb', line 57

def setExplicitWait(secs)
	@explicitWait=secs || 30
	if !@explicitWait.is_a?(Numeric)
		@explicitWait.to_i
	end
	@wait=Selenium::WebDriver::Wait.new(:timeout => @explicitWait)
	return @wait
end

#verify_HeaderLogoExistsObject


Header Logo Verification



107
108
109
110
111
112
113
# File 'lib/sfdc_se.rb', line 107

def verify_HeaderLogoExists
  if @driver.find_elements(:id => "phHeaderLogoImage").size > 0
    return true
  else
    return false
  end
end

#verify_SharingSettingsAccess(sObjName, hObjValues) ⇒ Object


> sObjName = string value of the sharing setting object to return

> hOjbValues = Hash of the values to verify for the sObjName

> Return = true/false

- True if values match
- False if values do not match


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
# File 'lib/sfdc_se/pages/page_sharingsettings.rb', line 145

def verify_SharingSettingsAccess(sObjName, hObjValues)
    @driver.manage.timeouts.implicit_wait = 0
    blnVerify=true
    $accessHeaders=[]

    # hObjValues[sObjName].each do |k,v|
    #   puts "\t\t#{k}: #{v}"
    # end
    
    get_SharingSettingAccessTable.each_with_index do |row, index|
      if index == 0
        # - Get headers
        row.find_elements(:xpath => "./th").each do |h|
          $accessHeaders.push(h.text)
        end
      else
        # Check values against hObjValues
        if row.find_element(:xpath => "./th").text == sObjName
          if !(hObjValues[sObjName][$accessHeaders[1]]==row.find_element(:xpath => "./td[1]").text)
            puts "#{$accessHeaders[1]}: #{hObjValues[sObjName][$accessHeaders[1]]} | #{row.find_element(:xpath => "./td[1]").text}"
            blnVerify=false
          end

          if !(hObjValues[sObjName][$accessHeaders[2]]==row.find_element(:xpath => "./td[2]").text)
            puts "#{$accessHeaders[2]}: #{hObjValues[sObjName][$accessHeaders[2]]} | #{row.find_element(:xpath => "./td[2]").text}"
            blnVerify=false
          end

          if row.find_elements(:xpath => "./td[3]//*").size > 0
            if !(hObjValues[sObjName][$accessHeaders[3]]==row.find_element(:xpath => "./td/img").attribute("title"))
              puts "#{$accessHeaders[3]}: #{hObjValues[sObjName][$accessHeaders[3]]} | #{row.find_element(:xpath => "./td/img").attribute("title")}"
              blnVerify=false
            end
          end

          break
        end
      end
    end

    @driver.manage.timeouts.implicit_wait = @implicitWait
    return blnVerify
end