强圆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 gradio的web端页面格式不对的问题
  • ¥15 求大家看看Nonce如何配置
  • ¥15 Matlab怎么求解含参的二重积分?
  • ¥15 苹果手机突然连不上wifi了?
  • ¥15 cgictest.cgi文件无法访问
  • ¥20 删除和修改功能无法调用
  • ¥15 kafka topic 所有分副本数修改
  • ¥15 小程序中fit格式等运动数据文件怎样实现可视化?(包含心率信息))
  • ¥15 如何利用mmdetection3d中的get_flops.py文件计算fcos3d方法的flops?
  • ¥40 串口调试助手打开串口后,keil5的代码就停止了