SeleniumHQ / selenium-google-code-issue-archive

Archive, please see main selenium repo
https://github.com/seleniumhq/selenium
345 stars 195 forks source link

Web Driver cannot be run with IE9 #3062

Closed lukeis closed 8 years ago

lukeis commented 8 years ago

Originally reported on Google Code with ID 3062

Before filing an issue, please read the page at
IE opened with "This is the initial start page for the WebDriver server." but doesn't
follow to needed URL

Selenium version: 2.15
OS: WIN7 - 64
Browser: ie9
Brower version:9

Eclipse:
Dec 13, 2011 4:10:48 PM org.openqa.selenium.remote.RemoteWebDriver execute
INFO: Executing: [null, newSession {"desiredCapabilities":"Capabilities [{platform=WINDOWS,
ensureCleanSession=true, browserName=internet explorer, version=}]"}]
Dec 13, 2011 4:10:50 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when processing
request: The target server failed to respond
Dec 13, 2011 4:10:50 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: Retrying request
Dec 13, 2011 4:10:50 PM org.openqa.selenium.remote.RemoteWebDriver execute
INFO: Executing: [fa123e21-3209-448a-b070-2c6d155fe490, getCurrentWindowHandle {}]
Dec 13, 2011 4:10:50 PM org.openqa.selenium.remote.RemoteWebDriver execute
INFO: Executing: [fa123e21-3209-448a-b070-2c6d155fe490, executeScript {"script":"if
(window.screen) { window.moveTo(0, 0); window.resizeTo(window.screen.availWidth, window.screen.availHeight);};","args":[]}]

Reported by ygrunin on 2011-12-14 08:21:02

lukeis commented 8 years ago

Reported by jmleyba on 2011-12-18 01:14:03

lukeis commented 8 years ago
The project has an extensive set of tests that are consistently run against IE9, so
saying that WebDriver does not work with IE9 in a global sense is inaccurate. The log
you posted in the issue report does not appear to include a call to the get() method
(or its equivalent in whatever language binding you use). Can you please provide the
test code you are using along with the URL you are trying to navigate to?

Reported by james.h.evans.jr on 2011-12-19 10:10:25

lukeis commented 8 years ago

    @Parameters({ "browser" })  
    @BeforeClass
    (groups = "part1" )
    public void setup(String browser) throws Exception {

        // You may use any WebDriver implementation.
        //TODO IE /Chrome don't work properly
        if (browser.equals("iexplore"))
        {
             driver = new InternetExplorerDriver();

            Reporter.log("Internet Explorer browser started.");
        }

        if (browser.equals("chrome"))
        {
            driver = new ChromeDriver();
            driver.get("http://lab.xxxxxx.com");
            Reporter.log("Chrome browser started.");
        }

        if (browser.equals("firefox"))
        {
            driver = new FirefoxDriver();
            Reporter.log("Firefox browser started.");
        }

        if (browser.equals(""))
        {
            Reporter.log("No browser specified in testng.xml.");
        } 

        // A "base url", used by selenium to resolve relative URLs
        String baseUrl = "http://lab.xxxxx.com";

        // Create the Selenium implementation
        selenium = new WebDriverBackedSelenium(driver, baseUrl);

        //this is how to start it with Selenium RC server
        //selenium = new DefaultSelenium("localhost", 4444, "*firefox C:\\Program Files (x86)\\Mozilla
Firefox\\firefox.exe", "http://lab.xxxxx.com");
        //selenium = new DefaultSelenium("localhost", 4444, "*iexplore  C:\\Program Files
(x86)\\Internet Explorer\\iexplore.exe", "http://lab.xxxxx.com");
        //selenium.start();

        selenium.addLocationStrategy("jquery",
                "var loc = locator; " +
                "var attr = null; " +
                "var isattr = false; " +
                "var inx = locator.lastIndexOf('@'); " +
                "if (inx != -1){ " +
                "   loc = locator.substring(0, inx); " +
                "   attr = locator.substring(inx + 1); " +
                "   isattr = true; " +
                "} " +
                "var found = jQuery(inDocument).find(loc); " +
                "if (found.length >= 1) { " +
                "   if (isattr) { " +
                "       return found[0].getAttribute(attr); " +
                "   } else { " +
                "       return found[0]; " +
                "   } " +
                "} else { " +
                "   return null; " +
                "}"
        );
        selenium.windowMaximize();
        selenium.windowFocus();

    }

    @DataProvider(name = "DP_LOGIN_EMP")
    public Object[][] createData_LOGIN_EMP() throws Exception{
        Object[][] retObjArr=getTableArray(ExcelFilePath,
                "Login", "loginEmp");
        return(retObjArr);
    }

    @Test  (dataProvider = "DP_LOGIN_EMP", groups = "part1") 
    public void LoginEmployer(String dd_username, String dd_password, String dd_usertype,
String dd_firstname, String dd_fullname) throws InterruptedException
    {

        String s;
        Reporter.log(Utils.testStart("LoginEmployer"));
        selenium.open("/SignIn/LogOn");

        Reporter.log("Username/Password: '" + dd_username + " / " + dd_password + "'");
        Thread.sleep(3000);
        selenium.click("jquery=#UserName");
        selenium.type("jquery=#UserName", dd_username);
        selenium.type("Password", dd_password);

Reported by ygrunin on 2011-12-20 06:55:17

lukeis commented 8 years ago
I tried running example from "The Book of Geb" , which navigates to google and searches
for wikipedia. following is the code 
import geb.*
import org.openqa.selenium.*
import org.openqa.selenium.firefox.FirefoxDriver
import org.openqa.selenium.ie.InternetExplorerDriver
import spock.lang.*

Browser.drive{
    autoclearcookies=false

    new InternetExplorerDriver()
    go "http://www.google.com"

    $("input",name: "q").value("wikipedia")
    $("input",name:"btng").click()

    waitFor{title.endswith("Google Search") }

    def firstLink=$("li.g",0).find("a.1")
    assert firstLink.text()=="wikipedia"

    firstLink.click()

    waitFor{title=="wikipedia" }
}

one of the issues i faced initially was the program didn't open internet explorer then
i found out  protected mode needs to be disabled. after i disabled it i ran the program
again which opened IE however it just says "This is the initial start page for the
WebDriver server." and tries navigating to http://localhost:48031/ [note every time
the port number changes]

other weirder thing is after it opens internet explorer it also opens Firefox and executes
rest of program [note :i dont call firefoxdriver]

attaching error log

Reported by srdvchandran on 2012-02-28 05:59:04


lukeis commented 8 years ago
I am having the exact same issue as well. First started with the Protected mode -> I
fixed that. Then I run into IE9 always opening the localhost page. I installed Selenium
2.2 and also Selenium Server. I am using Eclipse.

Reported by artez.hermez on 2012-03-23 16:08:15

lukeis commented 8 years ago
Hi,

Firstly i want to mention that it's ok that localhost:PORTNUMBER page is opened. That
is how webdriver works.

1) @ygru...

Sorry, but i'm not able to reproduce your issue.
At log from initial post i don't even see a try to open any URL. More information is
required.
MInimized from your code test is attached and it doesn't produce any errors on selenium
2.25.
Could you update selenium and reproduce issue or provide more information?

2) @srdvchan...

As i can see from attached log your test failed at "waitFor{title.endswith("Google
Search")}" line
due 5 seconds timeout. Could you encrease timeout or use another not so complex as
Google page as example?

I have no experience with geb so i cannot help with your test code. Also i don;t know
is it true or not but maybe firefox is started because of:

import org.openqa.selenium.firefox.FirefoxDriver

?

3) @artez.he...

If you still have some problem please update selenium up to last version - it's 2.25
now.
If problem is still unresolved then please provide example URL or HTML code of your
page,
your test script and adittional details like version of IE etc.
It'd be fine if you'll report it in another issue.

Reported by a.u.savchuk on 2012-07-21 07:28:08


lukeis commented 8 years ago
Closing the issue due to inactivity. If it is still actual please ask to reopen.

Reported by barancev on 2012-12-11 23:28:27

lukeis commented 8 years ago

Reported by luke.semerau on 2015-09-17 18:14:23