Python script: Convert excel into an xml file of testlink

Source: Internet
Author: User
Tags testlink

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.