自動化系列-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,再運行。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM