Watir::Exception::UnknownObjectException: unable to locate element
<p><a href="http://i.stack.imgur.com/EhKdx.png" rel="nofollow">This is the drop-down from where I will select the various contract type</a></p>

<p><a href="http://i.stack.imgur.com/q15ri.png" rel="nofollow">This the DIV, UL and LI classes which I have used in the code</a></p>

<pre><code>irb(main):128:0&gt; li_count_in_ul9 = browser.div(:class =&gt; "select2-drop select2-display-none select2-with-searchbox select2-drop-active").ul(:class =&gt; "select2-results").lis(:class =&gt; "select2-results-dept-0 select2-result select2-result-selectable")
=&gt; #&lt;Watir::LICollection:0x000000028ac0d0 @parent=#&lt;Watir::UList:0xfc812aa2 located=false selector={:class=&gt;"select2-results", :tag_name=&gt;"ul"}&gt;, @selector={:class=&gt;"select2-results-dept-0 select2-result select2-result-selectable", :tag_name=&gt;"li"}&gt;
irb(main):129:0&gt; li_count_in_ul9[0].click
Watir::Exception::UnknownObjectException: unable to locate element, using {:class=&gt;"select2-results-dept-0 select2-result select2-result-selectable", :tag_name=&gt;"li", :index=&gt;0}
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-webdriver-0.9.3/lib/watir-webdriver/elements/element.rb:536:in `assert_element_found'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-webdriver-0.9.3/lib/watir-webdriver/elements/element.rb:508:in `assert_exists'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-webdriver-0.9.3/lib/watir-webdriver/elements/element.rb:114:in `click'
        from (irb):129
        from C:/Ruby23-x64/bin/irb.cmd:19:in `&lt;main&gt;'
irb(main):130:0&gt; sleep 5
=&gt; 5
irb(main):131:0&gt;
</code></pre>