I'm only just beginning in programming.
The goal of the program is to check to make sure images are properly rendered within a program(within a VM)
. Below is the code, and I am asking what I can do to clean it up.
I don't think you can tell much without the .png's, but I would appreciate it if anyone knows where/how I can optimize my code.
Thank you very much for any help,
var=(0) #Empty Variable
jpgl=0 #NUMBER PASSES
vm = App("C:\Program Files (x86)\VMware\VMware Workstation\\vmware.exe")
switchApp("vm")
reg=( )
reg.find( )
#------------------------------------
#BEGINNING SPECIAL CASES/NAVIGATION
if not exists( ):
switchApp("vm")
type(Key.BACKSPACE)
onAppear( ,type(Key.BACKSPACE))
if exists( ):
click( )
#if exists( ):#attempt to get rid of.
# click( )
else:
exists( )
click( )
exists( )
click( )
wait(1)
if not exists ( ):#if the image hasn't already loaded, wait the maximum 5 seconds
wait(5)
#END FOLDER NAVIGATION
#----------------------------------
#BEGIN IMAGE CHECK 1
if not exists ( ):
print("B-JPEG_L-20.jpg not displayed correctly")
if exists( ):
print("B-JPEG_L-20.jpg Unable to play")
click( )
else:
jpgl=jpgl+1#if the image exists, it moves on by clicking "next"
click( )
wait(1)
if not exists ( ):
wait(5)
#DONE IMAGE CHECK 1
#----------------------------------
#BEGIN IMAGE CHECK 2
.....
#end code