Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8181629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:35:06+00:00 2026-06-07T00:35:06+00:00

I’ve tried various things and googled multiple hours but couldn’t find a solution to

  • 0

I’ve tried various things and googled multiple hours but couldn’t find a solution to my problem.

I’m using the Quality Center OTA API via Com4j to let my programm communicate with QC.
It works pretty good, but now I’ve stumbed upon this problem:

I want to add new parameters to a test case in “Test Plan” using my programm.

If I used VB it would work somehow like this:

Dim supportParamTest As ISupportTestParameters
Set supportParamTest = TDConnection.TestFactory.Item(5)

Set testParamsFactory = supportParamTest.TestParameterFactory
Set parameter = testParamsFactory.AddItem(Null)
parameter.Name = name
parameter.Description = desc
parameter.Post

Set AddTestParameter = parameter

The important part is the call of AddItem() on the TestParameterFactory. It adds and returns a parameter that you then can give a name and description. In VB the AddItem-method is given Null as argument.

Using Java looks similar at first:

First I establish the connection and get the TestFactory (and the list of test cases).

QcConnect qc = new QcConnect(server, login, password, domain, project);
ITDConnection qcConnection = qc.getConnection();

ITestFactory qcTestFactory = qcConnection.testFactory().queryInterface(ITestFactory.class);
IList qcTestList = qcTestFactory.newList("");   

qcTestList contains all tests from Test Plan.

ITest test = qcTestList.item(1);      
ISupportTestParameters testParam = test.queryInterface(ISupportTestParameters.class);
ITestParameterFactory paramFac = testParam.testParameterFactory().queryInterface(ITestParameterFactory.class);

No problem so far. All the “casts” are successful.
Now I want to call the addItem-method on the TestParameterFactory, just like in VB.

Com4jObject com = paramFac.addItem(null);

This doesn’t work. The addItem()-method always returns null. I’ve tried various arguments like a random String, a random Integer, the test case’s ID, etc. Nothing works.

How do I use this method correctly in Java?

Or in general: How do I add parameters to existing test cases in Test Plan using Java?

Quick note: Adding test cases to Test Plan works very similar to adding parameters to this test cases. You also use a factory and a addItem-method. In VB you give null as parameter, but in Java you use a String (that’s interpreted as the name of the test). But as I said, that does not work in here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T00:35:08+00:00Added an answer on June 7, 2026 at 12:35 am

    I have finally found the answer to this:

    Com4jObject obj = iTestParameterFactory.addItem(new Variant(Variant.Type.VT_NULL));
    iTestParameter = obj.queryInterface(ITestParameter.class);
    iTestParameter.name("AAB");
    iTestParameter.defaultValue("BBB");
    iTestParameter.description("CCC");
    iTestParameter.post();
    

    Regards.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.