Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to set implicit wait as a basic parameter to a keyword #1897

Open
vyvy3 opened this issue Apr 29, 2024 · 1 comment
Open

Request to set implicit wait as a basic parameter to a keyword #1897

vyvy3 opened this issue Apr 29, 2024 · 1 comment

Comments

@vyvy3
Copy link

vyvy3 commented Apr 29, 2024

Prerequisites

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.

@emanlove
Copy link
Member

@vyvy3 A few questions..

  • Have you seen a change in behavior where it was once returning on completion of the implicit wait?
  • Does this use the full time only when you use "Run Keyword And Return Status" or in every instance of a library call using locators?
  • Do you have a reproducible example on a public accessible website?
  • Do you have any other add on libraries which change the SeleniumLibrary functionality (like AngularJSLibrary or SeleniumTestability library)? (Not interested or concerned about all your libraries just those designed to supplement SeleniumLibrary).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants