Add seleniumlibrary prefix to keyword call issue

296 views Asked by At

I was facing keyword issue with robot framework and selenium in eclipse. I downgrade robot to 3.2.2 from 4.0 as it is not supporting in RED editor. Now I am facing new issue. I need to add seleniumlibrary prefix manually to all the keywords. Is there any way to do it quickly as I have around 55 scripts.

enter image description here

1

There are 1 answers

2
Morkkis On

Your issue, as can be seen in the screenshot, is that you have both SeleniumLibrary as well as Selenium2Library providing the same keyword for you. The best solution to this would be to remove the Selenium2Library altogether, if possible. Unless you have some extremely old scripts done with the old SeleniumLibrary it doesn't provide anything for you.

If both libraries are needed, the BuiltIn library provides keyword called Set Library Search Order which will resolve the conflicts by using the primary library first and then if the keyword is not found, defaulting to the secondary one. See the keyword documentation here.

So it would work like this

TC ID : N
    Set Library Search Order    SeleniumLibrary    Selenium2Library
    Open Browser    ${URL}    ${BROWSER}
    Maximize Browser Window