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

Import Argument prioritize_library Does Not Work #4

Open
jeremy-of-laurel opened this issue Apr 30, 2024 · 1 comment · May be fixed by #5
Open

Import Argument prioritize_library Does Not Work #4

jeremy-of-laurel opened this issue Apr 30, 2024 · 1 comment · May be fixed by #5

Comments

@jeremy-of-laurel
Copy link

Attempting to prioritize a library during import by using the prioritize_library argument does not set the search order as expected. When argument is set, I still receive keyword conflict errors between Browser and SeleniumLibraryToBrowser.

I import as per the library's documentation:
import_order

which results in keyword conflict errors:
error

The current workaround is to set the search order elsewhere by using the keyword Set Library Search Order.

@Lakitna
Copy link

Lakitna commented May 1, 2024

I ran into the same issue. And I also ran into the issue when using Set Library Search Order once.

It turns out that Set Library Search Order only works for a suite. From the keyword docs:

The search order is valid only in the suite where this keyword is used.
https://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Set%20Library%20Search%20Order

Because of this, the search order is set properly for the first test suite. However, in the second test suite things break.

I've also dove a bit into the source code. The issue seems to come from this function: https://github.com/Snooz82/robotframework-browser-migration/blob/master/src/SeleniumLibraryToBrowser/__init__.py#L579

It never uses the elif at line 600. Even after fixing the current function, it's pretty inefficient. Since I was rummaging around in the code, I wrote a new version of the function that seems to work. The new approach sets the order once per test suite.

See #5 for the fix

@Lakitna Lakitna linked a pull request May 1, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants