Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Robot framework output file is showing error #5372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JishaQA opened this issue Mar 18, 2025 · 4 comments
Open

Robot framework output file is showing error #5372

JishaQA opened this issue Mar 18, 2025 · 4 comments

Comments

@JishaQA
Copy link

JishaQA commented Mar 18, 2025

Error in the output.xml file,
[ ERROR ] Reading XML source <<<filePath\output.xml>>> failed: ParseError: mismatched tag: line 157, column 21
Trying to execute an End to End tests calling 4 .robot tests from the same project.
Please provide possible solution

I am on the latest versions
robotframework==7.2.2
robotframework-seleniumlibrary==6.7.1
selenium==4.29.1

@pekkaklarck
Copy link
Member

Sounds like your different executions would be writing to the same file which breaks it. If that's not the case, then you most likely have some library that runs something on background using threads or processes and causes the problem.

Overall it's rather impossible for us to know what breaks an output.xml file with this kind of information only. If the above doesn't help, you can do two things:

  • Debug this yourself until you know more and provide the information here.
  • Create a simple example that demonstrates the issue and that we can run ourselves to debug it.

@JishaQA
Copy link
Author

JishaQA commented Mar 27, 2025

I have created a Test Runner file that is executing 4 tests

*** Settings ***
Library    Process
Library    OperatingSystem
Library    Collections

Suite Setup       Log    Starting Journey Test Suite
Suite Teardown    Log    Journey Test Suite Completed

*** Variables ***
${TIMEOUT}    300s  
${ENCODING}   UTF-8  

*** Test Cases ***
Test 1 - Run Journey Content Test
    Log    Running Test 1     
    ${result}    Run Process    robot       PathtoTest1.robot    timeout=${TIMEOUT}
    Log    ${result.stdout}
    Should Be Equal As Integers    ${result.rc}    0    Test 1 Failed

Test 2 - Run Adding Journey Menu Test
    Log    Running Test 2
    ${result}    Run Process    robot     PathtoTest2.robot    timeout=${TIMEOUT}
    Log    ${result.stdout}
    Should Be Equal As Integers    ${result.rc}    0    Test 2 Failed

Test 3 - Run Journey Portal Frontend Test
    Log    Running Test 3
    ${result}    Run Process    robot    PathtoTest3.robot    timeout=${TIMEOUT}    shell=True
    Log    ${result.stdout}
    Run Keyword And Continue On Failure    Should Be Equal As Integers    ${result.rc}    0    Test 3 Failed or Hung

Test 4 - Run Delete Journey Automation Page Test
    Log    Running Test 4
    ${result}    Run Process    robot      PathtoTest4.robot    timeout=${TIMEOUT}
    Log    ${result.stdout}
    Should Be Equal As Integers    ${result.rc}    0    Test 4 Failed

output.xml is same and it hangs after third test.
Please let me know what I should provide to help resolve this issue
Output: <<>>\end_to_end\output.xml
[ ERROR ] Reading XML source <<>>\output.xml' failed: ParseError: not well-formed (invalid token): line 181, column 2
Output file on opening

Image

@pekkaklarck
Copy link
Member

Hanging may be due to output buffers getting full. As explained in the Process library documentation, that can be avoided by redirecting stdout and stderr to files. The reason why the third run hangs, not the earlier, could be that this run produces more output than others. You also use shell=True with that run that may have some effect.

@pekkaklarck
Copy link
Member

Did you try redirecting stdout and stdout? If that doesn't help, please try the forthcoming RF 7.3 because it has various fixes that may help in cases like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants