Quantcast
Viewing all articles
Browse latest Browse all 14708

Problems filtering for dates in BG_USER_30 using Perl and Win32::OLE / OTA API

Yes... A quite uncommon problem, isn't it?

 

I'm trying to use perl to access QC 10 and I got it running quite well I think,

 

But now I have a problem with dates in BG_USER_30 which is displayed in QC as "Modified".

 

I used the filter setting ">= 5/1/2013" and got 4 results. Then I used ">= 05/01/2013" and got 31 results.

 

It seems the value in that field is in fact a text and using OTA API isn't able to handle this.

 

An indicator for this is the results that I get. Example:

 

7283    21.05.2013 15:47:15     ("German" notation)
7733    17/05/2013 13:55:24    (DD/MM/YYYY hh:mm:ss)
8436    6/5/2013 2:58:10 PM     (M/D/YYYY h:mm:ss AMPM)
8555    2013-05-13                       (ISO Year)
8736    07/06/2013 12:01:05    (DD/MM/YYYY hh:mm:ss)

As you can see, it is a "nice" mixture.

 

Am I right in my assumption that BG_USER_30 is just a textfield and the display on QC's webinterface is simply somehow converted to display it properly? What could possibly be done to resolve that problem. Note: I'm just a user, not an admin of the server.

 

Just for completeness, here is my perl script, should anyone be interested.

#!/usr/bin/perl
use strict;
use Data::Dumper;
$Data::Dumper::Indent= 1;

my $MYSERVER= "https://.../qcbin";
my $USER= "...";
my $PASS= "...";
my $DOMAIN= "...";
my $PROJECT= "...";

# Return a connection with Test Director via the TD Object.
eval 'use Win32::OLE';
die "Unable to load Win32::OLE module: $@\n" if $@;
Win32::OLE->Option(_NewEnum => 1);
my $tdc = Win32::OLE->new('TDapiole80.TDconnection');
if (!$tdc) {
    die "Cannot start TestDirector object";
}

# Connect to specified server and project.
$tdc->InitConnectionEx($MYSERVER);
$tdc->Login($USER , $PASS);
$tdc->Connect($DOMAIN, $PROJECT);

my $BugFactory= $tdc->BugFactory();
my $Fields= $BugFactory->Fields->{_NewEnum};

my $BugFilter= $BugFactory->Filter;
$BugFilter->SetProperty('Filter', 'BG_USER_30', '>= 05/01/2013');
my $BugList = $BugFilter->NewList()->{_NewEnum};

foreach my $Bug (@$BugList) {
    print $Bug->ID(),"\t",$Bug->Field('BG_USER_30'),"\n";
}
print scalar @$BugList,"\n";

 

 

 

 


Viewing all articles
Browse latest Browse all 14708

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>