Incorrectly Spelled Property Working But Correctly Spelled Property Not Working

45 views
Skip to first unread message

Lee Cal

unread,
May 28, 2024, 1:25:35 AMMay 28
to Selenium Users
All, I am revisiting my Java skills to learn Selenium testing automation. I have this weird issue. The code in screenshot works fine. However, if you notice, the spelling of the property (mark black) is incorrect ('v' in wevdriver.chrome.driver). When I corrected it to the correct spelling ('b' in webdriver.chrome.driver), it’s returning the error below which does not make sense because the driver is in the folder mentioned (and it works with incorrectly spelled property). Here's what I have tried:
  1. 1. I even tried running it again with the incorrectly spelled property and it's working correctly.
  2. 2. I have tried setting the incorrectly spelled property to null and use the correctly spelled property but it does not help.
Any help is appreciated. Exception in thread "main" org.openqa.selenium.remote.NoSuchDriverException: Unable to obtain: chromedriver, error chromedriver must exist: <DIRECTORY STRUCTURE REMOVED>../SeleniumPractice/Testing/Drivers For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location/ Build info: version: '4.21.0', revision: '79ed462ef4' System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '14.5', java.version: '22.0.1' Driver info: driver.version: ChromeDriver


SiKing

unread,
May 28, 2024, 1:44:42 PMMay 28
to Selenium Users
Something else is setting the property correctly for you.

Try this:
  1. Using your working code - in your case with the *incorrect* spelling
  2. Add the following on line 13 of your code: System.out.println(System.getProperty("webdriver.chrome.driver"); // with the *correct* spelling here!
  3. Rerun your code.

Lee Cal

unread,
May 28, 2024, 4:27:08 PMMay 28
to seleniu...@googlegroups.com
Hi, thanks. I tried and it's still returning null. And, just to be sure, I printed before and after the working setter (incorrectly spelled). Furthermore, since it appears to be null, I tried to use the correctly spelled driver name as a setter but still getting the same error message.

Screenshot 2024-05-28 at 4.20.00 PM.png

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/QMm8krIDLak/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/2c5ea988-c61e-40df-90de-03653a5f976cn%40googlegroups.com.

SiKing

unread,
May 29, 2024, 1:19:14 PMMay 29
to Selenium Users
The only other explanation that I can think of is that (another?) chromedriver is already installed somewhere on your PATH.
From commandline you could try running `chromedriver --version` and see what the response is.
Reply all
Reply to author
Forward
0 new messages