Playwright Browser Automation on Windows

Launch Playwright Browser Automation on Windows

  • 1  Go to the Virtual machine service in the Azure portal.
  • 2  Click 'Add' -> 'Virtual Machine'.
  • 3  Under Image click on 'See all images'. Search for 'playwright' and select 'Playwright Browser Automation on Windows'.
  • 4  Fill out all needed informations and launch the Virtual Machine.

Connect to your instance via RDP
  • 1  Open a RDP client tool of your choice and add the appropiate values: Public IP address, username and password you specified when you created the VM
  • 2  Connect to your VM.

Run our sample code and develop your own scripts:

  • 1  Connect to the instance via RDP and log into the user you created in the Azure Portal.
  • 2  Open Command Line Interface. Navigate into C:\Playwright directory by
    cd C:\Playwright
  • 3  Run the sample code by
    node script.js
    You can watch the browser execute the sample script:

    Note: The first execution after startup is very slow, especially on VMs with low memory configured, the browser can run out of memory. The performance increases with time. So in case the browser exceeds the start up limit (30 seconds), just try again.
  • 4  By opening the folder C: -> Playwright you can see taken screenshots.
  • 5  Edit the script by right-click -> Open with Notepad++. You can find demo code for all available browsers in Playwright within the script. When you are done, save the file.
  • 6  Switch back to the Command Prompt window and run changed scripts again by
    node script.js