robotcodedev / robotcode

RobotFramework support for Visual Studio Code
https://robotcode.io
Apache License 2.0
168 stars 13 forks source link

[BUG] Keywords in SeleniumLibrary Plugins Like SeleniumTestablity not founded by robotcode #261

Closed m-amiri closed 1 month ago

m-amiri commented 1 month ago

Describe the bug The keywords that are imported by library plugins are associated with a not found error. but the test PASSED and the plugin's keyword works in the background by robot.

*** Settings ***
Library             SeleniumLibrary    plugins=SeleniumTestability;True;30 Seconds;True

Test Teardown       Close All Browsers

*** Test Cases ***
test1
    Open Browser    url=https://www.google.com/   browser=chrome
    ${storage_keys}=    Get Storage Keys    storage_type=localStorage
    Log    ${storage_keys}

Screenshots/ Videos

Screenshot 2024-06-04 at 1 16 02 PM

Logs automated-test ; /usr/bin/env xxx/.venv/bin/python xxx/.vscode/extensions/d-biehl.robotcode-0.83.0/bundled/tool/robotcode --default-path . debug --no-debug -- --parse-include features/test.robot --name Automated-Test --suite Automated-Test.Features.Test --by-longname Automated-Test.Features.Test.test1 .

Packages Versions

d-biehl commented 1 month ago

The keywords of a library are cached when the library is analysed for the first time. With the plugin mechanism of SeleniumLibrary, new keywords are added, but there is no way for RobotCode to automatically recognise that there are new keywords. Therefore, if you define new keywords in this way, simply execute the VSCode command RobotCode: Clear Cache and Restart Language Servers via F1 to reload all libraries.

You can also exclude a library from caching. To do this, search for robotcode.analysis.cache.ignoredLibraries in the VSCode Settings on the Workspace/Folder tab and simply add the SeleniumLibrary.

m-amiri commented 1 month ago

Thankful @d-biehl 🙏