I want to write a sikuli script which can clear the "Recycle bin" if it is full (when executed first time) and need to check the icon if it is empty and display (Recycle bin is empty)
Following is the code which I tried:
Try 1 - while not exists("RecycleBin-1.png"): --> Image when the "Recycle bin is full" rightClick("RecycleBin-1.png") --> "Right clicking the Recycle bin" full icon. click("EmptyRecycle.png") --> Image of confirmation to delete all items.
click("1406033619416.png") --> Image of "Recycle bin" is empty print ("Recycle bin has been emptied") else: while exists ("RecycleBin.png"): print ("Recycle bin is already empty") Try 2 - while not exists("RecycleBin-1.png"): rightClick("RecycleBin-1.png") click("EmptyRecycle.png")
click("1406033619416.png") print ("Recycle bin has been emptied") else: print ("Recycle bin is empty") My problem is either the while loop before else gets executed (or) the else part is executed in sikuli inspite of the Recycle bin is empty (or) full, sikuli is not doing any complete analysis and executing it as necessary.
Please anybody help me out on this as I am relatively new to sikuli and python.
Thanks, V.Prashanth