Wait For Promise interferes with taking screenshots on Click failure
Describe the bug When waiting for a response after clicking the button there is no screenshot of page where error occurred. Instead Take Screenshot have a description of the error that occurred on the Click keyword
To Reproduce
*** Settings ***
Library Browser
Suite Setup Register Keyword To Run On Failure Fail Screenshot
*** Test Cases ***
Click Disabled Button
[Tags] current
New Page https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_button_disabled
${promise}= Promise To Wait For Response thereisnospoon
Click //div[@id="accept-choices"]
Click //button[@type="button"]
Wait For ${promise}
*** Keywords ***
Fail Screenshot
${current-url}= Get Url
Log ${TEST NAME} encountered error on ${current-url} WARN
Take Screenshot ${OUTPUTDIR}/screenshots/browser/rf-browser-${TEST NAME}-{index} fullPage=True
Expected behavior Take Screenshot should take screenshots if possible :)
Screenshots

Desktop:
- OS: Windows 10
- Browser chromium
- robotframework 4.1.3
- robotframework-browser 12.2.0
I probably have the same issue in my docker container. The button 'Sign In' is found but cannot be clicked and screenshot isn't taken.
Versions: Ubuntu 20.04.2 LTS robotframework-browser 12.3.0 robotframework 5.0.1 Python 3.8.10 npm 6.14.16
Error in playwright-log.txt: {"level":30,"time":"2022-05-23T07:09:51.329Z","pid":66,"hostname":"runner-3xa35wsf-project-172060-concurrent-0pbhsn","msg":"Start of node method click"} {"level":30,"time":"2022-05-23T07:09:51.329Z","pid":66,"hostname":"runner-3xa35wsf-project-172060-concurrent-0pbhsn","msg":"Strict mode is enabled, find Locator with 'Sign In' in page."} 2022-05-23T07:09:51.330Z pw:api => locator.click started 2022-05-23T07:09:51.330Z pw:api waiting for selector "'Sign In'" 2022-05-23T07:09:51.333Z pw:api selector resolved to visible <input tabindex="4" name="login" id="kc-login" type="su…/> 2022-05-23T07:09:51.335Z pw:api attempting click action 2022-05-23T07:09:51.335Z pw:api waiting for element to be visible, enabled and stable 2022-05-23T07:09:51.810Z pw:api "networkidle" event fired 2022-05-23T07:10:01.333Z pw:api <= locator.click failed {"level":30,"time":"2022-05-23T07:10:01.333Z","pid":66,"hostname":"runner-3xa35wsf-project-172060-concurrent-0pbhsn","msg":"Error of node method click"} ================= Original suppressed error ================= locator.click: Timeout 10000ms exceeded. =========================== logs =========================== waiting for selector "'Sign In'" selector resolved to visible <input tabindex="4" name="login" id="kc-login" type="su…/> attempting click action waiting for element to be visible, enabled and stable
at click (/usr/local/lib/python3.8/dist-packages/Browser/wrapper/index.js:6955:17)
at async PlaywrightServer.click (/usr/local/lib/python3.8/dist-packages/Browser/wrapper/index.js:7757:28) {
name: 'TimeoutError' }
{"level":30,"time":"2022-05-23T07:10:01.338Z","pid":66,"hostname":"runner-3xa35wsf-project-172060-concurrent-0pbhsn","msg":"Start of node method takeScreenshot"} 2022-05-23T07:10:01.338Z pw:api => page.screenshot started 2022-05-23T07:10:11.348Z pw:api <= page.screenshot failed {"level":30,"time":"2022-05-23T07:10:11.348Z","pid":66,"hostname":"runner-3xa35wsf-project-172060-concurrent-0pbhsn","msg":"Error of node method takeScreenshot"} ================= Original suppressed error ================= page.screenshot: Timeout 10000ms exceeded. at takeScreenshot (/usr/local/lib/python3.8/dist-packages/Browser/wrapper/index.js:6319:16) at PlaywrightServer.takeScreenshot (/usr/local/lib/python3.8/dist-packages/Browser/wrapper/index.js:7757:34) at handleUnary (/usr/local/lib/python3.8/dist-packages/Browser/wrapper/node_modules/@grpc/grpc-js/build/src/server.js:718:13) { name: 'TimeoutError' }
If this should be another bug report please give feedback.
Having the same problem. No screenshot when failure happens while waiting for promise
I checked again and it is fixed in 17.5.2.