Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I posted it on Someone suggested me to post it here...

While trying to automate testing with selenium rc I ran into this problem. I was just following the steps in the tutorials. Here is the code (same as tutorials):

public class SeleniumTest
    private ISelenium selenium;
    private StringBuilder verificationErrors;

    public void SetupTest()
        selenium = new DefaultSelenium("localhost", 4444, @"*custom D:\Program Files (x86)\Firefox 4\firefox.exe", "");
        verificationErrors = new StringBuilder();

    public void TeardownTest()
        catch (Exception)
            // Ignore errors if unable to close the browser
        Assert.AreEqual("", verificationErrors.ToString());

    public void TheGoogleTest()
        selenium.Type("lst-ib", "selenium");
            Assert.IsTrue(selenium.IsTextPresent("Selenium - Web Browser Automation"));
        catch (AssertionException e)

When I run the test, my firefox-5 browser pops up and the url looks like this:

I thought the url should be http://localhost:4444 and changed the url (leaving the rest). Now a selenium page(RemoteRunner.html ) opens up (with commands on the right). It then opens the google page, but nothing after that. And nunit shows me the test case failed, stating the reason: Permission denied to access property 'document'

Any idea? Thanks in advance.

share|improve this question
Welcome to the site! I'm curious: you say firefox-5 pops up, but your file path appears to point to firefox-4 - typo, or something more? – corsiKa Jul 19 '11 at 17:19
it is not typo. I had ff4, and I upgraded it from ff menu. It shows me ff5, but the installed folder name is ff4, :) – mshsayem Jul 20 '11 at 3:14
It seems that there's a bug in recent Selenium's FirefoxDriver - 2.52.0 shows this – Ondra Žižka Mar 14 at 16:46
up vote 2 down vote accepted

Can you instantiate you selenium object as ?

selenium = new DefaultSelenium("localhost", 4444, "*chrome", "");

Here *chrome refers to firefox browser and has elevated security privileges on java script security restrictions.

share|improve this answer
wow! I tried with "*chrome D:\Program Files (x86)\Firefox 4\firefox.exe" and seems it is working. Great! My searching, trial and error works of 2 days comes to end. many many thanks! – mshsayem Jul 20 '11 at 3:21
:) glad it helped – Tarun Jul 20 '11 at 3:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.