robotframework-browser
robotframework-browser copied to clipboard
"Steam removed" issue happens once "Handle Future Dialogs" is used more than once
Describe the bug If "Handle Future Dialogs" keyword is called more than once then then test fails and "Stream removed" error appears in the logs.
To Reproduce Steps to reproduce the behavior:
- Open New Context
- Go to some page
- Use any reusable methotd that contains 'Handle Future Dialogs action=accept" inside
- Go to some other page within the same context
- Use any other reusable method that contains 'Handle Future Dialogs action=accept" inside
Code example: The Test Causing The Error [Documentation] This is just to report the problem ${case_id} Create Case Open Case With Case Id case_id=${case_id} Close This Case <-- this is reusable method that contains 'Hande Future Dialogs' inside Go To Some Other Page Delete Some Existing Report report_title=Report example <-- this is reusable method that contains 'Hande Future Dialogs' inside
Expected behavior Test should pass and close the browser at the end.
Screenshots
Desktop (please complete the following information):
- OS: [Windows 10 Pro]
- Browser [Chrome]
- Version [120.0.6099.200]
Additional context The idea that comes to my mind is to create additional keyword that will handle just one single alert.
Thre workaround is to close existing context and open a new one before the second 'Handle Future Dialogs' is called.
@allcontributors please add @amodzelewski for bugs
@aaltat
@amodzelewski already contributed before to bug
I have the same scenario issue on my end, except when I attempt to leave a dirty page and accept the alert, I get a Socket Closed error:
Ubuntu 22.04.3 Browser: Chrome robotframework-browser 18.1.0
If you use https://marketsquare.github.io/robotframework-browser/Browser.html#Wait%20For%20Alerts keyword from 18.9.1 version. Do you still experience this problem?
Most likely this is caused same thing as with https://github.com/MarketSquare/robotframework-browser/issues/3785
Walked into this exact issue, multiple handle dialogs in the same test causing a socket connection error, earlier today and your last comment @aaltat does fix it.
Meaning that replacing the Handle Future Dialogs with below code should solve the issue faced by the others as well.
${promise} Promise To Wait For Alert ${button_to_click_on}
Your keyword
Wait For ${promise}