我有一个类:函数库,我在构造函数中实例化 webdriver 实例,如下所示
public class FunctionLibrary {
public WebDriver driver;
public FunctionLibrary(WebDriver driver)
{
driver = new FirefoxDriver();
this.driver=driver;
}
public WebDriver getDriver(){
return this.driver;
}
}
我正在访问扩展超类的子类中的 webdriver 实例:函数库
public class Outlook extends FunctionLibrary{
public Outlook(WebDriver driver) {
super(driver);
}
@Before
public void testSetUp()
{
getDriver().navigate().to("https://google.com");
}
@After
public void closeTest()
{
getDriver().close();
}
@Test
public void openOutlookAndCountTheNumberOfMails()
{
System.out.println("executed @Test Annotation");
}
}
当我执行上面的junit代码时,我收到错误
java.lang.Exception:测试类应该只有一个公共零参数构造函数
任何人都可以让我在哪里出错