Best Python code snippet using pyatom_python
SortPlugin_RemoveDuplicates.py
Source:SortPlugin_RemoveDuplicates.py
...84 time.sleep(2)85 selectmenuitem('*gedit','mnuEdit;mnuSort')86 waittillguiexist('dlgSort') 87 if guiexist('dlgSort')==1:88 if verifyuncheck('dlgSort','chkRemoveduplicates')==1:89 click('dlgSort','chkRemoveduplicates')90 click('dlgSort','btnSort')91 time.sleep(5)92 selectmenuitem('*gedit','mnuFile;mnuSave')93 time.sleep(5)94 #test remove Duplicates95 fp1=open(filename)96 a=fp1.readline()97 #test the number of occurances of each line..if greater than98 #one then there are duplicates99 while a!='':100 fp2=open(filename)101 b=fp2.readline()102 count=0...
SortPlugin_CaseSensitive.py
Source:SortPlugin_CaseSensitive.py
...86 time.sleep(2)87 selectmenuitem('*gedit','mnuEdit;mnuSort')88 waittillguiexist('dlgSort') 89 if guiexist('dlgSort') == 1:90 if verifyuncheck('dlgSort','chkIgnorecase') == 1:91 click('dlgSort','chkIgnorecase')92 click('dlgSort','btnSort')93 time.sleep(5)94 selectmenuitem('*gedit','mnuFile;mnuSave')95 time.sleep(5)96 97 else:98 log('Sort Dialog does not appear','error')99 raise LdtpExecutionError(0)100 else:101 log('Preferences dialog does not appear','error')102 raise LdtpExecutionError(0)103 except:104 log('Test Sort Plugin with case sensitive Failed','error')...
checkbox.py
Source:checkbox.py
1#!/usr/bin/env python2#3# Linux Desktop Testing Project http://www.gnomebangalore.org/ldtp4#5# Description:6# This set of test scripts will test the LDTP framework for correct7# functioning of its APIs. This is a Regression Suite.8#9# Author:10# Prashanth Mohan <prashmohan@gmail.com>11#12#13# This test script is free software; you can redistribute it and/or14# modify it under the terms of the GNU Library General Public15# License as published by the Free Software Foundation; either16# version 2 of the License, or (at your option) any later version.17#18# This library is distributed in the hope that it will be useful,19# but WITHOUT ANY WARRANTY; without even the implied warranty of20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU21# Library General Public License for more details.22#23# You should have received a copy of the GNU Library General Public24# License along with this library; if not, write to the25# Free Software Foundation, Inc., 59 Temple Place - Suite 330,26# Boston, MA 02111-1307, USA.27#28from regression import *29import random, os30try:31 check_open('gedit')32except:33 raise34data_object = LdtpDataFileParser (datafilename)35chkbox = data_object.gettagvalue ('checkbox')36if chkbox == []:37 chkbox = 'chkDisplaylinenumbers'38else:39 chkbox = chkbox[0]40pref = '*Pref*'41log ('check','teststart')42try:43 open_pref()44 if guiexist (pref) != 1:45 log ('Gedit Preferences Window not open','cause')46 raise LdtpExecutionError (str (traceback.format_exc ()))47 if check (pref,chkbox) != 1:48 log ('Check failed','cause')49 raise LdtpExecutionError (str (traceback.format_exc ()))50 #time.sleep (2)51 if verifycheck (pref,chkbox) != 1:52 log ('Checkbox not checked','cause')53 raise LdtpExecutionError (str (traceback.format_exc ()))54 if verifyuncheck (pref,chkbox) != 0:55 log ('Checkbox not checked','cause')56 raise LdtpExecutionError (str (traceback.format_exc ()))57except:58 testfail ('check')59 raise LdtpExecutionError (str (traceback.format_exc ()))60testpass ('check')61log ('uncheck','teststart')62try:63 if uncheck (pref,chkbox) != 1:64 log ('UnCheck failed','cause')65 raise LdtpExecutionError (str (traceback.format_exc ()))66 #time.sleep (2)67 if verifyuncheck (pref,chkbox) != 1:68 log ('Checkbox not unchecked','cause')69 raise LdtpExecutionError (str (traceback.format_exc ()))70 if verifycheck (pref,chkbox) != 0:71 log ('Checkbox not unchecked','cause')72 raise LdtpExecutionError (str (traceback.format_exc ()))73except:74 testfail ('uncheck')75 raise LdtpExecutionError (str (traceback.format_exc ()))76testpass ('uncheck')77log ('click on checkbox','teststart')78try:79 pres = verifycheck (pref,chkbox)80 click (pref,chkbox)81 #time.sleep (2)82 if verifycheck (pref,chkbox) == pres:83 log ('Click did not function properly','cause')84 raise LdtpExecutionError (str (traceback.format_exc ()))85 click (pref,chkbox)86 #time.sleep (2)87 if verifycheck (pref,chkbox) != pres:88 log ('Click did not function properly','cause')89 raise LdtpExecutionError (str (traceback.format_exc ()))90 click (pref,'btnClose')91 waittillguinotexist (pref)92except:93 testfail ('click on checkbox')94 raise LdtpExecutionError (str (traceback.format_exc ()))...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!