Techno Logica


Showing posts with label QC OTA. Show all posts
Showing posts with label QC OTA. Show all posts

Tuesday, June 2, 2009

Connect to Quality Center OTA Client using PHP

CODE:

$qcurl =$_GET["qcurl"];
$usr =$_GET["usr"];
$pwd =$_GET["pwd"];
$dmn =$_GET["dmn"];
$prj =$_GET["prj"]; 

$tdc = new COM("TDApiOle80.TDConnection") or die("Unable to instantiate Quality Center OTA API COM Object");
$tdc->InitConnectionEx($qcurl);
$tdc->Login($usr, $pwd);

If ($tdc->LoggedIn == 1)
echo "
Connected";
Else
        echo "Check the Attributes";

$tdc->Connect($dmn,$prj);

If ($tdc->Connected == 1)
echo "
Logged In : Domain - $dmn | Project :$prj ";

//$tsttMgr = $tdc->TestSetTreeManager; 


//Disconnect from the project
If ($tdc->Connected == 1)
{    $tdc->Disconnect();
echo "
Disconnected";
 }
//Log off the server
If ($tdc->LoggedIn == 1)
    $tdc->Logout();

//Release the TDConnection object.
$tdc->ReleaseConnection();
echo "
Released Connection.";