← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #228393]: Taking Screenshot at the end of each test - Unittest - Get test case name in tear down method

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
--1. you might have a look at the modified HTMLTestRunner, that automatically takes shots for failing tests
https://answers.launchpad.net/sikuli/+question/176005

--2. there is no built in feature to get what you want
this might be a solution
- make a class variable currentID in the test class
- in each test def say at start:
<name of testclass>.currentID = id()
- then in teardown make your shot and name it using the info in <name of testclass>.currentID

look:
http://docs.python.org/2/library/unittest.html#unittest.TestCase.id

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