link to a test case

The release related discussions, plans and questions.
Locked
cosmo
Advanced user
Posts: 19
Joined: Wed Jan 16, 2008 9:40 am

link to a test case

Post by cosmo »

I have a test project with many test cases. How I can set a link from test case 1 to test case 100 ? Is it possible?

best regards, cosmo
gunter
Advanced user
Posts: 34
Joined: Mon Mar 27, 2006 1:41 pm

Post by gunter »

Hello cosmo,

you must create a littel bit of new code:

Code: Select all

function testsuite_Link(id)
{
    var pParams = tree_getPrintPreferences();
    parent.workframe.location = fRoot+"lib/testcases/archiveData.php?edit=testsuite&id="+id+args+"&"+pParams;
}


function testcase_Link(id,v)
{
    var pParams = tree_getPrintPreferences();
    parent.workframe.location = fRoot+"lib/testcases/archiveData.php?version_id="+v+"&edit=testcase&id="+id+args;
}
put this in testlink_library.js

and then you can create a link in a testcase with this url:
javascript:testcase_Link(xx) and no protokoll.

xx is the testcase ID where you want to link.

And if you want to link to a testsuite, use the other funktion.

will this help you?
regards
Gunter
cosmo
Advanced user
Posts: 19
Joined: Wed Jan 16, 2008 9:40 am

Post by cosmo »

Yes, thank you.
Nogem
Advanced user
Posts: 21
Joined: Tue Nov 13, 2007 10:53 pm

Post by Nogem »

wouldn't happen to have a 'default to most current version' variation handy would you?
cosmo
Advanced user
Posts: 19
Joined: Wed Jan 16, 2008 9:40 am

Post by cosmo »

hello gunter,

I complement the code in testlink_library.js but it doesn´t work. what is the problem? and another question: I have modified the "strings.txt" but there is no difference in testlink.

best regards, cosmo
cosmo
Advanced user
Posts: 19
Joined: Wed Jan 16, 2008 9:40 am

Post by cosmo »

@ nogem,

excuse me, but I don´t understand.
cosmo
Advanced user
Posts: 19
Joined: Wed Jan 16, 2008 9:40 am

Post by cosmo »

cosmo wrote:hello gunter,

I have complemented the code in testlink_library.js but it doesn´t work. what is the problem? and another question: I have modified the "strings.txt" but there is no difference in testlink.

best regards, cosmo
Nogem
Advanced user
Posts: 21
Joined: Tue Nov 13, 2007 10:53 pm

Post by Nogem »

That's ok cosmo. I was asking gunter for a variation of the code he posted.
As for the page you're seeing, have you ensured that you cleared your cache?
cosmo
Advanced user
Posts: 19
Joined: Wed Jan 16, 2008 9:40 am

Post by cosmo »

yes, I have cleared my cache.
cosmo
Advanced user
Posts: 19
Joined: Wed Jan 16, 2008 9:40 am

Post by cosmo »

After inserting the code, I could not open a testcase in the same window.
gunter
Advanced user
Posts: 34
Joined: Mon Mar 27, 2006 1:41 pm

Post by gunter »

@ cosmo
have you the same version? we are using 1.73
I'm not shure if this works on older version.

If you change anything on javascript, you have clean the browsercache and restart the browser. Sometimes you have to clean the smarty cache.
Or mabye the cache of your java engine.

Are your shure that your link ist correct? Linkt-Type: URL
Protokoll: other
url: javascript:testsuite_Link(35)

@Nogem
thank you for your note.
i have checkt this problem.
The function testcase_Link links always to the newest version .
gunter
Advanced user
Posts: 34
Joined: Mon Mar 27, 2006 1:41 pm

Post by gunter »

in the meantime we found out that the parameter v for the version will not work. so leave this parameter blank and you will get the newest version.

To get a spezial version of a testcase you have to do more changes in the code.
cosmo
Advanced user
Posts: 19
Joined: Wed Jan 16, 2008 9:40 am

Post by cosmo »

hello gunter,

yes, I´m sure. this is the code:

function testcase_Link(id)
{
var pParams = tree_getPrintPreferences();
parent.workframe.location = fRoot+"lib/testcases/archiveData.php?edit=testcase&id="+id+args;
}

(I have no ID for the testsuites.)

My TestLink version is 1.7.3 and the url is: javascript:testcase_Link(480).
I have no idea what´s going wrong.

best regards, cosmo
Locked