I recently started exploring robotframework FlaUI library as it could be better tool for our test automation.
However, our infrastructure supports many projects which can use different tools - meaning, even if our project switches to FlaUI, other project can be using other tools.
The infrastructure uses ScreenCapLibrary for taking screenshots in many points of tests, but it happens that the FlaUI library has a keyword with the same name “Take Screenshot”.
Specifying the resource with every “Take Screenshot” in the *.robot using FlaUILibrary is something I would like to avoid.
Is there a way to import the FlaUI (or any other) library without the one specific keyword?
I already tried:
Library FlaUILibrary exclude=Take Screenshot
And running a dummy test case with “Take Screenshot” only, but the keyword was still executable.
Basically you can determine which keyword takes precedence by controlling the order you import the libraries.
Also if you want to ensure you always use the keyword form a specific library you can use the LibraryName.Keyword Name method (FlaUILibrary.Take Screenshot or ScreenCapLibrary.Take Screenshot as you need)
So in your situation I’d try to ensure that ScreenCapLibrary takes precedence for the other test cases and then use FlaUILibrary.Take Screenshot as you need to.