sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #12373
[Question #205111]: Robotframework use unit test feature will get "I/O operation on closed file"
New question #205111 on Sikuli:
https://answers.launchpad.net/sikuli/+question/205111
OS: Win7 , python27, jython2.5.3b1,sikuli1.0rc3
I use java to run selenium-server.jar
I use selemium-ide to recorder script and save as python language for RC
ttt.py
###################################
from selenium import selenium
import unittest, time, re
class ttt(unittest.TestCase):
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", 4444, "*chrome", "http://www.google.com.tw/")
self.selenium.start()
def test_ttt(self):
sel = self.selenium
sel.open("/")
sel.type("id=lst-ib", "1234")
sel.click("name=btnK")
try: self.failUnless(sel.is_text_present(u"123(1234)"))
except AssertionError, e: self.verificationErrors.append(str(e))
print("Pass")
def tearDown(self):
self.selenium.stop()
self.assertEqual([], self.verificationErrors)
if __name__ == "__main__":
unittest.main()
###################################
main.py
###################################
import ttt
import unittest
class main:
def test(self):
suite = unittest.TestLoader().loadTestsFromTestCase(ttt.ttt)
unittest.TextTestRunner(verbosity=2).run(suite)
###################################
If use sikuli or python-ide to execute is work fine.
Use Robotframework will get ValueError: I/O operation on closed file.
Traceback (most recent call last):
File "F:\Robot\Belkin\lib\main.py", line 22, in test
unittest.TextTestRunner(verbosity=2).run(suit)
File "C:\Program Files\Sikuli X\sikuli-script.jar\Lib\unittest.py", line 705, in run
test(result)
File "C:\Program Files\Sikuli X\sikuli-script.jar\Lib\unittest.py", line 437, in __call__
return self.run(*args, **kwds)
File "C:\Program Files\Sikuli X\sikuli-script.jar\Lib\unittest.py", line 433, in run
test(result)
File "C:\Program Files\Sikuli X\sikuli-script.jar\Lib\unittest.py", line 281, in __call__
return self.run(*args, **kwds)
File "C:\Program Files\Sikuli X\sikuli-script.jar\Lib\unittest.py", line 247, in run
result.startTest(self)
File "C:\Program Files\Sikuli X\sikuli-script.jar\Lib\unittest.py", line 649, in startTest
self.stream.write(self.getDescription(test))
File "C:\Program Files\Sikuli X\sikuli-script.jar\Lib\StringIO.py", line 213, in write
_complain_ifclosed(self.closed)
File "C:\Program Files\Sikuli X\sikuli-script.jar\Lib\StringIO.py", line 40, in _complain_ifclosed
raise ValueError, "I/O operation on closed file"
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.