Webdriver exception | Selenium Forum
M
Posted on 24/02/2016
Hi,

I am getting the following exception intermittently, we are using Fluentlenium:

org.openqa.selenium.WebDriverException: org.openqa.selenium.remote.RemoteWebElement cannot be cast to java.util.List

I cant post the code here :(
However I have checked in my code to make sure that I am not doing anything like the following:

List<WebElement> fields = (List<WebElement>) driver.findElement(By.xpath("//input[@type='text']"));

please help!

M
Replied on 24/02/2016

use this

List<WebElement> fields = driver.findElement(By.xpath("//input[@type='text']"));


M
Replied on 03/03/2016

use this

List<WebElement> fields = driver.findElement[color=#00BF00:xvccnnf0][b:xvccnnf0]s[/b:xvccnnf0][/color:xvccnnf0](By.xpath("//input[@type='text']"));