Posts

Fitnesse from Command line

Image
In continuation to my previous post " Integrating QC with Fitnesse " Here are the commandline options for running Fitnesse: Advantages: All tests run in a single process unlike the web server test executions. It's easily debuggable. It removes the need to start a local FitNesse server to run tests. Can generate HTML output to a file Can generate XML output to a file Sample Command: java -jar fitnesse.jar -p "&strPort&" -c "&strFITTestScriptName&" > "&strExpectedResultsPath Command line options: -debug This option will print FitNesse protocol actions to the console. -v This option should give a verbose output about test progress to the console -results file The result of the testrun is saved to a textfile with the given name. -html file The result of the testrun is saved to a html file with the given name. -xml file The result of the testrun is saved to a xml file with the given name. -nopath This opt...

VBA - Combine worksheets in Excel and Kill all excel objects

Image
This is a simple vba script that will let you combine excel work sheets and make sure no orphan excel objects are pending. Sub CopyFromWorksheets() Dim wrk As Workbook Dim sht As Worksheet Dim trg As Worksheet Dim rng As Range Dim colCount As Long 'Dim sheetDelimiter As String ' Creates excel app object Set objExcel = CreateObject("Excel.Application")    ' Makes the excel invisible objExcel.Visible = False ' Supress all display alerts objExcel.DisplayAlerts = False ' Gets the complete path of the active excel sheet strExcelFilePath = ActiveWorkbook.FullName   ' Opens the excel file Set objWorkbook = objExcel.Workbooks.Open(Trim(strExcelFilePath)) Set objWorkSheet = objWorkbook.Worksheets("Merge") objWorkSheet.Activate ' Gets the count of column Set objRange = objWorkbook.Worksheets("Merge") numRowsCount = objRange.Evaluate("COUNTA(A1:A100)") Worksheets("Merge").Activate 'shee...

QC OTA - Test Lab

Image
Here are some amazing functions that can be reused wrt QC OTA for Test Lab module: - Create Test Set - Add tests to Test Set - Create the supplied directory structure in the test lab - Create a test set underneath a given parent - Return a test set if it exists - Returns a testsetfolder for the given path Public Function TestLabCreateTestSet(strFolderPath As String, strTestSetName As String, ByRef CreatedTestSet As TestSet)     Dim tstSetFolder As TestSetFolder     Dim testSetFolderF As TestSetTreeManager     Dim TestSetF As TestSetFactory     Dim testSet1 As TestSet     Dim oTestSet As TestSet             'Does the test set already exist? If so return it     Set oTestSet = TestLabGetTestSet(strFolderPath, strTestSetName)     If Not (oTestSet Is Nothing) Then         'Msg...

QC OTA - Test Plan - 2

- Find Test in Test Plan - Return a SubjectNode object for a given path in the Test Plan Function TestPlanFindTest(ByVal strTestName As String, ByVal strFolderToSearchPath As String, ByVal SearchChildFolders As Boolean, Optional ByVal strTestType As String, Optional blnSilentMode As Boolean) As Test         Dim oParentNode As SubjectNode     Dim SubjectNodeList As List     Dim oSubjectNode As SubjectNode     Dim intMatchCount As Integer: intMatchCount = 0     Dim TestFact As TestFactory     Dim oReturnValue As Test     Dim TestFilter As TDFilter     Dim TestList As List     Dim oTest As Test     Dim blnTypedMatched As Boolean: blnTypedMatched = True         Set oParentNode = TestPlanGetSubjectNode(strFolderToSearchPath)     Set TestFact = tdc.TestFactory ...

QC OTA - Test Plan - 1

Image
Here are some amazing functions that can be reused wrt QC OTA for Test Plan module: - Copy paste within Test Plan - Create folder structure within Test Plan - Does a particular path exist in Test Plan - Does a [particular test exist in Test Plan Function TestPlanCopyPasteTest(strSourceFolderPath, strDestFolderPath, strSourceTestName, strNewTestName) As Boolean 'Copy a test, including design steps and parameters. ' For example: ' CopyPasteTest "Subject\TestFolder1", "Subject\TestFolder2", "Test1" ' Copies Test1 to TestFolder2 Dim sourceFolder As SubjectNode Dim destFolder As SubjectNode Dim treeMng As TreeManager Dim iscp As ISupportCopyPaste Dim clipboard As String Dim oSourceTest As Test Dim oNewTest As Test 'Check that the source file exists If Not TestPlanDoesTestExist(strSourceTestName, strSourceFolderPath, False, "") Then TestPlanCopyPasteTest = False MsgBox "Source test does not exist: " ...