← Back to team overview

sikuli-driver team mailing list archive

[Question #203040]: ImportError: Errors in loading sikuli module: unittest

 

New question #203040 on Sikuli:
https://answers.launchpad.net/sikuli/+question/203040

Hi,

I'm using Win7 and Sikuli-r930-win32.

I've written this script in Sikuli IDE:

from sikuli import *
from unittest import *
from HTMLTestRunner import *

class BDTests(unittest.TestCase): 
    def setUp(self):
        App.open("C:\\Program Files\\Internet Explorer\\iexplore.exe www.google.com")
        wait(2) 

    def tearDown(self):
        App.close("C:\\Program Files\\Internet Explorer\\iexplore.exe")
        wait(2)

    def testA(self):
        print("done!!")
        
suite = unittest.TestLoader().loadTestsFromTestCase(BDTests)
#unittest.TextTestRunner(verbosity=2).run(suite)
outfile = open("C:\Report.html", "w")
runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title='Test Report', description='This is demo' )
runner.run(suite)
outfile.close()

But when i am running this script, it shows this error:

ImportError: Errors in loading sikuli module: unittest
'module' object has no attribute 'TestResult'
 - HOW TO FIX? Try adding "from sikuli import *" in the module.

Please help me in fixing this issue.
Thanx in Advance!!!

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