我有不同的类来实现 ExpectedCondition;其中之一,AttributeContainsCondition,如下所示。在我的测试中,我试图使用条件点之类的东西,并查看 ExpectedCondition 提供的所有方法以及我创建的实现 ExpectedCondition 的所有类。
所以在我的测试中,我试图添加一些东西来从 ExpectedCondition 中获取所有方法以及我创建的所有实现 ExpectedCondition 的类。我正在导入创建类的位置。
public class AttributeContainsCondition implements ExpectedCondition<Boolean>{
private final WebElement element;
private final String attributeName, expectedValue;
public AttributeContainsCondition(WebElement element, String attributeName, String expectedValue){
this.element = element;
this.attributeName = attributeName;
this.expectedValue = expectedValue;
}
public Boolean apply(WebDriver input){
return StringUtils.contains(element.getAttribute(attributeName), expectedValue);
}
}
测试文件:这不起作用
import org.openqa.selenium.support.ui.ExpectedConditions;
public class VerifyInfoTest extends mainTest {
ExpectedConditions condition = new ExpectedConditions<boolean>(); ????
所以如果我使用 condition.xxxx 我应该看到来自 ExpectedConditions 的方法以及我创建的所有实现它的类
谢谢 :)