Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Microsoft.Playwright.PlaywrightException: Executable doesn't exist at ~\AppData\Local\ms-playwright\ffmpeg-1007\ffmpeg-win64.exe #2006

Closed
infinitejest69 opened this issue Feb 11, 2022 · 6 comments
Labels

Comments

@infinitejest69
Copy link

infinitejest69 commented Feb 11, 2022

Context:

  • Playwright Version: 1.18.1
  • Operating System: Windows
  • .NET version: 6
  • Browser: Chrome / All
  • Extra:

Code Snippet

              //BrowserContext
                BrowserNewContextOptions browserNewContextOptions = new();
                browserNewContextOptions.StorageStatePath = "state.json";
                if (!String.IsNullOrEmpty(BaseConfig.Device))
                {
                    browserNewContextOptions = _playwright.Devices[BaseConfig.Device];
                }
                if (BaseConfig.Video)
                {
                    browserNewContextOptions.RecordVideoDir = VideoPath;
                    browserNewContextOptions.RecordVideoSize = new RecordVideoSize() { Height = 720, Width = 1280 };
                }
                if (BaseConfig.HAR)
                {
                    browserNewContextOptions.RecordHarPath = ResultsPath + $@"{ResultsPath}/HAR/{_scenarioContext.ScenarioInfo.Title}.har";
                }
                browserNewContextOptions.ViewportSize = new ViewportSize() { Height = 720, Width = 1280 };
                var browserContext = await _browser.NewContextAsync(browserNewContextOptions);

Describe the bug

After updating and running playwright install it appears to be looking for a different folder name for ffmpeg
if i rename the folder in appdata it works
for some reason even deleting all browsers and re-running playwright install still downloads 1006 and we need 1007

Microsoft.Playwright.PlaywrightException: 'Executable doesn't exist at C:\Users<myusername>\AppData\Local\ms-playwright\ffmpeg-1007\ffmpeg-win64.exe
╔═════════════════════════════════════════════════════════════════════════╗

@mxschmitt
Copy link
Member

Try installing the browsers and dependencies with: pwsh bin\Debug\net6.0\playwright.ps1 install.

@infinitejest69
Copy link
Author

infinitejest69 commented Feb 11, 2022

No luck,
i added .dotnet\tools to my PATH and rebooted.

.\bin\Debug\net6.0\playwright.ps1
Unable to find type [Microsoft.Playwright.Program]. At C:\Users\<myusername>\source\repos\<name of my Repo>\bin\Debug\net6.0\playwright.ps1:5 char:6 CategoryInfo : InvalidOperation: (Microsoft.Playwright.Program:TypeName) [], RuntimeException FullyQualifiedErrorId : TypeNotFound

@mxschmitt
Copy link
Member

Try this:

# If the pwsh command does not work (throws TypeNotFound), make sure to use an up-to-date version of PowerShell.
dotnet tool update --global PowerShell

(we have it soon in the docs)

@changhuixu
Copy link

In our servers (not our development workstations), there's no .NET SDK nor PowerShell permission.
Thus, if it possible to include these executables in a similar fashion like Node executable?

@infinitejest69
Copy link
Author

Try this:

# If the pwsh command does not work (throws TypeNotFound), make sure to use an up-to-date version of PowerShell.
dotnet tool update --global PowerShell

(we have it soon in the docs)

This Solved the issue, updating PowerShell. is the CLI not the preferred method for downloading the browsers now ?
Happy to close this issue

@mxschmitt
Copy link
Member

Yes, we did not continue with advertising the CLI because the CLI injects itself into the global PATH and the PowerShell approach is not global and more relative to the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants