首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >构造函数RemoteWebDriver(URL,DesiredCapabilities)未定义

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

Stack Overflow用户
提问于 2019-12-19 13:21:58
回答 1查看 155关注 0票数 0

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

‘package GridLearnings;

代码语言:javascript
复制
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);



    }

}

EN

回答 1

Stack Overflow用户

发布于 2019-12-19 14:47:25

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

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

收件人:import java.net.URL

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59403688

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档