强圆nice 2016-04-24 10:05 采纳率: 55.2%
浏览 1309
已采纳

DefaultSelenium过期了,那用什么代替呢?如图

图片说明

  • 写回答

1条回答

  • _1_1_7_ 2016-06-14 12:22
    关注

    The Selenium Interface and DefaultSelenium Class both belong to Selenium 1 and are deprecated. Selenium has advanced to Selenium 2 (WebDriver) and for this reason these warning messages are displayed to encourage users to stop using old Selenium 1 code and start using Selenium 2 (WebDriver) code.

    To add: This has got nothing to do with your IDE (Eclipse) or your Java version.

    You will want to use the following classes as these are part of Selenium 2 (WebDriver). WebDriver is an interface used by various Selenium 2 drivers.

    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    Then you have various drivers that you can use. RemoteWebDriver / HtmlUnitDriver / FireFoxDriver / ChromeDriver / IEDriverServer etc. You will want to import the driver in your Java class.

    Selenium selenium = new DefaultSelenium();
    Becomes

    WebDriver driver = new TheSpecificDriver();

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败