← Back to team overview

sikuli-driver team mailing list archive

[Question #147764]: Basic If usage: Look for image, if not found skip to

 

New question #147764 on Sikuli:
https://answers.launchpad.net/sikuli/+question/147764

I'm using sikuli to book into gym classes online for my work colleagues. I have the basic functionality working, but one of the flaws about the log in process is that if someone logs in to check their details and doesnt log out, the script to log in bugs out and the whole process fails. Therefore I need it to check on the first page it goes to, if LOG OUT is an option.

I found a similar question on this and tried the solution but i get a Cannot find img error before it even gets to the if.

img = ( LOGOUT)
if  find(LOGOUT ):
        click( logout )
	wait(2)
	type(accountandpassworddetails)
		wait(2)
	else:
	type(accountandpassworddetails)	
	wait(2)
bugs out on first line. Causing me headache.

any ideas? and what would I have to do to make it look for one of 2 pictures, like logout or page is currently unavailable?

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.