0

I got a piece of code in vbscript to add parameter to a test case but it throws following error
Entity with Key '5' does not exist in table 'TEST'

VBSCRIPT:

Dim supportParamTest
Set supportParamTest = TDConnection.TestFactory.Item(5)
Set testParamsFactory = supportParamTest.TestParameterFactory
Set parameter = testParamsFactory.AddItem(Null)
parameter.Name = "name"
parameter.Description = "desc"
parameter.Post

Can anyone help me out?

Abhishek Asthana
  • 1,857
  • 1
  • 31
  • 51
Ganeshja
  • 2,675
  • 12
  • 36
  • 57

1 Answers1

1

You specifically asked for the TestFactory managed item whose id is '5' (line 2 of your code). The error tells you that there is no such entity with this id.

Did you mean to get item 5? If yes, are you connected to the right project?

You can check the entity IDs using the Admin feature that lets you run SQL directly against the HPQC project database. Do a SELECT * FROM TEST and see whether there is a row whose id is 5.

TheArtTrooper
  • 1,105
  • 8
  • 19
  • Thanks for u response Trooper ! To make u clear I'm not trying get any item as i mentioned , just need to add parameter values using vbscript – Ganeshja Dec 18 '12 at 11:15
  • Dim supportParamTest has to initialized to ISupportParameterValues but m failing to initialise it – Ganeshja Dec 18 '12 at 11:17
  • Finally got d solution Trooper ! thanks a lot , i ve failed to mention the right test id in TDConnection.TestFactory.Item(5) – Ganeshja Dec 18 '12 at 11:26