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

"Wait for Condition" not working if Selenium Lib is installed #2373

Closed
amankul opened this issue Oct 14, 2022 · 6 comments · Fixed by #2418
Closed

"Wait for Condition" not working if Selenium Lib is installed #2373

amankul opened this issue Oct 14, 2022 · 6 comments · Fixed by #2418
Labels
bug Something isn't working priority: high
Milestone

Comments

@amankul
Copy link

amankul commented Oct 14, 2022

Describe the bug

"Wait for condition" is wrapper around our assertion keywords without using Get -
Example -
Browser.Wait for condition Title == ${title}

Gives the following error -

Multiple keywords with name 'get_title' found. Give the full name of the keyword you want to use:
    Browser.Get Title
    SeleniumLibrary.Get Title

Note - there is no way for user to specify the lib name in the condition argument.
E.g Browser.Wait for condition Browser.Title == ${title}
Yields me -

ValueError: Argument 'condition' got value 'Browser.Title' that cannot be converted to ConditionInputs: ConditionInputs does not have member 'Browser.Title'. Available: 'attribute', 'attribute_names', 'bounding_box', 'browser_catalog', 'checkbox_state', 'classes', 'client_size', 'element_count', 'element_states', 'page_source', 'property', 'scroll_position', 'scroll_size', 'select_options', 'selected_options', 'style', 'table_cell_index', 'table_row_index', 'text', 'title', 'url' and 'viewport_size'

To Reproduce
Steps to reproduce the behavior:

  1. Have both Selenium Lib and Browser Lib installed in your project.
  2. Write a test which needs to wait until page navigates using "Wait for condition". You can use any conditions like url, title etc

Expected behavior
test should pass without errors

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • Browser [e.g. chrome, safari]: NA
  • Version [e.g. 22]: RF 5.0.1/Browser 14.1.0/ Selenium 6.0.0
@mkorpela mkorpela added the bug Something isn't working label Oct 14, 2022
@mkorpela
Copy link
Member

Thank you for the report. The keyword names for "Wait for Condition" seem to not be unique.

@amankul
Copy link
Author

amankul commented Oct 14, 2022

Yeah both libraries have "Wait For Condition" and "Get Title" keywords.

@BCGST
Copy link
Contributor

BCGST commented Nov 3, 2022

To double up on what @amankul mentioned, the fact the libraries share multiple keyword names seems to break the ConditionInputs. Title, Element Count, Text all will fail because SeleniumLibrary shares keywords of the same name that these conditions try to execute.

@aaltat
Copy link
Member

aaltat commented Nov 3, 2022

Most likely you can overcome the problem with setting library search order: https://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Set%20Library%20Search%20Order But in any case we should fix the problem in our library side.

@aaltat aaltat added this to the v14.3.0 milestone Nov 3, 2022
@aaltat
Copy link
Member

aaltat commented Nov 3, 2022

@allcontributors please add @amankul for bugs.

@allcontributors
Copy link
Contributor

@aaltat

I've put up a pull request to add @amankul! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: high
Projects
None yet
4 participants