robotframework-browser icon indicating copy to clipboard operation
robotframework-browser copied to clipboard

"Steam removed" issue happens once "Handle Future Dialogs" is used more than once

Open amodzelewski opened this issue 1 year ago • 5 comments

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:

  1. Open New Context
  2. Go to some page
  3. Use any reusable methotd that contains 'Handle Future Dialogs action=accept" inside
  4. Go to some other page within the same context
  5. 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 2024-01-09_16h26_19

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.

amodzelewski avatar Jan 09 '24 15:01 amodzelewski

Thre workaround is to close existing context and open a new one before the second 'Handle Future Dialogs' is called.

amodzelewski avatar Jan 09 '24 15:01 amodzelewski

@allcontributors please add @amodzelewski for bugs

aaltat avatar Jan 11 '24 09:01 aaltat

@aaltat

@amodzelewski already contributed before to bug

allcontributors[bot] avatar Jan 11 '24 09:01 allcontributors[bot]

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: socket_closed

Ubuntu 22.04.3 Browser: Chrome robotframework-browser 18.1.0

jeremy-of-laurel avatar Feb 16 '24 19:02 jeremy-of-laurel

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

aaltat avatar Oct 21 '24 19:10 aaltat

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}

mtoskamp avatar Apr 03 '25 09:04 mtoskamp