Skip to content
This repository was archived by the owner on Nov 29, 2018. It is now read-only.
This repository was archived by the owner on Nov 29, 2018. It is now read-only.

WebDriver is not working properly with pages after HTTP redirect in IE? #232

@lukeis

Description

@lukeis

Originally reported on Google Code with ID 232

Browser: IE
Version: 7
Operating System: WinXP SP2
WebDriver Java client version: 0.6.964

Example code:

    public static void main(String[] args) {
        InternetExplorerDriver webDriver = new InternetExplorerDriver();
        try {
            webDriver.get("http://apphost:8888/SecuredAction.jsp");
            // webDriver.get("http://www.google.com");
            WebElement inputUserName = webDriver.findElement(By.name
("username"));
            WebElement inputPassword = webDriver.findElement(By.name
("password"));
...
        } catch(Exception e) {
            e.printStackTrace();
        } finally {
            webDriver.quit();
        }
    }

The code above is working with error:

org.openqa.selenium.NoSuchElementException: Unable to find element by name 
using "username" (16) (no document found)
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', 
java.version: '1.6.0_03'
Driver info: driver.version: ie
    at org.openqa.selenium.ie.ErrorHandler.verifyErrorCode
(ErrorHandler.java:60)
    at org.openqa.selenium.ie.Finder.handleErrorCode(Finder.java:206)
    at org.openqa.selenium.ie.Finder.findElementByName(Finder.java:143)
    at org.openqa.selenium.By$4.findElement(By.java:146)
    at org.openqa.selenium.ie.Finder.findElement(Finder.java:194)
    at org.openqa.selenium.ie.InternetExplorerDriver.findElement
(InternetExplorerDriver.java:261)

When user is not logged in, then there will be redirect to other host with 
login page. Login page has "username" and "password" fields. Login page 
appears in the IE during this code execution.
Also the calls webDriver.getTitle() or webDriver.getPageSource() return 
empty strings, though the login page is showing in the browser.

But same code above for google.com site is working fine...
Code above is working fine for Firefox and HtmlUnit implementation



Reported by Krapivin914 on 2009-08-25 13:06:31

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions