Repeat previous step if a image is not found --- use exists() instead of find()
So there is game on my Facebook which I'm trying to automate.
So what I need is keep on clicking 2 images ( with a time gap of 2sec).
So lets say img1 and img2 .
Now here img2 appears only if img1 is clicked (img1 is always there)
So I want to click on img1 and then img2 then sleep(2) and then repeat this infinite times .
Now I don't trust this script. What I want is , After clicking img1 if img2 is not found, I want it to repeat click img1 ( click until img2 comes)
This is what I tried with
x=1
while (x < 2):
while not find(img2):
click(img1)
click(img2)
sleep(3)
But this is not executing just because it says cant find image (img2) at line 3.
But actually if it cant find image, why is the script stopping? doesn't it have to go inside while ?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- srijith
- Solved:
- Last query:
- Last reply: