Browser Driver issues in WSL #1723
Answered
by
mdmintz
agarwalshashwat
asked this question in
Q&A
|
Hi ! I am running WSL instance and trying to do seleniumbase automation testing but the issue is pytest is unable to detect chromedriver or any driver when it is already there is the environment. How to deal with this ? Unable to find any solution online. Attaching the error below |
Answered by
mdmintz
Feb 2, 2023
Replies: 1 comment
|
That error means that SeleniumBase can't find Chrome on your system. (Not the driver). If Chrome isn't located at the usual location, you can change where SeleniumBase looks for it: #1709 Example: pytest test_demo_site.py --binary-location="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"Also as an option for other Syntax Formats: from seleniumbase import Driver
from seleniumbase import js_utils
from seleniumbase import page_actions
driver = Driver(browser="chrome", binary_location="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome")
try:
driver.get("https://seleniumbase.io/apps/calculator")
page_actions.wait_for_element(driver, "4", by="id").click()
page_actions.wait_for_element(driver, "2", by="id").click()
page_actions.wait_for_text(driver, "42", "output", by="id")
js_utils.highlight_with_js(driver, "#output", loops=6)
finally:
driver.quit() |
0 replies
Answer selected by
mdmintz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

That error means that SeleniumBase can't find Chrome on your system. (Not the driver).
If Chrome isn't located at the usual location, you can change where SeleniumBase looks for it: #1709
(for seleniumbase
4.12.3or newer)Example:
pytest test_demo_site.py --binary-location="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"Also as an option for other Syntax Formats: