Python script: An Introduction to converting excel into an xml file of testlink
Testlink only supports importing data in xml format, but some examples are displayed in excel. Test_link.py: Convert the excel file to the xml file of testlink, so that the excel file can also be imported to testlink.
Requirements for excel files: four columns: 1. Test Case name; 2. Test Preset conditions; 3. test steps; 4. Test expected results. The first line is the title and will not be imported.
Help
# ./test_link.py -husage: test_link.py [-h] [-o OUTPUT] [--version] input ----------------------------------------------------------------------- -*-test_link-*-***********************************************************************Function: Convert excel files to xml files which testlink know.Usage: use './test_link.py -h' to see helpExample: ./test_link.py test_link.xls positional arguments: input Input file name optional arguments: -h, --help show this help message and exit -o OUTPUT output file name, default is output.xml --version show program's version number and exit
Output file example
"ismp is ok"
"login web by selenium"
"login ok"
"ismp is ok"
"订购一个电视机"
"订购成功"
"ISMP就绪"
"关闭浏览器"
"退出成功"
Source code
See http://automationtesting.sinaapp.com/blog/python_code_testlink
Note that the string in xml must have double quotation marks step_number. If it is null, you must add the name _ equivalent. We do not recommend that you unpackage from the tuples. because the number of variables and metadata in python is different, an error is returned, however, it is normal to mix one line of space in excel. This article address http://automationtesting.sinaapp.com/blog/python_code_testlink