← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #261683]: Screenshot on error

 

Question #261683 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/261683

    Status: Open => Answered

Eugene S proposed the following answer:
Hi,

This is how I take my screenshots:

def takeScreenShot(application):
	img = capture(SCREEN) # img is an image file .png in temp folder now
	ts = time.time()
	st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d_%H-%M-%S')
	if not os.path.exists('PATH'):
		os.makedirs('')
	shutil.move(img, 'PATH\\%(appName)s\\%(timeStamp)s.png' %{"appName": application, "timeStamp": st})

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