Unable to pass "Predicate" argument to ``wait for`` keywords
See original GitHub issueDescribe the bug
I cannot pass in input of Wait For Response
a predicate matcher, it is always considered as a url.
Documentation states
matcher Request URL string, JavaScript regex or JavaScript function to match request by. By default (with empty string) matches first available request.
But there are no example on how to pass a predicate
To Reproduce Steps to reproduce the behavior:
Wait For Response matcher=request => request.url() === 'https://example.com' && request.method() === 'GET'
Expected behavior Wait for the request with given url and method
Desktop (please complete the following information):
- OS: MacOS
- Browser: Chromium
- Version: robotframework-browser==9.0.2
Additional context Note that my need behind is to be able to wait for a specific request method (sometimes I am polluted with the OPTIONS requests, so I want to filter them out)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
c++11 - Trying to use lambda functions as predicate for ...
The wait method for the condition_variable class has a predicate as second argument, so I thought of using a lambda function:
Read more >karate/README.md at master - GitHub
A very powerful variation of waitUntil() takes a full-fledged JavaScript function as the argument. This can loop until any user-defined condition and can...
Read more >Passing a function as an argument to another function in Python
When we call that function (with predicate(item) ), we pass a single argument to it and then check the truthiness of its return...
Read more >robot.libraries package - Robot Framework API documentation
Displays the given messages in the log file as keyword arguments. ... By default retry_interval is the time to wait _after_ a keyword...
Read more >Be Aware of the Traps of Condition Variables - Modernes C++
One thread prepares something and sends a notification another thread is waiting for. Why can't this be so dangerous?
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This should be resolved with #1533. I wasn’t sure how to associate it with this issue.
Desktop (please complete the following information): OS: MacOS 11.6 Browser: Chromium Version: robotframework-browser==10.0.3
I also ran into this issue. Curiously,
waitForRequest
andwaitForResponse
do different things; I’m not sure if it’s related:waitForResponse
waitForRequst
EDIT I removed the part of my comment regarding
POST
methods–it occurred to me after reading @Leemur89 's comment more carefully that I wasn’t filtering outOPTIONS
requests, which would explain the protocol error.