在调用assertEquals校验的时候,遇到了Warning:The method assertEquals(String, String) from the type Assert is deprecated(大意说Assert类下的assertEquals方法调用被禁止),代码如下:
public void explictedWaitTest(){
try {
WebElement textInputBox=(new WebDriverWait(driver, 10))
.until(new ExpectedCondition<WebElement>() {
@Override
public WebElement apply(WebDriver d){
return d.findElement(By.id("text"));
}
});
Assert.assertEquals("今年夏天西瓜相当甜!",textInputBox.getAttribute("value"));
} catch (NoSuchElementException e) {
e.printStackTrace();
}
}
解决办法:需要导入包org.junit.Assert,在导入那里加上import org.junit.Assert;就好了