1

I am writing an utility that creates Requirements in Quality Center using OTA (Open Test Architecture) api and ruby.

OTA is written in VB and is exposed as COM functions.

To create a blank requirement, we have to use a method called AddItem. The OTA document describes the addItem as follow:

Visual Basic
Public Function AddItem( _ 
   ByVal ItemData As Variant _ 
) As Object

ItemData: Null. Creating a virtual Req object with Null ensures that you cannot then Post until all required fields are initialized.

My problem is, I want to pass VB's Null value from ruby to the addItem function. I have tried to pass nil but it is of no use.

Can anyone please help me to solve the above problem.

Thanks in advance. Prasant Sutaria

Prasant
  • 105
  • 9

1 Answers1

0

The function takes a Variant, so you are being asked to pass a "Variant Null". A Variant Null is a Variant initialized with the special type of VT_NULL.

I don't know how you do that in Ruby, but with some help I can try guessing it looks something like this:

WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_NULL)

Does that help?

Community
  • 1
  • 1
Euro Micelli
  • 33,285
  • 8
  • 51
  • 70
  • Hi Euro, Thanks for help. Solution provided by you is working fine. Please find the working code for the above solution. addItem(WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_NULL)) – Prasant Dec 18 '13 at 06:34
  • @user3098734, thanks for the correction. I have edited my answer with it. – Euro Micelli Dec 18 '13 at 12:07