这只是点击网站上的登录链接。什么可以修复这个。 我在这个HTML中没有看到任何iFrame使用。所有都在li标签下。
@BeforeClass
public void Beforetest() throws IOException
{
try
{
driver = new FirefoxDriver();
info = new Properties();
msg = new Properties();
fismsgs = new FileInputStream(System.getProperty("user.dir")+"/src/test/resources/files/errorMsg.properties");
fis = new FileInputStream(System.getProperty("user.dir") + "/src/test/resources/files/info.properties");
msg.load(fismsgs);
info.load(fis);
lp = PageFactory.initElements(driver,LoginPage.class);
driver.get(info.getProperty("url").toString());
}
catch(Exception e)
{
Reporter.log("required things could not be initialized");
Reporter.log(e.getMessage());
}
}
@Test(priority = 1)
public void validLogin()
{
System.out.println("Yes!");
List <WebElement> loginLink = driver.findElements(By.xpath("//a[@class='_2k0gmP']"));
System.out.println("Number of link"+""+ loginLink.size());
loginLink.get(6).click();
}