testlink with Testing tools like QTP, WinRunner etc.

The release related discussions, plans and questions.
Locked
Harsha
TestLink user
Posts: 5
Joined: Tue Nov 27, 2007 10:45 am

testlink with Testing tools like QTP, WinRunner etc.

Post by Harsha »

Hi,

We are using testlink for our project.We wanted to integrate Testing tools like QTP and WinRunner to perform tests on the specified testplan .
steelgar
TestLink user
Posts: 2
Joined: Wed Jan 02, 2008 4:28 pm

Re: testlink with Testing tools like QTP, WinRunner etc.

Post by steelgar »

Harsha wrote:Hi,

We are using testlink for our project.We wanted to integrate Testing tools like QTP and WinRunner to perform tests on the specified testplan .
Hi, guys.

Well, my solution in this case was not very smart, but quite easy to implement - it would be more elegant to do it via DB... But I am not that smart :)

Anyway - may be it will be helpful . Here is my workaround:

Everything is done with QTP itself. I will describe my approach with this fake-semi-code example:

Code: Select all

QTP_Action_Check_Something:

tcase=123      ' number of testcase in the TL, can be found in Print Test, or just in the browsers status bar when you mouseover the testcase name on the execution page.

problems = ""  ' internal variable. Stores found problems' descriptions

do some_testing_steps
if error_found then 
   problems=problems + "Problem X appeared" 
end if

save2temp (tcase, problems) ' saves testcase ID and a string value with found problems' description. Save it to some temp_file.

Code: Select all

QTP_Action_SaveToTL ' the last executed action in the script:

testcase_num= read (temp_file)
testcase_problems = read (temp_file)

' navigate to testlink execution page (you need to login to TL before - I skip it here.)

browser ("TestLink"). navigate "...testlink/lib/execute/execSetResults.php?build=BUILD_VERSION&id=testcase_num"

' If there were problems for this testcase - set Failed and add description.

if testcase_problems = "" then browser("TestLink").RadioButton ("Pass").click
else
browser("TestLink").RadioButton ("Failed").click
browser("TestLink").webedit ("description").set testcase_problems
end if
I did it via custom vbs functions. The approach is quite dirty... But actually works for me for a long time.

Hope this helps. If anybody needs more exact description, or actual code samples - feel free to ask.

Regards,
Vadim
havlatm
Member of TestLink Community
Posts: 940
Joined: Mon Oct 31, 2005 1:24 am
Location: Czech

Post by havlatm »

Thank you for contribution. The next release (1.8) will have integrated XML/RPC interface, that will be more friendly for your case.
I expect, that this release could be ready for production about March.
Harsha
TestLink user
Posts: 5
Joined: Tue Nov 27, 2007 10:45 am

Post by Harsha »

Firstly I should thank you for the reply , though it is a long time since I posted this query.

Exactly my requirement is to :

1. I will create a test plan for my project and associate testcase,specifications etc to the same testplan . I developed a new GUI for integrating testlink with SCM like (cvs,svn) and able to check out code from it and build the project from the UI , and also we can deploy it on to the server.

But right now my requirement is to integrate it with QTP so that I can invoke the QTP testing from my testlink by giving the recorded file path or file as an input to QTP so that it will test the flow of the application depending on the input recorded file and set the errors to be associated with the testcases of the testplan and bugs need to be stored in to the bug tacking system .

Thanks In Advance,
Harsha
steelgar
TestLink user
Posts: 2
Joined: Wed Jan 02, 2008 4:28 pm

Post by steelgar »

Harsha wrote:...

But right now my requirement is to integrate it with QTP so that I can invoke the QTP testing from my testlink by giving the recorded file path or file as an input to QTP so that it will test the flow of the application depending on the input recorded file ...
How to launch QTP on a local box from IE:

Add some web element to the TestLink's page that would call this (sample) JavaScript:

Code: Select all

<script language="JavaScript">
	
function run_qtp() 

{
		
var pat, res_pat;

// you can obtain the path to your script from the TestLink's execution page, here it is hardcoded:

pat="C:\\Program Files\\Mercury Interactive\\QuickTest Professional\\Tests\\MyTest";

res_pat = "C:\\QTP_results\";
	qtp_runner(pat, res_pat);
};

alert ("Completed!");

}		

	
function qtp_runner(test_pat, res_pat)
{

var qtApp = new ActiveXObject("QuickTest.Application", 127.0.0.1); // Create the application object 
qtApp.Launch(); // Start QuickTest 
qtApp.Visible = true; // Make it visible 
qtApp.Options.Run.CaptureForTestResults = "OnError";
qtApp.Options.Run.RunMode = "Fast";
qtApp.Open (test_pat, true);
var qtTest = qtApp.Test;
qtTest.Settings.Run.IterationMode = "rngIterations" ;
qtTest.Settings.Run.StartIteration = 1;
qtTest.Settings.Run.EndIteration = 2;
qtTest.Settings.Run.OnError = "NextStep" ;
var qtResultsOpt = new ActiveXObject("QuickTest.RunResultsOptions"); 
qtResultsOpt.ResultsLocation = res_pat;
qtTest.Run (qtResultsOpt);
qtTest.Close();
qtApp.Application.Quit();
}
	
</script>
You might need to set-up some COM/DCOM settings to run it, esp to run the QTP on a remote PC... This is not related to TestLink - so ask google :)
Harsha wrote: and set the errors to be associated with the testcases of the testplan and bugs need to be stored in to the bug tacking system .
You will need to wait for the promised update of TestLink or to create your own QTP framework for it like we did.

Hope it helps.

Regards,
Vadim
Locked