Ruby integration with TestLink

366 views
Skip to first unread message

Natasha

unread,
Oct 6, 2008, 9:12:48 AM10/6/08
to Watir General
Hello All,

Has any tried integrating TestLink with Watir? Basically executing
watir tests through Testlink.

If yes, please could you share details about complexity of doing the
integration.

If not TestLink, is there any easy integration/support available for
any other opensource Test case management tool?

Thanks,
Natasha


Manish Sapariya

unread,
Oct 7, 2008, 2:26:34 AM10/7/08
to watir-...@googlegroups.com, man...@gslab.com
Hi Natasha,
We have developed a patch and contributed to testlink, which can run
a test from testlink.

Please note that this just enables you to RUN the tests, not write and
maintain them. Please read on for details. This might be little off
topic but I think it might be still useful to others.

The idea is simple. We have small CSV based test execution framework
around watir, which exposes all the tests using xml rpc server.

One needs to write a test cases in testlink such that the name of
testcase is exactly the name of test api in the framework. The patched
testlink provides a execute button, pressing which simply invokes
the test case using xmlrpc call. There will also be a execute complete
test plan in this way.

The testlink patch is already in the trunk and is enabled by some
config variable, I don't remember the exact name.

This is very simple and straight forward integration that we have
tried, but it works for us.

You may achieve the same thing by writing simple xmlrpc server
execution engine for your test cases. Best thing would be a
xmlrpc based runner for runit/testunit. :-)

Please do let me know if you need more details.
Regards,
Manish

Alister Scott

unread,
Oct 7, 2008, 3:55:14 AM10/7/08
to Watir General
Hi Manish,

If you have time, it would be great if you could share your solution
you talk about on a wiki page.
You can create a page with the example under:
http://wiki.openqa.org/display/WTR/Advanced+Examples
Screenshots would be good too.

Regards,
Alister Scott

Tim Koopmans

unread,
Oct 7, 2008, 5:54:20 AM10/7/08
to Watir General
Natasha, there's an API already available which you could use as a
client. As Manish has mentioned, it would be relatively simple to
execute test cases. To update, you could just use the sample ruby
client implementation ... Do you have specific functionality in mind
that you're looking to implement? If so, it might be worth mentioning
so some of us can have a hack at it =)

Regards,
Tim Koopmans

<snip>
#!/usr/bin/env ruby

# Testlink API Sample Ruby Client implementation
require 'xmlrpc/client'

class TestlinkAPIClient
# substitute your server URL Here
SERVER_URL = "http://qa/testlink_sandbox/api/xmlrpc.php"

def initialize(dev_key)
@server = XMLRPC::Client.new2(SERVER_URL)
@devKey = dev_key
end

def reportTCResult(tcid, tpid, status)
args = {"devKey"=>@devKey, "tcid"=>tcid, "tpid"=>tpid,
"status"=>status}
@server.call("tl.reportTCResult", args)
end
end

# substitute your Dev Key Here
client = TestlinkAPIClient.new("f2a979d533cdd9761434bba60a88e4d8")
# Substitute for tcid and tpid that apply to your project
result = client.reportTCResult(1132, 56646, "f")
# Typically you'd want to validate the result here and probably do
something more useful with it
puts "result was: %s" %(result)

Natasha Ranney

unread,
Oct 7, 2008, 6:06:23 AM10/7/08
to watir-...@googlegroups.com
Thanks a bunch for sharing details.
 
Actually I haven't yet thought about the exact implementation. I have recently started using Watir and am maintaining my tests in XLS. But I wanted to use any open source test case management tool which helps me organize my tests, allows me to execute tests selectively and then generates some reports like number of tests cases and test execution results.
 
I am aware of TestLink, but have never used it exhaustively. Also I knew it can be customized as its open source. Hence have been thinking that it may be a good option to try out. Now that Manish has given me some pointers, I will check it out and get back with some more queries.
 
Thanks and regards,
Natasha

Tim Koopmans <tim....@gmail.com> wrote:

Natasha, there's an API already available which you could use as a
client. As Manish has mentioned, it would be relatively simple to
execute test cases. To update, you could just use the sample ruby
client implementation ... Do you have specific functionality in mind
that you're looking to implement? If so, it might be worth mentioning
so some of us can have a hack at it =)

Regards,
Tim Koopmans


Manish Sapariya

unread,
Oct 8, 2008, 3:46:08 AM10/8/08
to watir-...@googlegroups.com
Alister,
I can describe the solution that we have created in great detail
However I am not sure, if I would be able to share the code.

Would it be all right to just describe the approach?

Thanks and Regards,
Manish

Alister Scott

unread,
Oct 8, 2008, 7:30:36 AM10/8/08
to Watir General
Hi Manish,
For sure, anything is better than nothing.
Regards,
Alister

KimBrown

unread,
Oct 9, 2008, 6:20:09 PM10/9/08
to Watir General
On Oct 8, 2:46 am, Manish Sapariya <man...@gslab.com> wrote:

> I can describe the solution that we have created in great detail
> However I am not sure, if I would be able to share the code.
>
Perhaps you would be able to post the code if you changed it to be
generic enough to remove any proprietary information? It would still
be just as effective as an example.


Kim

Manish Sapariya

unread,
Oct 10, 2008, 12:56:34 AM10/10/08
to watir-...@googlegroups.com
Hi,
I shall get back with basic document first,
describing what we have done. I am eager to
share the code as well, that might take little
time.

Thanks for the response.
Regards,
manish

SatheeshKumar

unread,
Oct 10, 2008, 2:18:25 AM10/10/08
to watir-...@googlegroups.com
Hi,
This Sounds interesting.
Keep sharing..

I have recently looked into Testlink tool. will be grateful if I can do
something. This would help us too.

/Sathyz

Reply all
Reply to author
Forward
0 new messages