अन्य लोगों के लिए जानकारी जो इस धागे को देख सकते हैं।
यह सब आप को स्थापित करने की आवश्यकता होगी pywin32 प्रारंभ करने के लिए की तरह यहां से http://sourceforge.net/projects/pywin32/files/pywin32/Build216/
सब आप pywin32 आयात करने के लिए की आवश्यकता होगी सबसे पहले
'''@author: www.qcintegration.com @mailto:[email protected]'''
import pywintypes
import win32com.client as w32c
from win32com.client import gencache, DispatchWithEvents, constants
फिर दूसरे ऑपरेशन के रूप में मैं यहाँ करने के लिए प्रवेश पर कार्रवाई शामिल सर्वर सभी विधि के
def connect_server(qc, server):
'''Connect to QC server
input = str(http adress)
output = bool(connected) TRUE/FALSE '''
try:
qc.InitConnectionEx(server);
except:
text = "Unable connect to Quality Center database: '%s'"%(server);
return qc.Connected;
def connect_login(qc, username, password):
'''Login to QC server
input = str(UserName), str(Password)
output = bool(Logged) TRUE/FALSE '''
try:
qc.Login(username, password);
except pywintypes.com_error, err:
text = unicode(err[2][2]);
return qc.LoggedIn;
def connect_project(qc, domainname, projectname):
'''Connect to Project in QC server
input = str(DomainName), str(ProjectName)
output = bool(ProjectConnected) TRUE/FALSE '''
try:
qc.Connect(domainname, projectname)
except pywintypes.com_error, err:
text = "Repository of project '%s' in domain '%s' doesn't exist or is not accessible. Please contact your Site Administrator"%(projectname, domainname);
return qc.ProjectConnected;
दूसरा जो OTAapi DLL
012,351 फाइल शामिल होंगे
def qc_instance():
'''Create QualityServer instance under variable qc
input = None
output = bool(True/False)'''
qc= None;
try:
qc = w32c.Dispatch("TDApiole80.TDConnection");
text = "DLL QualityCenter file correctly Dispatched"
return True, qc;
except:
return False, qc;
तब मुख्य विधि QCserver को
def qcConnect(server, username, password, domainname, projectname):
print("Getting QC running files");
status, qc = qc_instance();
if status:
print("Connecting to QC server");
if connect_server(qc, server):
##connected to server
print("Checking username and password");
if connect_login(qc, username, password):
print("Connecting to QC domain and project");
if connect_project(qc, domainname, projectname):
text = "Connected"
connected = True;
return connected, text;
else:
text = "Not connected to Project in QC server.\nPlease, correct DomainName and/or ProjectName";
connected = False;
return connected, text;
else:
text = "Not logged to QC server.\nPlease, correct UserName and/or Password";
connected = False;
return connected, text;
else:
text = "Not connected to QC server.\nPlease, correct server http address";
connected = False;
return connected, text;
else:
connected = False;
text = "Unable to find QualityCenter installation files.\nPlease connect first to QualityCenter by web page to install needed files"
return connected, text;
कनेक्ट करने के लिए और अंत में कैसे उपयोग
if __name__ == "__main__":
server= r"http://qualitycenterServer:8080/qcbin"
username= "alex_qc"
password= ""
domainname= "DEFAULT"
projectname= "QualityCenter_Demo"
connection_status, text = qcConnect(server, username, password, domainname, projectname);
print "connection_status:", connection_status
के उदाहरण के साथ एक ही स्थान पर उन तरीकों के सभी निष्पादित करने के लिए किसी भी मामले में अधिक प्रश्न mailto: [email protected] या सीधे वेब पक्ष पर: http://www.qcintegration.com
धन्यवाद, वीबीस्क्रिप्ट विकल्प को आजमाएं और देखें कि यह कैसा चल रहा है। – Hari