Sikuli - HTML Test Runner not working

Discussion in 'Python' started by JPerge, Jun 29, 2017.

  1. JPerge


    Jun 29, 2017
    Likes Received:

    I'm using Python for test in Sikuli following is my code:

    Code (Python):

    import unittest
    import HTMLTestRunner

    class UnitTestX(unittest.TestCase):

       #some steps

       suite = unittest.TestLoader().loadTestsFromTestCase(UnitTestX)
       outfile = file('my_report.html', 'wb')
       runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title='Test Report', description='This is demo' )
    and here is the error message:

    [error] NameError ( name 'UnitTestX' is not defined )
    [error] --- Traceback --- error source first line: module ( function ) statement 129: main ( UnitTestX ) suite = unittest.TestLoader().loadTestsFromTestCase(UnitTestX)
    [error] --- Traceback --- end --------------

    Here is my folder structure:
    Under C driver I have -
    The unittest folder in the Python27 - Lib folder
    The test scripts are in the Sikuli folder

    I am not sure if is because I place the folder in the wrong place or am I missing anything? Please help!

    JPerge, Jun 29, 2017
    John Joe likes this.
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.