Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 20th, 2012  |  syntax: None  |  size: 0.79 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Issue while adding attachment to QC Test Case using Com4j API
  2. IBaseFactory obj2 = testset.tsTestFactory().queryInterface(IBaseFactory.class);
  3.  IList tstestlist = obj2.newList("");
  4.   for(Com4jObject obj3:tstestlist){
  5.    ITSTest tstest = obj3.queryInterface(ITSTest.class);
  6.     if(tstest.name().contentEquals("[1]TC1")){
  7.     System.out.println("TC found");
  8.     IRunFactory runfactory = tstest.runFactory().queryInterface(IRunFactory.class);
  9.     IRun run=runfactory.addItem("RunNew").queryInterface(IRun.class);
  10.     run.status("Passed");
  11.     IAttachmentFactory attachfac = run.attachments().queryInterface(IAttachmentFactory.class);
  12.     IAttachment attach = attachfac.addItem("").queryInterface(IAttachment.class);
  13.     attach.type(1);
  14.     attach.fileName("Path to File TC1");
  15.     attach.post();
  16.     run.post();.