def select_restore_by_date(self, path="C:/test_data", dest="C:/RESTORE"): import time time.sleep(2) testfolder = path.split("/") file_treeview = self.SysTreeView date_setting = self.SearchByDate try: # file_treeview.GetItem([file_treeview.GetItem([0]).Text()]).Click(double=True) WindowsGUIUtil.click_button(date_setting) items = [file_treeview.GetItem([0]).Text()] + [ unicode("Drive(" + testfolder[0].upper() + ")") ] # + testfolder[1:] # Select files to restore file_treeview.GetItem(items).Click(double=True, where='check') # Set destination self.set_destination(dest) time.sleep(1) self.select_overwrite() time.sleep(1) # self.select_rename() return True except Exception as exc: raise self.retry(exc=exc, countdown=60) return False
def apply(self): # self.OKButton.Click() # okbutton = self.OKButton # okbutton.set_focus() # okbutton.DoubleClick() okbutton = self.OKButton if WindowsGUIUtil.is_visible(okbutton): WindowsGUIUtil.click_button(okbutton)
def show_restore_option(self): if WindowsGUIUtil.is_selected(self.CheckBox6): WindowsGUIUtil.click_button(self.ShowVirtualDrive) WindowsGUIUtil.click_button(self.ShowVirtualDrive) WindowsGUIUtil.click_button(self.ShowRestoreOption) else: WindowsGUIUtil.click_button(self.ShowVirtualDrive) WindowsGUIUtil.click_button(self.ShowRestoreOption)
def open_logindialog(self): # if self.continuesetupbutton.exists: continuebutton = self.ContinueSetup if continuebutton.exists(): WindowsGUIUtil.click_button(continuebutton) time.sleep(3) return True else: return False
def set_suspend_backup(self, number, type): if not WindowsGUIUtil.is_selected(self.CheckBox2): WindowsGUIUtil.click_button(self.SuspendBackup) if WindowsGUIUtil.is_enabled(self.BackupType): if type == "hours": WindowsGUIUtil.select_combobox(self.BackupType, 0) elif type == "days": WindowsGUIUtil.select_combobox(self.BackupType, 1) elif type == "weeks": WindowsGUIUtil.select_combobox(self.BackupType, 2) WindowsGUIUtil.input_text(self.SuspendBackupFor, str(number))
def set_throttle_parameter(self, start_time, end_time): if not WindowsGUIUtil.is_selected(self.AutoRadioButton2): WindowsGUIUtil.click_button(self.ThrottleBetween) time_list1 = start_time.split(":") hour1 = time_list1[0] minute1 = time_list1[1] WindowsGUIUtil.set_time(self.StartTime, int(hour1), int(minute1)) time_list2 = end_time.split(":") hour2 = time_list2[0] minute2 = time_list2[1] WindowsGUIUtil.set_time(self.EndTime, int(hour2), int(minute2))
def choose_license_agreement(self): WindowsGUIUtil.click_button(self.Viewthelicenseagreement)
def click_no(self): WindowsGUIUtil.click_button(self.NoButton)
def click_yes(self): WindowsGUIUtil.click_button(self.YesButton)
def install(self): time.sleep(2) if WindowsGUIUtil.is_visible(self.InstallButton): WindowsGUIUtil.click_button(self.InstallButton)
def apply(self): if WindowsGUIUtil.is_visible(self.SettingsDialog): WindowsGUIUtil.click_button(self.FinishButton)
def apply(self): WindowsGUIUtil.click_button(self.NextButton)
def cancel(self): WindowsGUIUtil.click_button(self.CancelButton)
def choose_location_change(self): WindowsGUIUtil.click_button(self.Chooseadifferentinstalllocation)
def accept(self): WindowsGUIUtil.click_button(self.AcceptButton) time.sleep(2)
def backup(self): # self.backbutton.Click() back_button = self.BackButton if WindowsGUIUtil.is_visible(back_button): WindowsGUIUtil.click_button(back_button)
def apply(self): # self.nextbutton.Click() print "Apply Summary Dialog" next_button = self.NextButton if WindowsGUIUtil.is_visible(next_button): WindowsGUIUtil.click_button(next_button)
return self.summarydialog.BackButton @property def cancelbutton(self): return self.summarydialog.CancelButton def apply(self): # self.nextbutton.Click() print "Apply Summary Dialog" next_button = self.NextButton if WindowsGUIUtil.is_visible(next_button): WindowsGUIUtil.click_button(next_button) def backup(self): # self.backbutton.Click() back_button = self.BackButton if WindowsGUIUtil.is_visible(back_button): WindowsGUIUtil.click_button(back_button) def cancel(self): # self.cancelbutton.Click() cancel_button = self.CancelButton if WindowsGUIUtil.is_visible(cancel_button): WindowsGUIUtil.click_button(cancel_button) if __name__ == "__main__": summary = SummaryDialog("mozypro") # summary.apply() WindowsGUIUtil.click_button(summary.BackButton)
def apply(self): okbutton = self.OKButton if WindowsGUIUtil.is_visible(okbutton): WindowsGUIUtil.click_button(okbutton)
def back(self): back_button = self.BackButton if WindowsGUIUtil.is_visible(back_button): WindowsGUIUtil.click_button(back_button)
def apply(self): WindowsGUIUtil.click_button(self.NextButton) time.sleep(2)
def open_restorepanel(self): # self.restorebutton.Click() WindowsGUIUtil.click_button(self.RestoreButton) time.sleep(15)
def finish_and_exit(self): WindowsGUIUtil.click_button(self.FinishButton)
def open_settingwindow(self): # self.settingsbutton.Click() WindowsGUIUtil.click_button(self.Settings) time.sleep(10)
def back(self): WindowsGUIUtil.click_button(self.BackButton)
def open_historyspanel(self): # self.historybutton.Click() WindowsGUIUtil.click_button(self.Details) time.sleep(10)
def apply(self): # self.nextbutton.Click() okbutton = self.NextButton if WindowsGUIUtil.is_visible(okbutton): WindowsGUIUtil.click_button(okbutton)
def startbackup(self): # self.backupbutton.Click() WindowsGUIUtil.click_button(self.StartBackup)
def cancel(self): cancelbutton = self.CancelButton if WindowsGUIUtil.is_visible(cancelbutton): WindowsGUIUtil.click_button(cancelbutton)
def cancelbackup(self): # self.backupbutton.Click() WindowsGUIUtil.click_button(self.CancelBackup)