My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 3218: InternetExplorerDriver.getPageSource() returns empty string
1 person starred this issue and may be notified of changes. Back to list
Status:  Invalid
Owner:  ----
Closed:  Jan 2012

Sign in to add a comment
Reported by, Jan 17, 2012
Hi all,

I'm testing Selenium for using into a project. I'm trying to create a very simple test to be run as JUnit test case. The test loads google main page and try to write something in the textbox. This is my code:

public class SeleniumTest
	private WebDriver driver;
	public void SetUp()
		//driver = new FirefoxDriver();
		driver = new InternetExplorerDriver();
		//driver = new HtmlUnitDriver();
		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
	public synchronized void Test()
		System.out.println("PageSource: " + driver.getPageSource());

When I run the test using FirefoxDriver or HtmlUnitDriver it runs ok, and driver.getPageSource() returns the source of the page. But If I run the test using InternetExplorerDriver, driver.getPageSource() returns an empty string and driver.findElement doesn't find the textbox (I suppose it doesn't loads the page or the page is not loaded yet). Below are the system details and the stack trace that I obtain when I use InternetExplorerDriver. Is anyone else having the same problem? Is something wrong in my configuration? 

Selenium version: 2.17.0
OS: Windows XP
Browser: Internet Explorer
Brower version: 8

Trace: org.openqa.selenium.InvalidSelectorException: The xpath expression '//div/input' cannot be evaluated or does notresult in a WebElement (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 172 milliseconds
For documentation on this error, please visit:
Build info: version: '2.17.0', revision: '15540', time: '2012-01-16 16:52:31'
System info: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.6.0_26'
Driver info: driver.version: RemoteWebDriver
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
	at java.lang.reflect.Constructor.newInstance(
	at org.openqa.selenium.remote.ErrorHandler.createThrowable(
	at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(
	at org.openqa.selenium.remote.RemoteWebDriver.execute(
	at org.openqa.selenium.remote.RemoteWebDriver.findElement(
	at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(
	at org.openqa.selenium.By$ByXPath.findElement(
	at org.openqa.selenium.remote.RemoteWebDriver.findElement(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(
	at org.junit.internal.runners.statements.RunBefores.evaluate(
	at org.junit.internal.runners.statements.RunAfters.evaluate(
	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(
	at org.junit.runners.ParentRunner$
	at org.junit.runners.ParentRunner$1.schedule(
	at org.junit.runners.ParentRunner.runChildren(
	at org.junit.runners.ParentRunner.access$000(
	at org.junit.runners.ParentRunner$2.evaluate(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

Thanks in advance.

Jan 18, 2012
I repeat the same test on a fresh install of Windows XP and it works OK! It should be produced by a Internet Explorer security policy of my company.
Jan 18, 2012
Project Member #2
(No comment was entered for this change.)
Status: Invalid
Sign in to add a comment

Powered by Google Project Hosting