自动化系列-python+TestLink+Jenkins 坑王系列

在配置开发自动化测试框架中遇到了很多的坑。现开一系列 先把这些坑都记录下来,待以后有证可查

1.python 连接 testlink' 错误:xml.parsers.expat.ExpatError: junk after document element: line 2, column 0

pip install TestLink-API-Python-client

#!/usr/bin/env python
# -*- coding:utf-8 -*-

from testlink import TestLinkHelper, TestlinkAPIClient
from globalpkg.log import logger

class TestLink():
    def __init__(self):
        tlk_helper = TestLinkHelper()

        try:
            self.testlink = tlk_helper.connect(TestlinkAPIClient)  # 连接TestLink

        except Exception as e:
            logger.error('连接testlink失败:%s' % e)
            exit()

    def get_testlink(self):
        return self.testlink

执行会发现报错:

断点追查client.py,发现错误提示Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set \'always_populate_raw_post_data\' to \'-1\' in php.ini 

里面提到在php.ini将always_populate_raw_post_data设为-1可修复。按建议来做,重启Apache,再运行。

 

posted @ 2017-03-24 16:46  DANNY  阅读(1820)  评论(1)    收藏  举报