from watsup.launcher import launchApp,terminateApp from watsup.winGuiAuto import findTopWindows, findControl,getEditText,clickButton from watsup.performance import PerformanceCheck,PerformanceCheckError from time import sleep,time def main(myExecutable,myWantedText): # find an instance of SimpleForm. If one isn't there, launch it forms=findTopWindows(wantedText=myWantedText) if forms: form=forms[0] else: form=launchApp(myExecutable,wantedText=myWantedText) button=findControl(form,wantedText='Click me') editbox=findControl(form,wantedClass='TEdit') #start a performance check instance p=PerformanceCheck() clickButton(button) # belts and braces to avoid infinite waiting! maxWaitTime=2.0 startTime=time() while time()-startTime