History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: SRC-497
Type: Bug Bug
Status: Resolved Resolved
Resolution: Won't Fix
Priority: Major Major
Assignee: Unassigned
Reporter: xavs
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Selenium Remote Control

Permission denied to get property Window.document on session FF3

Created: 08/Jul/08 07:22 AM   Updated: 27/Nov/08 06:47 AM
Component/s: Client Driver - Java
Affects Version/s: 1.0
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: windows vista, executing from eclipse a test. Using nightly as the test is mainly for firefox 3.


 Description  « Hide
Got:
Permission denied to get property Window.document on session

when trying to do:
    selenium.isElementPresent("email")

Expected result:
   The field is there so, should be a "true"

code:

import com.thoughtworks.selenium.*;

import java.util.regex.Pattern;

import org.openqa.selenium.server.SeleniumServer;

public class DesktopTest1 extends SeleneseTestCase {

private static final String MAX_WAIT_TIME_IN_MS = "60000";
private static final String BASE_URL = "http://localhost:8085/";
private Selenium selenium;
private SeleniumServer seleniumServer;

public void setUp() throws Exception {
seleniumServer = new SeleniumServer();
//seleniumServer.setProxyInjectionMode(true);
seleniumServer.stop();
seleniumServer.start();
}

public void tearDown() throws Exception {
selenium.stop();
seleniumServer.stop();
}

public void testNewFirefox() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*firefox", BASE_URL);
selenium.start();
body();
selenium.stop();
}

public void testNewExplorer() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*iexplore", BASE_URL);
selenium.start();
body();
selenium.stop();
}


public void body() throws Exception {

selenium.open("http://localhost:8085/desktop/");

selenium.click("//td[3]/table/tbody/tr/td[2]/div");
for (int second = 0;; second++) {
if (second >= 60)
fail("timeout");
try {
if (selenium.isElementPresent("email"))
break;
} catch (Exception e) {
}

Thread.sleep(1000);
}

selenium.type("email", "javier.garcia@saasplex.com");
selenium.click("//button");
selenium.click("//span/input");
selenium.type("username", "admin");
selenium.type("password", "p");
selenium.click("//button");
for (int second = 0;; second++) {
if (second >= 60)
fail("timeout");
try {
if (selenium.isElementPresent("username"))
break;
} catch (Exception e) {
}
Thread.sleep(1000);
}

selenium.type("username", "admin");
selenium.click("//span/input");
selenium.type("password", "password");
selenium.click("//button");
for (int second = 0;; second++) {
if (second >= 60)
fail("timeout");
try {
if (selenium.isElementPresent("icon+Tools"))
break;
} catch (Exception e) {
}
Thread.sleep(1000);
}

selenium.click("//button[@type='button']");
selenium.click("//button");
selenium.click("//td[@id='logoutcaption']/div");
}
}



 All   Comments   Work Log   Change History      Sort Order:
xavs - 08/Jul/08 07:42 AM
the same happens with iexplorer: Error = Access Denied.

xavs - 08/Jul/08 07:48 AM
More info:
The field is there on a iFrame.
Notice that the first call to isElementPresent does not appear to unleash an Exception. Maybe becuase of the asynchronous load of the page.

 Command request: click[//td[3]/table/tbody/tr/td[2]/div, ] on session 802cf307604e4caa8f076530c6118cb2
13:43:07.935 INFO - Got result: OK on session 802cf307604e4caa8f076530c6118cb2
13:43:07.939 INFO - Command request: isElementPresent[email, ] on session 802cf307604e4caa8f076530c6118cb2
13:43:07.948 INFO - Got result: OK,false on session 802cf307604e4caa8f076530c6118cb2
13:43:08.648 INFO - Started SocketListener on 0.0.0.0:64782
13:43:08.950 INFO - Command request: isElementPresent[email, ] on session 802cf307604e4caa8f076530c6118cb2
13:43:08.964 INFO - Got result: ERROR: Selenium failure. Please report to the Selenium Users forum at http://forums.openqa.org, with error details from the log window. The error message is: Permission denied to get property Window.document on session

Andras Hatvani - 13/Jul/08 11:51 AM
Did you search the forum for this issue? Did you try to use selectFrame?

Andras Hatvani - 27/Nov/08 06:47 AM
If the iframe's source points to another (sub)domain, then the access to element properties in it violates cross-site scripting restrictions, thus the exception is correct. Use *chrome or *iehta as they have elevated privileges.