• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

convert IList objects into ITestSet type

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I need some help in converting IList objects into ITestSet type. The usual type casting technique is not working as you can see my code below


I am getting the following error : "$Proxy9 cannot be cast to com.mercury.qualitycenter.otaclient.ITestSet"


I also tried the other way using item method of IList class


And for this i am getting error as : "java.lang.ClassCastException: com4j.Wrapper cannot be cast to com.mercury.qualitycenter.otaclient.ITestSet"


But i could see "objTestSetFolder.findTestSets("Test_SetName_xyz", true, null);" statement is fetching the correct number of TestSet's into the IList object (its1).
I am just not able to traverse through this IList to get the individual TestSet.

Please provide me any suggestion. You Help would be highly appreciated.

Cheers!
Kalidas
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

I did a search on a combination of ITestSet and IList, and the only thing I could find is this. I definitely couldn't find any ITestSet in QcTools4j's Javadoc.

And could you please UseCodeTags next time?
 
Kalidas Raju
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rob,

I could fix the issue by converting the IList element to Com4jObject first and then converting to ITestSet object.

Thank you very much for your time, I really appreciate your effort to help me

Cheers!
Kalidas
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kalidas Raju wrote:Hi Rob,

I could fix the issue by converting the IList element to Com4jObject first and then converting to ITestSet object.

Thank you very much for your time, I really appreciate your effort to help me

Cheers!
Kalidas




Hi Kalidas,

I was struggling with the same problem mentioned above for the last two days... Getting class cast exception.....
It would be really helpful, if you could share the piece of code with me...


Thanks In Advance..


Anandkumar.
 
Kalidas Raju
Greenhorn
Posts: 4
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Anandakumar Palanisamy wrote:

Hi Kalidas,

I was struggling with the same problem mentioned above for the last two days... Getting class cast exception.....
It would be really helpful, if you could share the piece of code with me...


Thanks In Advance..


Anandkumar.




Hi Anand,

Check the code below. I guess that would help you to fix your problem



Cheers!
Kalidas
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kalidas,

i found this thread, because i have problems reading from Quality Center Test Plan too.
Would you bee so kind to provide your code doing this. I'm new to java and the above posted code fragments and the things i found till now are not working (together).

thanks
 
Kalidas Raju
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

R Sch wrote:Hi Kalidas,

i found this thread, because i have problems reading from Quality Center Test Plan too.
Would you bee so kind to provide your code doing this. I'm new to java and the above posted code fragments and the things i found till now are not working (together).

thanks



Hello R Sh,

I have already posted the code on the top. It's a simple issue with the typecasting.

Cheers!
Kalidas
 
Roland Schmit
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kalidas,

mybee i should open a new thread, but i'm not shure.
let me first try to explain my problem a bit mor in detail. In the QC TestPlan, i have three foldres below "Subject", e.g:
Subject\Frontend
Subject\Backend
Subject\all the Rest

I have following code:


When i run this code with TP_Pfad = Subject, it's working, but not as expected. I expect that all "items" within my three foldes Frontend, Backend and all the Rest Should be displayed to me. In the output i see three times "Subject <<< Top Level Element" as i expect it to be. But the content diplayed below this output is alwas the same. Only the content of one of my folders is displayed (three times)? What's wrong here? What do i have to change to see the content of all three folders?

What i don't understand is, if i use TP_Pfad = Subject\\Frontend, to see just the content of the frontend folder i get:


Can you tell me what's wrong?

Thank you very much

R.Sch
reply
    Bookmark Topic Watch Topic
  • New Topic