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

from sikuli import *
import OpenApplications
reload(OpenApplications)

dir = os.path.dirname(getBundlePath()) # the folder, where your script is stored
def setUp(self):
    logging.basicConfig(filename='..\\logfile.log', level=logging.DEBUG)
    Images.images()
def tearDown(self):
    OpenApplications.CloseApp()
    self.app.close()

class TestDemo(unittest.TestCase):

            def functiontest1(self):
                try:
                        OpenApplications.OpenApp()
                        print 'Applications should be opened successfully'
                        click('Image1') ---> #This image is not present so 
program should not halt and continue to next step
                        OpenApplications.CloseApp()
                except Exception as e:
                        print (e)
                
                #Also program should execute this function even if it 
encounters some issues in above code
                def functiontest2(self):
        OpenApplications.OpenApp()
        print 'Applications should be opened successfully'
        OpenApplications.CloseApp()
                
suite = unittest.TestLoader().loadTestsFromTestCase(TestDemo)
outfile = open("..\\results.html", "w")
runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title='Test Report', 
description='Test Flows' )
runner.run(suite)
outfile.close()

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to