Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
730 views
in Technique[技术] by (71.8m points)

chrome Webdriver can't be resolved to a type error eclipse and java

Im trying to do some automation projects with chrome, java and selenium and having problems importing the chrome driver.

package main;

import org.openqa.selenium.*;

public class SitePoster {

    public static void main(String[] args) {
         //System.setProperty("webdriver.chrome.driver", "./pathtodriver");
        WebDriver driver = new ChromeDriver();
        //Getting error saying "ChromeDriver can't be resolved to a type"
    } 

}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

chrome Webdriver can't be resolved to a type error eclipse and java:-

I was getting same problem with selenium -java 3.141.59 on macOs.Check below steps to resolve issue:-

  1. Create a new Java Project >class >Create Class name
  2. Right click on Project >Property > Build path > Libraries
  3. Add external Jars to Classpath download from selenium client & web driver language binding.
  4. Apply and Close.

Hope you got your Issue fixed. Kindly reply back in case of any issue.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...