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.

IE10 Select object can not select by text or by value. #7785

Open
@lukeis

Description

@lukeis

Originally reported on Google Code with ID 7785

Select select = new Select(driver.findElement(By.id("ctl00_ContentPlaceHolder1_ddlClient")));
         select.selectByVisibleText("1107 local client update");

when I call select.selectByVisibleText, program throw a excpetion as below: 
   Exception in thread "main" org.openqa.selenium.WebDriverException: Cannot click
on option element. Executing JavaScript click function returned an unexpected error,
but no error could be returned from Internet Explorer's JavaScript engine. (WARNING:
The server did not provide any stacktrace information)
Command duration or timeout: 67 milliseconds
Build info: version: '2.42.0', revision: '5e82430', time: '2014-05-22 20:18:33'
System info: host: 'JIM-LI', ip: '10.152.86.15', os.name: 'Windows 7', os.arch: 'x86',
os.version: '6.1', java.version: '1.7.0_60'
Session ID: b7d8ac11-9861-496f-b186-6796cfa4c6c0
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{platform=WINDOWS, javascriptEnabled=true, elementScrollBehavior=0, ignoreZoomSetting=false,
enablePersistentHover=true, ie.ensureCleanSession=false, browserName=internet explorer,
enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss, version=10, ie.usePerProcessProxy=false,
cssSelectorsEnabled=true, ignoreProtectedModeSettings=false, requireWindowFocus=false,
handlesAlerts=true, initialBrowserUrl=http://localhost:9637/, ie.forceCreateProcessApi=false,
nativeEvents=true, browserAttachTimeout=0, ie.browserCommandLineSwitches=, takesScreenshot=true}]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:596)
    at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:268)
    at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:79)
    at org.openqa.selenium.support.ui.Select.setSelected(Select.java:318)
    at org.openqa.selenium.support.ui.Select.selectByVisibleText(Select.java:116)
    at Program.main(Program.java:44)


IE driver server Trace log is in attachment.

Selenium version: 2.42.0
OS: windows 7,32bit
Browser: IE
Browser version: 10


My code is :
         System.setProperty(
                "webdriver.ie.driver",
                "D:/selenium/driverserver/IEDriverServer.exe");
         WebDriver  driver = new InternetExplorerDriver();

     driver.get("http://127.0.0.1/hahah.html");

         WebElement element = driver.findElement(By.id("kw"));
         element.sendKeys("chesse");


         Select select = new Select(driver.findElement(By.id("ctl00_ContentPlaceHolder1_ddlClient")));
         select.selectByVisibleText("1107 local client update");

//        driver.quit();
        System.out.print("aaa");


My html is :
<html>
<body>
<select name="ctl00$ContentPlaceHolder1$ddlClient" id="ctl00_ContentPlaceHolder1_ddlClient"
>
        <option selected="selected" value="-1"> - Select - </option>
        <option value="27920">01_nonglobal_client_test</option>
        <option value="27916">01test_nonglobal_client</option>
        <option value="26308">1 YEAR &amp; MORE PRODUCTION</option>
        <option value="27631">1107 global client check</option>
        <option value="27633">1107 local client update</option>
        <option value="27634">1107 non client 007</option>
</select>       
<input type="text" id="kw"/>
</body>
</html>


Reported by gcyciopes on 2014-08-25 03:35:42


- _Attachment: [driverlog.txt](https://storage.googleapis.com/google-code-attachments/selenium/issue-7785/comment-0/driverlog.txt)_

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions