获取错误-Permission被拒绝在执行selenium代码时访问属性“H”

时间:2016-08-15 07:39:40

标签: selenium selenium-webdriver selenium-rc

这只是点击网站上的登录链接。什么可以修复这个。 我在这个HTML中没有看到任何iFrame使用。所有都在li标签下。

Here's the link to the HTML of the page

@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();
}

0 个答案:

没有答案