构造函数RemoteWebDriver(URL,DesiredCapabilities)未定义

问题描述 投票:0回答:1

此行有多个标记-构造函数RemoteWebDriver(URL,DesiredCapabilities)未定义-构造函数URL(String)未定义

'打包GridLearnings;

import org.openqa.selenium.Platform;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.Test;

import com.gargoylesoftware.htmlunit.javascript.host.URL;

public class GridSample  {

    @Test
    public void TestLogin()
    {
        DesiredCapabilities cap= DesiredCapabilities.chrome();
        cap.setBrowserName("Chrome");
        cap.setPlatform(Platform.ANY);

        RemoteWebDriver d =new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"),cap);



    }

}

'

java selenium selenium-chromedriver selenium-grid
1个回答
0
投票

[RemoteWebDriver接受URL作为参数,但来自java.net程序包的URL。

更改import com.gargoylesoftware.htmlunit.javascript.host.URL;

至:import java.net.URL

© www.soinside.com 2019 - 2024. All rights reserved.