Multiple Logs messages in Test

Viewed 63

I have a script like below:

[CCO-XXXXX_4] 
         [Tags]    TEST_CCO-XXXXX 
         Run Keyword And Continue On Failure        Run Test      General                test.out         testProfile          mode.out 
         Run Keyword And Continue On Failure        Run Test      General                test.out         testProfile          mode.out 

The Idea is to run 2 test cases with different arguments:

Run Test
    [Documentation]    Run the suite
    [Arguments]       ${type}     ${profile}     ${file}    ${test}
    When suite config is updated 
    Then publish test status

Then publish test status
    Set Test Message     ${LogStr}

Stop Test  
    [Documentation]    Stop Execution of suite
    [Arguments]       ${FIALUREMSG}        
    Log To Console    ${FIALUREMSG}
    Fail        ${FIALUREMSG}

The issue is in the report - when the test fails for both the runs then there are 2 separate individual messages in Error Reportreport messages: "This is stop called"

But when it passes only one message log is available - since there are two runs for the above two test cases is it not possible that the for each individual test there can be test related message : [ex "Hello this an example" should be logged twice?]

Successs Report

1 Answers

Your problem is that Set Test Message overrides the earlier content in every iterations. To fix the problem you should use the append parameter of this keyword. For example:

Set Test Message    is continued.   append=yes

Relevant part from the documentation:

If the optional append argument is given a true value (see Boolean arguments), the given message is added after the possible earlier message by joining the messages with a space.

Related