How to generate report using sikuli for desktop application

拜拜、爱过 提交于 2019-12-13 07:04:12

问题


I automated an application using sikuli. Now the program is full of image (usual sikuli program), I want to generate the final report for the test cases. I can only see the option for robot framework to generate the report. I don't know python. How can I do that without robot framework? Can you jus guide me with the steps to do that? if there is no option guide with the normal way. Thanks


回答1:


You can try one of those two:

  • HTMLTestRunner can be used by adding this script (and the .py file) to your currrent solution:

--script--

from sikuli import *
import unittest
import HTMLTestRunner

Class ClassName(unittest.TestCase):

#paste your script

suite = unittest.TestLoader().loadTestsFromTestCase(ClassName)
outfile = open("C:\\Sikuli\\Reports\\report.html", "w") # path to report folder
runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title=' Report Title', description='desc..' )
runner.run(suite)  
  • XMLTestRunner almost the same as above:

--script--

import xmlrunner
import unittest

class MyTest(unittest.TestCase):
    def setUp(self):
        // setUp

    def testMyTest(self):
        // test

    def tearDown(self):
        // tearDown

suite = unittest.TestLoader().loadTestsFromTestCase(MyTest)
result = XMLTestRunner(file("unittest.xml", "w")).run(suite)


来源:https://stackoverflow.com/questions/27418416/how-to-generate-report-using-sikuli-for-desktop-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!