有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java中jenkins中显示的api访问Fitnesse结果

我在詹金斯安排了一份fitnesse的工作。现在,当作业完成后,我们可以在Fitnesse结果链接中看到作业的结果。我想通过java访问这些结果。是否有任何API或其他东西可以帮助我访问这些结果


共 (2) 个答案

  1. # 1 楼答案

    如果您想运行测试,我们可以调用direct fitnesse test附加测试页?测试及测试;format=xml和?套房及酒店;format=xml

    for ex:- http://localhost:8086/QaTestPage?test&format=xml 
    it will return the results something like below
    
    <testResults>
    <FitNesseVersion>v20140418</FitNesseVersion>
    <rootPath>QaTestPage</rootPath>
    <result>
    <counts>
    <right>0</right>
    <wrong>1</wrong>
    <ignores>0</ignores>
    <exceptions>2</exceptions>
    </counts>
    <runTimeInMillis>50220</runTimeInMillis>
    <content>
    {{{ this will have content in HTML format
    }}}
    </content>
    <relativePageName>QaTestPage</relativePageName>
    </result>
    <finalCounts>
    <right>0</right>
    <wrong>1</wrong>
    <ignores>0</ignores>
    <exceptions>0</exceptions>
    </finalCounts>
    <totalRunTimeInMillis>52985</totalRunTimeInMillis>
    </testResults>
    

    当我们调用fitNesse时,服务器将返回如上所示的结果,您可以在java文件中解析此XML