Results 1 to 2 of 2
  1. #1

    Not able to cast TestObject to busniessProcess Obj

    I am trying to get the component details of BPT test from TestLab -> test Set > Test

    Getting invalid cast exception when I try to cast Test Object to Business Process test (BPTest = objTest )

    Dim sUserName
    Dim sPassword
    Dim Url
    Dim sDomain
    Dim sProject
    Dim testSetnode = "ROOT\FMW_BPT"
    Dim tdc = New TDConnection
    Dim objTest As Test
    Dim BPTest As BusinessProcess
    Dim Component As BPComponent
    Dim params, components_Bpt As List, tList As List
    Dim iterations As List
    Dim iteration As BPIteration
    Dim objTestFactory, tst
    Dim myTest As Test
    tdc.Login(sUserName, sPassword)

    If (tdc.LoggedIn <> True) Then
    MsgBox("QC User Authentication Failed")
    End If

    tdc.Connect(sDomain, sProject)

    If (tdc.Connected <> True) Then
    MsgBox("QC Project Failed to Connect to " & sProject)
    End If

    ' Get the QCCon.TestSetFactory
    Dim TestSetFact, objTestSetTreeManager, objTestSetFolderPath, LobjTestSet, objTestSet
    Dim objTSTestFactory, LobjTSTestFactory, objTest
    Dim testSetFolder

    TestSetFact = tdc.TestSetFactory
    testSetFolder = "Portfolio_Explorer_Funds"

    ' Get the test set tree manager from the test set factory
    objTestSetTreeManager = tdc.TestSetTreeManager
    objTestSetFolderPath = objTestSetTreeManager.NodeByPath(testSetnode)

    LobjTestSet = objTestSetFolderPath.FindTestSets(testSetFolder)
    objTestSet = LobjTestSet.Item(1)


    objTSTestFactory = objTestSet.TSTestFactory
    LobjTSTestFactory = objTSTestFactory.NewList("")

    For Each objTest In LobjTSTestFactory

    If objTest.Type = "BUSINESS-PROCESS" Then
    'BPTest = CType(objTest, BusinessProcess)
    BPTest = objTest
    end if
    Any help will be really appriciated
    Kind Regards,

  2. #2

    Re: Not able to cast TestObject to busniessProcess Obj

    Hi Deepankar,

    Within the VBscript language, it isn't possible to cast objects to a specified type. This means that the additional functionalities of Business Process Tests are not available directly through workflow scripts.

    I believe that some creative workflow workaround are already posted on this forum.

    Another workaround is to embed your coding in a dll file written in a more advanced programming language such as C#. By calling the fuctionality of this dll, you should be able to get access to the required functionalities.

    Kind Regards,




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 03:55 PM.

Copyright BetaSoft Inc.