SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
29.73k stars 8.02k forks source link

[🐛 Bug]: selenium.common.exceptions.InvalidArgumentException: Message: binary is not a Firefox executable #14159

Open Davidgithub1 opened 1 week ago

Davidgithub1 commented 1 week ago

What happened?

I followed the instruction on https://www.selenium.dev/documentation/webdriver/getting_started/first_script/ using ubuntu on AWS EC2 I got the error: selenium.common.exceptions.InvalidArgumentException: Message: binary is not a Firefox executable

Are you able to get this to work on Ubuntu on AWS EC2?

How can we reproduce the issue?

from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Firefox()

driver.get("https://www.selenium.dev/selenium/web/web-form.html")

title = driver.title

driver.implicitly_wait(0.5)

text_box = driver.find_element(by=By.NAME, value="my-text")
submit_button = driver.find_element(by=By.CSS_SELECTOR, value="button")

text_box.send_keys("Selenium")
submit_button.click()

message = driver.find_element(by=By.ID, value="message")
text = message.text

driver.quit()

Relevant log output

I got the error: selenium.common.exceptions.InvalidArgumentException: Message: binary is not a Firefox executable

Operating System

Ubuntu

Selenium version

4.21.0

What are the browser(s) and version(s) where you see this issue?

Firefox and Chrome

What are the browser driver(s) and version(s) where you see this issue?

tutorial doesnt mention these? What am I supposed to do?

Are you using Selenium Grid?

No response

github-actions[bot] commented 1 week ago

@Davidgithub1, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

github-actions[bot] commented 1 week ago

We need more information about this issue in order to troubleshoot.

Please turn on logging and re-run your code. Information on how to adjust logs for your language can be found in our Troubleshooting documentation.