2015-02-09 44 views
0

在使用下面的TestLink APIConst值時,xml-rpc調用產生了一個異常。沒有報告打印的相應的測試用例帶有狀態碼問題的TestLink APIException

testlinkResult = TestLinkAPIResults.TEST_DEPARTED; 
testlinkResult = TestLinkAPIResults.TEST_WRONG; 

調用reportTCResult()與任一的那些狀態碼產生以下例外

The xml-rpc call to TestLink API method tl.reportTCResult failed. 
Result[0] = {message=The status code (d) provided is not valid!, code=6000} 
The xml-rpc call to TestLink API method tl.reportTCResult failed. 
Result[0] = {message=The status code (w) provided is not valid!, code=6000} 

當我用TEST_PASSEDTEST_FAILED,結果成功地打印。我的問題是爲什麼TEST_DEPARTEDTEST_WRONG失敗?


測試框架:TestNG和Selenum webdriver的&的Java

讓我知道如果需要有關config文件等任何更改或信息。

回答

0

與理查德的幫助下,需要在上面的文件更新下列文件TESTLINK

cfg/const.inc.php 

將更新以下

$tlCfg->results['status_label'] 
$tlCfg->results['status_label_for_exec_ui'] 
$tlCfg->results['charts']['status_colour'] 

添加所有新引進的地位應該被添加

locale/en_gb /string.txt 
Status (used wide) 
1

Testlink服務器API的文檔很難找到!但是,我做了一些搜索,發現了一些自動生成的文檔上someones blog here,害得我this question(關於與詹金斯整合TESTLINK)

的結果是,它似乎您TestLink的服務器上,您需要設置註冊您想要使用的狀態碼。看看測試鏈接服務器code here看起來它們是在const.inc.php文件中設置的(在那裏發佈的版本中的第420行)。默認情況是:

$tlCfg->results['status_code'] = array (
'failed' => 'f', 
'blocked' => 'b', 
'passed' => 'p', 
'not_run' => 'n', 
'not_available' => 'x', 
'unknown' => 'u', 
'all' => 'a' 
); 

一種方法是將要直接使用的狀態添加到該文件。如果您的安裝中已經有一些名爲custom_config.inc.php或類似的東西 - 您可能需要在其中添加陣列 - 請參閱this question in the testlink bug tracker

您需要添加

'departed` => 'd' 

'wrong' => 'w' 

所以你的數組現在看起來像:

$tlCfg->results['status_code'] = array (
'failed' => 'f', 
'blocked' => 'b', 
'passed' => 'p', 
'not_run' => 'n', 
'not_available' => 'x', 
'unknown' => 'u', 
'all' => 'a', 
'departed' => 'd', 
'wrong' => 'w' 
); 

不要忘了逗號,或者你可能會遇到into this problem(報告在Testlink bug系統上)

+0

@Richard:謝謝,讓我們知道一旦得到了正面的結果 – Prabu 2015-02-09 13:30:50

+0

沒問題 - 希望它有效(我目前還沒有一個Testlink服務器可以試用它,曾經使用它... ) – 2015-02-09 13:39:11