# Query : How to Count the Value or No of Items in Select List

**URL:** <https://www.ruby-forum.com/t/query-how-to-count-the-value-or-no-of-items-in-select-list/174456>\
**Category:** Ruby\
**Created:** [August 26, 2009, 11:21pm UTC](https://www.ruby-forum.com/t/query-how-to-count-the-value-or-no-of-items-in-select-list/174456 "2009-08-26T23:21:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rasein](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/46a35a/32.png) [@rasein](https://www.ruby-forum.com/u/rasein)\
**Post date:** [August 26, 2009, 11:21pm UTC](https://www.ruby-forum.com/t/query-how-to-count-the-value-or-no-of-items-in-select-list/174456/1 "2009-08-26T23:21:53Z")

</div>

Hi Everybody…

I am new to Ruby, Watir

i am automating a web based application

1. My web page has Drop down list box or Select list box
2. It has 10 items ( Eg: 10 Diff car names Audi, BMW, Mazda etc) or it  
can contain N of Cars also

Scenario

1. After selecting the car, the page gets refreshed and i have to write  
the details of the car in the Excel sheet …like this it happens for  
every car  
before this i have know No of Car available in the List;
2. After having the Car Count can loop for N no of Cars

is there anyway to Count no of items in the Select List using the VALUE

1st CAR : Value = 0  
2nd CAR : Value = 1  
3rd CAR : Value = 2  
4th CAR : Value = 3

Please help me out

Regards  
Rafiq
