0
org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with
Command duration or timeout: 21 milliseconds
Build info: version: '2.32.0', revision: '6c40c18', time: '2013-04-09 17:22:56'
System info: os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.7.0_25'
Session ID: 16492097-714b-42c4-b9dc-2c3979db180f
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=XP, databaseEnabled=true, cssSelectorsEnabled=true, javascriptEnabled=true, acceptSslCerts=true, handlesAlerts=true, browserName=firefox, browserConnectionEnabled=true, nativeEvents=true, webStorageEnabled=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=22.0}]

The results of the executed scripts are not consistent. Sometimes it passes, and sometime it throws the exception mentioned above.

4
  • I'd suggest trying a delay, either a short Sleep, or a waitforelement. Commented May 1, 2014 at 17:53
  • At the very least it's time to upgrade your versions. v2.32 of Selenium and v22 of Firefox? We are at v2.41 of Selenium and v29 of Firefox. Time to upgrade. Commented May 1, 2014 at 21:59
  • Hi Arran, I am using Mozilla version 28.0 and Selenium 2.32. If I will upgrade it to the new version will my earlier running scripts will run sucessfully? I dont want to get new errors on version upgrade. Please let me know ASAP. Thanks in advance. Commented May 2, 2014 at 5:23
  • Richard I am already using Sleep but its not working with it Commented May 2, 2014 at 5:26

2 Answers 2

0

The script result is not same because the element might talking different amount of time for appear on page.

Using sleep can solve the problem but that is not good practice as you may have to adjust/increase the value if test case failed even after giving sleep.

Better use wait for element functionality.

Refer document @ "http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp" for details

Sign up to request clarification or add additional context in comments.

Comments

0

yes You need to use a conditional wait , so that your code will wait until it locates the element.

For Example:If you are using web-driver

wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("username")));

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.