// Opening QC Connection public static bool ConnectQCServer(string QCServerUrl, string QCUserName, string QCPassword) { bool qcConn = false; DisconnectQCServer(); mTDConn.InitConnectionEx(QCServerUrl); mTDConn.Login(QCUserName, QCPassword); qcConn = true; return(qcConn); }
public void Login(string address, string user, string password) { try { tdConn.InitConnectionEx(address); tdConn.Login(user, password); if (tdConn.Connected) { isConnectToQC = true; } } catch { } }
// Opening QC Connection public static bool ConnectQCServer(string QCServerUrl, string QCUserName, string QCPassword) { if (string.IsNullOrEmpty(QCServerUrl) || string.IsNullOrEmpty(QCUserName) || string.IsNullOrEmpty(QCPassword)) { return(false); } bool qcConn = false; DisconnectQCServer(); mTDConn.InitConnectionEx(QCServerUrl); mTDConn.Login(QCUserName, QCPassword); qcConn = true; return(qcConn); }
//protected static TDConnection tdc = new TDConnection(); /// <exception cref="COMException">Server connection error.</exception> protected bool Connect(String serverUrl, String username, string password, string domain, string project) { try { tdc.InitConnectionEx(serverUrl); } catch (System.Runtime.InteropServices.COMException ce) { rr.AddErrorLine(HandleException(ce)); //Environment.Exit(0); } catch (Exception e) { rr.AddErrorLine("Error: " + e.Message); } if (tdc.Connected) { try { tdc.Login(username, password); } catch (System.Runtime.InteropServices.COMException ce) { rr.AddErrorLine(HandleException(ce)); return(false); //Environment.Exit(0); } if (tdc.LoggedIn) { try { tdc.Connect(domain, project); } catch (COMException ce) { rr.AddErrorLine(HandleException(ce)); //Environment.Exit(0); } if (tdc.ProjectConnected) { return(true); } else { return(false); } } else { return(false); } } else { return(false); } }
public QCHelperTest() { qcConnect = new TDConnection(); qcConnect.InitConnectionEx("http://qualitycenter-v10.homedepot.com/qcbin"); qcConnect.Login("PXS8677", "tree$123"); qcConnect.Connect("ONLINE", "EBWCS"); if (qcConnect.Connected) { Console.WriteLine("Connected to QC"); } else { Console.WriteLine("Not Connected to QC"); } }
public TDConnect(string UserName, string PWD, string Domain, string Project, string Address) { _UserName = UserName; _PWD = PWD; _Domain = Domain; _Project = Project; _Address = Address; qc = new TDConnection(); qc.InitConnectionEx(Address); qc.Login(UserName, PWD); qc.Connect(Domain, Project); if (qc.Connected) { Console.WriteLine("Login Success"); } }
public QCHelper() { try { qcConnect = new TDConnection(); qcConnect.InitConnectionEx("http://qualitycenter-v10.homedepot.com/qcbin"); qcConnect.Login(HelperClass.QCUserName, HelperClass.QCPassword); qcConnect.Connect("ONLINE", "EBWCS"); if (qcConnect.Connected) { Console.WriteLine("Connected to QC"); } else { Console.WriteLine("Not Connected to QC"); } } catch (Exception ex) { Logger.Log(ex.ToString()); } }
public static string ReportResults(List<Results> results, string runName, string userName, string password) { string rc = "Nothing Reported"; if (runName != null && userName != null && password != null) { TDConnection connection = null; try { connection = new TDConnection(); String URL = "http://hpqualitycenter/qcbin/"; String domainName = "Default"; String projectName = "Production"; //Response.Write("Server:" + URL + " Domain:" + domainName + " Project:" + projectName + "<br/>"); //Prompt for QC credentials. connection.InitConnectionEx(URL); connection.Login(userName, password); connection.Connect(domainName, projectName); //Response.Write("Opening Connection <br/>"); //Response.Write("Connection Status: " + (connection.Connected ? "connected" : "not connected") + "<br/>"); if (connection != null && connection.Connected) { foreach (Results r in results) { TestSetTreeManager treeManager = (TestSetTreeManager)connection.TestSetTreeManager; //Response.Write("Folder: " + rootPathPrefix + path + " <br/>"); TestSetFolder folder = (TestSetFolder)treeManager.get_NodeByPath(rootPathPrefix + r.Path); TestSetFactory tFactory = (TestSetFactory)folder.TestSetFactory; TDFilter tFilter = (TDFilter)tFactory.Filter; tFilter["TS_TEST_ID"] = r.Id; //http://atg05-yyz/YUI/ReportResultToQC.aspx?id=2367453&path=BlackBerry%20Developer%20Tools\Sandbox&result=0 if (r.Id != null) { //Response.Write("testId= " + testId + " result= " + result + "<br/>"); List tests = folder.FindTestInstances("", false, tFilter.Text); if (tests.Count == 1) { TSTest t = (TSTest)tests[1]; //Response.Write(t.ID + " " + t.Status + " " + t.Name + " " + "<br/>"); RunFactory runFactory = (RunFactory)t.RunFactory; Run newRun = (Run)runFactory.AddItem(runName); switch (r.Result) { case 0: newRun.Status = @"FAILED"; break; case 1: newRun.Status = @"PASSED"; break; case 2: newRun.Status = @"N/A"; break; } //Response.Write("Status = " + newRun.Status + "<br/>"); newRun.Post(); rc = "Success"; } else { rc = "Error: Multiple Tests Returned for ID # " + r.Id; break; } } else { rc = "No Test Specified"; break; } }//foreach result }//if connection else rc = "Connection to QC could not be established"; } catch (Exception ex) { rc = ex.Message; } finally { if (connection != null) { if (connection.Connected) connection.Disconnect(); if (connection.LoggedIn) connection.Logout(); connection.ReleaseConnection(); connection = null; } } } return rc; }
private void ConnectToQC() { _conn= new TDConnectionClass(); try { _conn.InitConnectionEx(_config.QCAddress); _conn.Login(_config.UserName, _config.Pwd); _conn.Connect(_config.Domain, _config.Project); } catch(Exception e) { } }