Currently i am trying to parse a sample site.
In that site there is a which set to "display :none"
in order to apply css effects. I mean in fact that select
component is visible.
How can i set value to that html select component ?
Here is my code :
WebElement element = driver.findElement(By.name("paper"));
Select paperList = new Select(element);
paperList .selectByValue("73"); // it gives error
I am using Java + Selenium WebDriver 2.0
Here is the exception :
Caused by: org.openqa.selenium.remote.ErrorHandler
$UnknownServerException: Element is not currently visible and so may
not be interacted with Build info: version: '2.14.0', revision:
'unknown', time: '2011-11-29 13:13:16' System info: os.name: 'Windows
XP', os.arch: 'x86', os.version: '5.1', java.version: '1.7.0-ea'
------ EDIT ------
Here's an example:
Find the UI element exactly with all the //div attributes helped me to locate element in every run. Include all attributes to find element like class name, text, style etc.
please update your selenium stand alone server to 2.35.0 or more if available. the jar file needs to be updated. I had the same issue and I was using jar file version 2.33.0 and as soon as I updated /downloaded the new selenium stand-alone-server jar file of 2.35.0 , it solved my issue.