Playwright Recorder not working in VS Code


When I try to add locators by clicking on RessourcesPlaywright (Browser)Playwright Reorder (Python)... I get:

robocorp code: 2023-11-10 16:34:24 UTC pid: 26128 - ThreadPoolExecutor-0_0 - INFO - robocorp_code._language_server_playwright
Running: c:\ProgramData\robocorp\ht\e5921b1_b1f3c24_59f207d3\python.exe c:\Users\rivad\.vscode\extensions\robocorp.robocorp-code-1.12.0-win32-x64\src\robocorp_code\playwright\

Traceback (most recent call last):
  File "c:\Users\rivad\.vscode\extensions\robocorp.robocorp-code-1.12.0-win32-x64\src\robocorp_code\playwright\", line 180, in <module>
    import playwright
ModuleNotFoundError: No module named 'playwright'

Funny thing is that when I run the robot it works:

Total: 1 Failures: 0


* PASSTasks.ISOP (14.72s)

  * PASSKEYWORD - navigation to (14.68s)

    * PASSKEYWORD - RPA.Browser.Playwright.Open Browser (12.64s)

    * PASSKEYWORD - RPA.Browser.Playwright.New Page | (0.96s)

    * PASSKEYWORD - BuiltIn.Sleep | 1 (1.01s)

Any ideas?

Hi @Dominik,

What do you have in your conda.yaml file?
…and how are you running the robot?

If you take on of our python templates, does the recorder work then?

BR, Kari

Here my conda.yaml

# For more details on the format and content:
# Tip: Adding a link to the release notes of the packages helps maintenance and security.

  - conda-forge

  - python=3.11.6                    #
  - pip=23.2.1                        #
  - robocorp-truststore=0.8.0         #
  - nodejs=20.8.1                    #
  - pip:
    - robotframework-browser==17.5.2  #
    - rpaframework==27.5.2            #
#    - pip-system-certs==4.0 # required to access system cert store
    - robotframework-reportportal==5.5.0 # Robot Framework Listener for ReportPortal
    - robotframework-listener-icinga==0.0.14 # Robot Framework Listener for Icinga2 API
    - robotframework-listener-archive-output==0.0.4 # Robot Framework listener for archiving the output

  - rfbrowser init                    # Initialize Playwright

Just pressing run in the VS Code extension.

Will check with the python templates on Monday.

BR, Dominik

Hi @Dominik,

Thanks for the report, managed to reproduce this and hunt the reason.

Drop NodeJS to v18.17.1, as robotframework-browser does not support v20 of NodeJS yet.

There is a channel dedicated to the robotframework-browser -library in the RFW community slack.

BR, Kari

Hi @Kari,

I couldn’t get it to work as NodeJS v18.18.1 isn’t found and 18.17.1 still produces the same error.

Will test with a new clone from GitHub - robocorp/example-playwright tomorrow.

BR, Dominik

Yeah sorry I took the node version number from the wrong place… it takes some time for all versions to get to conda-forge so 18.17.1 is the latest one there.

(I edited my previous post to avoid confusion later on)

BR Kari