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

Running selenium with .Net #6

Open
karpikpl opened this issue Nov 1, 2022 · 0 comments
Open

Running selenium with .Net #6

karpikpl opened this issue Nov 1, 2022 · 0 comments

Comments

@karpikpl
Copy link

karpikpl commented Nov 1, 2022

Hi @anthonychu,
I've been trying to follow your example and build an azure function with Selenium that uses chromium driver, but it keeps failing to start chrome.

Packages I used:

		<PackageReference Include="Selenium.WebDriver" Version="4.5.1" />
		<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="107.0.5304.6200" />
		<PackageReference Include="Selenium.WebDriverBackedSelenium" Version="4.1.0" />

When I publish/build the application, chromedriver.exe is in the bin\debug and publish directories but azure function throws an exception

unknown error: cannot find Chrome binary OpenQA.Selenium.WebDriverException at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError

I can see that binary is where it supposed to.
I've tested on consumption plans for both windows (chromedriver.exe) and linux (chromedriver). Any suggestions on the solution?

Error on premium app service plan Linux is slightly different and says that it could not start chrome service on port xxxx.
image

Repository with full code: https://github.com/karpikpl/selenium-azure-functions

--update

For playwright to work I had to run

/site/wwwroot/.playwright/node/linux-x64# ./playwright.sh install --with-deps

but playwright expects a different directory:
Exception while executing function: RunPlaywright Driver not found: /home/site/.playwright/node/linux-x64/playwright.sh so I had to copy .playwright to /home/site for it to work

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

No branches or pull requests

1 participant