3

I wonder that how can we import library as another name in robot framework?

For example: I want to import Selenium2Library as name "SL"

So what do I need to do?

1

2 Answers 2

7

You should import like this

Library    Selenium2Library    WITH NAME    SL

http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#setting-custom-name-to-test-library

Sign up to request clarification or add additional context in comments.

1 Comment

Thank Zverev, but in my case, how you can manage 2 library which have same keywords. For example, When test fail, RF will automatically run Capture Screen shoot (by default). I've added another lib and it also has Capture Screen Shoot. So test will fail because (Duplicated keyword!).
0

@MinhNguyen-Phuong-Hoang You could try importing each library with a different name and then specify the keyword you want with a fully qualified name.

Library    SeleniumLibrary     WITH NAME    SL
Library    Selenium2Library    WITH NAME    SL2

    SL2.Capture Screen

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.