python - Why does my pywinauto code continuously give an error at the while statement -
python - Why does my pywinauto code continuously give an error at the while statement -
i've tried different if statement in 2nd while statement no avail, maintain getting error, , don't know why. here code below, along traceback error. help in advance!
import os import time pywinauto import application sendkeys import sendkeys start = time.clock() while true: # open update tool app=application.application() app.start_(r"c:\program files\... \file.exe") dlg=app.update time.sleep(2) #delete lastly octet of ip address app.dlg.edit0.setedittext('') time.sleep(2) #type sim's lastly octet of ip address app.dlg.edit0.typekeys('76') time.sleep(2) #click connect button app.dlg.button4.click() time.sleep(2) #click resources management tab app.dlg.clickinput(button='left',coords=(263,50),double=false,wheel_dist=0) time.sleep(4) #select version combobox app.dlg.combobox.select('release_02.0.1') time.sleep(2) #click select checkbox app.dlg.checkbox.check() time.sleep(2) #click update button (update window) app.dlg.update.click() while app.dlg.update.isenabled(): t_time = time.clock() - start t_minutes = t_time / 60.0 print t_time, 'seconds' if app.dlg.update.waitnot('visible'): break print '\n' print t_minutes, "minutes" time.sleep(2) #click okay button exit success dialog (this pop dialog, denoting update has finished) app.dlg.okbutton.click() #click actual state tab app.dlg.clickinput(button='left',coords=(75,50),double=false,wheel_dist=0) time.sleep(5) #click disconnect button app.dlg.button3.click() time.sleep(3) app.kill_() tot_time = time.clock() - start print time.clock() - start, "seconds" time.sleep(5) if tot_time >= 600.0: break
here traceback:
traceback (most recent phone call last): file "c:\users\mike\desktop\updte.py", line 51, in <module> if app.dlg.update.waitnot('visible'): file "c:\python27\lib\site-packages\pywinauto\application.py", line 442, in waitnot "', '".join( wait_for_not.split() ) ) runtimeerror: timed out while waiting window (button - 'update') not in 'visible' state
python while-loop pywinauto
Comments
Post a Comment