2 u013370108 u013370108 于 2016.04.24 18:05 提问

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

图片说明

1个回答

u011606457
u011606457   2016.06.14 20: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();

u011606457
u011606457 用Selenium 2 (WebDriver)
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!