The special theory of relativity was proposed in 1905 by Albert Einstein in his article "On the Electrodynamics of Moving Bodies". Some three centuries earlier, Galileo's principle of relativity had stated that all uniform motion was relative, and that there was no absolute and well-defined state of rest; a person on the deck of a ship may be at rest in his opinion, but someone observing from the shore would say that he was moving. Einstein's theory generalized Galilean relativity from only mechanics to all laws of physics including electrodynamics. To stress this point, Einstein not only widened the postulate of relativity, but added the second postulate - that all observers will always measure the speed of light to be the same no matter what their state of uniform linear motion is.
This theory has a variety of surprising consequences that seem to violate common sense, but all have been experimentally verified. Special relativity overthrows Newtonian notions of absolute space and time by stating that distance and time depend on the observer, and that time and space are perceived differently, depending on the observer. It yields the equivalence of matter and energy, as expressed in the mass-energy equivalence formula E = mc², where c is the speed of light in a vacuum. Special relativity agrees with Newtonian mechanics in their common realm of applicability, in experiments in which all velocities are small compared to the speed of light.
The theory was called "special" because it applies the principle of relativity only to inertial frames. Einstein developed general relativity to apply the principle generally, that is, to any frame, and that theory includes the effects of gravity. Special relativity does not account for gravity, but it can deal with accelerations.
Although special relativity makes some quantities relative, such as time, that we would have imagined to be absolute based on everyday experience, it also makes absolute some others that we would have thought were relative. In particular, it states that the speed of light is the same for all observers, even if they are in motion relative to one another. Special relativity reveals that c is not just the velocity of a certain phenomenon - light - but rather a fundamental feature of the way space and time are tied together. In particular, special relativity states that it is impossible for any material object to accelerate to light speed.
'
Option Explicit
'call fn_GenericALMTYpeConvert( "u490277", "Wels@123", "O:\Development\FunctionalTypeConvert.xls")
'a = "sunday"
'b = "monday"
'a = a&b
'b = left (a , len(a)-len(b))
'a = right (a,len(a)-len(b))
'msgbox b
'msgbox a
'
'msgbox a
''Function primeNumber()
' flag=1
' primeNo=inputbox("Enter a number")
' For n=1 to primeNo
' flag=1
' For j=2 to n/2
' If n mod j=0 Then
' flag=0
' End If
' Next
' If flag=1 Then
' msgbox "prime no is:" & n
' End If
' Next
' 'End Function
'
'Dim test
' ========================================================================================================================================
' Description : This script will Drive the Automation Execution
' Created By : Neeraj Gaur
' Creation Date : 04-Aug-2015
' Modified By : Neeraj Gaur
' Modification Date : 17-Dec-2015
' Modification Comments : Code for column header names from Test Case Step sheet and reporting function to include more columns in StepLevel report.
' Read test case row number from TestCaseSteps sheet to TestCase sheet.
' Modification History :
' Neeraj Gaur 07-Oct-2015 Code updated for Common Steps Group Steps,ALM Integration.
' Neeraj Gaur 13-Oct-2015 Code added to make Driver run from ALM.
' Neeraj Gaur 28-Oct-2015 Execution control is added in configuration file to generate Module and Test case report.
' Driver code to pass the sheet name from test case step file to Group sheet is updated.
' Driver code updated to get the test set name at run time while running from ALM.
' Neeraj Gaur 09-Nov-2015 Updated the "Group" and "CommonSteps" name with "Call" and reporting function parameters added to take.
' screenshot for Validate keyword.
' Neeraj Gaur 12-Nov-2015 Code updated for Common Steps , Group Steps , ALM Integration
' Neeraj Gaur 17-Nov-2015 Code updated for logging the exceptions in the text file.
' Neeraj Gaur 01-Dec-2015 Code updated to consider strDataValue2 for Validate , ValidateObject and ValidateColor actions
' Neeraj Gaur 04-Dec-2015 Start time variables added for duration calculation on TestCaseLevel and ModuleLevel reports.
' Exception is added for Test Case Step , Test Module File , Test Case Files and TSR file not found.
' Neeraj Gaur 08-Dec-2015 Code updated for mathmatical functions.
' Neeraj Gaur 14-Dec-2015 Code for additional TestData6 column is added.
'Initialize Error Handling
On Error Resume Next
'Declare Varibales
'Conf Variables
'=======================================================================================================================================================================================================
Dim strConfFolderName,strFrmFolderPath,strConfFilePath
'Declare framework path variables
Dim strModFilePath,strTestCasePath,strTestCaseFilePath,strCurTestRunFldPath,strResultPath,strTestResDateFldPath,_
strTestModResFldPath,strTestCaseFldPath,strSnapResFldPath,strTSRORPath,strXLORPath
'Declare row count variables
Dim intModRowCount,intTestCaseRowCount,intTestStepRowCount,intTDRowCount
'Declare row number variables
Dim intTestCaseRowNo,intModRowNo,intTestStepRowNo,intTDRowNo,intRowNo, strTestCaseStatus
Dim ExistingValue,strRndValue
'Declare variables to capture execution flag column names
Dim strModExeFlag,strTestCaseExeFlag,strTestStepExeFlag,strTestDataExeFlag,strTestCaseName,strModName,strTestStepCaseName,strResDateFldName,strALMTestIDColumnName,strALMTestID,strTempTestStepCaseName
Dim strExecutionStartTimeTc,strExecutionStartTimeMl,strExecutionStartTime
'Declare the TestCaseStep sheet column names variable
Dim strAction,strObjName,strTDSheetName,strScreenName,strStepStatus,strDataValue,strTestCaseNo,strDataValue2,strObjName2,strDataValue1,strObjName1,strDataValue3,strObjName3,strDataValue4,_
strObjName4,strDataValue5,strDataValue6
'Declare object variables
Dim objUI,objDictRUNTIMEVALUE,objUI2,objUI3,objUI4
'Declare file system object variables for result and log file
Dim objFSOResultTestStep,objLogFile,objLog,strLogFilePath,objFSO
Dim strExpectedResult,strActualResult,strManualCaseMap,strTimeStamp
'Conf - General sheet name variables
Dim strAppName,strAppType,strFrmRunLocation,strTestCaseSheetName,strTestStepSheetName,strScreenMapSheetName,strActionSheetName,strBrowser,strAppURL,strEnv,intTestCaseSNo,intStepRow
'Conf - Framework sheet name variables
Dim strFrmPath,strModFolderName,strTestCaseFolderName,strReportFolderName,strORFolderName,strModFileName
'Conf - Report name variables
Dim strTestStepReportName,strTestCaseReportName,strModReportName,strAttachmentLocation,strReportType,strModuleRepFlag,strTestCaseRepFlag,strTestStepRepFlag,strScreenShotStepFlag
'Conf - Obj Sheet name variables
Dim strUFTORFileName,strXLORFileName,strObjectType,strObjHier,strObjHier2,strObjHier3,strObjHier4
'Conf - Sheet Name variables
Dim strConfGenSheetName,strConfFrmSheetname,strConfReportSheetname,strConfEmailSheetname,strConfQCSheetname,strConfORSheetname,strConfQCPwdSheetname
'Other sheet name variables
Dim strModSheetName, strTestCaseHtmlPath, strModuleStatus, strHTMLFileResPathModule, intModSNo
'Declare variables for column names in module,test case step sheet
Dim strExecColumnName,strModColumnName,strActionColumnName,strObjColumnName,strSheetColumnName,strTDColumnName,strScreenColumnName,strTesResultfoldPath,_
strManualCaseMapColName,strTestCaseColumnName,strSlNoColumnName,strObjNameColPos,strTDNameColPos,strObjNameColOrigPos,strTDNameColOrigPos,_
strStartRowColName,strEndRowColName,strRTObjectTypeColName,strRTObjectType,strTDColumnName2,_
strTDColumnName3,strTDColumnName4,strTDColumnName5,strTDColumnName6
'Dim strObjNameColOrigPos2,strObjNameColOrigPos3,strObjNameColOrigPos4,strTDNameColOrigPos4,strTDNameColOrigPos5,strTDNameColPos5,strTDNameColOrigPos6,strTDNameColPos6,strTDNameColOrigPos3
'Dim strObjNameColPos3,strTDNameColPos3,strObjNameColPos4,strTDNameColPos4,strObjNameColPos2,strTDNameColPos2,strTDNameColOrigPos2
'Declare variables related to validate the flag and status
Dim strYESFlag,strNOFlag,strPASSEDStatus,strFAILEDStatus
Dim strSnapResFldName,intTestStepTotalColNo,intTestStepColNo
'Varibale related to data parameterization
Dim intStartRow,intEndRow,intDPStartRow,intDPEndRow,strDPTDSheetName,intDPTDRowNo,blnTestCaseEnd,blnTestDataRowEnd,blnTestCaseStepFound,blnModuleFileFound,blnTSRPathFound,blnTestCaseFileFound
Dim strTestCaseEnd
'Declare variables for Group Sheet
Dim intGroupTestStepRowCount,strGroupTestStepExeFlag,strGroupTestStepCaseName,intGroupRowNo,intGroupTestStepRowNo,blnGroupCase,intOrigTestStepRowNo,strOrigTestStepSheetName,strGroupSheetName,_
strCommonStepName,strGroupStepName,strExpectedStepName,blnNextGroupStep,strGroupTDSheetName
'Declare ALM variables
Dim strQCURL,strQCDomainName,strQCProjectName,strQCUserID,strQCTestResourceFolderName,strQCTestPlanPath,strQCTestLabPath,strQCPwd,objDictTestId,blnQCUpdateFlag,strDriverType,strQCTestSetName
Dim objTestSet,strModuleName
Dim intStepRowNo,strStepRowNoColumnName
Dim strObjColumnName2,strObjColumnName3,strObjColumnName4,strObjColumnName5,strObjColumnName6,strTDColName1,strTDColName2,strTDColName3,strTDColName4,strTDColName5,strTDColName6
'Initialize variables for GroupTestStep sheet
strCommonStepName = "CALL" '"COMMONSTEPS"
strGroupStepName = "CALL" '"GROUP"
'Initialize variables Configuration - General sheet name
strConfGenSheetName = "General"
strConfFrmSheetname = "Framework"
strConfReportSheetname = "Report"
strConfEmailSheetname = "Email"
strConfQCSheetname = "QCConnection"
strConfQCPwdSheetname = "QCPwd"
strConfORSheetname = "ObjectRepository"
strModSheetName = "Module"
'Initialize variables for column names in Module and TestCaseStep sheet
strExecColumnName = "Execution"
strModColumnName = "ModuleName"
strActionColumnName = "Action"
strRTObjectTypeColName = "ObjectType"
strObjColumnName = "ObjectName1"
strObjColumnName2 = "ObjectName2"
strObjColumnName3 = "ObjectName3"
strObjColumnName4 = "ObjectName4"
strObjColumnName5 = "ObjectName5"
strObjColumnName6 = "ObjectName6"
strSheetColumnName = "SheetName"
strTDColName1 = "TestData1"
strTDColName2 = "TestData2"
strTDColName3 = "TestData3"
strTDColName4 = "TestData4"
strTDColName5 = "TestData5"
strTDColName6 = "TestData6"
strScreenColumnName = "ScreenName"
'strManualCaseMapColName = "ManualCaseMapping"
strTestCaseColumnName = "TestCaseName"
strALMTestIDColumnName = "ALMTestID"
strStepRowNoColumnName = "StepRowNo"
strStartRowColName = "StartRow"
strEndRowColName = "EndRow"
strSlNoColumnName = "SlNo"
strObjNameColOrigPos = 9
strTDNameColOrigPos = 10
'strObjNameColOrigPos2 = 11
'strTDNameColOrigPos2 = 12
'strObjNameColOrigPos3 = 13
'strTDNameColOrigPos3 = 14
'strObjNameColOrigPos4 = 15
'strTDNameColOrigPos4 = 16
'strTDNameColOrigPos5 = 18
'strTDNameColOrigPos6 = 20
Dim scriptTotalStartTime,scriptTotalEndTime
scriptTotalStartTime = Now
'Kill excel process
Systemutil.CloseProcessByName "Excel.exe"
'Initialize variables related to validate the flag and status
strYESFlag = "YES"
strNOFlag = "NO"
strPASSEDStatus = "PASSED"
strFAILEDStatus = "FAILED"
'Initialize the HTML,Excel and Snapshot result folder name
strSnapResFldName = "SnapShot"
'Get the configuration file value from environment variable
strConfFolderName = Environment.Value("SUMS_LOCAL_CONFIG_PATH")
'Find if script is running from local or ALM and If from local then Driver Script path - (Script name + Script folder name) and PathFinder.Locate
strFrmFolderPath = fn_GetFrmFolderPath()
strConfFilePath = strFrmFolderPath & strConfFolderName
strTimeStamp = FormatDateTime(Now,3)
strTimeStamp = Replace(Replace(strTimeStamp," ","_"),":","_") & ".txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
strLogFilePath = Environment.Value("FRM_PATH") & "TestResults\LogFile\"
Set objLogFile = objFSO.CreateTextFile(strLogFilePath & strTimeStamp)
objLogFile.WriteLine "Log Initiated"
If Not(objFSO.FileExists(strConfFilePath)) Then
objLogFile.WriteLine "Error: Driver Script:File path " & strConfFilePath & " does not exist."
End If
'Upload the sheets from config file in DataTablek
Call fn_Generic_AddSheetInDataTable(objLogFile,strConfFilePath,strConfGenSheetName)
Call fn_Generic_AddSheetInDataTable(objLogFile,strConfFilePath,strConfFrmSheetname)
Call fn_Generic_AddSheetInDataTable(objLogFile,strConfFilePath,strConfReportSheetname)
Call fn_Generic_AddSheetInDataTable(objLogFile,strConfFilePath,strConfORSheetname)
'Initialize the variables for the General sheet of framework
strAppName = DataTable.GetSheet(strConfGenSheetName).GetParameter("ApplicationName").Value
strAppType = DataTable.GetSheet(strConfGenSheetName).GetParameter("ApplicationType").Value
strFrmRunLocation = DataTable.GetSheet(strConfGenSheetName).GetParameter("FrameworkRunLocation").Value
strTestCaseSheetName = DataTable.GetSheet(strConfGenSheetName).GetParameter("TestCaseSheetName").Value
strTestStepSheetName = DataTable.GetSheet(strConfGenSheetName).GetParameter("TestCaseStepSheetName").Value
strOrigTestStepSheetName = strTestStepSheetName
strGroupSheetName = DataTable.GetSheet(strConfGenSheetName).GetParameter("GroupStepSheetName").Value
'strTestStepSheetName = DataTable.GetSheet(strConfGenSheetName).GetParameter("TestCaseStepSheetName").Value
strScreenMapSheetName = DataTable.GetSheet(strConfGenSheetName).GetParameter("ScreenMappingSheetName").Value
strActionSheetName = DataTable.GetSheet(strConfGenSheetName).GetParameter("ActionNameSheetName").Value
strBrowser = DataTable.GetSheet(strConfGenSheetName).GetParameter("Browser").Value
strAppURL = DataTable.GetSheet(strConfGenSheetName).GetParameter("AppURL").Value
Environment.value("APPURL") = strAppURL
strEnv = DataTable.GetSheet(strConfGenSheetName).GetParameter("Environment").Value
Environment.value("Environment") = strEnv
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while Initialize the variables for the General sheet of framework.Error is " & Err.Description
Err.Clear
End If
'Initialize the variables for the Framework sheet of framework
strFrmPath = DataTable.GetSheet(strConfFrmSheetname).GetParameter("FrameworkPath").Value
strModFolderName = DataTable.GetSheet(strConfFrmSheetname).GetParameter("ModuleFolderName").Value
strTestCaseFolderName = DataTable.GetSheet(strConfFrmSheetname).GetParameter("TestCaseFolderName").Value
strReportFolderName = DataTable.GetSheet(strConfFrmSheetname).GetParameter("ReportFolderName").Value
strORFolderName = DataTable.GetSheet(strConfFrmSheetname).GetParameter("ORFolderName").Value
strModFileName = DataTable.GetSheet(strConfFrmSheetname).GetParameter("ModuleFileName").Value
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while Initialize the variables for the Framework sheet of framework.Error is " & Err.Description
Err.Clear
End If
'Initialize the variables for the Report sheet of framework
strTestStepReportName = DataTable.GetSheet(strConfReportSheetname).GetParameter("TestStepReportName").Value
strTestCaseReportName = DataTable.GetSheet(strConfReportSheetname).GetParameter("TestCaseReportName").Value
strModReportName = DataTable.GetSheet(strConfReportSheetname).GetParameter("ModuleReportName").Value
strReportType = DataTable.GetSheet(strConfReportSheetname).GetParameter("ReportType").Value
strModuleRepFlag = DataTable.GetSheet(strConfReportSheetname).GetParameter("GenerateModuleReport").Value
strTestCaseRepFlag = DataTable.GetSheet(strConfReportSheetname).GetParameter("GenerateTestCaseReport").Value
strTestStepRepFlag = DataTable.GetSheet(strConfReportSheetname).GetParameter("GenerateTestStepReport").Value
strScreenShotStepFlag = DataTable.GetSheet(strConfReportSheetname).GetParameter("ScreenShotToBeTakenForSteps").Value
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while Initialize the variables for the Report sheet of framework.Error is " & Err.Description
Err.clear
End If
'Initialize the variables for the Object Repository sheet of framework
strUFTORFileName = DataTable.GetSheet(strConfORSheetname).GetParameter("UFTORFileName").Value
strXLORFileName = DataTable.GetSheet(strConfORSheetname).GetParameter("ORFileName").Value
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while Initialize the variables for the Object Repository sheet of framework.Error is " & Err.Description
Err.clear
End If
'Remove the configuration sheets from data table
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strConfGenSheetName)
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strConfFrmSheetname)
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strConfReportSheetname)
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strConfORSheetname)
If Err.Number<>0 Then
Err.clear
End If
'Get the framework folder and file path
strResultPath = strFrmPath & "\" & strReportFolderName & "\"
strModFilePath = strFrmPath & "\" & strModFolderName & "\" & strModFileName
strTestCasePath = strFrmPath & "\" & strTestCaseFolderName & "\"
strTSRORPath = strFrmPath & "\" & strORFolderName & "\" & strUFTORFileName
strXLORPath = strFrmPath & "\" & strORFolderName & "\" & strXLORFileName
If Not(objFSO.FolderExists(strResultPath)) or Not(objFSO.FileExists(strModFilePath)) or Not(objFSO.FolderExists(strTestCasePath)) or Not(objFSO.FileExists(strTSRORPath)) or Not(objFSO.FileExists(strXLORPath)) Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while getting the framework folder and file path."
Err.Clear
End If
Set objFSO = Nothing
'De-initialize the variables that are not required
strORFolderName=Empty:strUFTORFileName=Empty:strTestCaseFolderName=Empty:strModFolderName=Empty:strModFileName=Empty:strReportFolderName=Empty
'Create the file system object for Test Case Step Report
Set objFSOResultTestStep = CreateObject("Scripting.FileSystemObject")
'Load the shared object respoitory at run time
If Not(objFSOResultTestStep.FileExists(strTSRORPath)) Then
blnTSRPathFound = False
objLogFile.WriteLine "Error: Driver Script:Shared object respository file path " & chr(34) & strTSRORPath & chr(34) & " is not found."
Else
blnTSRPathFound = True
RepositoriesCollection.RemoveAll
RepositoriesCollection.Add strTSRORPath
If Err.Number<>0 Then
objLogFile.WriteLine "Error:Driver Script:Error Occurred while loading the shared object respoitory at run time.Error is " & Err.Description
Err.Clear
End If
End If
If Not(objFSOResultTestStep.FileExists(strModFilePath)) Then
blnModuleFileFound = False
objLogFile.WriteLine "Error: Driver Script:Module file path " & chr(34) & strModFilePath & chr(34) & " is not found."
Else
blnModuleFileFound = True
'Add the Test Mod sheet from Test Mod file in datatable and import the data
Call fn_Generic_AddSheetInDataTable(objLogFile,strModFilePath,strModSheetName)
'Get the row count from Mod sheet
intModRowCount = DataTable.GetSheet(strModSheetName).GetRowCount
strResDateFldName = DatePart("m",Date) & "-" & DatePart("d",Date) & "-" & DatePart("yyyy",Date)
strTestResDateFldPath = fn_Generic_Report_CreateFolder(strResultPath,strResDateFldName)
strModName = DataTable.GetSheet(strModSheetName).GetParameter(strModColumnName).Value
End If
If ucase(strModuleRepFlag) = strYESFlag Then
'Create Current Date result folder for the current framework run
fn_Common_Results_CreateTestResultFile strALMTestID,strTestResDateFldPath, strResultPath, "","", strModName,"modulelevel","ResultTemplateModule"
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while creating Current Date result folder for the current framework run.Error is " & Err.Description
Err.clear
End If
strHTMLFileResPathModule = Environment.Value("strHTMLFileResPathModule")
End If
'Iterate through the Mod data table sheet
intModSNo = 1
For intModRowNo = 1 to intModRowCount
If blnTSRPathFound=False or blnModuleFileFound=False Then
Exit For
End If
'Set the current row based on the Mod data table sheet row number
DataTable.GetSheet(strModSheetName).SetCurrentRow intModRowNo
'Get the execution flag column value from the Mod data table sheet
strModExeFlag = Trim(DataTable.GetSheet(strModSheetName).GetParameter(strExecColumnName).Value)
'Condition to check if execution flag captured above from Mod data table sheet is "YES"
strModExeFlag = DataTable.GetSheet(strModSheetName).GetParameter(strExecColumnName).Value
strModName = Trim(DataTable.GetSheet(strModSheetName).GetParameter(strModColumnName).Value)
If qcutil.IsConnected=True Then
Set objTestSet = qcutil.CurrentTestSet
strModuleName = objTestSet.Name
Set objTestSet = Nothing
strModuleName = strModName
Else
strModuleName = strModName
End If
If ucase(strModExeFlag) = ucase(strYESFlag) and ucase(Trim(strModName)) = ucase(Trim(strModuleName)) Then
strExecutionStartTimeMl = Now
intRowNo=1
'Get the Mod name from Mod data table sheet and build the test case file path from Test Case folder of the framework.
'strModName = DataTable.GetSheet(strModSheetName).GetParameter(strModColumnName).Value
strTestModResFldPath = fn_Generic_Report_CreateFolder(strTestResDateFldPath,strModName)
strTestCaseFilePath = strTestCasePath & strModName & ".xls"
If ucase(strTestCaseRepFlag) = strYESFlag Then
'Create test case level report
fn_Common_Results_CreateTestResultFile strALMTestID,strTestModResFldPath, strResultPath, "","", strModName,"testcaselevel","ResultTemplateTestCase"
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while creating test case level report.Error is " & Err.Description
Err.clear
End If
'Added new variable
strTestCaseHtmlPath = Environment("strTestCaseHtmlPath")
End If
If Not(objFSOResultTestStep.FileExists(strTestCaseFilePath)) Then
blnTestCaseFileFound = False
objLogFile.WriteLine "Error: Driver Script:Test Case file path " & chr(34) & strTestCaseFilePath & chr(34) & " is not found."
Else
blnTestCaseFileFound = True
'Add the test case sheet in datatable and get the row count from the data sheet
Call fn_Generic_AddSheetInDataTable(objLogFile,strTestCaseFilePath,strTestCaseSheetName)
intTestCaseRowCount = DataTable.GetSheet(strTestCaseSheetName).GetRowCount
End If
intTestCaseSNo = 1
'Iterate through the Test case steps in TestCase sheet of data table
For intTestCaseRowNo = 1 To intTestCaseRowCount
If blnTestCaseFileFound=False Then
Exit For
End If
intGroupRowNo = 1
'Set the current row based on the Mod data table sheet row number and Get the execution flag column value from the Mod data table sheet
DataTable.GetSheet(strTestCaseSheetName).SetCurrentRow intTestCaseRowNo
strTestCaseExeFlag = Trim(DataTable.GetSheet(strTestCaseSheetName).GetParameter(strExecColumnName).Value)
'Condition to check if execution flag captured above from Mod data table sheet is "YES"
If Ucase(strTestCaseExeFlag) = Ucase(strYESFlag) Then
'Initialize the data parameterization variables to empty. Start row , end row and sheetname for every new test case to be executed.
intStartRow="":intEndRow="":strDPTDSheetName=Empty:strExpectedStepName=Empty:strTestStepCaseName=Empty:blnTestCaseStepFound=False
strExecutionStartTimeTc = now()
'Get the test case name from the test case sheet
strTestCaseName = Trim(DataTable.GetSheet(strTestCaseSheetName).GetParameter(strTestCaseColumnName).Value)
'Get the test case ALM TestID and step row number from the test case sheet
strALMTestID = Trim(DataTable.GetSheet(strTestCaseSheetName).GetParameter(strALMTestIDColumnName).Value)
intStepRowNo = Trim(DataTable.GetSheet(strTestCaseSheetName).GetParameter(strStepRowNoColumnName).Value)
'Call the function to create the Test Case result folder and return the path of this folder
strTestCaseFldPath = fn_Generic_Report_CreateFolder(strTestModResFldPath,strTestCaseName)
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while creating Test Case result folder.Error is " & Err.Description
Err.clear
End If
'Time stamp variable to be used as prefix to create the folder with this name
strTimeStamp = FormatDateTime(Now,3)
strTimeStamp = Replace(Replace(strTimeStamp," ","_"),":","_")
'Call the function to create the Time stamp folder in the test case folder and return this path
strCurTestRunFldPath = fn_Generic_Report_CreateFolder(strTestCaseFldPath,strTimeStamp)
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while creating Time stamp folder.Error is " & Err.Description
Err.clear
End If
Environment.Value("envResultHTMLPath") = strCurTestRunFldPath
strTesResultfoldPath = strCurTestRunFldPath
'Create the Snapshot folder inside the timestamp folder
strSnapResFldPath = fn_Generic_Report_CreateFolder(strCurTestRunFldPath,strSnapResFldName)
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while creating Snapshot folder.Error is " & Err.Description
Err.clear
End If
'Create test step level report
strStepStatus = fn_Common_Results_CreateTestResultFile(strALMTestID,strCurTestRunFldPath,strResultPath,strTestStepReportName,strSnapResFldPath,strTestCaseName,"steplevel","ResultTemplate")
If Err.Number<>0 or strStepStatus = "FAILED" Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while creating test step level report.Error is " & Err.Description
Err.clear
End If
'Get the test case sl number from TestCase sheet
strTestCaseNo = Trim(DataTable.GetSheet(strTestCaseSheetName).GetParameter(strSlNoColumnName).Value)
'Call the function to add the TestCaseStep sheet in the datatable
Call fn_Generic_AddSheetInDataTable(objLogFile,strTestCaseFilePath,strTestStepSheetName)
'Get the row count from the test case step sheet,Current row number which is selected in the TestCaseStep sheet
intTestStepRowCount = DataTable.GetSheet(strTestStepSheetName).GetRowCount
intRowNo=1 'DataTable.GetSheet(strTestStepSheetName).GetCurrentRow
intTDRowNo=1:intDPTDRowNo=1
Set objDictRUNTIMEVALUE = CreateObject("Scripting.Dictionary")
objDictRUNTIMEVALUE.RemoveAll
If intStepRowNo>1 Then
' DataTable.GetSheet(strTestStepSheetName).SetCurrentRow intStepRowNo-1
intRowNo = intStepRowNo-1
End If
'Iterate through the test case steps in the data table
For intTestStepRowNo = intRowNo To intTestStepRowCount
blnTestDataRowEnd = False
'Set the curent row and get the execution flag for test step and test case name
If blnGroupCase <> True Then
DataTable.GetSheet(strTestStepSheetName).SetCurrentRow intTestStepRowNo
strTestStepExeFlag = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strExecColumnName).Value)
If Trim(strTestStepExeFlag) <> Empty Then
strTestStepCaseName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strTestCaseColumnName).Value)
'*************************************************************************************************************
strTempTestStepCaseName = Right(strTestStepCaseName,Len(strTestStepCaseName)-InStr(strTestStepCaseName,"<"))
strTempTestStepCaseName = Left(strTempTestStepCaseName,Len(strTempTestStepCaseName)-1)
'*************************************************************************************************************
End If
End If
'Condition to Validate if test case name in TestCase sheet is matching with the test case name in TestCaseStep sheet
If (ucase(strTestStepCaseName) = ucase(strTestCaseName)) Or (ucase(strTempTestStepCaseName) = ucase(strTestCaseName)) Then
blnTestCaseStepFound = True
'Condition to check if TestCaseStep execution flag is Yes
If ucase(strTestStepExeFlag) = ucase(strYESFlag) Then
'*******************************
'If condition for Group step to be executed
If (instr(1,ucase(strTestStepCaseName),ucase(strCommonStepName))>=1 Or instr(1,ucase(strTestStepCaseName),ucase(strGroupStepName))>=1) and ((instr(1,strTestStepCaseName,"<")>=1) Or (instr(1,strTestStepCaseName,">")>=1)) Then
If Trim(intOrigTestStepRowNo) = "" Then
intOrigTestStepRowNo = intTestStepRowNo
End If
If Trim(strGroupTDSheetName) = "" Then
strGroupTDSheetName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strSheetColumnName).Value)
End If
Call fn_Generic_AddSheetInDataTable(objLogFile,strTestCaseFilePath,strGroupSheetName)
intGroupTestStepRowCount = DataTable.GetSheet(strGroupSheetName).GetRowCount
Dim blnGroupCaseEnd
For intGroupTestStepRowNo = intGroupRowNo To intGroupTestStepRowCount
DataTable.GetSheet(strGroupSheetName).SetCurrentRow intGroupTestStepRowNo
strGroupTestStepExeFlag = Trim(DataTable.GetSheet(strGroupSheetName).GetParameter(strExecColumnName).Value)
If instr(1,ucase(strTestStepCaseName),ucase(strGroupStepName))>=1 and ((instr(1,strTestStepCaseName,"<")>=1) or (instr(1,strTestStepCaseName,">")>=1)) Then
strExpectedStepName = Trim(Left(strTestStepCaseName,InStr(strTestStepCaseName,"<")-1))
strExpectedStepName = Right(strExpectedStepName,(Len(strExpectedStepName)-instr(ucase(strExpectedStepName),strGroupStepName)+1))
strExpectedStepName = Trim(Right(strExpectedStepName,len(strExpectedStepName)-len(strGroupStepName)))
ElseIf instr(1,ucase(strTestStepCaseName),ucase(strCommonStepName))>=1 and ((instr(1,strTestStepCaseName,"<")>=1) or (instr(1,strTestStepCaseName,">")>=1)) Then
strExpectedStepName = Trim(Left(strTestStepCaseName,InStr(strTestStepCaseName,"<")-1))
strExpectedStepName = Right(strExpectedStepName,(Len(strExpectedStepName)-instr(ucase(strExpectedStepName),strCommonStepName)+1))
strExpectedStepName = Trim(Right(strExpectedStepName,len(strExpectedStepName)-len(strCommonStepName)))
End If
strGroupTestStepCaseName = Trim(DataTable.GetSheet(strGroupSheetName).GetParameter(strTestCaseColumnName).Value)
' If ucase(Trim(strExpectedStepName))=ucase(Trim(strGroupTestStepCaseName)) Then
Select Case ucase(strGroupTestStepCaseName)
Case ucase(strExpectedStepName)
If ucase(Trim(strGroupTestStepExeFlag)) = ucase(Trim("YES")) Then
blnGroupCase = True
strTestStepSheetName = strGroupSheetName
blnNextGroupStep = False
blnGroupCaseEnd=False
Exit For
End If
Case Else
blnGroupCaseEnd = True
End Select
If blnGroupCase = True and intGroupTestStepRowNo <= intGroupTestStepRowCount and blnGroupCaseEnd = True Then
blnGroupCase = False
Exit For
End If
' End If
Next
If intGroupTestStepRowNo > intGroupTestStepRowCount Then
blnGroupCase = False
End If
' Else
' blnGroupCase = False
End If ' End - If condition for Group step to be executed
If blnGroupCase = False and Trim(blnGroupCase) <> Empty Then
intTestStepRowNo = intOrigTestStepRowNo
strTestStepSheetName = strOrigTestStepSheetName
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strGroupSheetName)
intGroupRowNo = 1
DataTable.GetSheet(strTestStepSheetName).SetCurrentRow intTestStepRowNo + 1
intTestStepRowNo = intTestStepRowNo + 1
intStepRow = DataTable.GetSheet(strTestStepSheetName).GetCurrentRow
For intStepRow = intStepRow To intTestStepRowCount
DataTable.GetSheet(strTestStepSheetName).SetCurrentRow intStepRow
strTestStepCaseName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strTestCaseColumnName).Value)
strTestStepExeFlag = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strExecColumnName).Value)
If (instr(1,ucase(strTestStepCaseName),ucase(strCommonStepName))>=1 Or instr(1,ucase(strTestStepCaseName),ucase(strGroupStepName))>=1) and ucase(strTestStepExeFlag)=ucase(strYESFlag) Then
blnNextGroupStep = True
intTestStepRowNo = intTestStepRowNo - 1
Exit For
ElseIf (instr(1,ucase(strTestStepCaseName),ucase(strCommonStepName))<1 Or instr(1,ucase(strTestStepCaseName),ucase(strGroupStepName))<1) and ucase(strTestStepExeFlag)=ucase(strYESFlag) Then
intTestStepRowNo = intStepRow
blnNextGroupStep = False
Exit For
Else
blnNextGroupStep = False
End If
Next
blnGroupCase=Empty:intGroupTestStepRowNo=Empty:strGroupTestStepExeFlag=Empty:strGroupTestStepCaseName=Empty:intGroupTestStepRowCount=Empty:intOrigTestStepRowNo=Empty:strGroupTDSheetName=Empty
End If
' strTestStepCaseName = strTempTestStepCaseName
'*******************************
'Get the variables from TestCaseStep sheet
If blnNextGroupStep = False Then
'Get the variables from TestCaseStep sheet
strAction = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strActionColumnName).Value)
If Trim(strGroupTDSheetName) = "" Then
strTDSheetName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strSheetColumnName).Value)
ElseIf Trim(strGroupTDSheetName) <> "" Then
strTDSheetName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strSheetColumnName).Value)
If Trim(Ucase(strTDSheetName))="SHEETNAME" Then
strTDSheetName = strGroupTDSheetName
Else
strTDSheetName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strSheetColumnName).Value)
End If
End If
strScreenName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strScreenColumnName).Value)
' strManualCaseMap = DataTable.GetSheet(strTestStepSheetName).GetParameter(strManualCaseMapColName).Value
intStartRow = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strStartRowColName).Value)
intEndRow = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strEndRowColName).Value)
'************************* Start - Code for Data Parameterization *********************************************
'Get the colum name from the Datavalue column based on the SheetName column is empty or not - Done.If not empty then store the sheetname and load that datasheet in datatable - Done
'Get the current row in test data sheet to be executed based on execution flag and store in a variable.Get the column name value from data value column of test case step sheet -
'Get the data value for that column from data sheet.Validate If EndRow is matching with the test case step last row if no then continue execution on current step
'************************* End - Code for Data Parameterization ************************************************
intTestStepTotalColNo = DataTable.GetSheet(strTestStepSheetName).GetParameterCount
strObjNameColPos = strObjNameColOrigPos
strTDNameColPos = strTDNameColOrigPos
'Iterate through the Columns in TestCaseStep sheet for ObjectName and DataValue
For intTestStepColNo = strObjNameColPos To intTestStepTotalColNo
If strObjNameColPos > intTestStepTotalColNo Then
Exit For
End If
'Get Object Name and Value from test data column
strObjName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strObjNameColPos).Value)
strTDColumnName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strTDNameColPos).Value)
' ***************** Start - Commented to remove the ObjectType column from TestCaseStep sheet *****************************
' strRTObjectType = DataTable.GetSheet(strTestStepSheetName).GetParameter(strRTObjectTypeColName).Value
' ***************** End - Commented to remove the ObjectType column from TestCaseStep sheet *****************************
If (ucase(strAction)="CONCATENATE") or (ucase(strAction)="ADD") or (ucase(strAction)="SUBTRACT") or (ucase(strAction)="MULTIPLY") or (ucase(strAction)="DIVISION") or (ucase(strAction)="VALIDATE") Or (instr(1,ucase(strAction),"VALIDATECOLOR")>0) Or (instr(1,ucase(strAction),"VALIDATEOBJECT")>0) Or (instr(1,ucase(strAction),"TABLE")>0) Or (instr(1,ucase(strAction),"COMPAREVALUES")>0) Or (instr(1,ucase(strAction),"COMPAREPARTIALVALUE")>0) Then
' strObjNameColPos2 = strObjNameColOrigPos2
' strTDNameColPos2 = strTDNameColOrigPos2
' strObjNameColPos3 = strObjNameColOrigPos3
' strTDNameColPos3 = strTDNameColOrigPos3
' strObjNameColPos4 = strObjNameColOrigPos4
' strTDNameColPos4 = strTDNameColOrigPos4
' strTDNameColPos5 = strTDNameColOrigPos5
' strTDNameColPos6 = strTDNameColOrigPos6
strObjName2 = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strObjColumnName2).Value)
strTDColumnName2 = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strTDColName2).Value)
strObjName3 = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strObjColumnName3).Value)
strTDColumnName3 = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strTDColName3).Value)
strObjName4 = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strObjColumnName4).Value)
strTDColumnName4 = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strTDColName4).Value)
strTDColumnName5 = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strTDColName5).Value)
strTDColumnName6 = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strTDColName6).Value)
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while getting the name of ObjectName2,TestData2 etc valriables from test step sheet.Error is " & Err.Description
Err.clear
End If
End If
If Trim(strObjName) = "" Then
Exit For
End If
'Function to close popups on the application
'Call fn_Generic_Close_Popup(objLogFile,strExpectedResult,strActualResult,strObjectType,strObjHier,strScreenName,strObjName,strXLORPath)
'Get the Datavalue from the column and intitate the check for Data Parameterization.
strDataValue = fn_Generic_DataParametrization(objLogFile,strDPTDSheetName,intDPStartRow,intDPTDRowNo,intDPEndRow,intStartRow,intEndRow,blnTestCaseEnd,objDictRUNTIMEVALUE,_
strTDColumnName,strTestCaseFilePath,strTDSheetName,strExecColumnName,strALMTestID,strALMTestIDColumnName)
'In case of table related actions we may use multiple test data value columns
If (ucase(strAction)="CONCATENATE") or (ucase(strAction)="ADD") or (ucase(strAction)="SUBTRACT") or (ucase(strAction)="MULTIPLY") or (ucase(strAction)="DIVISION") or _
(ucase(strAction)="VALIDATE") Or (instr(1,ucase(strAction),"VALIDATECOLOR")>0) Or (instr(1,ucase(strAction),"VALIDATEOBJECT")>0) Or (instr(1,ucase(strAction),"TABLE")>0) Or _
(instr(1,ucase(strAction),"COMPAREVALUES")>0) Or (instr(1,ucase(strAction),"COMPAREPARTIALVALUE")>0) Then
strDataValue2 = fn_Generic_DataParametrization(objLogFile,strDPTDSheetName,intDPStartRow,intDPTDRowNo,intDPEndRow,intStartRow,intEndRow,blnTestCaseEnd,objDictRUNTIMEVALUE,_
strTDColumnName2,strTestCaseFilePath,strTDSheetName,strExecColumnName,strALMTestID,strALMTestIDColumnName)
strDataValue3 = fn_Generic_DataParametrization(objLogFile,strDPTDSheetName,intDPStartRow,intDPTDRowNo,intDPEndRow,intStartRow,intEndRow,blnTestCaseEnd,objDictRUNTIMEVALUE,_
strTDColumnName3,strTestCaseFilePath,strTDSheetName,strExecColumnName,strALMTestID,strALMTestIDColumnName)
strDataValue4 = fn_Generic_DataParametrization(objLogFile,strDPTDSheetName,intDPStartRow,intDPTDRowNo,intDPEndRow,intStartRow,intEndRow,blnTestCaseEnd,objDictRUNTIMEVALUE,_
strTDColumnName4,strTestCaseFilePath,strTDSheetName,strExecColumnName,strALMTestID,strALMTestIDColumnName)
strDataValue5 = fn_Generic_DataParametrization(objLogFile,strDPTDSheetName,intDPStartRow,intDPTDRowNo,intDPEndRow,intStartRow,intEndRow,blnTestCaseEnd,objDictRUNTIMEVALUE,_
strTDColumnName5,strTestCaseFilePath,strTDSheetName,strExecColumnName,strALMTestID,strALMTestIDColumnName)
strDataValue6 = fn_Generic_DataParametrization(objLogFile,strDPTDSheetName,intDPStartRow,intDPTDRowNo,intDPEndRow,intStartRow,intEndRow,blnTestCaseEnd,objDictRUNTIMEVALUE,_
strTDColumnName6,strTestCaseFilePath,strTDSheetName,strExecColumnName,strALMTestID,strALMTestIDColumnName)
End If
If blnTestCaseEnd = True Then
objDictRUNTIMEVALUE.RemoveAll
Set objUI = Nothing
Set objUI2 = Nothing
Set objUI3 = Nothing
strObjName=Empty:strTDColumnName=Empty:strDataValue=Empty:objUI=Empty:strExpectedResult=Empty:strActualResult=Empty
strObjName2=Empty:strTDColumnName2=Empty:strDataValue2=Empty:objUI2=Empty:strObjName3=Empty:strTDColumnName3=Empty:strDataValue3=Empty:objUI3=Empty
strObjName4=Empty:strTDColumnName4=Empty:strDataValue4=Empty:objUI4=Empty:strTDColumnName5=Empty
Exit For
End If
If Trim(strScreenName) <> "" Then
Set objUI = fn_Generic_GetObjectFromOR(objLogFile,strExpectedResult,strActualResult,strObjectType,strObjHier,strScreenName,strObjName,strXLORPath,strAction)
'In case of table related actions we may use multiple objects
If instr(1,Ucase(strAction),"TABLE") > 0 Then
If Trim(strObjName2) <> "" Then
Set objUI2 = fn_Generic_GetObjectFromOR(objLogFile,strExpectedResult,strActualResult,strObjectType,strObjHier2,strScreenName,strObjName2,strXLORPath,strAction)
End If
If Trim(strObjName3) <> "" Then
Set objUI3 = fn_Generic_GetObjectFromOR(objLogFile,strExpectedResult,strActualResult,strObjectType,strObjHier3,strScreenName,strObjName3,strXLORPath,strAction)
End If
If Trim(strObjName4) <> "" Then
Set objUI4 = fn_Generic_GetObjectFromOR(objLogFile,strExpectedResult,strActualResult,strObjectType,strObjHier4,strScreenName,strObjName4,strXLORPath,strAction)
End If
End If
End If
'Condition to check if Action is launch and in case of Launch action ignore the sync function
If instr(1,ucase(strAction),"LAUNCH") = 0 And Trim(strObjHier)<>"" Then
strStepStatus = fn_Generic_Sync(objUI,objLogFile,strObjHier,strExpectedResult,strActualResult,strScreenName,strObjName,strObjectType,strXLORPath,strAction)
ElseIf Trim(strObjHier)="" Then
strStepStatus = strFAILEDStatus
End If
If strStepStatus = strFAILEDStatus Then
blnTestCaseEnd = True
Else
strDataValue1 = strDataValue
strObjName1 = strObjName
strStepStatus = fn_Generic_ExecuteTestCaseSteps(objUI,objUI2,objUI3,objUI4,strExpectedResult,strActualResult,objLogFile,objDictRUNTIMEVALUE,strDataValue1,strObjName1,_
strScreenName,strObjectType,strAction,strXLORPath,strRTObjectType,strObjName2,strDataValue2,strObjName3,strDataValue3,strObjName4,strDataValue4,strDataValue5,strDataValue6)
End If
'Capture and concatenate the "strStepStatus"
strTestCaseStatus = strTestCaseStatus & ";" & strStepStatus
'Report Step results
If ucase(strTestStepRepFlag) = strYESFlag Then
If ucase(strStepStatus) = strPASSEDStatus Then
fn_Common_Results_CreateTestResultsReport "","" ,"micpass",strExpectedResult ,strActualResult,1,strTestStepCaseName,strSnapResFldPath,"steplevel",strAction,strScreenShotStepFlag,strExecutionStartTime,strScreenName,strObjName,strDataValue1
Else
blnTestCaseEnd = True
fn_Common_Results_CreateTestResultsReport "","" ,"micfail",strExpectedResult ,strActualResult,1,strTestStepCaseName,strSnapResFldPath,"steplevel",strAction,strScreenShotStepFlag,strExecutionStartTime,strScreenName,strObjName,strDataValue1
' Exit For 'Test case ended due to failed step
End If
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Function Name:fn_Common_Results_CreateTestResultsReport.Error Occurred while reporting step results.Error is " & Err.Description
Err.clear
End If
End If
Set objUI = Nothing
Set objUI2 = Nothing
' Call fn_CreateStepReport(objFSO,strTestCaseNo,strManualCaseMap,strTestCaseName,strScreenName,strAction,strObjName,strStepStatus,strDataValue,strExpectedResult,strActualResult,strResultPath,strTimeStamp)
' If ucase(strStepStatus)=strFAILEDStatus Then
' Exit For
' End If
'************************* Start - Code for Data Parameterization ***************************************************
'Validate if test data row end is reached or not based on the execution flag
'If yes then go to next test case using Endrow + 1
'Else go to test case step row mentioned in StartRow variable in TestCaseStep sheet and start executing that line.
'************************* End - Code for Data Parameterization *****************************************************
strObjNameColPos = strObjNameColPos + 2
strTDNameColPos = strTDNameColPos + 2
Set objUI = Nothing
Set objUI2 = Nothing
strObjName=Empty:strTDColumnName=Empty:strDataValue=Empty:objUI=Empty:strExpectedResult=Empty:strActualResult=Empty
strObjName2=Empty:strTDColumnName2=Empty:strDataValue2=Empty:objUI2=Empty:strObjName3=Empty:strTDColumnName3=Empty:strDataValue3=Empty:objUI3=Empty
strObjName4=Empty:strTDColumnName4=Empty:strDataValue4=Empty:objUI4=Empty:strTDColumnName5=Empty
'In case of table related actions we need to iterate only once
If instr(1,Ucase(strAction),"TABLE") > 0 Then
Exit For
End If
If ucase(strStepStatus)=strFAILEDStatus Then
Exit For
End If
strStepStatus=Empty:blnTestCaseEnd=Empty
Next ' For Loop for test case step columns
'De-initialize variables
strAction=Empty:strTDSheetName=Empty:strScreenName=Empty:strManualCaseMap=Empty:intStartRow=Empty:intEndRow=Empty:intTestStepTotalColNo=Empty:strObjNameColPos=Empty:strTDNameColPos=Empty
strStepStatus=Empty':strObjNameColPos2=Empty:strTDNameColPos2=Empty:strObjNameColPos3=Empty:strTDNameColPos3=Empty:strObjNameColPos4=Empty:strTDNameColPos4=Empty
End If
End If ' If condition for executable test steps
If blnTestCaseEnd = True Then
blnGroupCase = False
objDictRUNTIMEVALUE.RemoveAll
intTestStepRowNo = intOrigTestStepRowNo
strTestStepSheetName = strOrigTestStepSheetName
intGroupRowNo = 1
blnGroupCase=Empty:intGroupTestStepRowNo=Empty:strGroupTestStepExeFlag=Empty:strGroupTestStepCaseName=Empty:intGroupTestStepRowCount=Empty:intOrigTestStepRowNo=Empty:blnNextGroupStep=False
Exit For
End If
If intGroupRowNo = intGroupTestStepRowCount Then
intTestStepRowNo = intOrigTestStepRowNo
strTestStepSheetName = strOrigTestStepSheetName
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strGroupSheetName)
intGroupRowNo = 1
' DataTable.GetSheet(strTestStepSheetName).SetCurrentRow intTestStepRowNo + 1
' intTestStepRowNo = intTestStepRowNo + 1
blnGroupCase=Empty:intGroupTestStepRowNo=Empty:strGroupTestStepExeFlag=Empty:strGroupTestStepCaseName=Empty:intGroupTestStepRowCount=Empty:intOrigTestStepRowNo=Empty:blnNextGroupStep=False
End If
If Trim(blnGroupCase) = False or Trim(blnGroupCase) = Empty Then 'or instr(1,ucase(strTestStepCaseName),"GROUP")>=1 Then
DataTable.GetSheet(strTestStepSheetName).SetCurrentRow intTestStepRowNo + 1
blnTestCaseEnd = fn_Generic_ValidateEndDP(objLogFile,intDPStartRow,intDPTDRowNo,intDPEndRow,intTestStepRowNo,strTestStepSheetName,strTestCaseColumnName,strTestCaseName,_
strDPTDSheetName,strExecColumnName,strCommonStepName,strGroupStepName,strALMTestID,strALMTestIDColumnName)
If blnTestCaseEnd = True Then
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strDPTDSheetName)
objDictRUNTIMEVALUE.RemoveAll
Exit For
End If
'De-initialize variables
strTestStepExeFlag=Empty:strTestStepCaseName=Empty:blnTestCaseEnd=Empty
Else
intGroupRowNo = DataTable.GetSheet(strGroupSheetName).GetCurrentRow
intGroupRowNo = intGroupRowNo + 1
DataTable.GetSheet(strGroupSheetName).SetCurrentRow intGroupRowNo
End If
Else
'Flag that test case is not found in test case sheet
End If 'If condition to check if test case name from test case sheet macthes with name in Test Case step sheet.
'Declare variables
' strTestStepExeFlag=Empty:strTestStepCaseName=Empty:blnTestCaseEnd=Empty
Next ' For Loop for Test Case Step
If blnTestCaseStepFound=False Then 'Condition if test case is found in TestCase sheet but not in TestCaseStep sheet.
strTestCaseStatus = strFailedStatus
strExpectedResult = "Test Case is found in Test case Step sheet."
strActualResult = "Test case is present in TestCase sheet but steps are not found in TestCaseStep sheet."
fn_Common_Results_CreateTestResultsReport "","" ,"micfail",strExpectedResult ,strActualResult,1,strTestCaseName,strSnapResFldPath,"steplevel",strAction,strScreenShotStepFlag,strExecutionStartTime,strScreenName,strObjName1,strDataValue1
End If
If ucase(strTestStepRepFlag)=strYESFlag Then
'End the HTML report
fn_Common_Results_EndHTMLReporter strTestCaseName,"steplevel",strTesResultfoldPath
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Function Name:fn_Common_Results_EndHTMLReporter.Error Occurred while ending the step level HTML report.Error is " & Err.Description
Err.Clear
End If
End If
If Instr(1,strTestCaseStatus,"FAILED",1)>0 Then
strTestCaseStatus = "micfail"
Else
strTestCaseStatus = "micpass"
End If
'Capture and concatenate the "strTestSaseStatus"
strModuleStatus = strModuleStatus & ";" & strTestCaseStatus
'Report Test Case level results
If ucase(strTestCaseRepFlag)=strYESFlag Then
fn_Common_Results_CreateTestResultsReport strALMTestID,intTestCaseSNo,strTestCaseStatus,strExpectedResult,strActualResult,1,strTestCaseName,strSnapResFldPath,"testcaselevel",strAction,strScreenShotStepFlag,strExecutionStartTimeTc,strScreenName,strObjName1,strDataValue1
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Function Name:fn_Common_Results_CreateTestResultsReport.Error Occurred while reporting test Case level results.Error is " & Err.Description
Err.Clear
End If
End If
'Increment the Serial Number for Test Cases
intTestCaseSNo = intTestCaseSNo + 1
'De-initialize the variables
strTestCaseName=Empty:strALMTestID=Empty:strTestCaseFldPath=Empty:strTimeStamp=Empty:strCurTestRunFldPath=Empty:strSnapResFldPath=Empty:strTestCaseNo=Empty:intTestStepRowCount=Empty:intRowNo=Empty:intTDRowNo=Empty
intDPTDRowNo=Empty:blnTestCaseEnd=Empty:strStepStatus=Empty:strTestCaseStatus=Empty:strTesResultfoldPath=Empty
Set objDictRUNTIMEVALUE=Nothing
Systemutil.CloseProcessByName "excel.exe"
Wait(1)
End If
'De-initialize the variables
strTestCaseExeFlag=Empty
Next ' For Loop for Test Case
'De-Initialize the Variable
intTestCaseSNo=Empty
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strTestStepSheetName)
' Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strTestCaseSheetName)
If Instr(1,strModuleStatus,"micfail",1) > 0 Then
strModuleStatus = "micfail"
Else
strModuleStatus = "micpass"
End If
'Report Test case result
If ucase(strTestCaseRepFlag)=strYESFlag Then
fn_Common_Results_EndHTMLReporter strModName,"testcaselevel", strTestCaseHtmlPath
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Function Name:fn_Common_Results_EndHTMLReporter.Error Occurred while ending Test Case Level HTML report.Error is " & Err.Description
Err.clear
End If
End If
'Report Module results
If ucase(strModuleRepFlag)=strYESFlag Then
fn_Common_Results_CreateTestResultsReport "",intModSNo,strModuleStatus,strExpectedResult,strActualResult,1,strModName,strSnapResFldPath,"modulelevel",strAction,strScreenShotStepFlag,strExecutionStartTimeMl,strScreenName,strObjName1,strDataValue1
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Function Name:fn_Common_Results_CreateTestResultsReport.Error Occurred while reporting Module level results.Error is " & Err.Description
Err.clear
End If
End If
'Increment Module Level Sl No
intModSNo = intModSNo + 1
'De-initialize the variables
intRowNo=Empty:strTestModResFldPath=Empty:strTestCaseFilePath=Empty:intTestCaseRowCount=Empty:strTestCaseHtmlPath=empty:strModName=Empty
End If
'De-initialize the Variables
strModExeFlag=Empty
Next
'De-initialize the Variables
intModSNo = Empty
'Report Module Header update results
If ucase(strModuleRepFlag)=strYESFlag Then
fn_Common_Results_EndHTMLReporter "ModulesResults","modulelevel",strHTMLFileResPathModule
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Function Name:fn_Common_Results_EndHTMLReporter.Error Occurred while reporting Module Header update results.Error is " & Err.Description
Err.Clear
End If
End If
scriptTotalEndTime = Now
Print DateDiff("s",scriptTotalStartTime,scriptTotalEndTime)
'Load the QC Connection sheet from configuration file
Call fn_Generic_AddSheetInDataTable(objLogFile,strConfFilePath,strConfQCSheetname)
blnQCUpdateFlag = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCUpdate").Value
If Ucase(Trim(blnQCUpdateFlag))=ucase(strYESFlag) and blnTSRPathFound=True and blnModuleFileFound=True Then
'Initialize the QC Connection variables
strQCURL = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCURL").Value
strQCDomainName = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCDomainName").Value
strQCProjectName = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCProjectName").Value
strQCUserID = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCUserID").Value
strQCTestResourceFolderName = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCTestResourceFolderName").Value
strQCTestPlanPath = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCTestPlanPath").Value
strQCTestLabPath = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCTestLabPath").Value
strQCTestSetName = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCTestSetName").Value
strDriverType = DataTable.GetSheet(strConfQCSheetname).GetParameter("DriverType").Value
strAttachmentLocation = DataTable.GetSheet(strConfQCSheetname).GetParameter("AttachmentLocation").Value
If qcUtil.IsConnected <> True Then
'Call the function to load the ALM password sheets from datatable
Call fn_Generic_AddSheetInDataTable(objLogFile,strConfFilePath,strConfQCPwdSheetname)
strQCPwd = DataTable.GetSheet(strConfQCPwdSheetname).GetParameter("QCPwd").Value
'Call the function to remove the ALM configuration and QC Password configuration sheets from DataTable
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strConfQCPwdSheetname)
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strConfQCSheetname)
End If
'Call the function to update the result in ALM
Call fn_Generic_ALM_ResultUpdate(objLogFile,strTestResDateFldPath,strQcURL,strQCUserID,strQCPwd,strQCDomainName,strQCProjectName,strQCTestLabPath,strDriverType,strModSheetName,strTestCaseSheetName,_
strExecColumnName,strTestCaseColumnName,strModColumnName,strAttachmentLocation,strQCTestSetName)
End If
Wait(1)
'Kill excel process
Systemutil.CloseProcessByName "excel.exe"
Wait(2)
Systemutil.CloseProcessByName "iexplore.exe"
Wait(1)
'Call the function to remove the "TestCase" sheet from DataTable
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strTestCaseSheetName)
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strConfQCSheetname)
objLogFile.WriteLine "Log Ended."
objLogFile.Close
Set objLogFile = Nothing
Call fn_Generic_ResetVariables
'===============================================================================================================================================================================================
'Name : fn_Generic_ResetVariables
'Purpose : This function is used to get the data value from data sheet
'Associated Keyword : NA
'Input Parameters : NA
'Output Parameters : NA
'Created By : Neeraj Gaur
'Created On : 04-Sep-2015
'Modified By :
'Modified On :
'Modification Comment :
Public Function fn_Generic_ResetVariables()
strConfGenSheetName=Empty:strConfFrmSheetname=Empty:strConfReportSheetname=Empty:strConfEmailSheetname=Empty:strConfQCSheetname=Empty:strConfORSheetname=Empty:strModSheetName=Empty:strExecColumnName=Empty
strModColumnName=Empty:strActionColumnName=Empty:strObjColumnName=Empty:strSheetColumnName=Empty:strTDColumnName=Empty:strScreenColumnName=Empty:strManualCaseMapColName=Empty:strTestCaseColumnName=Empty:strALMTestIDColumnName=Empty
strStartRowColName=Empty:strEndRowColName=Empty:strSlNoColumnName=Empty:strObjNameColOrigPos=Empty:strTDNameColOrigPos=Empty:strYESFlag=Empty:strNOFlag=Empty:strPASSEDStatus=Empty:strFAILEDStatus=Empty
strSnapResFldName=Empty:strConfFolderName=Empty:strFrmFolderPath=Empty:strConfFilePath=Empty:strTimeStamp=Empty:objLog=Empty:objLogFile=Empty:strAppName=Empty:strAppType=Empty:strFrmRunLocation=Empty
strTestCaseSheetName=Empty:strTestStepSheetName=Empty:strScreenMapSheetName=Empty:strActionSheetName=Empty:strBrowser=Empty:strFrmPath=Empty:strModFolderName=Empty:strTestCaseFolderName=Empty
strReportFolderName=Empty:strORFolderName=Empty:strModFileName=Empty:strTestStepReportName=Empty:strTestCaseReportName=Empty:strModReportName=Empty:strAttachmentLocation=Empty
strReportType=Empty:strUFTORFileName=Empty:strXLORFileName=Empty:strResultPath=Empty:strModFilePath=Empty:strTestCasePath=Empty:strTSRORPath=Empty:strXLORPath=Empty
strORFolderName=Empty:strUFTORFileName=Empty:strTestCaseFolderName=Empty:strModFolderName=Empty:strModFileName=Empty:strReportFolderName=Empty
objFSOResultTestStep=Empty:intModRowCount=Empty:strResDateFldName=Empty:strTestResDateFldPath=Empty:strDataValue1=Empty:strObjName2=Empty:strObjNameColOrigPos2=Empty:strTDNameColOrigPos2=Empty
strRTObjectTypeColName=Empty:strRTObjectType=Empty:objDictRUNTIMEVALUE=Empty:strDataValue2=Empty:strObjName3=Empty:strObjNameColOrigPos3=Empty:strTDNameColOrigPos3=Empty
strDataValue3=Empty:strObjName4=Empty:strObjNameColOrigPos4=Empty:strTDNameColOrigPos4=Empty:strDataValue4=Empty:strTDNameColPos4=Empty:strTDColumnName3=Empty:strTDColumnName4=Empty
strObjHier=Empty:strObjHier2=Empty:strObjHier3=Empty:strObjHier4=Empty:strTDColumnName5=Empty
End Function
This theory has a variety of surprising consequences that seem to violate common sense, but all have been experimentally verified. Special relativity overthrows Newtonian notions of absolute space and time by stating that distance and time depend on the observer, and that time and space are perceived differently, depending on the observer. It yields the equivalence of matter and energy, as expressed in the mass-energy equivalence formula E = mc², where c is the speed of light in a vacuum. Special relativity agrees with Newtonian mechanics in their common realm of applicability, in experiments in which all velocities are small compared to the speed of light.
The theory was called "special" because it applies the principle of relativity only to inertial frames. Einstein developed general relativity to apply the principle generally, that is, to any frame, and that theory includes the effects of gravity. Special relativity does not account for gravity, but it can deal with accelerations.
Although special relativity makes some quantities relative, such as time, that we would have imagined to be absolute based on everyday experience, it also makes absolute some others that we would have thought were relative. In particular, it states that the speed of light is the same for all observers, even if they are in motion relative to one another. Special relativity reveals that c is not just the velocity of a certain phenomenon - light - but rather a fundamental feature of the way space and time are tied together. In particular, special relativity states that it is impossible for any material object to accelerate to light speed.
'
Option Explicit
'call fn_GenericALMTYpeConvert( "u490277", "Wels@123", "O:\Development\FunctionalTypeConvert.xls")
'a = "sunday"
'b = "monday"
'a = a&b
'b = left (a , len(a)-len(b))
'a = right (a,len(a)-len(b))
'msgbox b
'msgbox a
'
'msgbox a
''Function primeNumber()
' flag=1
' primeNo=inputbox("Enter a number")
' For n=1 to primeNo
' flag=1
' For j=2 to n/2
' If n mod j=0 Then
' flag=0
' End If
' Next
' If flag=1 Then
' msgbox "prime no is:" & n
' End If
' Next
' 'End Function
'
'Dim test
' ========================================================================================================================================
' Description : This script will Drive the Automation Execution
' Created By : Neeraj Gaur
' Creation Date : 04-Aug-2015
' Modified By : Neeraj Gaur
' Modification Date : 17-Dec-2015
' Modification Comments : Code for column header names from Test Case Step sheet and reporting function to include more columns in StepLevel report.
' Read test case row number from TestCaseSteps sheet to TestCase sheet.
' Modification History :
' Neeraj Gaur 07-Oct-2015 Code updated for Common Steps Group Steps,ALM Integration.
' Neeraj Gaur 13-Oct-2015 Code added to make Driver run from ALM.
' Neeraj Gaur 28-Oct-2015 Execution control is added in configuration file to generate Module and Test case report.
' Driver code to pass the sheet name from test case step file to Group sheet is updated.
' Driver code updated to get the test set name at run time while running from ALM.
' Neeraj Gaur 09-Nov-2015 Updated the "Group" and "CommonSteps" name with "Call" and reporting function parameters added to take.
' screenshot for Validate keyword.
' Neeraj Gaur 12-Nov-2015 Code updated for Common Steps , Group Steps , ALM Integration
' Neeraj Gaur 17-Nov-2015 Code updated for logging the exceptions in the text file.
' Neeraj Gaur 01-Dec-2015 Code updated to consider strDataValue2 for Validate , ValidateObject and ValidateColor actions
' Neeraj Gaur 04-Dec-2015 Start time variables added for duration calculation on TestCaseLevel and ModuleLevel reports.
' Exception is added for Test Case Step , Test Module File , Test Case Files and TSR file not found.
' Neeraj Gaur 08-Dec-2015 Code updated for mathmatical functions.
' Neeraj Gaur 14-Dec-2015 Code for additional TestData6 column is added.
'Initialize Error Handling
On Error Resume Next
'Declare Varibales
'Conf Variables
'=======================================================================================================================================================================================================
Dim strConfFolderName,strFrmFolderPath,strConfFilePath
'Declare framework path variables
Dim strModFilePath,strTestCasePath,strTestCaseFilePath,strCurTestRunFldPath,strResultPath,strTestResDateFldPath,_
strTestModResFldPath,strTestCaseFldPath,strSnapResFldPath,strTSRORPath,strXLORPath
'Declare row count variables
Dim intModRowCount,intTestCaseRowCount,intTestStepRowCount,intTDRowCount
'Declare row number variables
Dim intTestCaseRowNo,intModRowNo,intTestStepRowNo,intTDRowNo,intRowNo, strTestCaseStatus
Dim ExistingValue,strRndValue
'Declare variables to capture execution flag column names
Dim strModExeFlag,strTestCaseExeFlag,strTestStepExeFlag,strTestDataExeFlag,strTestCaseName,strModName,strTestStepCaseName,strResDateFldName,strALMTestIDColumnName,strALMTestID,strTempTestStepCaseName
Dim strExecutionStartTimeTc,strExecutionStartTimeMl,strExecutionStartTime
'Declare the TestCaseStep sheet column names variable
Dim strAction,strObjName,strTDSheetName,strScreenName,strStepStatus,strDataValue,strTestCaseNo,strDataValue2,strObjName2,strDataValue1,strObjName1,strDataValue3,strObjName3,strDataValue4,_
strObjName4,strDataValue5,strDataValue6
'Declare object variables
Dim objUI,objDictRUNTIMEVALUE,objUI2,objUI3,objUI4
'Declare file system object variables for result and log file
Dim objFSOResultTestStep,objLogFile,objLog,strLogFilePath,objFSO
Dim strExpectedResult,strActualResult,strManualCaseMap,strTimeStamp
'Conf - General sheet name variables
Dim strAppName,strAppType,strFrmRunLocation,strTestCaseSheetName,strTestStepSheetName,strScreenMapSheetName,strActionSheetName,strBrowser,strAppURL,strEnv,intTestCaseSNo,intStepRow
'Conf - Framework sheet name variables
Dim strFrmPath,strModFolderName,strTestCaseFolderName,strReportFolderName,strORFolderName,strModFileName
'Conf - Report name variables
Dim strTestStepReportName,strTestCaseReportName,strModReportName,strAttachmentLocation,strReportType,strModuleRepFlag,strTestCaseRepFlag,strTestStepRepFlag,strScreenShotStepFlag
'Conf - Obj Sheet name variables
Dim strUFTORFileName,strXLORFileName,strObjectType,strObjHier,strObjHier2,strObjHier3,strObjHier4
'Conf - Sheet Name variables
Dim strConfGenSheetName,strConfFrmSheetname,strConfReportSheetname,strConfEmailSheetname,strConfQCSheetname,strConfORSheetname,strConfQCPwdSheetname
'Other sheet name variables
Dim strModSheetName, strTestCaseHtmlPath, strModuleStatus, strHTMLFileResPathModule, intModSNo
'Declare variables for column names in module,test case step sheet
Dim strExecColumnName,strModColumnName,strActionColumnName,strObjColumnName,strSheetColumnName,strTDColumnName,strScreenColumnName,strTesResultfoldPath,_
strManualCaseMapColName,strTestCaseColumnName,strSlNoColumnName,strObjNameColPos,strTDNameColPos,strObjNameColOrigPos,strTDNameColOrigPos,_
strStartRowColName,strEndRowColName,strRTObjectTypeColName,strRTObjectType,strTDColumnName2,_
strTDColumnName3,strTDColumnName4,strTDColumnName5,strTDColumnName6
'Dim strObjNameColOrigPos2,strObjNameColOrigPos3,strObjNameColOrigPos4,strTDNameColOrigPos4,strTDNameColOrigPos5,strTDNameColPos5,strTDNameColOrigPos6,strTDNameColPos6,strTDNameColOrigPos3
'Dim strObjNameColPos3,strTDNameColPos3,strObjNameColPos4,strTDNameColPos4,strObjNameColPos2,strTDNameColPos2,strTDNameColOrigPos2
'Declare variables related to validate the flag and status
Dim strYESFlag,strNOFlag,strPASSEDStatus,strFAILEDStatus
Dim strSnapResFldName,intTestStepTotalColNo,intTestStepColNo
'Varibale related to data parameterization
Dim intStartRow,intEndRow,intDPStartRow,intDPEndRow,strDPTDSheetName,intDPTDRowNo,blnTestCaseEnd,blnTestDataRowEnd,blnTestCaseStepFound,blnModuleFileFound,blnTSRPathFound,blnTestCaseFileFound
Dim strTestCaseEnd
'Declare variables for Group Sheet
Dim intGroupTestStepRowCount,strGroupTestStepExeFlag,strGroupTestStepCaseName,intGroupRowNo,intGroupTestStepRowNo,blnGroupCase,intOrigTestStepRowNo,strOrigTestStepSheetName,strGroupSheetName,_
strCommonStepName,strGroupStepName,strExpectedStepName,blnNextGroupStep,strGroupTDSheetName
'Declare ALM variables
Dim strQCURL,strQCDomainName,strQCProjectName,strQCUserID,strQCTestResourceFolderName,strQCTestPlanPath,strQCTestLabPath,strQCPwd,objDictTestId,blnQCUpdateFlag,strDriverType,strQCTestSetName
Dim objTestSet,strModuleName
Dim intStepRowNo,strStepRowNoColumnName
Dim strObjColumnName2,strObjColumnName3,strObjColumnName4,strObjColumnName5,strObjColumnName6,strTDColName1,strTDColName2,strTDColName3,strTDColName4,strTDColName5,strTDColName6
'Initialize variables for GroupTestStep sheet
strCommonStepName = "CALL" '"COMMONSTEPS"
strGroupStepName = "CALL" '"GROUP"
'Initialize variables Configuration - General sheet name
strConfGenSheetName = "General"
strConfFrmSheetname = "Framework"
strConfReportSheetname = "Report"
strConfEmailSheetname = "Email"
strConfQCSheetname = "QCConnection"
strConfQCPwdSheetname = "QCPwd"
strConfORSheetname = "ObjectRepository"
strModSheetName = "Module"
'Initialize variables for column names in Module and TestCaseStep sheet
strExecColumnName = "Execution"
strModColumnName = "ModuleName"
strActionColumnName = "Action"
strRTObjectTypeColName = "ObjectType"
strObjColumnName = "ObjectName1"
strObjColumnName2 = "ObjectName2"
strObjColumnName3 = "ObjectName3"
strObjColumnName4 = "ObjectName4"
strObjColumnName5 = "ObjectName5"
strObjColumnName6 = "ObjectName6"
strSheetColumnName = "SheetName"
strTDColName1 = "TestData1"
strTDColName2 = "TestData2"
strTDColName3 = "TestData3"
strTDColName4 = "TestData4"
strTDColName5 = "TestData5"
strTDColName6 = "TestData6"
strScreenColumnName = "ScreenName"
'strManualCaseMapColName = "ManualCaseMapping"
strTestCaseColumnName = "TestCaseName"
strALMTestIDColumnName = "ALMTestID"
strStepRowNoColumnName = "StepRowNo"
strStartRowColName = "StartRow"
strEndRowColName = "EndRow"
strSlNoColumnName = "SlNo"
strObjNameColOrigPos = 9
strTDNameColOrigPos = 10
'strObjNameColOrigPos2 = 11
'strTDNameColOrigPos2 = 12
'strObjNameColOrigPos3 = 13
'strTDNameColOrigPos3 = 14
'strObjNameColOrigPos4 = 15
'strTDNameColOrigPos4 = 16
'strTDNameColOrigPos5 = 18
'strTDNameColOrigPos6 = 20
Dim scriptTotalStartTime,scriptTotalEndTime
scriptTotalStartTime = Now
'Kill excel process
Systemutil.CloseProcessByName "Excel.exe"
'Initialize variables related to validate the flag and status
strYESFlag = "YES"
strNOFlag = "NO"
strPASSEDStatus = "PASSED"
strFAILEDStatus = "FAILED"
'Initialize the HTML,Excel and Snapshot result folder name
strSnapResFldName = "SnapShot"
'Get the configuration file value from environment variable
strConfFolderName = Environment.Value("SUMS_LOCAL_CONFIG_PATH")
'Find if script is running from local or ALM and If from local then Driver Script path - (Script name + Script folder name) and PathFinder.Locate
strFrmFolderPath = fn_GetFrmFolderPath()
strConfFilePath = strFrmFolderPath & strConfFolderName
strTimeStamp = FormatDateTime(Now,3)
strTimeStamp = Replace(Replace(strTimeStamp," ","_"),":","_") & ".txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
strLogFilePath = Environment.Value("FRM_PATH") & "TestResults\LogFile\"
Set objLogFile = objFSO.CreateTextFile(strLogFilePath & strTimeStamp)
objLogFile.WriteLine "Log Initiated"
If Not(objFSO.FileExists(strConfFilePath)) Then
objLogFile.WriteLine "Error: Driver Script:File path " & strConfFilePath & " does not exist."
End If
'Upload the sheets from config file in DataTablek
Call fn_Generic_AddSheetInDataTable(objLogFile,strConfFilePath,strConfGenSheetName)
Call fn_Generic_AddSheetInDataTable(objLogFile,strConfFilePath,strConfFrmSheetname)
Call fn_Generic_AddSheetInDataTable(objLogFile,strConfFilePath,strConfReportSheetname)
Call fn_Generic_AddSheetInDataTable(objLogFile,strConfFilePath,strConfORSheetname)
'Initialize the variables for the General sheet of framework
strAppName = DataTable.GetSheet(strConfGenSheetName).GetParameter("ApplicationName").Value
strAppType = DataTable.GetSheet(strConfGenSheetName).GetParameter("ApplicationType").Value
strFrmRunLocation = DataTable.GetSheet(strConfGenSheetName).GetParameter("FrameworkRunLocation").Value
strTestCaseSheetName = DataTable.GetSheet(strConfGenSheetName).GetParameter("TestCaseSheetName").Value
strTestStepSheetName = DataTable.GetSheet(strConfGenSheetName).GetParameter("TestCaseStepSheetName").Value
strOrigTestStepSheetName = strTestStepSheetName
strGroupSheetName = DataTable.GetSheet(strConfGenSheetName).GetParameter("GroupStepSheetName").Value
'strTestStepSheetName = DataTable.GetSheet(strConfGenSheetName).GetParameter("TestCaseStepSheetName").Value
strScreenMapSheetName = DataTable.GetSheet(strConfGenSheetName).GetParameter("ScreenMappingSheetName").Value
strActionSheetName = DataTable.GetSheet(strConfGenSheetName).GetParameter("ActionNameSheetName").Value
strBrowser = DataTable.GetSheet(strConfGenSheetName).GetParameter("Browser").Value
strAppURL = DataTable.GetSheet(strConfGenSheetName).GetParameter("AppURL").Value
Environment.value("APPURL") = strAppURL
strEnv = DataTable.GetSheet(strConfGenSheetName).GetParameter("Environment").Value
Environment.value("Environment") = strEnv
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while Initialize the variables for the General sheet of framework.Error is " & Err.Description
Err.Clear
End If
'Initialize the variables for the Framework sheet of framework
strFrmPath = DataTable.GetSheet(strConfFrmSheetname).GetParameter("FrameworkPath").Value
strModFolderName = DataTable.GetSheet(strConfFrmSheetname).GetParameter("ModuleFolderName").Value
strTestCaseFolderName = DataTable.GetSheet(strConfFrmSheetname).GetParameter("TestCaseFolderName").Value
strReportFolderName = DataTable.GetSheet(strConfFrmSheetname).GetParameter("ReportFolderName").Value
strORFolderName = DataTable.GetSheet(strConfFrmSheetname).GetParameter("ORFolderName").Value
strModFileName = DataTable.GetSheet(strConfFrmSheetname).GetParameter("ModuleFileName").Value
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while Initialize the variables for the Framework sheet of framework.Error is " & Err.Description
Err.Clear
End If
'Initialize the variables for the Report sheet of framework
strTestStepReportName = DataTable.GetSheet(strConfReportSheetname).GetParameter("TestStepReportName").Value
strTestCaseReportName = DataTable.GetSheet(strConfReportSheetname).GetParameter("TestCaseReportName").Value
strModReportName = DataTable.GetSheet(strConfReportSheetname).GetParameter("ModuleReportName").Value
strReportType = DataTable.GetSheet(strConfReportSheetname).GetParameter("ReportType").Value
strModuleRepFlag = DataTable.GetSheet(strConfReportSheetname).GetParameter("GenerateModuleReport").Value
strTestCaseRepFlag = DataTable.GetSheet(strConfReportSheetname).GetParameter("GenerateTestCaseReport").Value
strTestStepRepFlag = DataTable.GetSheet(strConfReportSheetname).GetParameter("GenerateTestStepReport").Value
strScreenShotStepFlag = DataTable.GetSheet(strConfReportSheetname).GetParameter("ScreenShotToBeTakenForSteps").Value
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while Initialize the variables for the Report sheet of framework.Error is " & Err.Description
Err.clear
End If
'Initialize the variables for the Object Repository sheet of framework
strUFTORFileName = DataTable.GetSheet(strConfORSheetname).GetParameter("UFTORFileName").Value
strXLORFileName = DataTable.GetSheet(strConfORSheetname).GetParameter("ORFileName").Value
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while Initialize the variables for the Object Repository sheet of framework.Error is " & Err.Description
Err.clear
End If
'Remove the configuration sheets from data table
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strConfGenSheetName)
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strConfFrmSheetname)
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strConfReportSheetname)
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strConfORSheetname)
If Err.Number<>0 Then
Err.clear
End If
'Get the framework folder and file path
strResultPath = strFrmPath & "\" & strReportFolderName & "\"
strModFilePath = strFrmPath & "\" & strModFolderName & "\" & strModFileName
strTestCasePath = strFrmPath & "\" & strTestCaseFolderName & "\"
strTSRORPath = strFrmPath & "\" & strORFolderName & "\" & strUFTORFileName
strXLORPath = strFrmPath & "\" & strORFolderName & "\" & strXLORFileName
If Not(objFSO.FolderExists(strResultPath)) or Not(objFSO.FileExists(strModFilePath)) or Not(objFSO.FolderExists(strTestCasePath)) or Not(objFSO.FileExists(strTSRORPath)) or Not(objFSO.FileExists(strXLORPath)) Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while getting the framework folder and file path."
Err.Clear
End If
Set objFSO = Nothing
'De-initialize the variables that are not required
strORFolderName=Empty:strUFTORFileName=Empty:strTestCaseFolderName=Empty:strModFolderName=Empty:strModFileName=Empty:strReportFolderName=Empty
'Create the file system object for Test Case Step Report
Set objFSOResultTestStep = CreateObject("Scripting.FileSystemObject")
'Load the shared object respoitory at run time
If Not(objFSOResultTestStep.FileExists(strTSRORPath)) Then
blnTSRPathFound = False
objLogFile.WriteLine "Error: Driver Script:Shared object respository file path " & chr(34) & strTSRORPath & chr(34) & " is not found."
Else
blnTSRPathFound = True
RepositoriesCollection.RemoveAll
RepositoriesCollection.Add strTSRORPath
If Err.Number<>0 Then
objLogFile.WriteLine "Error:Driver Script:Error Occurred while loading the shared object respoitory at run time.Error is " & Err.Description
Err.Clear
End If
End If
If Not(objFSOResultTestStep.FileExists(strModFilePath)) Then
blnModuleFileFound = False
objLogFile.WriteLine "Error: Driver Script:Module file path " & chr(34) & strModFilePath & chr(34) & " is not found."
Else
blnModuleFileFound = True
'Add the Test Mod sheet from Test Mod file in datatable and import the data
Call fn_Generic_AddSheetInDataTable(objLogFile,strModFilePath,strModSheetName)
'Get the row count from Mod sheet
intModRowCount = DataTable.GetSheet(strModSheetName).GetRowCount
strResDateFldName = DatePart("m",Date) & "-" & DatePart("d",Date) & "-" & DatePart("yyyy",Date)
strTestResDateFldPath = fn_Generic_Report_CreateFolder(strResultPath,strResDateFldName)
strModName = DataTable.GetSheet(strModSheetName).GetParameter(strModColumnName).Value
End If
If ucase(strModuleRepFlag) = strYESFlag Then
'Create Current Date result folder for the current framework run
fn_Common_Results_CreateTestResultFile strALMTestID,strTestResDateFldPath, strResultPath, "","", strModName,"modulelevel","ResultTemplateModule"
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while creating Current Date result folder for the current framework run.Error is " & Err.Description
Err.clear
End If
strHTMLFileResPathModule = Environment.Value("strHTMLFileResPathModule")
End If
'Iterate through the Mod data table sheet
intModSNo = 1
For intModRowNo = 1 to intModRowCount
If blnTSRPathFound=False or blnModuleFileFound=False Then
Exit For
End If
'Set the current row based on the Mod data table sheet row number
DataTable.GetSheet(strModSheetName).SetCurrentRow intModRowNo
'Get the execution flag column value from the Mod data table sheet
strModExeFlag = Trim(DataTable.GetSheet(strModSheetName).GetParameter(strExecColumnName).Value)
'Condition to check if execution flag captured above from Mod data table sheet is "YES"
strModExeFlag = DataTable.GetSheet(strModSheetName).GetParameter(strExecColumnName).Value
strModName = Trim(DataTable.GetSheet(strModSheetName).GetParameter(strModColumnName).Value)
If qcutil.IsConnected=True Then
Set objTestSet = qcutil.CurrentTestSet
strModuleName = objTestSet.Name
Set objTestSet = Nothing
strModuleName = strModName
Else
strModuleName = strModName
End If
If ucase(strModExeFlag) = ucase(strYESFlag) and ucase(Trim(strModName)) = ucase(Trim(strModuleName)) Then
strExecutionStartTimeMl = Now
intRowNo=1
'Get the Mod name from Mod data table sheet and build the test case file path from Test Case folder of the framework.
'strModName = DataTable.GetSheet(strModSheetName).GetParameter(strModColumnName).Value
strTestModResFldPath = fn_Generic_Report_CreateFolder(strTestResDateFldPath,strModName)
strTestCaseFilePath = strTestCasePath & strModName & ".xls"
If ucase(strTestCaseRepFlag) = strYESFlag Then
'Create test case level report
fn_Common_Results_CreateTestResultFile strALMTestID,strTestModResFldPath, strResultPath, "","", strModName,"testcaselevel","ResultTemplateTestCase"
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while creating test case level report.Error is " & Err.Description
Err.clear
End If
'Added new variable
strTestCaseHtmlPath = Environment("strTestCaseHtmlPath")
End If
If Not(objFSOResultTestStep.FileExists(strTestCaseFilePath)) Then
blnTestCaseFileFound = False
objLogFile.WriteLine "Error: Driver Script:Test Case file path " & chr(34) & strTestCaseFilePath & chr(34) & " is not found."
Else
blnTestCaseFileFound = True
'Add the test case sheet in datatable and get the row count from the data sheet
Call fn_Generic_AddSheetInDataTable(objLogFile,strTestCaseFilePath,strTestCaseSheetName)
intTestCaseRowCount = DataTable.GetSheet(strTestCaseSheetName).GetRowCount
End If
intTestCaseSNo = 1
'Iterate through the Test case steps in TestCase sheet of data table
For intTestCaseRowNo = 1 To intTestCaseRowCount
If blnTestCaseFileFound=False Then
Exit For
End If
intGroupRowNo = 1
'Set the current row based on the Mod data table sheet row number and Get the execution flag column value from the Mod data table sheet
DataTable.GetSheet(strTestCaseSheetName).SetCurrentRow intTestCaseRowNo
strTestCaseExeFlag = Trim(DataTable.GetSheet(strTestCaseSheetName).GetParameter(strExecColumnName).Value)
'Condition to check if execution flag captured above from Mod data table sheet is "YES"
If Ucase(strTestCaseExeFlag) = Ucase(strYESFlag) Then
'Initialize the data parameterization variables to empty. Start row , end row and sheetname for every new test case to be executed.
intStartRow="":intEndRow="":strDPTDSheetName=Empty:strExpectedStepName=Empty:strTestStepCaseName=Empty:blnTestCaseStepFound=False
strExecutionStartTimeTc = now()
'Get the test case name from the test case sheet
strTestCaseName = Trim(DataTable.GetSheet(strTestCaseSheetName).GetParameter(strTestCaseColumnName).Value)
'Get the test case ALM TestID and step row number from the test case sheet
strALMTestID = Trim(DataTable.GetSheet(strTestCaseSheetName).GetParameter(strALMTestIDColumnName).Value)
intStepRowNo = Trim(DataTable.GetSheet(strTestCaseSheetName).GetParameter(strStepRowNoColumnName).Value)
'Call the function to create the Test Case result folder and return the path of this folder
strTestCaseFldPath = fn_Generic_Report_CreateFolder(strTestModResFldPath,strTestCaseName)
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while creating Test Case result folder.Error is " & Err.Description
Err.clear
End If
'Time stamp variable to be used as prefix to create the folder with this name
strTimeStamp = FormatDateTime(Now,3)
strTimeStamp = Replace(Replace(strTimeStamp," ","_"),":","_")
'Call the function to create the Time stamp folder in the test case folder and return this path
strCurTestRunFldPath = fn_Generic_Report_CreateFolder(strTestCaseFldPath,strTimeStamp)
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while creating Time stamp folder.Error is " & Err.Description
Err.clear
End If
Environment.Value("envResultHTMLPath") = strCurTestRunFldPath
strTesResultfoldPath = strCurTestRunFldPath
'Create the Snapshot folder inside the timestamp folder
strSnapResFldPath = fn_Generic_Report_CreateFolder(strCurTestRunFldPath,strSnapResFldName)
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while creating Snapshot folder.Error is " & Err.Description
Err.clear
End If
'Create test step level report
strStepStatus = fn_Common_Results_CreateTestResultFile(strALMTestID,strCurTestRunFldPath,strResultPath,strTestStepReportName,strSnapResFldPath,strTestCaseName,"steplevel","ResultTemplate")
If Err.Number<>0 or strStepStatus = "FAILED" Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while creating test step level report.Error is " & Err.Description
Err.clear
End If
'Get the test case sl number from TestCase sheet
strTestCaseNo = Trim(DataTable.GetSheet(strTestCaseSheetName).GetParameter(strSlNoColumnName).Value)
'Call the function to add the TestCaseStep sheet in the datatable
Call fn_Generic_AddSheetInDataTable(objLogFile,strTestCaseFilePath,strTestStepSheetName)
'Get the row count from the test case step sheet,Current row number which is selected in the TestCaseStep sheet
intTestStepRowCount = DataTable.GetSheet(strTestStepSheetName).GetRowCount
intRowNo=1 'DataTable.GetSheet(strTestStepSheetName).GetCurrentRow
intTDRowNo=1:intDPTDRowNo=1
Set objDictRUNTIMEVALUE = CreateObject("Scripting.Dictionary")
objDictRUNTIMEVALUE.RemoveAll
If intStepRowNo>1 Then
' DataTable.GetSheet(strTestStepSheetName).SetCurrentRow intStepRowNo-1
intRowNo = intStepRowNo-1
End If
'Iterate through the test case steps in the data table
For intTestStepRowNo = intRowNo To intTestStepRowCount
blnTestDataRowEnd = False
'Set the curent row and get the execution flag for test step and test case name
If blnGroupCase <> True Then
DataTable.GetSheet(strTestStepSheetName).SetCurrentRow intTestStepRowNo
strTestStepExeFlag = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strExecColumnName).Value)
If Trim(strTestStepExeFlag) <> Empty Then
strTestStepCaseName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strTestCaseColumnName).Value)
'*************************************************************************************************************
strTempTestStepCaseName = Right(strTestStepCaseName,Len(strTestStepCaseName)-InStr(strTestStepCaseName,"<"))
strTempTestStepCaseName = Left(strTempTestStepCaseName,Len(strTempTestStepCaseName)-1)
'*************************************************************************************************************
End If
End If
'Condition to Validate if test case name in TestCase sheet is matching with the test case name in TestCaseStep sheet
If (ucase(strTestStepCaseName) = ucase(strTestCaseName)) Or (ucase(strTempTestStepCaseName) = ucase(strTestCaseName)) Then
blnTestCaseStepFound = True
'Condition to check if TestCaseStep execution flag is Yes
If ucase(strTestStepExeFlag) = ucase(strYESFlag) Then
'*******************************
'If condition for Group step to be executed
If (instr(1,ucase(strTestStepCaseName),ucase(strCommonStepName))>=1 Or instr(1,ucase(strTestStepCaseName),ucase(strGroupStepName))>=1) and ((instr(1,strTestStepCaseName,"<")>=1) Or (instr(1,strTestStepCaseName,">")>=1)) Then
If Trim(intOrigTestStepRowNo) = "" Then
intOrigTestStepRowNo = intTestStepRowNo
End If
If Trim(strGroupTDSheetName) = "" Then
strGroupTDSheetName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strSheetColumnName).Value)
End If
Call fn_Generic_AddSheetInDataTable(objLogFile,strTestCaseFilePath,strGroupSheetName)
intGroupTestStepRowCount = DataTable.GetSheet(strGroupSheetName).GetRowCount
Dim blnGroupCaseEnd
For intGroupTestStepRowNo = intGroupRowNo To intGroupTestStepRowCount
DataTable.GetSheet(strGroupSheetName).SetCurrentRow intGroupTestStepRowNo
strGroupTestStepExeFlag = Trim(DataTable.GetSheet(strGroupSheetName).GetParameter(strExecColumnName).Value)
If instr(1,ucase(strTestStepCaseName),ucase(strGroupStepName))>=1 and ((instr(1,strTestStepCaseName,"<")>=1) or (instr(1,strTestStepCaseName,">")>=1)) Then
strExpectedStepName = Trim(Left(strTestStepCaseName,InStr(strTestStepCaseName,"<")-1))
strExpectedStepName = Right(strExpectedStepName,(Len(strExpectedStepName)-instr(ucase(strExpectedStepName),strGroupStepName)+1))
strExpectedStepName = Trim(Right(strExpectedStepName,len(strExpectedStepName)-len(strGroupStepName)))
ElseIf instr(1,ucase(strTestStepCaseName),ucase(strCommonStepName))>=1 and ((instr(1,strTestStepCaseName,"<")>=1) or (instr(1,strTestStepCaseName,">")>=1)) Then
strExpectedStepName = Trim(Left(strTestStepCaseName,InStr(strTestStepCaseName,"<")-1))
strExpectedStepName = Right(strExpectedStepName,(Len(strExpectedStepName)-instr(ucase(strExpectedStepName),strCommonStepName)+1))
strExpectedStepName = Trim(Right(strExpectedStepName,len(strExpectedStepName)-len(strCommonStepName)))
End If
strGroupTestStepCaseName = Trim(DataTable.GetSheet(strGroupSheetName).GetParameter(strTestCaseColumnName).Value)
' If ucase(Trim(strExpectedStepName))=ucase(Trim(strGroupTestStepCaseName)) Then
Select Case ucase(strGroupTestStepCaseName)
Case ucase(strExpectedStepName)
If ucase(Trim(strGroupTestStepExeFlag)) = ucase(Trim("YES")) Then
blnGroupCase = True
strTestStepSheetName = strGroupSheetName
blnNextGroupStep = False
blnGroupCaseEnd=False
Exit For
End If
Case Else
blnGroupCaseEnd = True
End Select
If blnGroupCase = True and intGroupTestStepRowNo <= intGroupTestStepRowCount and blnGroupCaseEnd = True Then
blnGroupCase = False
Exit For
End If
' End If
Next
If intGroupTestStepRowNo > intGroupTestStepRowCount Then
blnGroupCase = False
End If
' Else
' blnGroupCase = False
End If ' End - If condition for Group step to be executed
If blnGroupCase = False and Trim(blnGroupCase) <> Empty Then
intTestStepRowNo = intOrigTestStepRowNo
strTestStepSheetName = strOrigTestStepSheetName
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strGroupSheetName)
intGroupRowNo = 1
DataTable.GetSheet(strTestStepSheetName).SetCurrentRow intTestStepRowNo + 1
intTestStepRowNo = intTestStepRowNo + 1
intStepRow = DataTable.GetSheet(strTestStepSheetName).GetCurrentRow
For intStepRow = intStepRow To intTestStepRowCount
DataTable.GetSheet(strTestStepSheetName).SetCurrentRow intStepRow
strTestStepCaseName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strTestCaseColumnName).Value)
strTestStepExeFlag = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strExecColumnName).Value)
If (instr(1,ucase(strTestStepCaseName),ucase(strCommonStepName))>=1 Or instr(1,ucase(strTestStepCaseName),ucase(strGroupStepName))>=1) and ucase(strTestStepExeFlag)=ucase(strYESFlag) Then
blnNextGroupStep = True
intTestStepRowNo = intTestStepRowNo - 1
Exit For
ElseIf (instr(1,ucase(strTestStepCaseName),ucase(strCommonStepName))<1 Or instr(1,ucase(strTestStepCaseName),ucase(strGroupStepName))<1) and ucase(strTestStepExeFlag)=ucase(strYESFlag) Then
intTestStepRowNo = intStepRow
blnNextGroupStep = False
Exit For
Else
blnNextGroupStep = False
End If
Next
blnGroupCase=Empty:intGroupTestStepRowNo=Empty:strGroupTestStepExeFlag=Empty:strGroupTestStepCaseName=Empty:intGroupTestStepRowCount=Empty:intOrigTestStepRowNo=Empty:strGroupTDSheetName=Empty
End If
' strTestStepCaseName = strTempTestStepCaseName
'*******************************
'Get the variables from TestCaseStep sheet
If blnNextGroupStep = False Then
'Get the variables from TestCaseStep sheet
strAction = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strActionColumnName).Value)
If Trim(strGroupTDSheetName) = "" Then
strTDSheetName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strSheetColumnName).Value)
ElseIf Trim(strGroupTDSheetName) <> "" Then
strTDSheetName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strSheetColumnName).Value)
If Trim(Ucase(strTDSheetName))="SHEETNAME" Then
strTDSheetName = strGroupTDSheetName
Else
strTDSheetName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strSheetColumnName).Value)
End If
End If
strScreenName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strScreenColumnName).Value)
' strManualCaseMap = DataTable.GetSheet(strTestStepSheetName).GetParameter(strManualCaseMapColName).Value
intStartRow = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strStartRowColName).Value)
intEndRow = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strEndRowColName).Value)
'************************* Start - Code for Data Parameterization *********************************************
'Get the colum name from the Datavalue column based on the SheetName column is empty or not - Done.If not empty then store the sheetname and load that datasheet in datatable - Done
'Get the current row in test data sheet to be executed based on execution flag and store in a variable.Get the column name value from data value column of test case step sheet -
'Get the data value for that column from data sheet.Validate If EndRow is matching with the test case step last row if no then continue execution on current step
'************************* End - Code for Data Parameterization ************************************************
intTestStepTotalColNo = DataTable.GetSheet(strTestStepSheetName).GetParameterCount
strObjNameColPos = strObjNameColOrigPos
strTDNameColPos = strTDNameColOrigPos
'Iterate through the Columns in TestCaseStep sheet for ObjectName and DataValue
For intTestStepColNo = strObjNameColPos To intTestStepTotalColNo
If strObjNameColPos > intTestStepTotalColNo Then
Exit For
End If
'Get Object Name and Value from test data column
strObjName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strObjNameColPos).Value)
strTDColumnName = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strTDNameColPos).Value)
' ***************** Start - Commented to remove the ObjectType column from TestCaseStep sheet *****************************
' strRTObjectType = DataTable.GetSheet(strTestStepSheetName).GetParameter(strRTObjectTypeColName).Value
' ***************** End - Commented to remove the ObjectType column from TestCaseStep sheet *****************************
If (ucase(strAction)="CONCATENATE") or (ucase(strAction)="ADD") or (ucase(strAction)="SUBTRACT") or (ucase(strAction)="MULTIPLY") or (ucase(strAction)="DIVISION") or (ucase(strAction)="VALIDATE") Or (instr(1,ucase(strAction),"VALIDATECOLOR")>0) Or (instr(1,ucase(strAction),"VALIDATEOBJECT")>0) Or (instr(1,ucase(strAction),"TABLE")>0) Or (instr(1,ucase(strAction),"COMPAREVALUES")>0) Or (instr(1,ucase(strAction),"COMPAREPARTIALVALUE")>0) Then
' strObjNameColPos2 = strObjNameColOrigPos2
' strTDNameColPos2 = strTDNameColOrigPos2
' strObjNameColPos3 = strObjNameColOrigPos3
' strTDNameColPos3 = strTDNameColOrigPos3
' strObjNameColPos4 = strObjNameColOrigPos4
' strTDNameColPos4 = strTDNameColOrigPos4
' strTDNameColPos5 = strTDNameColOrigPos5
' strTDNameColPos6 = strTDNameColOrigPos6
strObjName2 = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strObjColumnName2).Value)
strTDColumnName2 = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strTDColName2).Value)
strObjName3 = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strObjColumnName3).Value)
strTDColumnName3 = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strTDColName3).Value)
strObjName4 = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strObjColumnName4).Value)
strTDColumnName4 = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strTDColName4).Value)
strTDColumnName5 = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strTDColName5).Value)
strTDColumnName6 = Trim(DataTable.GetSheet(strTestStepSheetName).GetParameter(strTDColName6).Value)
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Error Occurred while getting the name of ObjectName2,TestData2 etc valriables from test step sheet.Error is " & Err.Description
Err.clear
End If
End If
If Trim(strObjName) = "" Then
Exit For
End If
'Function to close popups on the application
'Call fn_Generic_Close_Popup(objLogFile,strExpectedResult,strActualResult,strObjectType,strObjHier,strScreenName,strObjName,strXLORPath)
'Get the Datavalue from the column and intitate the check for Data Parameterization.
strDataValue = fn_Generic_DataParametrization(objLogFile,strDPTDSheetName,intDPStartRow,intDPTDRowNo,intDPEndRow,intStartRow,intEndRow,blnTestCaseEnd,objDictRUNTIMEVALUE,_
strTDColumnName,strTestCaseFilePath,strTDSheetName,strExecColumnName,strALMTestID,strALMTestIDColumnName)
'In case of table related actions we may use multiple test data value columns
If (ucase(strAction)="CONCATENATE") or (ucase(strAction)="ADD") or (ucase(strAction)="SUBTRACT") or (ucase(strAction)="MULTIPLY") or (ucase(strAction)="DIVISION") or _
(ucase(strAction)="VALIDATE") Or (instr(1,ucase(strAction),"VALIDATECOLOR")>0) Or (instr(1,ucase(strAction),"VALIDATEOBJECT")>0) Or (instr(1,ucase(strAction),"TABLE")>0) Or _
(instr(1,ucase(strAction),"COMPAREVALUES")>0) Or (instr(1,ucase(strAction),"COMPAREPARTIALVALUE")>0) Then
strDataValue2 = fn_Generic_DataParametrization(objLogFile,strDPTDSheetName,intDPStartRow,intDPTDRowNo,intDPEndRow,intStartRow,intEndRow,blnTestCaseEnd,objDictRUNTIMEVALUE,_
strTDColumnName2,strTestCaseFilePath,strTDSheetName,strExecColumnName,strALMTestID,strALMTestIDColumnName)
strDataValue3 = fn_Generic_DataParametrization(objLogFile,strDPTDSheetName,intDPStartRow,intDPTDRowNo,intDPEndRow,intStartRow,intEndRow,blnTestCaseEnd,objDictRUNTIMEVALUE,_
strTDColumnName3,strTestCaseFilePath,strTDSheetName,strExecColumnName,strALMTestID,strALMTestIDColumnName)
strDataValue4 = fn_Generic_DataParametrization(objLogFile,strDPTDSheetName,intDPStartRow,intDPTDRowNo,intDPEndRow,intStartRow,intEndRow,blnTestCaseEnd,objDictRUNTIMEVALUE,_
strTDColumnName4,strTestCaseFilePath,strTDSheetName,strExecColumnName,strALMTestID,strALMTestIDColumnName)
strDataValue5 = fn_Generic_DataParametrization(objLogFile,strDPTDSheetName,intDPStartRow,intDPTDRowNo,intDPEndRow,intStartRow,intEndRow,blnTestCaseEnd,objDictRUNTIMEVALUE,_
strTDColumnName5,strTestCaseFilePath,strTDSheetName,strExecColumnName,strALMTestID,strALMTestIDColumnName)
strDataValue6 = fn_Generic_DataParametrization(objLogFile,strDPTDSheetName,intDPStartRow,intDPTDRowNo,intDPEndRow,intStartRow,intEndRow,blnTestCaseEnd,objDictRUNTIMEVALUE,_
strTDColumnName6,strTestCaseFilePath,strTDSheetName,strExecColumnName,strALMTestID,strALMTestIDColumnName)
End If
If blnTestCaseEnd = True Then
objDictRUNTIMEVALUE.RemoveAll
Set objUI = Nothing
Set objUI2 = Nothing
Set objUI3 = Nothing
strObjName=Empty:strTDColumnName=Empty:strDataValue=Empty:objUI=Empty:strExpectedResult=Empty:strActualResult=Empty
strObjName2=Empty:strTDColumnName2=Empty:strDataValue2=Empty:objUI2=Empty:strObjName3=Empty:strTDColumnName3=Empty:strDataValue3=Empty:objUI3=Empty
strObjName4=Empty:strTDColumnName4=Empty:strDataValue4=Empty:objUI4=Empty:strTDColumnName5=Empty
Exit For
End If
If Trim(strScreenName) <> "" Then
Set objUI = fn_Generic_GetObjectFromOR(objLogFile,strExpectedResult,strActualResult,strObjectType,strObjHier,strScreenName,strObjName,strXLORPath,strAction)
'In case of table related actions we may use multiple objects
If instr(1,Ucase(strAction),"TABLE") > 0 Then
If Trim(strObjName2) <> "" Then
Set objUI2 = fn_Generic_GetObjectFromOR(objLogFile,strExpectedResult,strActualResult,strObjectType,strObjHier2,strScreenName,strObjName2,strXLORPath,strAction)
End If
If Trim(strObjName3) <> "" Then
Set objUI3 = fn_Generic_GetObjectFromOR(objLogFile,strExpectedResult,strActualResult,strObjectType,strObjHier3,strScreenName,strObjName3,strXLORPath,strAction)
End If
If Trim(strObjName4) <> "" Then
Set objUI4 = fn_Generic_GetObjectFromOR(objLogFile,strExpectedResult,strActualResult,strObjectType,strObjHier4,strScreenName,strObjName4,strXLORPath,strAction)
End If
End If
End If
'Condition to check if Action is launch and in case of Launch action ignore the sync function
If instr(1,ucase(strAction),"LAUNCH") = 0 And Trim(strObjHier)<>"" Then
strStepStatus = fn_Generic_Sync(objUI,objLogFile,strObjHier,strExpectedResult,strActualResult,strScreenName,strObjName,strObjectType,strXLORPath,strAction)
ElseIf Trim(strObjHier)="" Then
strStepStatus = strFAILEDStatus
End If
If strStepStatus = strFAILEDStatus Then
blnTestCaseEnd = True
Else
strDataValue1 = strDataValue
strObjName1 = strObjName
strStepStatus = fn_Generic_ExecuteTestCaseSteps(objUI,objUI2,objUI3,objUI4,strExpectedResult,strActualResult,objLogFile,objDictRUNTIMEVALUE,strDataValue1,strObjName1,_
strScreenName,strObjectType,strAction,strXLORPath,strRTObjectType,strObjName2,strDataValue2,strObjName3,strDataValue3,strObjName4,strDataValue4,strDataValue5,strDataValue6)
End If
'Capture and concatenate the "strStepStatus"
strTestCaseStatus = strTestCaseStatus & ";" & strStepStatus
'Report Step results
If ucase(strTestStepRepFlag) = strYESFlag Then
If ucase(strStepStatus) = strPASSEDStatus Then
fn_Common_Results_CreateTestResultsReport "","" ,"micpass",strExpectedResult ,strActualResult,1,strTestStepCaseName,strSnapResFldPath,"steplevel",strAction,strScreenShotStepFlag,strExecutionStartTime,strScreenName,strObjName,strDataValue1
Else
blnTestCaseEnd = True
fn_Common_Results_CreateTestResultsReport "","" ,"micfail",strExpectedResult ,strActualResult,1,strTestStepCaseName,strSnapResFldPath,"steplevel",strAction,strScreenShotStepFlag,strExecutionStartTime,strScreenName,strObjName,strDataValue1
' Exit For 'Test case ended due to failed step
End If
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Function Name:fn_Common_Results_CreateTestResultsReport.Error Occurred while reporting step results.Error is " & Err.Description
Err.clear
End If
End If
Set objUI = Nothing
Set objUI2 = Nothing
' Call fn_CreateStepReport(objFSO,strTestCaseNo,strManualCaseMap,strTestCaseName,strScreenName,strAction,strObjName,strStepStatus,strDataValue,strExpectedResult,strActualResult,strResultPath,strTimeStamp)
' If ucase(strStepStatus)=strFAILEDStatus Then
' Exit For
' End If
'************************* Start - Code for Data Parameterization ***************************************************
'Validate if test data row end is reached or not based on the execution flag
'If yes then go to next test case using Endrow + 1
'Else go to test case step row mentioned in StartRow variable in TestCaseStep sheet and start executing that line.
'************************* End - Code for Data Parameterization *****************************************************
strObjNameColPos = strObjNameColPos + 2
strTDNameColPos = strTDNameColPos + 2
Set objUI = Nothing
Set objUI2 = Nothing
strObjName=Empty:strTDColumnName=Empty:strDataValue=Empty:objUI=Empty:strExpectedResult=Empty:strActualResult=Empty
strObjName2=Empty:strTDColumnName2=Empty:strDataValue2=Empty:objUI2=Empty:strObjName3=Empty:strTDColumnName3=Empty:strDataValue3=Empty:objUI3=Empty
strObjName4=Empty:strTDColumnName4=Empty:strDataValue4=Empty:objUI4=Empty:strTDColumnName5=Empty
'In case of table related actions we need to iterate only once
If instr(1,Ucase(strAction),"TABLE") > 0 Then
Exit For
End If
If ucase(strStepStatus)=strFAILEDStatus Then
Exit For
End If
strStepStatus=Empty:blnTestCaseEnd=Empty
Next ' For Loop for test case step columns
'De-initialize variables
strAction=Empty:strTDSheetName=Empty:strScreenName=Empty:strManualCaseMap=Empty:intStartRow=Empty:intEndRow=Empty:intTestStepTotalColNo=Empty:strObjNameColPos=Empty:strTDNameColPos=Empty
strStepStatus=Empty':strObjNameColPos2=Empty:strTDNameColPos2=Empty:strObjNameColPos3=Empty:strTDNameColPos3=Empty:strObjNameColPos4=Empty:strTDNameColPos4=Empty
End If
End If ' If condition for executable test steps
If blnTestCaseEnd = True Then
blnGroupCase = False
objDictRUNTIMEVALUE.RemoveAll
intTestStepRowNo = intOrigTestStepRowNo
strTestStepSheetName = strOrigTestStepSheetName
intGroupRowNo = 1
blnGroupCase=Empty:intGroupTestStepRowNo=Empty:strGroupTestStepExeFlag=Empty:strGroupTestStepCaseName=Empty:intGroupTestStepRowCount=Empty:intOrigTestStepRowNo=Empty:blnNextGroupStep=False
Exit For
End If
If intGroupRowNo = intGroupTestStepRowCount Then
intTestStepRowNo = intOrigTestStepRowNo
strTestStepSheetName = strOrigTestStepSheetName
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strGroupSheetName)
intGroupRowNo = 1
' DataTable.GetSheet(strTestStepSheetName).SetCurrentRow intTestStepRowNo + 1
' intTestStepRowNo = intTestStepRowNo + 1
blnGroupCase=Empty:intGroupTestStepRowNo=Empty:strGroupTestStepExeFlag=Empty:strGroupTestStepCaseName=Empty:intGroupTestStepRowCount=Empty:intOrigTestStepRowNo=Empty:blnNextGroupStep=False
End If
If Trim(blnGroupCase) = False or Trim(blnGroupCase) = Empty Then 'or instr(1,ucase(strTestStepCaseName),"GROUP")>=1 Then
DataTable.GetSheet(strTestStepSheetName).SetCurrentRow intTestStepRowNo + 1
blnTestCaseEnd = fn_Generic_ValidateEndDP(objLogFile,intDPStartRow,intDPTDRowNo,intDPEndRow,intTestStepRowNo,strTestStepSheetName,strTestCaseColumnName,strTestCaseName,_
strDPTDSheetName,strExecColumnName,strCommonStepName,strGroupStepName,strALMTestID,strALMTestIDColumnName)
If blnTestCaseEnd = True Then
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strDPTDSheetName)
objDictRUNTIMEVALUE.RemoveAll
Exit For
End If
'De-initialize variables
strTestStepExeFlag=Empty:strTestStepCaseName=Empty:blnTestCaseEnd=Empty
Else
intGroupRowNo = DataTable.GetSheet(strGroupSheetName).GetCurrentRow
intGroupRowNo = intGroupRowNo + 1
DataTable.GetSheet(strGroupSheetName).SetCurrentRow intGroupRowNo
End If
Else
'Flag that test case is not found in test case sheet
End If 'If condition to check if test case name from test case sheet macthes with name in Test Case step sheet.
'Declare variables
' strTestStepExeFlag=Empty:strTestStepCaseName=Empty:blnTestCaseEnd=Empty
Next ' For Loop for Test Case Step
If blnTestCaseStepFound=False Then 'Condition if test case is found in TestCase sheet but not in TestCaseStep sheet.
strTestCaseStatus = strFailedStatus
strExpectedResult = "Test Case is found in Test case Step sheet."
strActualResult = "Test case is present in TestCase sheet but steps are not found in TestCaseStep sheet."
fn_Common_Results_CreateTestResultsReport "","" ,"micfail",strExpectedResult ,strActualResult,1,strTestCaseName,strSnapResFldPath,"steplevel",strAction,strScreenShotStepFlag,strExecutionStartTime,strScreenName,strObjName1,strDataValue1
End If
If ucase(strTestStepRepFlag)=strYESFlag Then
'End the HTML report
fn_Common_Results_EndHTMLReporter strTestCaseName,"steplevel",strTesResultfoldPath
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Function Name:fn_Common_Results_EndHTMLReporter.Error Occurred while ending the step level HTML report.Error is " & Err.Description
Err.Clear
End If
End If
If Instr(1,strTestCaseStatus,"FAILED",1)>0 Then
strTestCaseStatus = "micfail"
Else
strTestCaseStatus = "micpass"
End If
'Capture and concatenate the "strTestSaseStatus"
strModuleStatus = strModuleStatus & ";" & strTestCaseStatus
'Report Test Case level results
If ucase(strTestCaseRepFlag)=strYESFlag Then
fn_Common_Results_CreateTestResultsReport strALMTestID,intTestCaseSNo,strTestCaseStatus,strExpectedResult,strActualResult,1,strTestCaseName,strSnapResFldPath,"testcaselevel",strAction,strScreenShotStepFlag,strExecutionStartTimeTc,strScreenName,strObjName1,strDataValue1
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Function Name:fn_Common_Results_CreateTestResultsReport.Error Occurred while reporting test Case level results.Error is " & Err.Description
Err.Clear
End If
End If
'Increment the Serial Number for Test Cases
intTestCaseSNo = intTestCaseSNo + 1
'De-initialize the variables
strTestCaseName=Empty:strALMTestID=Empty:strTestCaseFldPath=Empty:strTimeStamp=Empty:strCurTestRunFldPath=Empty:strSnapResFldPath=Empty:strTestCaseNo=Empty:intTestStepRowCount=Empty:intRowNo=Empty:intTDRowNo=Empty
intDPTDRowNo=Empty:blnTestCaseEnd=Empty:strStepStatus=Empty:strTestCaseStatus=Empty:strTesResultfoldPath=Empty
Set objDictRUNTIMEVALUE=Nothing
Systemutil.CloseProcessByName "excel.exe"
Wait(1)
End If
'De-initialize the variables
strTestCaseExeFlag=Empty
Next ' For Loop for Test Case
'De-Initialize the Variable
intTestCaseSNo=Empty
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strTestStepSheetName)
' Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strTestCaseSheetName)
If Instr(1,strModuleStatus,"micfail",1) > 0 Then
strModuleStatus = "micfail"
Else
strModuleStatus = "micpass"
End If
'Report Test case result
If ucase(strTestCaseRepFlag)=strYESFlag Then
fn_Common_Results_EndHTMLReporter strModName,"testcaselevel", strTestCaseHtmlPath
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Function Name:fn_Common_Results_EndHTMLReporter.Error Occurred while ending Test Case Level HTML report.Error is " & Err.Description
Err.clear
End If
End If
'Report Module results
If ucase(strModuleRepFlag)=strYESFlag Then
fn_Common_Results_CreateTestResultsReport "",intModSNo,strModuleStatus,strExpectedResult,strActualResult,1,strModName,strSnapResFldPath,"modulelevel",strAction,strScreenShotStepFlag,strExecutionStartTimeMl,strScreenName,strObjName1,strDataValue1
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Function Name:fn_Common_Results_CreateTestResultsReport.Error Occurred while reporting Module level results.Error is " & Err.Description
Err.clear
End If
End If
'Increment Module Level Sl No
intModSNo = intModSNo + 1
'De-initialize the variables
intRowNo=Empty:strTestModResFldPath=Empty:strTestCaseFilePath=Empty:intTestCaseRowCount=Empty:strTestCaseHtmlPath=empty:strModName=Empty
End If
'De-initialize the Variables
strModExeFlag=Empty
Next
'De-initialize the Variables
intModSNo = Empty
'Report Module Header update results
If ucase(strModuleRepFlag)=strYESFlag Then
fn_Common_Results_EndHTMLReporter "ModulesResults","modulelevel",strHTMLFileResPathModule
If Err.Number<>0 Then
objLogFile.WriteLine "Error: Driver Script:Function Name:fn_Common_Results_EndHTMLReporter.Error Occurred while reporting Module Header update results.Error is " & Err.Description
Err.Clear
End If
End If
scriptTotalEndTime = Now
Print DateDiff("s",scriptTotalStartTime,scriptTotalEndTime)
'Load the QC Connection sheet from configuration file
Call fn_Generic_AddSheetInDataTable(objLogFile,strConfFilePath,strConfQCSheetname)
blnQCUpdateFlag = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCUpdate").Value
If Ucase(Trim(blnQCUpdateFlag))=ucase(strYESFlag) and blnTSRPathFound=True and blnModuleFileFound=True Then
'Initialize the QC Connection variables
strQCURL = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCURL").Value
strQCDomainName = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCDomainName").Value
strQCProjectName = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCProjectName").Value
strQCUserID = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCUserID").Value
strQCTestResourceFolderName = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCTestResourceFolderName").Value
strQCTestPlanPath = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCTestPlanPath").Value
strQCTestLabPath = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCTestLabPath").Value
strQCTestSetName = DataTable.GetSheet(strConfQCSheetname).GetParameter("QCTestSetName").Value
strDriverType = DataTable.GetSheet(strConfQCSheetname).GetParameter("DriverType").Value
strAttachmentLocation = DataTable.GetSheet(strConfQCSheetname).GetParameter("AttachmentLocation").Value
If qcUtil.IsConnected <> True Then
'Call the function to load the ALM password sheets from datatable
Call fn_Generic_AddSheetInDataTable(objLogFile,strConfFilePath,strConfQCPwdSheetname)
strQCPwd = DataTable.GetSheet(strConfQCPwdSheetname).GetParameter("QCPwd").Value
'Call the function to remove the ALM configuration and QC Password configuration sheets from DataTable
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strConfQCPwdSheetname)
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strConfQCSheetname)
End If
'Call the function to update the result in ALM
Call fn_Generic_ALM_ResultUpdate(objLogFile,strTestResDateFldPath,strQcURL,strQCUserID,strQCPwd,strQCDomainName,strQCProjectName,strQCTestLabPath,strDriverType,strModSheetName,strTestCaseSheetName,_
strExecColumnName,strTestCaseColumnName,strModColumnName,strAttachmentLocation,strQCTestSetName)
End If
Wait(1)
'Kill excel process
Systemutil.CloseProcessByName "excel.exe"
Wait(2)
Systemutil.CloseProcessByName "iexplore.exe"
Wait(1)
'Call the function to remove the "TestCase" sheet from DataTable
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strTestCaseSheetName)
Call fn_Generic_RemoveSheetFromDataTable(objLogFile,strConfQCSheetname)
objLogFile.WriteLine "Log Ended."
objLogFile.Close
Set objLogFile = Nothing
Call fn_Generic_ResetVariables
'===============================================================================================================================================================================================
'Name : fn_Generic_ResetVariables
'Purpose : This function is used to get the data value from data sheet
'Associated Keyword : NA
'Input Parameters : NA
'Output Parameters : NA
'Created By : Neeraj Gaur
'Created On : 04-Sep-2015
'Modified By :
'Modified On :
'Modification Comment :
Public Function fn_Generic_ResetVariables()
strConfGenSheetName=Empty:strConfFrmSheetname=Empty:strConfReportSheetname=Empty:strConfEmailSheetname=Empty:strConfQCSheetname=Empty:strConfORSheetname=Empty:strModSheetName=Empty:strExecColumnName=Empty
strModColumnName=Empty:strActionColumnName=Empty:strObjColumnName=Empty:strSheetColumnName=Empty:strTDColumnName=Empty:strScreenColumnName=Empty:strManualCaseMapColName=Empty:strTestCaseColumnName=Empty:strALMTestIDColumnName=Empty
strStartRowColName=Empty:strEndRowColName=Empty:strSlNoColumnName=Empty:strObjNameColOrigPos=Empty:strTDNameColOrigPos=Empty:strYESFlag=Empty:strNOFlag=Empty:strPASSEDStatus=Empty:strFAILEDStatus=Empty
strSnapResFldName=Empty:strConfFolderName=Empty:strFrmFolderPath=Empty:strConfFilePath=Empty:strTimeStamp=Empty:objLog=Empty:objLogFile=Empty:strAppName=Empty:strAppType=Empty:strFrmRunLocation=Empty
strTestCaseSheetName=Empty:strTestStepSheetName=Empty:strScreenMapSheetName=Empty:strActionSheetName=Empty:strBrowser=Empty:strFrmPath=Empty:strModFolderName=Empty:strTestCaseFolderName=Empty
strReportFolderName=Empty:strORFolderName=Empty:strModFileName=Empty:strTestStepReportName=Empty:strTestCaseReportName=Empty:strModReportName=Empty:strAttachmentLocation=Empty
strReportType=Empty:strUFTORFileName=Empty:strXLORFileName=Empty:strResultPath=Empty:strModFilePath=Empty:strTestCasePath=Empty:strTSRORPath=Empty:strXLORPath=Empty
strORFolderName=Empty:strUFTORFileName=Empty:strTestCaseFolderName=Empty:strModFolderName=Empty:strModFileName=Empty:strReportFolderName=Empty
objFSOResultTestStep=Empty:intModRowCount=Empty:strResDateFldName=Empty:strTestResDateFldPath=Empty:strDataValue1=Empty:strObjName2=Empty:strObjNameColOrigPos2=Empty:strTDNameColOrigPos2=Empty
strRTObjectTypeColName=Empty:strRTObjectType=Empty:objDictRUNTIMEVALUE=Empty:strDataValue2=Empty:strObjName3=Empty:strObjNameColOrigPos3=Empty:strTDNameColOrigPos3=Empty
strDataValue3=Empty:strObjName4=Empty:strObjNameColOrigPos4=Empty:strTDNameColOrigPos4=Empty:strDataValue4=Empty:strTDNameColPos4=Empty:strTDColumnName3=Empty:strTDColumnName4=Empty
strObjHier=Empty:strObjHier2=Empty:strObjHier3=Empty:strObjHier4=Empty:strTDColumnName5=Empty
End Function