Skip to main content

Robot Framework - How to add selenium keywords to autocomplete in Visual Studio Code

Why to use autocomplete selenium keywords?

When you start typing the first few letters of the keyword, you get a list of predictions. It’s called Autocomplete. There is a difference between having good knowledge of coding and memorizing all the keywords from the library. Memorizing all the library keywords doesn't judge your knowledge of coding. That’s where having these autocomplete keywords in IDE comes in handy.
IDE PyCharm automatically enables the autocompleting keywords feature. But In order to have this work on VS code, it takes a couple modifications on IDE.

Follow the below steps to enable autocomplete keyword feature on VSCode:

  1. In the VS Code, get the following extension: Robot Framework intellisense FORK  

    ( How to add extension )

  2. Click on the gear icon present next to the extension.

  3. Click Extension Settings

  4. Look for RF Language Server:Libraries

    Click Edit in Settings.json

  5. This opens in the editor. Add the below library to the settings.Json file. Start typing seleniumLibrary and autocpmplete shows the versions. Select the desired version.

  6. {
        "rfLanguageServer.libraries": [
        "SeleniumLibrary-3.3.1"
        ]
    }
  7. Save.

  8. Go back to the .robot file. When you start typing, the keywords will be displayed to autocomplete.

To get the keywords from any other libraries(Eg: BuiltIn, String, etc), in the settings.json file add the corresponding libraries.

Hope this article was helpful. Happy Automating :)

Comments

  1. Nice write up! Hope this helps the community.

    ReplyDelete
  2. Directly to the point. Thanks.

    ReplyDelete
  3. couldn't find "Edit in Settings.json" menu by clicking on Extension settings

    ReplyDelete

Post a Comment