System setProperty String String is showing System is not applicable for the arguments

0 votes
System.setProperty("webdriver.chrome.driver","C:\Users\Sradha\Downloads\chromedriver.exe");

This is not accepting the above string. Can someone help?
Dec 26, 2018 in Selenium by Sradha
• 1,760 points
1,948 views

1 answer to this question.

0 votes

You are correct that it requires (String,String) the one that you have provided, / is considered as escape character. When you provide the path it contains / but in order for program to understand you must use //. 

Hence, instead of writing 

System.setProperty("webdriver.chrome.driver","C:\Users\Sradha\Downloads\chromedriver.exe");

if you use 

System.setProperty("webdriver.chrome.driver","C:\\Users\\Sradha\\Downloads\\chromedriver.exe");

This will work fine.

answered Dec 26, 2018 by Rashmi

Related Questions In Selenium

0 votes
2 answers

System.setProperty is not recogonized in Eclipse.

Try adding the selenium jar files to ...READ MORE

answered Feb 5, 2019 in Selenium by Shashank
• 1,370 points
6,880 views
0 votes
0 answers
0 votes
1 answer
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,151 views