sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #12485
Re: [Question #205117]: multiple scripts --- from sikuli import * needed
Question #205117 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/205117
Status: Needs information => Open
arun.a gave more information on the question:
No..it is correct..
if i am using new1 script i will mention that file in import file..that i understood
See the final one
test.sikuli
-------------
from sikuli import *
#myScriptPath = "C:\\Documents and Settings\\USER\\Desktop\\dlmsnew1.sikuli"
from dlmsnew1 import *
import unittest
import HTMLTestRunner
#importPath = r"C:\\Documents and Settings\\USER\\Desktop\\dlmsnew1.sikuli"
#myPath ="C:\\Documents and Settings\\USER\\Desktop"
suite = unittest.TestLoader().loadTestsFromTestCase(Channel)
#unittest.TextTestRunner(verbosity=2).run(suite)
outfile = open("C:\Report.html", "wb")
runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title='Xbox Test Report', description='This is a demo' )
runner.run(suite)
outfile.close()
dlmsnew1.sikuli
------------------
from sikuli import *
#import unittest
#import HTMLTestRunner
class Channel(unittest.TestCase):
def test0(self):
popup ("Good morning")
dragDrop("1343374822138.png", "1343283210216.png")
click("1343283226606.png")
App.open("C:\Program Files\Kalkitech\DLMS Explorer\DLMS Explorer.exe")
wait(1)
assert exists("OpticalChann.png")
Log file
--------
[error] Stopped
[error] An error occurs at line 3
[error] Error message: Traceback (most recent call last):
File "C:\DOCUME~1\USER\LOCALS~1\Temp\sikuli-tmp1236482336831598545.py", line 3, in
from dlmsnew1 import *
File "C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\SikuliImporter.py", line 45, in load_module
File "C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\SikuliImporter.py", line 29, in _load_module
ImportError: Errors in loading sikuli module: dlmsnew1
name 'unittest' is not defined
- HOW TO FIX? Try adding "from sikuli import *" in the module.
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.