一尘不染

selenium驱动程序无法解析导入

selenium

我正在尝试导入WebDriver和ChromeDriver,尝试了所有的尝试,但没有运气

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

public class TestChrome {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        System.setProperty("webdriver.chrome.driver", "/home/vikas/Downloads/chromedriver.exe");

        // Initialize browser
        WebDriver driver=new ChromeDriver();


        // Open Google
        driver.get("http://www.google.com");

        // Maximize browser

        driver.manage().window().maximize();
    }

}

摆脱错误

The import org.openqa.selenium.WebDriver cannot be resolved
The import org.openqa.selenium.chrome.ChromeDriver cannot be resolved

阅读 753

收藏
2020-06-26

共1个答案

一尘不染

硒罐必须添加到项目中以标识接口org.openqa.selenium.WebDriver和类org.openqa.selenium.chrome.ChromeDriver

硒下载链接:http :
//www.seleniumhq.org/download/

2020-06-26