Having an error while picking the WebElement in Collect 'List' class!

18 views
Skip to first unread message

javel...@gmail.com

unread,
Apr 20, 2018, 7:27:28 PM4/20/18
to Selenium Users
Dear Selenium user, 

I am having the following error while saving the WebElements in List class any suggestions what should I do?? 


""" The type List is not generic; it cannot be parameterized with arguments <WebElement> """"""" 

Please find the attached screenshot.. 

I will greatly appreciate any help!! 

Java lover and selenium learner ... 



error in selenium.JPG

Santhu

unread,
Apr 21, 2018, 5:41:51 AM4/21/18
to seleniu...@googlegroups.com
Use findelements instead of findelement.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/03bc4279-12e6-476b-94e3-7a887e50bc4e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Java Learner

unread,
Apr 21, 2018, 8:53:26 AM4/21/18
to seleniu...@googlegroups.com
Thanks for your help and also ... It is working now by writing in this way.. 

java.util.List<WebElement> allRows = Class_03_27_2018.driver
.findElements(By.xpath("//div[@id='ui-datepicker-div']//table//tbody//tr"));

I am interested to write the code like this... 
List<WebElement> allRows = Class.driver
.findElements(By.xpath("//div[@id='ui-datepicker-div']//table//tbody//tr"));

and import the java.util.. under the class.. How I can do that?? 

Thanks! 
Java leaner

On Sat, Apr 21, 2018 at 2:42 AM, Santhu <rgsa...@gmail.com> wrote:
Use findelements instead of findelement.

On Sat, Apr 21, 2018, 4:57 AM <javel...@gmail.com> wrote:
Dear Selenium user, 

I am having the following error while saving the WebElements in List class any suggestions what should I do?? 


""" The type List is not generic; it cannot be parameterized with arguments <WebElement> """"""" 

Please find the attached screenshot.. 

I will greatly appreciate any help!! 

Java lover and selenium learner ... 



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/HJLNXsXOCOE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAGPWr3gXU6Rn%3DSUOQXQPtXKPFqc-qXKjOH2jeoEtRc5s4NPYng%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages