SeleniumLibrary
SeleniumLibrary copied to clipboard
Request to set implicit wait as a basic parameter to a keyword
Prerequisites
- I have searched for similar issues in open tickets and cannot find a duplicate.
- The issue still exists against the latest released version of SeleniumLibrary.
- This is not a usage question or support request. For those, see more details in README.rst: https://github.com/robotframework/SeleniumLibrary#support
- You are not using the Java Selenium2Library: https://github.com/MarketSquare/robotframework-seleniumlibrary-java
- Remember that this is a public forum, so remember to remove all sensitive information, like username and password.
For issues
Steps to reproduce the issue
Our team uses 1.5 min as a basic implicit wait. Sometimes, we need to get results immediately (e.g., is there an element on the page). Since implicit wait is set globally we are failing to structurize scripts nicely and are forced to proceed with the following workaround where we change the global wait, run the keyword, and set it back:
${orig}= Get Selenium Implicit Wait
Set Browser Implicit Wait 1s
${check_abc}= Run Keyword And Return Status Element Should Be Visible xpath=%xpath%
Set Browser Implicit Wait ${orig}
or
Set Browser Implicit Wait 1s
${status}= Run Keyword And Return Status Page Contains Text IMAGE_1.png
Set Browser Implicit Wait ${orig}
Can you please suggest ways to accomplish the same logic without waiting for 1.5 minutes and not playing with that "Set Browser Implicit Wait"? Or maybe there is a possibility to add an implicit wait for a specific keyword execution?
Thank you in advance!
Expected behavior and actual behavior
When I follow those steps, I see... keyword needs 1.5 min for execution
I was expecting... a way to execute a keyword and get result immediately
Environment
Browser: Google Chrome 124.0.6367.63 Browser driver: chromedriver 124.x.x Operating System: Windows 11 Libraries
- Robot Framework: 6.1.1
- Selenium: 4.8.2
- SeleniumLibrary: 6.0.0
- Interpreter: Python 3.11
This project is not funded by any organisation or company, I do this because I want to do this on my own free time. Therefore if you want feature be implemented, the easiest and usually fastest way usually is to provide pull request. See https://github.com/robotframework/SeleniumLibrary/blob/master/CONTRIBUTING.rst for mode details about project development.