Sikuli xmlrunner/htmlrunner with try catch in test cases
Hello everyone, I want to aplogize to Raiman, I'm openning a new question related to xmlrunner/html runner.
First off I'm using this xml runner.I have a problem logging error in a file log.log and at the same time getting a correct xmlreport.xml report. When I have try to run my suite the logging works flawlessly but the xmlreport generates a positive report every time, regardless if my test fails.
Here is my test setup:
import unittest
import sys
import logging
import os
import traceback
from sikuli import *
class setUp(unittest.
def setUp(self):
file = open("C:
wait(1)
def tearDown(self):
file = open("C:
def myTest(self):
try:
#test
except:
var = traceback.
file = open("C:
Here is my runner setup
import sys
import os
if not helpersPath in sys.path: sys.path.
MyTestPath = "C:\\Sikuli\
if not MyTestPath in sys.path: sys.path.
from xmlrunner import *
from sikuli.Sikuli import *
from MyTest import *
#setup - clean log file
fileName = "C:\\Sikuli\
f = open(fileName,'w')
f.truncate()
f.close()
suite=unittest.
result = XMLTestRunner(
Is there any way that I can get the error in my log file and at the same time to generate a working xmlresult file at the end ? Thank you in advance and especially for your patience with me :) I a python newbie :)
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- stewazy
- Solved:
- Last query:
- Last reply: