Need to collect all the values inside a drop-down list

22 views
Skip to first unread message

ADITYA GAURAV

unread,
Mar 16, 2017, 1:05:44 PM3/16/17
to Geb User Mailing List
Hi,

I just got stuck in a scenario where I need to collect all the text values from a drop-down list. WHAT IS THE BEST WAY TO DO THAT? Any help will be really helpful.

def textFromDropDown = $('LOCATOR OF DROP-DOWN LIST').text()

Will this work?
Thanks,
Aditya
 

Raja Rajan

unread,
Apr 14, 2017, 4:30:41 AM4/14/17
to Geb User Mailing List
Hi , 

Hope this would help you.

 def textFromDropDown = $('LOCATOR OF DROP-DOWN LIST').allElements()*.text() 


Thanks,

Rajarajan C

Raja Rajan

unread,
Apr 14, 2017, 4:30:45 AM4/14/17
to Geb User Mailing List
Hi , 

Hope this would help you.

 def textFromDropDown = $('LOCATOR OF DROP-DOWN LIST').allElements()*.text() 


Thanks,

Rajarajan C

                


On Thursday, 16 March 2017 22:35:44 UTC+5:30, ADITYA GAURAV wrote:
Reply all
Reply to author
Forward
0 new messages