Playwright Recorder not working in VS Code

Hi,

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\__playwright__main.py

Traceback (most recent call last):
  File "c:\Users\rivad\.vscode\extensions\robocorp.robocorp-code-1.12.0-win32-x64\src\robocorp_code\playwright\__playwright__main.py", 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

Filter:


* PASSTasks.ISOP (14.72s)

  * PASSKEYWORD - navigation to https://isop-20.example.com/ (14.68s)

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

    * PASSKEYWORD - RPA.Browser.Playwright.New Page | https://isop-20.example.com/ (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:
# https://github.com/robocorp/rcc/blob/master/docs/recipes.md#what-is-in-condayaml
# Tip: Adding a link to the release notes of the packages helps maintenance and security.

channels:
  - conda-forge

dependencies:
  - python=3.11.6                    # https://pyreadiness.org/3.10
  - pip=23.2.1                        # https://pip.pypa.io/en/stable/news
  - robocorp-truststore=0.8.0         # https://pypi.org/project/robocorp-truststore/
  - nodejs=20.8.1                    # https://github.com/nodejs/node/blob/main/CHANGELOG.md
  - pip:
    - robotframework-browser==17.5.2  # https://github.com/MarketSquare/robotframework-browser/releases
    - rpaframework==27.5.2            # https://rpaframework.org/releasenotes.html
#    - 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

rccPostInstall:
  - 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

Hi,
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