import sys import traceback import time from selenium.webdriver.common.keys import Keys dir_path = os.path.dirname(os.path.realpath(__file__)) folder_path = os.path.abspath(os.path.join(dir_path, os.pardir)) sys.path.insert(0, folder_path + "\Syslibrary") sys.path.insert(0, folder_path + "\Library") from datadriver import readjson jsonread1 = readjson() from Launchapplication import launchapplication application = launchapplication() tf = 'test_TestcaseNo100030' #Test case No : 100030 class TestcaseNo100030(unittest.TestCase): def test_TestcaseNo100030(self): try: browser = application.intializebrowser() application.inputurl(browser) registrationform_locator = application.registrationform_locators() registrationform_testdata = application.registrationform_testdata() password = application.registrationform_password( browser, registrationform_locator)
#print folderpath sys.path.append(folderpath + '\Testscripts') sys.path.append(folderpath + '\Library') #sys.path.insert(0,folderpath+'\Testscripts') #sys.path.insert(0,folderpath+'\Library') from Launchapplication import launchapplication from ApplicationSignIn import applicationsignin import HTMLTestRunner #import HTMLTestRunnernew suite = unittest.TestSuite() suite.addTest(launchapplication('test_launchapplication')) #suite.addTest(applicationsignin('test_applicationsignin')) todaysdate = datetime.datetime.today().strftime('%d_%m_%Y-%H_%M_%S') outfile = file( folderpath + '\TestReport\Regressionreport-%s.html' % todaysdate, 'w') #runner = HTMLTestRunner.HTMLTestRunner(stream = outfile,verbosity = 2,title='Regression Report', description='Automation report') runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, verbosity=2, title='Regression Report', description='Automation report', dirTestScreenshots=folderpath + '\Screenshots')