-1

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

Amaze_Rock
  • 163
  • 3
  • 16

1 Answers1

2

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
Morkkis
  • 450
  • 3
  • 12
  • That issue now resolved. I am getting new error. [ ERROR ] Taking listener 'C:\Users\AppData\Local\Temp\RobotTempDir5042264645351673193\TestRunnerAgent.py:54844' into use failed: Importing listener 'C:\Users\AppData\Local\Temp\RobotTempDir5042264645351673193\TestRunnerAgent.py' failed: ModuleNotFoundError: No module named 'robot.parsing.populators' Traceback (most recent call last): – Amaze_Rock Jul 16 '21 at 12:42
  • Either your Robot was partially uninstalled or something else happened but for some reason the robot.parsing.populators is missing. You can try to re-install robot to get the missing files with ``pip install --upgrade --force-reinstall ``. If that doesn't help, see that your ``%PYTHONPATH%`` contains path to the robot installation. – Morkkis Jul 16 '21 at 12:47