rendered paste bodyError message I get while trying to run the script :(
ashish@ash:~/minefield$ python file_menu.py
File "file_menu.py", line 56
wait(3)
^
SyntaxError: invalid syntax
ashish@ash:~/minefield$
Program - File Menu automation
from ldtp import *
from ldtputils import *
log('Firefox 3.0', 'teststart')
firefox3 = LdtpDataFileParser ()
try:
firefox3.setfilename('firefox3.0.xml')
launchPath = firefox3.gettagvalue('launchpath')
profile2use = firefox3.gettagvalue('spooky')
firefoxPath = 'firefox'
if launchPath != []:
firefoxPath = launchPath[0] + '/' + firefoxPath
if profile2use != []:
firefoxPath = firefoxPath + ' -P ' + profile2use[0]
launchapp(firefoxPath, 1)
# Wait till window appears
waittillguiexist('*-Minefield')
# Open new window
selectmenuitem('*-Minefield','mnuFile;mnuNewWindow')
wait(3) # Wait for 3 seconds
print 'hi!.................................................................'
# Open new tab
selectmenuitem('*-Minefield','mnuFile;mnuNewTab')
# Open local file
selectmenuitem('*-Minefield', 'mnuFile;mnuOpenFile')
wait(3)
waittillguiexist('dlgOpenFile')
selectrow('dlgOpenFile', 'tblFiles', 'test.html') # Recommend to use Data XML, instead of hard coding file name
click('dlgOpenFile', 'btnOpen')
# Close FF window
#wait(3)
#selectmenuitem('*-Minefield', 'mnuFile;mnuClose')
#wait(3)
# Save as
# selectmenuitem('*-Minefield', 'mnuFile;mnuSavePageAs')
# wait(3)
# settextvalue('dlgSaveAs', 'txtName', 'newpage.html')
# wait(3)
# click('dlgSaveAs', 'tbtnBrowseforotherfolders')
# wait(3)
# click('dlgSaveAs', 'tbtnashish')
# wait(3)
# #click('dlgSaveAs', 'btnCreateFolder')
# wait(3)
# click('dlgSaveAs', 'btnSave')
# wait(3)
# x = ldtp.getobjectlist('Downloads')
# print x
# click('frmDownloads','btnCleanUp')
wait(3)
except LdtpExecutionError, msg:
log('Firefox 3.0 automation script execution: ' + str(msg), 'fail')
log('Firefox 3.0', 'teststop')