question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with `Wait For Response`

See original GitHub issue

Describe the bug I wonder why Wait For Response succeeds on the first URL but fails on second. The first one is a GET request while the second one is a POST request.

# 1. works
Wait For Response   https://keycloak.dummy.de/auth/realms/foo/protocol/openid-connect/login-status-iframe.html
# OR
Wait For Response    /openid-connect/login-status-iframe

# 2. does NOT work
Wait For Response    https://keycloak.dummy.de/auth/realms/foo/protocol/openid-connect/token
TimeoutError: page.waitForResponse: Timeout while waiting for event "response"
=========================== logs ===========================
waiting for response /.*\/openid-connect\/token/

both request can be seen in browser dev tools. image

What could be the reason for different behaviour? Any ideas how to fix or workaround it?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
rsandbachcommented, Nov 24, 2021

This may be resolved by #1533 , both Wait For Request and Response should support predicates, Example

1reaction
rsandbachcommented, Nov 25, 2021

The keyword parameter names are optional. You should be able to whip together your own Keyword to accomplish the syntax you are requesting. I don’t have enough context in this domain to know if it makes sense to create a built in keyword for URL / METHOD.

# Matches any URL that contains the supplied URL (treated as RegEx).
Wait For Response url
    Click    \#delayed_request
    Wait For Response /api/get/json

# Simplified Syntax
Wait For Method Example
    Click    \#delayed_request
    Wait For Response Method  api/get/json   GET

*** Keywords ***
Wait For Response Method
    [Arguments]    ${url}    ${method}
    Wait For Response    response => response.url().endsWith('${url}') && response.request().method() === '${method}'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does it say "waiting for a response" when opening a
If the issue doesn't persists in safe mode, the place the computer in clean boot and check. Step 2: Perform Clean Boot. To...
Read more >
[Question] Wait for response.ok() · Issue #2821 - GitHub
ok() to be truthy within a set interval. As a workaround, I'm using the following code. const response = await waitForServer ...
Read more >
c# - async/await problems getting system to wait for response
When you await the first one, your method will stop executing until that one finishes; the other request will still be executing during...
Read more >
Overview of a hang or wait - IBM
A system hang or wait can occur gradually as a resource contention problem or abruptly when a disabled wait state is loaded for...
Read more >
How to ask the REST Response to wait 60 seconds
Hi All,. i have a scenario in one of the integration like. If i get response as "200" then update the task with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found