Rayrun
โ† Back to Discord Forum

Driver not found : path\bin\.playwright\node\win32_x64\playwright.cmd

I am new to playwright and followed all step of installation from official doc. Whenever I run test I get error Driver not found : path\bin.playwright\node\win32_x64\playwright.cmd.

I am using .net6.0 so the folder path ideally should be path\bin\Debug.net6.0.playwright\node\win32_x64\playwright.cmd.

I am confused from where the path is set. And ideally the test should pick the driver path automatically and run.

Can someone help me with this.

This thread is trying to answer question "How can the issue of the driver not being found at the expected path in Playwright be resolved, and how can the need to run a command before every debug run be avoided?"

6 replies

How do you install playwright? generally you only need to run the powershell install pwsh bin/Debug/netX/playwright.ps1 install or the manual steps dotnet tool install --global Microsoft.Playwright.CLI playwright install

shoaib2046
shoaib2046

Yes, but that does not give solutions, every time before debugging through visual studio 2022 you need to run command separately of dotnet build, pwsh bin/debug/netx/playwright.ps1 install.

The installation should happen only once. Currently before every debug you need to run the above command then debug.

You include a reference via nugget package? Been a while since doing C# && PW, but thought i needed nugget && the CLI, some reason i'm remembering there was a pwsh needed to install the browsers... Was fine after all that.

As a side note i much prefer C#, but the functionality provided in the javashit script helps a lot more then doing all in C#, not that you can't you simply will miss out on a lot of great features... And a lot of the stuff you'll need to implement as PW provides a lot in the JS flavor...

shoaib2046
shoaib2046

Thanks for the details ๐Ÿ˜Š.

In future will surely explore PW with javascript.

But currently i want to fix the issue mentioned because i need to run pwsh command before every debug run it is something not good.

Might suggest something else is deleting or cleaning up something it shouldn't, My projects once setup were good to go and never needed anything else to be installed. Project under source control, i've seen devs put in build to clean up, they had step called 'nuke' anything not in source/git it was deleted... That might do it..

shoaib2046
shoaib2046

I tried creating a fresh project but did not helped.๐Ÿ˜”

This needs to be fixed in playwright I feel.

Running the script everytime is something that should not happen.

Answer

Troubleshooting 'Driver not found' Issue in Playwright

If you're facing a 'Driver not found' issue in Playwright, it could be due to incorrect driver paths in the configuration file or issues with the browser driver installations.

Check Your Browser Driver Installations

Playwright uses specific browser drivers to interact with browsers like Chromium, Firefox, and WebKit. Ensure these drivers are installed correctly. Refer to the Playwright documentation for installation instructions.

Verify Driver Paths in Configuration File

The paths to the driver executables should be correctly specified in your Playwright configuration file. Make sure you've provided accurate paths for each browser's driver.

// playwright.config.ts
import { PlaywrightTestConfig } from '@playwright/test';

const config: PlaywrightTestConfig = {
  use: {
    // Specify driver paths here
  },
};

export default config;

Update or Reinstall Playwright

If the issue persists, consider updating or reinstalling Playwright. This can resolve compatibility issues or missing dependencies.

Check System Environment Variables

Some browsers require specific environment variables to be configured for their drivers to work with Playwright. Ensure these are set up correctly.

In summary, to resolve the 'Driver not found' issue, verify your configuration file and browser driver installations. If necessary, update or reinstall Playwright and check your system environment variables.

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].