- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java Selenium Chromedriver.exe Does not Exist IllegalStateException
An IllegalStateException is thrown while working with Chrome browser if the chromedriver.exe file path is set incorrectly in the method System.setProperty. Once this executable file is downloaded, it has to be extracted. Then its path should be copied and added as a parameter to the System.setProperty method.
Syntax
System.setProperty("webdriver.chrome.driver", "C:\Users\ghs6kor\Desktop\DebomitaJava\chromedriver.exe")
Also, it must be remembered that, for Windows, we have to specify the .exe extension while including the path. But it is not required for Mac or Ubuntu. We should also ensure that the chromedriver.exe file that we are using is compatible with the local Chrome browser version.
Let us see an example for IllegalStateException.
Example
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.concurrent.TimeUnit; public class PathChromeDriver{ public static void main(String[] args) { //path of chromedriver.exe set System.setProperty("webdriver.chrome.driver", "C:\Users\ghs6kor\Desktop\Java\chromedriver.exe"); WebDriver driver = new ChromeDriver(); //implicit wait driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); //launch URL driver.get("https://www.tutorialspoint.com/about/about_careers.htm"); System.out.println("Page title is: " + driver.getTitle()); driver.quit(); } }
Output
- Related Articles
- How do I verify that an element does not exist in Selenium 2?
- Does NOT EQUAL exist in MySQL?
- MySQL create user if it does not exist?
- Insert records in MongoDB collection if it does not exist?
- Select from table where value does not exist with MySQL?
- Create view in MySQL only if it does not already exist?
- MongoDB query to determine if a specific value does not exist?
- How can I create a python directory if it does not exist?
- How to create a folder if it does not exist in C#?
- Add object to array in JavaScript if name does not already exist?
- When will be an IllegalStateException (unchecked) thrown in Java?
- When do IllegalStateException and IllegalArgumentException get thrown? in java?
- How can I check if some text exist or not in the page using Selenium?
- How can I create a directory if it does not exist using Python?
- Insert array where element does not exist else update it (with multiple conditions)?

Advertisements