当我试图通过 TestNG 打开一个站点时,会出现一个安全页面,为此我单击了一个链接文本“继续访问此网站(不推荐)”。我已经通过 TestNG 编码完成了,但它给出了java.lang.NullPointerException错误。
这是我正在尝试的代码......
public class Registration {
WebDriver driver;
WebElement element;
WebElement element2;
WebDriverWait waiter;
@Test(priority = 1)
public void register_With_Cash() throws RowsExceededException, BiffException, WriteException, IOException
{
File file = new File("D:\\IEDriverServer.exe");
System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
driver=new InternetExplorerDriver();
driver.get("https://172.25.155.250/loginpage.aspx");
sleep(10000);
waiter.until(ExpectedConditions.presenceOfElementLocated(By.linkText("Continue to this website (not recommended).")));
driver.findElement(By.linkText("Continue to this website (not recommended).")).click();
sleep(50000);
提前感谢任何帮助。