HOW TO - testcases import google spreadsheets and python.

Moderators: Amaradana, TurboPT, TL Developers

HOW TO - testcases import google spreadsheets and python.

Postby dnozay » Tue Sep 10, 2013 11:23 pm

Using:
- google spreadsheets to store TDS
- testlink 1.9.7
- python (e.g. because you <3 python)

Objective:
- import testcases from google spreadsheet into testlink


This thread [1] has other alternatives if you are able to export your spreadsheet to excel (.xls) format.
This "tutorial" assumes you are comfortable with python / virtualenv / google spreadsheets.

----

I've been able to export the google spreadsheet to (.xlsx) format but XLStoXML [2] does not currently handle that. So I was stuck trying an alternate route. I've found that there are python client using the XMLRPC interface [3]. One of them is TestLink-API-Python-client [4]. I did some messing around and I was able to format my testcases according to the template that is advertised by XLStoXML [5], then export it to JSON using the exportJSON script [6] for google spreadsheet. Once that was done a little script using TestLink-API-Python-client can do the job just fine [7].

Recap:
1. format your TDS using the template [5]
2. freeze the first row (corresponding to column headers)
3. in the Tools > Script Manager menu create a new script that is a copy of [6]
4. reload the document for the new "macro" to load
5. export spreadsheet as JSON and save as a file
6. install TestLink-API-Python-client [4] (e.g. pip install git+https://github.com/orenault/TestLink-API-Python-client)
7. download script [7] and use it to create your testcases.

References:
[1]: http://www.teamst.org/forum/viewtopic.php?f=38&t=4371
[2]: http://sourceforge.net/projects/xlstoxml/
[3]: http://www.teamst.org/forum/viewtopic.php?f=10&t=6656
[4]: https://github.com/orenault/TestLink-API-Python-client
[5]: https://www.dropbox.com/s/vmnw7tae3evxgob/Template.xls
[6]: https://gist.github.com/daaain/3932602
[7]: https://gist.github.com/dnozay/6499423
dnozay
TestLink user
 
Posts: 2
Joined: Tue Sep 10, 2013 5:42 am

Return to Import / Export



Who is online

Users browsing this forum: No registered users and 1 guest

cron