microsoft / playwright-dotnet

.NET version of the Playwright testing and automation library.
https://playwright.dev/dotnet/
MIT License
2.47k stars 235 forks source link

Exe encouter issue "The path is empty. (Parameter 'path')" when publish as single file format. #1069

Closed ScottHuangZL closed 3 years ago

ScottHuangZL commented 3 years ago

I complete one automation, it is work where if not publish as single file., I mean it is work if publish with multiple .dlls + main exe

I try to publish as single exe: dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true The publish itself is work.

However, when I click the main exe, it would show error with message "The path is empty. (Parameter 'path')"

I think need assign a path for Playwright.CreateAsync , but what is the path string I need provided??**** I try as . or same _browsersPath(rread from setting file, usually as ms-playwright, both not work.

using var playwright = await Playwright.CreateAsync( browsersPath: _browsersPath, //I can set as current sub folder "ms-playwright" after manual copy browser folders driverExecutablePath: "What path I need put here??" );

ScottHuangZL commented 3 years ago

I find it can set as "./playwright-cli.exe", issue closed.