Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ALL,

The following code has been given for to upload TC to ALM. Its is throwing some Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))Error message near " sampleTest.Field("TS_NAME") = xlworksheets.Cells(i, 2) " Code. Please help this is very much Required


<pre>
VB
Private Sub Upload_btn_Click(sender As Object, e As EventArgs) Handles Upload_btn.Click
        Dim combo_domain, combo_Project
        Dim xl_App As New Excel.Application()
        QC_ID = WindowsApplication1.Form1.TextBox_Username.Text
        QC_Pass = WindowsApplication1.Form1.TextBox_Password.Text
        combo_domain = WindowsApplication1.Form1.Domain_txt.Text
        combo_Project = WindowsApplication1.Form1.Project_txt.Text
        tdc = CreateObject("TDApiOle80.TDConnection")
        tdc.InitConnectionEx("https://alm-eas.zurich.com/qcbin")
        tdc.Login(QC_ID, QC_Pass)
        tdc.Connect(combo_domain, combo_Project)
        Dim tsf
        Dim trmgr
        Dim trfolder, testList, sampleTest
        Dim dsf, dstep, StepList, iLastRow
        tsf = tdc.TestFactory
        trmgr = tdc.TreeManager
        trfolder = trmgr.NodebyPath("Subject\Subjectt\CR235")
        Dim xlworkBook As Excel.Workbook
        Dim xlworksheets As Excel.Worksheet
        xlworkBook = xl_App.Workbooks.Open(TextBox1.Text)
        xlworksheets = xlworkBook.Worksheets("TestCase")
        iLastRow = xlworksheets.UsedRange.Rows.Count
        MsgBox(iLastRow)
        For i = 2 To iLastRow - 1
            testList = tsf.NewList("")

            ' now create a test case
            sampleTest = trfolder.TestFactory.AddItem(DBNull.Value)
            ' set mandatory values

            sampleTest.Field("TS_NAME") = xlworksheets.Cells(i, 2) 'Test Name'
            sampleTest.Field("TS_TYPE") = xlworksheets.Cells(i, 9) 'Type'
            sampleTest.Field("TS_USER_01") = xlworksheets.Cells(i, 4) ' Requrimet ID'
            sampleTest.Field("TS_USER_02") = "1"
            sampleTest.Field("TS_STATUS") = "Imported"
            sampleTest.Field("TS_USER_03") = "SIT"
            sampleTest.Field("TS_RESPONSIBLE") = "pa041225"
            sampleTest.Field("TS_DESCRIPTION") = xlworksheets.Cells(i, 5) 'Description'
            sampleTest.Post()


            'design Step'
            dsf = sampleTest.DesignStepFactory
            StepList = dsf.NewList("")
            'Create Desingstep'
            dstep = dsf.AddItem(DBNull.Value)
            dstep.Field("DS_STEP_NAME") = xlworksheets.Cells(i, 6)
            dstep.Field("DS_DESCRIPTION") = xlworksheets.Cells(i, 7)
            dstep.Field("DS_EXPECTED") = xlworksheets.Cells(i, 8)
            StepList.Add(dstep)
            StepList.Post()
        Next ' add the next test case

    End Sub
End Class
Posted
Comments
Sinisa Hajnal 2-Oct-14 2:55am    
Sounds like your sampleTest doesn't have TS_NAME field :) Check that it really exists. Step through code and see what line it breaks exactly.

1 solution

I tried the solution, Still failinf on the same value/Code on tbe system
 
Share this answer
 
Comments
shashank bs 5-Oct-14 12:17pm    
Please help me . I am really feeling some problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900