Test Management . com Forum Index

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

QATraq API

 
Post new topic   Reply to topic    Test Management . com Forum Index -> Software Testing
View previous topic :: View next topic  
Author Message
fhynes



Joined: 11 Mar 2008
Posts: 2
Location: Ireland

PostPosted: Mon Apr 28, 2008 11:29 am    Post subject: QATraq API Reply with quote

Hi all,
I am investigating how to use python 2.3 (package = SOAPpy) to interface with the QATraq API on my hosted QATraq instance. The first request I am attempting to perform is 'updateTestResult'. Has anybody implemented this in their test infrastructure?

I would also be interested in hearing how the API is being used by other users, i.e. what languages are being used to create clients and what request types are being used (insertTestScript, updateTestResult etc).

Has any user implemented a fully automated test infrastructure with QATraq fully integrated?

Thanks in advance,
Fergal.
_________________
Regards,
Fergal.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fhynes



Joined: 11 Mar 2008
Posts: 2
Location: Ireland

PostPosted: Fri Aug 22, 2008 3:43 pm    Post subject: Sample perl code for using the QATraq API Reply with quote

An update on my use of the API. I now have a large automated test suite performing tests and writing test results directly to QATraq, it's very useful and equally visually impressive. Python support for SOAP did not compare to PERL support for SOAP and I ran into problem after problem, therefore I used PERL instead. I am using the SOAP::Lite package and the following sample code will get you started writing test results to QATraq in PERL. Code efficiency may not be too impressive but this does work for me in a critical environment. Also includes a nice piece of code that emails you on a failure with appropriate parameters. Hope it helps someone.

.....
if (...whatever test condition...)
{
$res = "Pass";
&writeResult($TC_NAME,$TS_ID1,$ProdVer1,$PlatName1,$OSName1,$res);
}
else
{
$res = "Fail";
&writeResult($TC_NAME,$TS_ID1,$ProdVer1,$PlatName1,$OSName1,$res);

# Configure smtp server
MIME::Lite->send ("smtp", "AAA.BBB.C.DD");
my $msg = MIME::Lite->new
(
From => 'abc@defg.com',
To => 'abc@defg.com',
Subject => "$App_ID1-Test Failure",
Data =>
"$App_ID1,$TS_ID1,$TC_NAME,$ProdVer1,$PlatName1,$OSName1\n",
);
$msg->send ();
}
.....

sub writeResult
{
require Api;
my $WSDL = "file:///apiManager.wsdl";
my $URI = "http://schema.example.com";
my $PROXY = "https://abc.traqhost.com/api.php?class=apiManager";
my $api = Api->new($WSDL, $URI, $PROXY);

$get=1;

$api->reset_params;
$api->add_param("APIID", "api001");
$api->add_param("Username", "uname");
$api->add_param("Password", "pwd");
$api ->add_param("TestScriptID", $TS_ID1);
$api ->add_param("TestCaseID", $TC_NAME);
$api ->add_param("ResultCategoryName", $res);
$api ->add_param("TestDate", "");
$api ->add_param("ProductVersionName", $ProdVer1);
$api ->add_param("PlatformName", $PlatName1);
$api ->add_param("OsName", $OSName1);
$api ->add_param("TesterName", "admin");
$api ->add_param("ResultsSourceName", "API");
$api ->add_param("Comments", "");
$api ->add_param("CalcActTime", "00:00:10");
sub SOAP::Serializer::as_updateTestResultReq
{$api->serializer(@_);}
if ($get == 1)
{
my $Script = $api->call(updateTestResult, updateTestResultReq);
print "\n Update Test Result:\n\n".Dumper($Script);
}
}
_________________
Regards,
Fergal.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Test Management . com Forum Index -> Software Testing All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum