SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Nov 2007
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Problem with creating graph in Perl API for QC

    Hi all. I've been having some trouble creating a graph from a Test Set today. I can get a graph to be created when I leave out a bunch of the parameters, like this:

    <font class="small">Code:</font><hr /><pre>my $tdc;
    eval {$tdc = Win32::OLE-&gt;GetActiveObject('TDapiole80.TDconnection')} ;
    die "td object not installed" if $@;
    unless (defined $tdc)
    {
    $tdc = Win32::OLE-&gt;new('TDapiole80.TDconnection', sub {$_[0]-&gt;Quit;})
    or die "Oops, cannot start td object: $!";
    }

    #Initialize the Connection and connect to the project
    $tdc-&gt;InitConnectionEx("http://mercuryqualitycenter/qcbin");
    $tdc-&gt;ConnectProjectEx("DEFAULT","Production","guest ","guest");

    my $treemgr = $tdc-&gt;{TestSetTreeManager};
    my $tstsetfold = $treemgr-&gt;NodeByPath($path);
    my $tfac = $tstsetfold-&gt;{TestSetFactory};
    my $list = $tfac-&gt;NewList('');
    my $tstset = $list-&gt;Item(1);

    my $path = 'SOME PATH'; # Replaced for privacy
    my $graph = $tstset-&gt;BuildSummaryGraph(undef, undef, undef, 0, $path, 1, 0);</pre><hr />

    This creates a 1 by 1 graph apparently containing the number of tests in the test set. However, I want to specify an x and y axis for the graph and set the sum to 'Count'.

    (Actually, as a side-note, I'm not really confident that I'm using filters correctly here. By using the $path as a filter, I mean that I want to restrict results to just that folder.)

    If I replace the last line with:

    <font class="small">Code:</font><hr /><pre>my $graph = $tstset-&gt;BuildSummaryGraph('XAXISFIELD', 'GROUPBYFIELD', 'Count', 0, $path, 1, 0);</pre><hr />

    then somehow the method fails (without an error), and $graph is left undefined. I know that both my fields, here represented by XAXISFIELD and GROUPBYFIELD are valid fields in the database since I copied them straight from a working graph made in the QC web-app.

    Anyone know what's going on?

  2. #2
    Junior Member
    Join Date
    Nov 2007
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Problem with creating graph in Perl API for QC

    Perhaps I should clarify my goal. I want to create a graph from an entire test set folder using the API; the above is an intermediate step that I was trying to get working.. This is possible in the web-app, so I assume it's possible through the API too. Does anyone have examples of graph creation through the API (in any language, since they're reasonably easily translateable).

  3. #3
    Junior Member
    Join Date
    Nov 2007
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Problem with creating graph in Perl API for QC

    This issue has been resolved (although another came up just afterwards). The problem was that XAXISFIELD and GROUPBYFIELD must be actual fields in the database (e.g. TS_SUBJECT or whatever), and the ones I were using were just aliases. Also, 'Count' should be '' instead in order to achieve the effect that enables Count in MQC does.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 12.50%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:41 AM.

Copyright BetaSoft Inc.