Quantcast
Channel: All Quality Center / ALM Practitioners Forum posts
Viewing all articles
Browse latest Browse all 14708

Re: Export from Excel - how do I load parameter data (i.e. parameter "Actual Value") into

$
0
0

Hi

 

There is no way via the Export process;

 

I had to write workflow to do it - not quite neat enough to release

 

The basics are below but PLEASE NOTE - this is to give you a start position, it is not intended as a solution. As I tidy up and improve the process then I will release as a solution

 

1. To create the Configuration entry :

 

Sub Create_Config(parm_TestId, str_configName)

    str_TestID = parm_TestId

    Set objTest=TDConnection.TestFactory.Item(str_TestID)

    Set objTestConfigFact = objTest.TestConfigFactory

    Set lstConfig = objTestConfigFact.NewList("")

    If lstConfig.Count = 0 Then

      Msgbox "Test ID " & str_TestID & " specified in the Excel not found in the Project " & TDConnection.ProjectName

      Exit Sub

    End If

    isAdd = True

    For Each tconfig In lstConfig

        If UCASE(tconfig.Name) = UCASE(Trim(str_configName))  Then

           isAdd = False

           Exit For

        End If

    Next

    If isAdd = True Then

       Set objNewConfig = objTestConfigFact.AddItem(Null)

       objNewConfig.Name = Trim(str_configName)

       objNewConfig.TheDataUsage = 0

        objNewConfig.Post

    End If

End Sub

 

2. To add the parameters

 

Sub Create_Config_Step_Param(parm_TestId, objXls_TestConfigFile)

    str_TestID = parm_TestId

    Set objTest=TDConnection.TestFactory.Item(str_TestID)

    Set objTestConfigFact = objTest.TestConfigFactory

    Set lstConfig = objTestConfigFact.NewList("")

    If lstConfig.Count = 0 Then

      Msgbox "Test ID " & str_TestID & " specified in the Excel not found in the Project " & TDConnection.ProjectName

      Exit Sub

    End If

 

    colCnt = 1

    strConfigSheetName = <name of the sheet with the Configs>

    objXls_TestConfigFile.Application.Worksheets(strConfigSheetName).Activate

    noOfConfigRows = objXls_TestConfigFile.ActiveSheet.UsedRange.Rows.count

    Dim obJtestConfigToUpdate

    For k = 2 to noOfConfigRows

      isAdd = True

      If Len(Trim(objXls_TestConfigFile.ActiveSheet.Cells(k,1).Value)) <> 0 Then         For Each tconfig In lstConfig

          If UCASE(tconfig.Name) = UCASE(Trim(objXls_TestConfigFile.ActiveSheet.Cells(k,1).Value))  Then

            isAdd = False

            Set obJtestConfigToUpdate = tconfig

            Exit For

          End If

        Next

        If isAdd = True Then

          Set objNewConfig = objTestConfigFact.AddItem(Null)

          objNewConfig.Name = Trim(objXls_TestConfigFile.ActiveSheet.Cells(k,1).Value)

          objNewConfig.TheDataUsage = 0

          objNewConfig.Post

          Set supportParamValuesDS = objNewConfig

          Set paramValueFct = supportParamValuesDS.ParameterValueFactory

          Set lst = paramValueFct.NewList("")

          index = 3

          For Each param In lst

                With param

                   strActualValue = GetActualValueByColNo(index,K,objXls_TestConfigFile)

                   If Len(Trim(strActualValue)) <> 0 Then                       .ActualValue = strActualValue

                      .Post

                   End If

                   index = index + 1

                End With

          Next

        Else

            Set supportParamValuesDS = obJtestConfigToUpdate

            Set paramValueFct = supportParamValuesDS.ParameterValueFactory             Set lst = paramValueFct.NewList("")

            index = 3

            For Each param In lst

                With param

                  strActualValue = GetActualValueByColNo(index,K,objXls_TestConfigFile)

                  If Len(Trim(strActualValue)) <> 0 Then                       .ActualValue = strActualValue

                      .Post

                  End If

                  index = index + 1

                End With

            Next

        End If

         objXls_TestConfigFile.Application.Worksheets(strConfigSheetName).Activate

      Else

        Exit For

      End If

    Next

  End Sub

 

 

Thanks

Martin

 

Please Note - the views expressed here are entirely my own


Viewing all articles
Browse latest Browse all 14708

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>