def backup_simple(finish=True, error=None, timeout=400, backend = None, encrypt = True, dest = None, includes = None, excludes = None, add_srcdir = True): global srcdir if add_srcdir: if includes is not None: includes = [os.path.join(srcdir, f) for f in includes] if excludes is not None: excludes = [os.path.join(srcdir, f) for f in excludes] start_deja_dup(executable='deja-dup-preferences') if guivisible('frmBackup', 'btnJustshowmybackupsettings'): ldtp.click('frmBackup', 'btnJustshowmybackupsettings') remap('frmBackup') if backend is not None or includes is not None or excludes is not None: walk_prefs(backend=backend, dest=dest, includes=includes, excludes=excludes) ldtp.selecttab('frmBackup', 'ptlCategories', 'Overview') ldtp.click('frmBackup', 'btnBackUpNow') waitforgui('frmBackUp') if encrypt is not None: wait_for_encryption('frmBackUp', encrypt) if finish: error = strip_obj_name(error) wait_for_finish('frmBackUp', error, timeout, prefix=True)
def test_startUI(self): ldtp.launchapp("./netzob") selectWorkspaceFrame = "SelectWorkspace" ldtp.waittillguiexist(selectWorkspaceFrame, guiTimeOut=30) ldtp.click(selectWorkspaceFrame, "btnCancel") ldtp.waittillguinotexist(selectWorkspaceFrame)
def mac_take_finder_combo_box_action(self, window_name, action): try: ldtp.mouseleftclick("frm"+window_name,'cbo0') time.sleep(3) ldtp.selectmenuitem("frm"+window_name,"mnu%s*" % action) except: ldtp.click(window_name,'cbo0') time.sleep(3) ldtp.selectmenuitem(window_name,"mnu%s*" % action)
def chk_keyboard_a11y(self): """ To check the Keyboard Accessibility feature. """ at = ooldtp.context(self.WINDOW) at.getchild(self.BTN_KEYBOARDACCESSIBILITY).click() if ldtp.waittillguiexist(self.DLG_KEYBOARD_PREFERENCES) == 1: ldtp.click(self.DLG_KEYBOARD_PREFERENCES, self.BTN_CLOSE) else: raise ldtp.LdtpExecutionError, "Failed to check Keyboard Accessibility feature" ldtp.wait(1)
def chk_mouse_a11y(self): """ To check the Mouse Accessibility feature. """ at = ooldtp.context(self.WINDOW) at.getchild(self.BTN_MOUSEACCESSIBILITY).click() if ldtp.waittillguiexist(self.DLG_MOUSE_PREFERENCES) == 1: ldtp.click(self.DLG_MOUSE_PREFERENCES, self.BTN_CLOSE) else: raise ldtp.LdtpExecutionError, "Failed to check Mouse Accessibility feature" ldtp.wait(1)
def select_backend(dialog_title, backend_name): try: button_texts = backend_create_db_button_texts[backend_name] except KeyError: raise ldtp.LdtpExecutionError('Backend "' + backend + '" does not exist') for text in button_texts: if ldtp.objectexist(dialog_title, 'rbtn' + text): ldtp.click(dialog_title, 'rbtn' + text) break else: raise ldtp.LdtpExecutionError('Backend "' + backend + '" not supported')
def chk_pref_app(self): """ To check the Preferred Application feature """ at = ooldtp.context(self.WINDOW) at.getchild(self.BTN_PREFERREDAPPLICATIONS).click() if ldtp.waittillguiexist(self.DLG_PREFERRED_APPLICATIONS) == 1: ldtp.click(self.DLG_PREFERRED_APPLICATIONS, self.BTN_CLOSE) else: raise ldtp.LdtpExecutionError, "Failed to check Preferred Applications" ldtp.wait(1)
def to_uplist(self,name): # 查找类似"btn下划线"的特殊子窗口,需先关闭软件,不然找不到 ldtp.launchapp('liteword') lst1=ldtp.getwindowlist() ldtp.click(define.special_updlg.get(name),name) ldtp.generatekeyevent('<up>') lst2=ldtp.getwindowlist() ret=list(set(lst1)^set(lst2)) print 'hehe :',ret if ret: for i in ret: if i.startswith("dlg"): return i
def restore_specific(files, path, date=None, backend = None, encrypt = True, dest = None): global srcdir files = [os.path.join(srcdir, f) for f in files] args = ['--restore'] + files start_deja_dup(args=args, waitfor='frmRestore') if backend is not None: walk_restore_prefs('frmRestore', backend=backend, dest=dest) ldtp.click('frmRestore', 'btnForward') wait_for_finish('frmRestore', 'lblRestoreFromWhen?', 200) if date: ldtp.comboselect('frmRestore', 'cboDate', date) ldtp.click('frmRestore', 'btnForward') ldtp.click('frmRestore', 'btnRestore') if encrypt is not None: wait_for_encryption('frmRestore', encrypt) if len(files) == 1: lbl = 'lblYourfilewassuccessfullyrestored' else: lbl = 'lblYourfilesweresuccessfullyrestored' wait_for_finish('frmRestore', lbl, 400) ldtp.click('frmRestore', 'btnClose') ldtp.waittillguinotexist('frmRestore')
def wait_for_encryption(dlg, encrypt): count = 0 max_count = 10 while count < max_count: if guivisible(dlg, 'txtEncryptionpassword'): if encrypt: ldtp.settextvalue(dlg, 'txtEncryptionpassword', 'test') if guivisible(dlg, 'txtConfirmpassword'): ldtp.settextvalue(dlg, 'txtConfirmpassword', 'test') else: ldtp.click(dlg, 'rbtnAllowrestoringwithoutapassword') ldtp.click(dlg, 'btnContinue') break time.sleep(1) count += 1 assert count < max_count, max_count
def click(self, window_name, object_name): """ [关键字概要] 鼠标点击操作, 点击对象包括radio button/check box/push button/combo box/radio menu item/toggle button. :@参数 window_name: 窗口名称 :@参数 object_name: 对象名称 :@返回值: 成功或失败,执行异常时,抛出LdtpExecutionError异常类型 Examples: | *Test Cases* | *Action* | *Argument* | *Arguments* | | Example_Test | Click | ${FRM_NAME} | ${BTN_NAME} | """ try: self._info("mouse click... (%s, %s)" % (window_name, object_name)) # print("*INFO* Mouse click ... [%s, %s] \r\n" % (window_name, object_name)) return ldtp.click(window_name, object_name) except LdtpExecutionError: raise LdtpExecutionError( "click failed, please check if the input parameters are correct." )
def close_window(self,msg,window_name = None): logger.debug(msg) if self.os_family == "windows": try: if window_name == None: self.send_keys_to_current_focused_object('<alt><f4>') else: ldtp.click(window_name,"btnClose") except: pass elif self.os_family == "mac": try: if window_name == None: self.send_keys_to_current_focused_object('<command_l><q>') else: ldtp.mouseleftclick(window_name,"btnclosebutton") except: pass
def enter_connection_credentials(backend_name): if backend_name == 'PostgresCentral': if ldtp.waittillguiexist('Connection Details') == 0: raise ldtp.LdtpExecutionError('The Glom connection details dialog did not appear.') (hostname, username, password) = read_central_info() # Set connection details ldtp.settextvalue('Connection Details', 'txtHost', hostname) ldtp.settextvalue('Connection Details', 'txtUser', username) ldtp.settextvalue('Connection Details', 'txtPassword', password) # Acknowledge the dialog ldtp.click('Connection Details', 'btnConnect') # Make sure it's gone if ldtp.waittillguinotexist('Connection Details') == 0: raise ldtp.LdtpExecutionError('The cnnection details dialog did not disappear')
def enter_connection_credentials(backend_name): if backend_name == 'PostgresCentral': if ldtp.waittillguiexist('Connection Details') == 0: raise ldtp.LdtpExecutionError( 'The Glom connection details dialog did not appear.') (hostname, username, password) = read_central_info() # Set connection details ldtp.settextvalue('Connection Details', 'txtHost', hostname) ldtp.settextvalue('Connection Details', 'txtUser', username) ldtp.settextvalue('Connection Details', 'txtPassword', password) # Acknowledge the dialog ldtp.click('Connection Details', 'btnConnect') # Make sure it's gone if ldtp.waittillguinotexist('Connection Details') == 0: raise ldtp.LdtpExecutionError( 'The cnnection details dialog did not disappear')
def testInstallSimplePackage(self): pkgname = 'package1' pm_str = "%s/usr/bin/packagemanager" % pkg5unittest.g_proto_area self.pkgsend_bulk(self.rurl, self.foo10) self.image_create(self.rurl) ldtp.launchapp(pm_str,["-R", self.get_img_path()]) ldtp.waittillguiexist('Package Manager', state = ldtp.state.ENABLED) ldtp.selectindex('Package Manager', 'Publisher', 0) ldtp.selectrow('Package Manager', 'Packages', pkgname) ldtp.selectmenuitem('Package Manager', 'mnuEdit;mnuSelect All') ldtp.click('Package Manager', 'btnInstall/Update') ldtp.waittillguiexist('dlgInstall Confirmation') ldtp.click('dlgInstall Confirmation', 'btnProceed') while (ldtp.objectexist('dlgInstall/Update', 'btnClose') == 0): ldtp.wait(0.1) ldtp.click('dlgInstall/Update', 'btnClose') ldtp.waittillguinotexist('dlgInstall/Update') # Verify result self.pkg('verify') # Quit packagemanager ldtp.selectmenuitem('Package Manager', 'mnuFile;mnuQuit')
def set_file_list(dlg, obj, addObj, removeObj, files): # Clear existing items while (True): try: ldtp.selectrowindex(dlg, obj, 0) ldtp.click(dlg, removeObj) except: break # FIXME compiz and modal windows tend to not work with ldtp set_settings_value('include-list' if obj == 'tblIncludeList' else 'exclude-list', '[%s]' % ', '.join(["'%s'" % os.path.abspath(x) for x in files])) return # Add new items for f in files: ldtp.click(dlg, addObj) waitforgui('dlgChoosefolders') # Make sure path ends in '/' if f[-1] != '/': f += '/' ldtp.selectlastrow('dlgChoosefolders', 'tblPlaces') # must switch away from Recent Files view to get txtLocation ldtp.wait(1) ldtp.settextvalue('dlgChoosefolders', 'txtLocation', f) ldtp.click('dlgChoosefolders', 'btnOpen') ldtp.wait(1) # let dialog close
def testRmRepository(self): repo_name = "test2" pm_str = "%s/usr/bin/packagemanager" % pkg5unittest.g_proto_area ldtp.launchapp(pm_str,["-R", self.get_img_path()]) ldtp.waittillguiexist('Package Manager', state = ldtp.state.ENABLED) ldtp.selectmenuitem('Package Manager', 'mnuFile;mnuManage Publishers...') ldtp.waittillguiexist('dlgManage Publishers') ldtp.selectrow('dlgManage Publishers', 'Publishers', repo_name) ldtp.click('dlgManage Publishers', 'btnRemove') ldtp.click('dlgManage Publishers', 'btnOK') ldtp.waittillguiexist('dlgManage Publishers Confirmation') ldtp.click('dlgManage Publishers Confirmation', 'btnOK') ldtp.waittillguinotexist('dlgManage Publishers') # Verify result self.pkg('publisher | grep %s' % repo_name, exit=1) # Quit Package Manager ldtp.selectmenuitem('Package Manager', 'mnuFile;mnuQuit')
def testPmHelp(self): ldtp.launchapp(self.pm_str,["-R", self.get_img_path()]) ldtp.waittillguiexist('Package Manager', state = ldtp.state.ENABLED) ldtp.selectmenuitem('Package Manager', 'mnuHelp;mnuContents') # Verify result ldtp.waittillguiexist('*Online Help') self.assertEqual(ldtp.guiexist('*Online Help'), 1) ldtp.selectmenuitem('*Online Help', 'mnuCloseWindow') ldtp.selectmenuitem('Package Manager', 'mnuHelp;mnuAbout') # Verify result self.assertEqual(ldtp.guiexist('About Package Manager'), 1) ldtp.waittillguiexist('dlgAboutPackageManager') ldtp.click('dlgAboutPackageManager', 'btnClose') # Quit Package Manager ldtp.selectmenuitem('Package Manager', 'mnuFile;mnuQuit')
def testAddRepository(self): repo_name = "test2" pm_str = "%s/usr/bin/packagemanager" % pkg5unittest.g_proto_area ldtp.launchapp(pm_str,["-R", self.get_img_path()]) ldtp.waittillguiexist('Package Manager', state = ldtp.state.ENABLED) ldtp.selectmenuitem('Package Manager', 'mnuFile;mnuAdd Publisher...') ldtp.waittillguiexist('dlgAdd Publisher') ldtp.settextvalue('dlgAdd Publisher', "txtURI", self.dcs[2].get_depot_url()) ldtp.click('dlgAdd Publisher', 'btnAdd') ldtp.waittillguiexist('dlgAdding Publisher Complete') ldtp.click('dlgAdding Publisher Complete', 'btnClose') # Verify result self.pkg('publisher | grep %s' % repo_name, exit=0) # Quit Package Manager ldtp.selectmenuitem('Package Manager', 'mnuFile;mnuQuit')
def click_pane(self, msg, window_name, pane_name): ''' Generic call to click any type of element. Tries coordinate based clicking if default does not work. ''' logger.debug(msg) pane_name = "pane" + pane_name try: success = ldtp.click(window_name,pane_name ) except Exception, e: try: ldtp.mouseleftclick(window_name, pane_name) except Exception, e: raise AssertionError("Unable to click element: %s" % traceback.format_exc())
def restore_missing(files, path): args = ['--restore-missing', path] start_deja_dup(args=args, waitfor='frmRestore') wait_for_finish('frmRestore', 'lblScanningfinished', 200) for f in files: index = ldtp.gettablerowindex('frmRestore', 'tbl0', f) if index != -1: ldtp.checkrow('frmRestore', 'tbl0', index) ldtp.click('frmRestore', 'btnForward') ldtp.click('frmRestore', 'btnRestore') wait_for_encryption('frmRestore', True) if len(files) == 1: lbl = 'lblYourfilewassuccessfullyrestored' else: lbl = 'lblYourfilesweresuccessfullyrestored' wait_for_finish('frmRestore', lbl, 200) ldtp.click('frmRestore', 'btnClose')
def create_new_file(self,window_name): if self.os_family == 'windows': if self.os_check not in ["Win_8"]: ldtp.mouseleftclick(window_name,'paneShellFolderView') ldtp.generatekeyevent('<alt>f') ldtp.keypress('w') ldtp.keypress('t') else: try: ldtp.click(window_name,'uknNewitem') except: ldtp.click(window_name,'btnMinimizetheRibbon') ldtp.click(window_name,'uknNewitem') time.sleep(2) ldtp.selectmenuitem('frmNewitem','mnuTextDocument') time.sleep(2) ldtp.generatekeyevent("%s<enter>" % str(int(time.time())))
def click_element(self, msg, window_name, object_name,double = False): ''' Generic call to click any type of element. Tries coordinate based clicking if default does not work. ''' logger.debug(msg) prefix = "img" if self.os_check == "Mac": prefix_of_obj = ["lbl","img","btn","chk","txt", "grp"] if window_name.find("frm") == -1 : window_name = "frm" + window_name if object_name[:3] not in prefix_of_obj: object_name = prefix + object_name try: ldtp.selectmenuitem(window_name,"mnuView;mnuasIcons") time.sleep(2) ldtp.selectmenuitem('frmsample','mnuView;mnuCleanUp') time.sleep(2) except: pass try: if not double: success = ldtp.click(window_name, object_name) else: success = ldtp.doubleclick(window_name, object_name) except Exception, e: try: if not double: ldtp.mouseleftclick(window_name, object_name) else: # on mac first time doubleclick does not work at times ldtp.doubleclick(window_name, object_name) except Exception, e: raise AssertionError("Unable to click element: %s" % traceback.format_exc())
def click(self, window, componentId): """Left-click on component :componentId of :window""" click(window, componentId)
def restore_simple(path, date=None, backend = None, encrypt=True, dest = None): start_deja_dup(executable='deja-dup-preferences') if guivisible('frmBackup', 'btnIwanttorestorefilesfromapreviousbackup…'): ldtp.click('frmBackup', 'btnIwanttorestorefilesfromapreviousbackup…') else: ldtp.selecttab('frmBackup', 'ptlCategories', 'Overview') ldtp.click('frmBackup', 'btnRestore…') waitforgui('frmRestore') if backend is not None: walk_restore_prefs('frmRestore', backend, dest) ldtp.click('frmRestore', 'btnForward') wait_for_finish('frmRestore', 'lblRestoreFromWhen?', 200) if date: ldtp.comboselect('frmRestore', 'cboDate', date) ldtp.click('frmRestore', 'btnForward') ldtp.click('frmRestore', 'rbtnRestoretospecificfolder') ldtp.comboselect('frmRestore', 'cboRestorefolder', 'Other...') waitforgui('dlgChoosedestinationforrestoredfiles') # Make sure path ends in '/' if path[-1] != '/': path += '/' ldtp.selectlastrow('dlgChoosedestinationforrestoredfiles', 'tblPlaces') # must switch away from Recent Files view to get txtLocation ldtp.wait(1) # give the dlg a second to settle ldtp.settextvalue('dlgChoosedestinationforrestoredfiles', 'txtLocation', path) ldtp.click('dlgChoosedestinationforrestoredfiles', 'btnOpen') ldtp.wait(1) # give the combo a second to settle ldtp.click('frmRestore', 'btnForward') ldtp.wait(1) # give the dlg a second to settle ldtp.click('frmRestore', 'btnRestore') if encrypt is not None: wait_for_encryption('frmRestore', encrypt) wait_for_finish('frmRestore', 'lblYourfilesweresuccessfullyrestored', 400) ldtp.click('frmRestore', 'btnClose') ldtp.waittillguinotexist('frmRestore')
connecter() traiterFiche() fenetre = "*Traitement d'une fiche de maintenance*" ldtp.waittillguiexist(fenetre) ldtp.mouseleftclick(fenetre, 'txtFiche#13') ldtp.keypress('<ctrl>') ldtp.keypress('a') ldtp.keyrelease('<ctrl>') ldtp.keypress('<bksp>') ldtp.keyrelease('<bksp>') ldtp.enterstring(fenetre, 'txtFiche#13', 'allo mon grand') ldtp.click(fenetre, 'btnCancel') ldtp.click('*Gestion de dossiers*', 'btnTraiter') ldtp.waittillguiexist(fenetre) coordinate = ldtp.getwindowsize(fenetre) if (len(sys.argv) > 1) and (sys.argv[1] == 'origin'): ldtp.imagecapture(fenetre, 'images/traiter_fiche_commentaire_basse_origin.png', coordinate[0], coordinate[1], coordinate[2], coordinate[3]) else: ldtp.imagecapture(fenetre, 'images/traiter_fiche_commentaire_basse.png', coordinate[0], coordinate[1], coordinate[2], coordinate[3]) im1 = Image.open("images/traiter_fiche_commentaire_basse.png") im2 = Image.open("images/traiter_fiche_commentaire_basse_origin.png") diff = ImageChops.difference(im2, im1) if diff.getbbox():
def click(self, control): return ldtp.click(*_ldtp_args(control))
import sys import ldtp import Image import ImageChops from commandes_bases import * connecter() traiterFiche() fenetre = "*Traitement d'une fiche de maintenance*" ldtp.waittillguiexist(fenetre) ldtp.click(fenetre, u'btnT\xe2ches') fenetre = "*Ajouter une*" ldtp.waittillguiexist(fenetre) ldtp.mouseleftclick(fenetre, 'cboDown') ldtp.mouseleftclick(fenetre, 'lstCombofix') ldtp.mouseleftclick(fenetre, 'cboDown1') ldtp.mouseleftclick(fenetre, 'lstEncours') # ldtp.mouseleftclick(fenetre, 'txt0') # ldtp.enterstring(fenetre, 'txt0', "") ldtp.click(fenetre, 'btnSaveEnter') ldtp.click("*Traitement d'une fiche de maintenance*", 'btnSaveEnter') ldtp.click('*Gestion de dossiers*', 'btnTraiter') fenetre = "*Traitement d'une fiche de maintenance*" ldtp.waittillguiexist(fenetre) coordinate = ldtp.getwindowsize(fenetre) if (len(sys.argv) > 1) and (sys.argv[1] == 'origin'):
import ldtp import Image import ImageChops from commandes_bases import * connecter() traiterFiche() fenetre = "*Traitement d'une fiche de maintenance*" ldtp.waittillguiexist(fenetre) ldtp.mouseleftclick(fenetre, "cboFiche#13Down") ldtp.mouseleftclick(fenetre, "lstEnattente") ldtp.click("*Gestion de dossiers*", "btnTraiter") ldtp.waittillguiexist(fenetre) coordinate = ldtp.getwindowsize(fenetre) if (len(sys.argv) > 1) and (sys.argv[1] == "origin"): ldtp.imagecapture( fenetre, "images/traiter_fiche_commentaire_basse_origin.png", coordinate[0], coordinate[1], coordinate[2], coordinate[3], ) else: ldtp.imagecapture( fenetre,
import sys import ldtp import Image import ImageChops from commandes_bases import * connecter() traiterFiche() fenetre = "*Traitement d'une fiche de maintenance*" ldtp.waittillguiexist(fenetre) ldtp.click(fenetre, u"btnPi\xe8ces") fenetre = "*une nouvelle*" ldtp.waittillguiexist(fenetre) ldtp.mouseleftclick(fenetre, 'txt1') ldtp.enterstring(fenetre, 'txt1', "disque dur") #ldtp.mouseleftclick(fenetre, 'txt0') #ldtp.enterstring(fenetre, 'txt0', "") ldtp.mouseleftclick(fenetre, 'sldr0') ldtp.enterstring(fenetre, 'txt0', "<del><del><del><del><del>999,99") ldtp.click(fenetre, 'btnSaveEnter') fenetre = "*Traitement d'une fiche de maintenance*" coordinate = ldtp.getobjectsize(fenetre, 'tbl1') ldtp.generatemouseevent(coordinate[0]+120, coordinate[1]+35, 'b1d') ldtp.keypress('<ctrl>') ldtp.keypress('a') ldtp.keyrelease('<ctrl>') ldtp.keypress('<bksp>')
def click_button(self, window, button_name): ldtp.click(RHSMGuiLocator().get_locator(window), RHSMGuiLocator().get_locator(button_name))
import sys import ldtp import Image import ImageChops from commandes_bases import * connecter() traiterFiche() fenetre = "*Traitement d'une fiche de maintenance*" ldtp.waittillguiexist(fenetre) ldtp.click(fenetre, u"btnPi\xe8ces") fenetre = "*une nouvelle*" ldtp.waittillguiexist(fenetre) ldtp.mouseleftclick(fenetre, 'txt1') ajouterPressePapier("Lorem ipsum dolor sit amet, consectetur adipiscing elit. In rhoncus felis sed condimentum pretium. Etiam vulputate sapien eu massa consectetur imperdiet. Nunc non pulvinar magna. Donec fermentum sagittis condimentum. Vivamus et quam nec ante turpis ") ldtp.keypress('<ctrl>') ldtp.keypress('v') ldtp.keyrelease('<ctrl>') ldtp.mouseleftclick(fenetre, 'sldr0') ldtp.enterstring(fenetre, 'txt0', "<del><del><del><del><del>999,99") ldtp.click(fenetre, 'btnCancel') ldtp.click("*Traitement d'une fiche de maintenance*", 'btnSaveEnter') ldtp.click('*Gestion de dossiers*', 'btnTraiter') fenetre = "*Traitement d'une fiche de maintenance*" ldtp.waittillguiexist(fenetre) coordinate = ldtp.getwindowsize(fenetre)
def click_menu(self, window, menu_name): ldtp.click(RHSMGuiLocator().get_locator(window), RHSMGuiLocator().get_locator(menu_name))
import sys import ldtp import Image import ImageChops from commandes_bases import * connecter() ajouterFiche() ldtp.click('*Gestion de dossiers*', 'btnAjouter') ldtp.waittillguiexist('*une nouvelle fiche*') ldtp.mouseleftclick('*une nouvelle fiche*', 'txt0') ldtp.enterstring('*une nouvelle fiche*', 'txt0', "bonjour comment ca va") ldtp.mouseleftclick('*une nouvelle fiche*', 'cboDown') ldtp.mouseleftclick('*une nouvelle fiche*', 'lstInstallationavecbackup') ldtp.mouseleftclick('*une nouvelle fiche*', 'sldr0') ldtp.enterstring('*une nouvelle fiche*', 'sldr0', "<del>2") ldtp.click('*une nouvelle fiche*', 'btnSaveEnter') coordinate = ldtp.getobjectsize('*Gestion de dossiers*', 'pane0') if (len(sys.argv) > 1) and (sys.argv[1] == 'origin'): ldtp.imagecapture('*Gestion de dossiers*', 'images/creer_fiche_test_priorite2_origin.png', coordinate[0], coordinate[1], coordinate[2], coordinate[3]) else: ldtp.imagecapture('*Gestion de dossiers*', 'images/creer_fiche_test_priorite2.png', coordinate[0], coordinate[1], coordinate[2], coordinate[3]) im1 = Image.open("images/creer_fiche_test_priorite2.png") im2 = Image.open("images/creer_fiche_test_priorite2_origin.png") diff = ImageChops.difference(im2, im1) if diff.getbbox():
def testInteraction(self): ldtp.click('frmCalculator*', 'btnNumeric1') sleep(0.5) ldtp.click('frmCalculator*', 'btnNumeric2') sleep(0.5) ldtp.click('frmCalculator*', 'btnNumeric3') sleep(0.5) ldtp.click('frmCalculator*', 'btnNumeric4') sleep(0.5) ldtp.click('frmCalculator*', 'btnMultiply') sleep(0.5) ldtp.click('frmCalculator*', 'btnNumeric2') sleep(0.5) ldtp.click('frmCalculator*', 'btnCalculateresult')