unit testing: how to handle exceptions and continue in case of failures
from sikuli import *
import OpenApplications
reload(
dir = os.path.
def setUp(self):
logging.
Images.images()
def tearDown(self):
OpenApplica
self.
class TestDemo(
def functiontest1(
try:
OpenApplicat
print 'Applications should be opened successfully'
click('Image1') ---> #This image is not present so program should not halt and continue to next step
OpenApplicat
except Exception as e:
print (e)
#Also program should execute this function even if it encounters some issues in above code
def functiontest2(
print 'Applications should be opened successfully'
suite = unittest.
outfile = open(".
runner = HTMLTestRunner.
runner.run(suite)
outfile.close()
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
This question was reopened
- by Sonali
Can you help with this problem?
Provide an answer of your own, or ask Sonali for more information if necessary.