ElementNotVisible Exception | Selenium Forum
M
Posted on 19/11/2015
Hi ,

In one of my application I am trying to scroll to an element.
I have to test it on both browsers IE 10 and Chrome 40

I have used the following code

WebElement elementpincode =driver.findElement(By.cssSelector("input[id*='0Address_Postcode']"));
Actions action = new Actions(driver);
// Click on the PostCode
action.moveToElement(elementpincode).click().perform();
//Type PostCode
elementpincode.sendKeys("HP2 4NW");

This works fine for chrome but for IE its giving ElementNotVisible Exception error (its not scrolling to the control)

M
Replied on 19/11/2015

ie driver has a lot problems/bugs.

i would like you to add a wait statement. and try again.


M
Replied on 01/12/2015

I tried using wait but this did not help.

Please see the error details I get in Eclipse :

Exception in thread "main" org.openqa.selenium.ElementNotVisibleException: Element is not displayed (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 784 milliseconds
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 02:56:46'
System info: host: 'rav-dsk-397', ip: '192.168.6.63', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_31'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.usePerProcessProxy=false, ignoreZoomSetting=false, handlesAlerts=true, version=9, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:3944/, takesScreenshot=true, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=dismiss}]
Session ID: d5299bf8-caa3-45c2-b30b-f1fa43013cec
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:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:273)
at org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:94)
at LoginEngage.main(LoginEngage.java:75)


M
Replied on 01/12/2015

change security setting in ie.

Internet option>>security tab.


M
Replied on 03/12/2015

I have already done the Enable Protected mode settings in the security tab of IE.

This does not help


M
Replied on 03/12/2015

iedriver has a lot bugs try changing the version of iedriver.exe


M
Replied on 10/12/2015

tried with the latest version but that does not help


M
Replied on 11/12/2015

use ie 8 its stable. the other version are not stable.