How to connect HP Quality Center using C# and ASP.net -
i looking connect hp quality center using c# , asp.net. can please suggest me way connect using .net web application. also, need installation on server application hosted?
below java code found, want this
//connect qc itdconnection itdc= classfactory.createtdconnection(); system.out.println(itdc.connected()); itdc.initconnectionex("http://qc.com/qcbin"); system.out.println(itdc.connected()); itdc.connectprojectex("domaina", "projectb", "userid", "password");
well, there 2 ways of doing this. these using:
ota client (open test architecture)
this traditional way of connecting hp qc/alm third party app. api has been available many years , quite mature in terms of interactions allows qc. api believe com based , fast becoming outdated. therefore wouldn't recommend using build extensive custom qc harnesses.
rest api
hp has started providing rest api qc in last few version. rest api in latest version of qc (now known hp alm 11.5) seems quite mature. i'd main advantage of speed , better interoperability believe rest fast becoming 1 of main stream standards exposing remote services.
that background on options. give examples of code in c#, see following code snippet.
using tdapiolelib; // qtp interop library private tdconnection qcconnection; private string connect() { string status; status = "initialising"; qcconnection.initconnectionex("<qc url>"); qcconnection.connectprojectex("<qc domain>", "<qc project>", "<loginuserid>", "<userpassword>"); if (qcconnection.projectconnected) { status = "connected"; } return status; } public void gettestsintestset(string testfolder, string testsetname) { tdapiolelib.list tstestlist = new tdapiolelib.list(); try { if (qcconnection.projectconnected) { testsetfactory tsetfact = (testsetfactory)qcconnection.testsetfactory; testsettreemanager tstreemgr = (testsettreemanager)qcconnection.testsettreemanager; testsetfolder tsfolder = (testsetfolder)tstreemgr.get_nodebypath(testfolder); list tslist = tsfolder.findtestsets(testsetname, false, null); foreach (testset testset in tslist) { testsetfolder tsfolder = (testsetfolder)testset.testsetfolder; tstestfactory tstestfactory = (tstestfactory)testset.tstestfactory; tstestlist = tstestfactory.newlist(""); } foreach (tstest test in tstestlist) { system.diagnostics.debug.writeln(test[qcframeworktestidfieldname]); } } else { console.writeline("qc connection failed"); } } catch (exception e) { throw e; } } notes:
- to qc interop library, otaclient.dll. downloaded onto local machine once first access qc machine.
- hp alm 11.50 - rest api refrence: http://support.openview.hp.com/selfsolve/document/km1413621/binary/alm11.50_rest_api_ref.html?searchidentifier=4a65d813%3a140830b7b59%3a6cfa&resulttype=document
- hp alm 11.50 - ota api refrence: http://support.openview.hp.com/selfsolve/document/km1413612/binary/alm11.50_opentest_architect_api_ref.html?searchidentifier=4a65d813%3a140830b7b59%3a6e9b&resulttype=document
- generally, found quite tedious work ota api in c#. reference guides it's quite difficult times work out of object types , casting. using vb.net may make little easier believe wouldn't need casting. however, if had on again, consider rest api first.
all best.
s
Comments
Post a Comment