Sikuli - HTML Test Runner not working

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

  1. JPerge

    JPerge

    Joined:
    Jun 29, 2017
    Messages:
    1
    Likes Received:
    1
    Hi,

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

    Code (Python):

    import unittest
    import HTMLTestRunner

    class UnitTestX(unittest.TestCase):

       #some steps
       click()
       ....

       suite = unittest.TestLoader().loadTestsFromTestCase(UnitTestX)
       outfile = file('my_report.html', 'wb')
       runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title='Test Report', description='This is demo' )
       runner.run(suite)
    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!

    Thanks
     
    JPerge, Jun 29, 2017
    #1
    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.