System.setProperty is not recogonized in Eclipse.

0 votes
package demo;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver.SystemProperty;
import org.openqa.selenium.io.*;

public class one 
{
    System.setProperty("webdriver.chrome.driver","c:\\chromedriver\\chromedriver.exe");
    WebDriver driver = new ChromeDriver();
    driver.manage().window().maximize();
    driver.get("http://google.com");
}
Jan 21 in Selenium by anonymous
260 views
Can you please tell the complete error you are facing?

2 answers to this question.

0 votes
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class One {

    public static void main(String[] args)
    {
        System.setProperty("webdriver.chrome.driver", "C:\\Users\\priyaj_Kumar\\Downloads\\chromedriver.exe");
        WebDriver driver = new ChromeDriver();
        driver.get("https://www.google.com");

    }

}

This code works fine without any error. Your code is also similar so can you please tell more about your error?

answered Jan 21 by Priyaj
• 56,540 points
+1 vote
Try adding the selenium jar files to your package. It will work fine. That could be the most common error I can think of.
answered Feb 4 by Shashank
• 1,350 points
@Shashank yes that could be a probable reason. good observation
Thank you priyaj.

Related Questions In Selenium

0 votes
1 answer
0 votes
2 answers

Getting Error in System.setProperty of ChromeDriver

System.setProperty("webdriver.chrome.driver", ...READ MORE

answered Jan 8 in Selenium by anonymous
2,174 views
0 votes
1 answer

Check that the element is clickable or not in Selenium WebDriver

Use Selenium Waits: WebDriverWait ...READ MORE

answered Jun 12, 2018 in Selenium by Meci Matt
• 9,420 points
8,687 views
0 votes
1 answer
0 votes
1 answer

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,090 points
592 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
901 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
580 views
0 votes
2 answers

What is the output of Usability Testing?

Usability testing = navigation + context testing. The ...READ MORE

answered Feb 14 in Selenium by Shashank
• 1,350 points
29 views