首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何修复“拒绝访问属性‘文档’的权限”?

如何修复“拒绝访问属性‘文档’的权限”?
EN

Stack Overflow用户
提问于 2011-07-19 04:22:17
回答 1查看 2.7K关注 0票数 0

在使用selenium进行自动化测试时,我遇到了这个问题。我只是在遵循教程中的步骤。下面是代码(与教程相同):

代码语言:javascript
复制
[TestFixture]
public class SeleniumTest
{
    private ISelenium selenium;
    private StringBuilder verificationErrors;

    [SetUp]
    public void SetupTest()
    {
        selenium = new DefaultSelenium("localhost", 4444, @"*custom D:\Program Files (x86)\Firefox 4\firefox.exe", "http://www.google.com/");
        selenium.Start();
        verificationErrors = new StringBuilder();
    }

    [TearDown]
    public void TeardownTest()
    {
        try
        {
            selenium.Stop();
        }
        catch (Exception)
        {
            // Ignore errors if unable to close the browser
        }
        Assert.AreEqual("", verificationErrors.ToString());
    }

    [Test]
    public void TheGoogleTest()
    {
        selenium.Open("/");
        selenium.Type("lst-ib", "selenium");
        try
        {
            Assert.IsTrue(selenium.IsTextPresent("Selenium - Web Browser Automation"));
        }
        catch (AssertionException e)
        {
            verificationErrors.Append(e.Message);
        }
    }
}

当我运行测试时,我的firefox-5浏览器弹出,url如下所示:

http://www.google.com/selenium-server/core/RemoteRunner.html?sessionId=507c2d6ec7214587984f0f86148e9ff5&multiWindow=true&baseUrl=http%3A%2F%2Fwww.google.com%2F&debugMode=false

我认为url应该是http://localhost:4444,并更改了url (剩下的)。现在打开一个selenium页面(右边是命令)。然后它打开了google页面,但之后就什么都没有了。nunit向我展示了测试用例失败的原因:拒绝访问属性“文档”的权限

有什么想法吗?提前谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-07-20 04:21:31

有人在sqa.stackexchange.com上回答了

我试过用"*chrome D:\Program Files (x86)\Firefox 4\firefox.exe",它看起来很管用。

引用上述链接的话:

这里的

指的是火狐浏览器,并在java脚本安全限制上提升了安全权限.

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6742271

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档