def activate_linux_menus(): """Linux must open a menu to call OnMenuOpen() in astylewx to activate or deactivate the submenus. """ if not os.name == "nt": ldtp.selectmenuitem('frmAStyleWx', 'mnuFile') ldtp.keypress('<esc>') ldtp.keyrelease('<esc>') ldtp.wait(1)
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 sendkeys(self, key1, key2="", key3=""): ldtp.keypress(key1) if not key2 == "": ldtp.keypress(key2) if not key3 == "": ldtp.keypress(key3) ldtp.keyrelease(key3) ldtp.keyrelease(key2) ldtp.keyrelease(key1)
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) if (len(sys.argv) > 1) and (sys.argv[1] == 'origin'): ldtp.imagecapture(fenetre, 'images/ajouter_piece_test_annuler_origin.png', coordinate[0], coordinate[1], coordinate[2], coordinate[3])
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.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',