Launch Playwright on Windows
Connect to your VM
Run our sample code and develop your own scripts
Troubleshooting
Navigate to our listings page Playwright on Windows on Azure Marketplace.
Click on "Get it now" to initiate the launch dialog.
On the "Create a virtual machine" page, enter a username for the virtual machine (e.g., "azureuser") and a password.
Review the settings and proceed to create the virtual machine.
Please refer to the 'Launch and Configure' section above before proceeding with this part. For the RDP/VNC connection, you will need the username you created in the Azure portal, as well as the Virtual Machine ID (vmId).
Obtain the public IP address of your Virtual Machine:
Open 'Remote Desktop Connection' and connect using the public IP address of your virtual machine.
When prompted, enter the username and password you specified during the launch of the virtual machine.
On the virtual machine, open the file explorer and navigate to "C:\Playwright\Microsoft VS Code", then open Visual Studio Code.
In Visual Studio Code, go to the Explorer tab on the left panel and click "Open Folder". Navigate to and open the SampleCode folder located at "C:\Playwright\SampleCode".
Open the NodeJS folder and run script.js by clicking Run and then Start Debugging. When prompted, select Node.js as the debugger.
During the first execution, you will encounter an error indicating that browsers are not installed.
To install the latest browsers, open the Terminal and run the command:
npx playwright install
Looks like Playwright test or Playwright was just installed.
When running your script for the first time, you need to download the latest browser versions. To do this, execute "npx playwright install" or "playwright install" in the Command Prompt.
Resolving Copy & Paste Issues
You may experience issues with copying and pasting to and from the virtual machine. Ensure that your local RDP client supports clipboard sharing. If the keyboard shortcuts for copy and paste do not work, try using right-click to copy or right-click to paste.