def setTiming(self, speed): if speed.lower() == 'slow': Timings.Slow() elif speed.lower() == 'fast': Timings.Fast() else: Timings.Defaults()
def initTimings(self): Timings.window_find_timeout = 10 Timings.app_start_timeout = 10 Timings.exists_timeout = 5 Timings.after_click_wait = .5 Timings.after_clickinput_wait = .01 Timings.after_menu_wait = .05 Timings.after_sendkeys_key_wait = .01 Timings.after_button_click_wait = 0 Timings.before_closeclick_wait = 0.1 Timings.closeclick_dialog_close_wait = 1.0 Timings.after_closeclick_wait = 1.0 Timings.after_windowclose_timeout = 2 Timings.after_setfocus_wait = .06 Timings.after_setcursorpos_wait = .01 Timings.sendmessagetimeout_timeout = .001 Timings.after_tabselect_wait = 1 Timings.after_listviewselect_wait = .01 Timings.after_listviewcheck_wait = .001 Timings.after_treeviewselect_wait = 0.5 Timings.after_toobarpressbutton_wait = .01 Timings.after_updownchange_wait = .001 Timings.after_movewindow_wait = 0 Timings.after_buttoncheck_wait = 0 Timings.after_comboboxselect_wait = 0 Timings.after_listboxselect_wait = 0 Timings.after_listboxfocuschange_wait = 0 Timings.after_editsetedittext_wait = 0 Timings.after_editselect_wait = 0 Timings.Slow()
def setUp(self): """Set some data and ensure the application is in the state we want""" Timings.Slow() self.app = Application(backend="uia") self.app = self.app.start(wpf_app_1) self.dlg = self.app.WPFSampleApplication self.handle = self.dlg.handle self.ctrl = UIAElementInfo(self.handle)
def sap_transfer(self, sheet, row, contract_num, app): Timings.Slow() #Display Contract:Header Data dlg_spec = app.Display_Contract_Header_Data actionable_dlg = dlg_spec.wait('visible') rect = app.Display_Contract_Header_Data['Pane6'].rectangle() #Get coordinates that will be used as reference to get the #data from SAP fields x_ref = rect.left y_ref = rect.top #get agreement start valid_start = None x = x_ref + 125 y = y_ref + 125 pyautogui.moveTo(x, y) pyautogui.click() pyautogui.click() pywinauto.mouse.press(button='left', coords=(x + FIELD_LENGTH - 1, y)) time.sleep(0.2) valid_start = pyautogui.hotkey('ctrl', 'c') time.sleep(0.2) if valid_start is not None: sheet.cell(row=row, column=LISTINGS[3][1], value=valid_start) pywinauto.mouse.release(button='left', coords=(x + FIELD_LENGTH, y)) #get agreement end valid_end = None x = x_ref + 330 y = y_ref + 125 pyautogui.moveTo(x, y) pyautogui.click() pyautogui.click() pywinauto.mouse.press(button='left', coords=(x + FIELD_LENGTH - 1, y)) time.sleep(0.2) valid_end = pyautogui.hotkey('ctrl', 'c') time.sleep(0.2) if valid_end is not None: sheet.cell(row=row, column=LISTINGS[4][1], value=valid_end) pywinauto.mouse.release(button='left', coords=(x + FIELD_LENGTH, y)) #get OA net oa_net = None x = x_ref + 161 y = y_ref + 470 pyautogui.moveTo(x, y) pyautogui.click() pyautogui.click() pywinauto.mouse.press(button='left', coords=(x + 102, y)) time.sleep(0.2) oa_net = pyautogui.hotkey('ctrl', 'c') time.sleep(0.2) if oa_net is not None: sheet.cell(row=row, column=LISTINGS[2][1], value=oa_net) pywinauto.mouse.release(button='left', coords=(x + 101, y)) #return to contract agreement page pyautogui.press('f3', interval=3)
def __init__(self): Timings.Slow() self.base_path = Config.get("CAM_RESULT_PATH") self.app = Application(backend="win32").connect( path=Config.get("CAM_PROGRAM_PATH")) self.dlg = self.app.Test9k self.frequency = self.dlg.Spinner4.get_buddy_control().text_block() return
print "Must point to the 3dMDpatient.exe program!" sys.exit(1) if not os.path.exists(exepath): print "Couldn't find 3dMDpatient.exe at '%s'" % exepath sys.exit(1) infiles = getFilePaths("tsb", sys.argv[2:]) if len(infiles) == 0: print "No valid input files specified!" sys.exit(1) n = len(infiles) outfiles = [x[0:-3] + "obj" for x in infiles] Timings.Slow() # Open the application app = Application().start(exepath) w = app.window(title="3dMDpatient") for i in range(0, n): tsbfilepath = infiles[i] objfilepath = outfiles[i] modelname = objfilepath.split(os.path.sep)[-1].split(".")[0] print "Exporting '%s' to .obj" % tsbfilepath loadTSB(w, tsbfilepath) exportOBJ(w, objfilepath) closeModel(w, modelname)
def setUp(self): """Set some data and ensure the application is in the state we want""" Timings.Slow() self.app = Application().start('explorer.exe "' + mfc_samples_folder_32 + '"') self.desktop = Desktop(backend='uia')
def setUp(self): """Set some data and ensure the application is in the state we want""" Timings.Slow() self.app = Application(backend='uia').start( os.path.join(mfc_samples_folder, u"RowList.exe")) self.dlg = self.app.RowListSampleApplication