How to put WebElements in a list

cDriver.navigate().to(“http://toolsqa.com/automation-practice-form/”);

List <WebElement>  sList = cDriver.findElement(By.name(“sex”));

 

The above throws an error

Exception in thread “main” java.lang.ClassCastException: org.openqa.selenium.remote.RemoteWebElement cannot be cast to java.util.List
at Demo.main(Demo.java:61)

 

 

Default Asked on December 28, 2018 in Selenium WebDriver.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.