Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3313104
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:04:34+00:00 2026-05-17T22:04:34+00:00

I am having any issue with selecting any item from the drop down. Below

  • 0

I am having any issue with selecting any item from the drop down. Below is the HTML from our site. The HTML looks like this

<div class="x-form-field-wrap x-trigger-wrap-focus" 
id="ext-gen157" style="width: 170px;"><input type="hidden" 
id="parentEntity" name="parentEntity" value=""><input type="text" 
id="cmbParentEntityId" autocomplete="off" size="24" class=" 
x-form-text x-form-field x-form-focus" style="width: 145px;">
<img class="x-form-trigger x-form-arrow-trigger" 
src="../ext/resources/images/default/s.gif" id="ext-gen158"></div>

So I have created a watir code which looks like this:

@browser.text_field(:id,"cmbParentEntityId").set("1")

which search for all the accounts starting with 1.Once the value is set to 1, the drop down is showing only accounts starting with 1. Below is the HTML code from the drop down

 <div class="x-combo-list-inner" id="ext-gen336" style="width: 
248px; overflow: auto; height: 40px;"><div class="x-combo-list-item  
x-combo-selected">10_12_2010</div><div 
class="x-combo-list-item ">10_13_2010</div></div>

Based on the above code I have created the Watir code

@browser.div(:class => "x-combo-list-inner", :text => "10_12_2010").click

But nothing is happening, I have searched the web but couldn’t find any answers, I really appreciate that if anyone can help me to point to right direction.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:04:34+00:00Added an answer on May 17, 2026 at 10:04 pm

    What do you mean that nothing is happening? If i try the code provided by you, then i’ll get an expected UnknownObjectException:

    irb(main):003:0> b.div(:class => "x-combo-list-inner", :text => "10_12_2010").click
    Watir::Exception::UnknownObjectException: Unable to locate element, using {:class=>"x-combo-list-inner", :text=>"10_12_2010"}
            from c:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/element.rb:57:in `assert_exists'
            from c:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/element.rb:315:in `enabled?'
            from c:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/element.rb:62:in `assert_enabled'
            from c:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/element.rb:259:in `click!'
            from c:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/element.rb:229:in `click'
            from (irb):3
    

    That is because you’re trying to find a div element with a class of “x-combo-list-inner” and a text of “10_12_2010”. There isn’t such an element. See this:

    irb(main):007:0> b.div(:class => "x-combo-list-inner").text
    => "10_12_2010\r\n10_13_2010"
    

    Text of “x-combo-list-inner” includes texts for every child element. You could search for that particular child element like this:

    irb(main):008:0> b.div(:class => "x-combo-list-inner").div(:text => "10_12_2010").html
    => "\r\n<DIV class=\"x-combo-list-item  &#13;&#10;x-combo-selected\">10_12_2010</DIV>"
    

    Or with regexps:

    irb(main):009:0> b.div(:class => "x-combo-list-inner", :text => /10_12_2010/).text
    => "10_12_2010\r\n10_13_2010"
    

    And when it comes to clicking then you have to know which exact div you need to click – is it the first one, or the second one. Also, if nothing happens then you have to find out what JavaScript events are binded to these elements exactly and then fire events manually:

    irb(main):010:0> div = b.div(:class => "x-combo-list-inner").div(:text => "10_12_2010")
    => #<Watir::Div:0x5846088 located=false how={:text=>"10_12_2010"} what=nil>
    irb(main):013:0> div.fire_event("onmousedown")
    => nil
    irb(main):014:0> div.fire_event("onmouseup")
    => nil
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having yet another WPF binding issue. Just when I think I've got this
Are there any conflicts with having any combination of Visual Studio 2003, 2005 and/or
I'm interfacing with a payment gateway and not having any luck with Net::SSLeay and
Has anybody any successful remarks about having a team working via Remote Desktop? In
Having the hours and minutes, is there any easier or better way to set
Is there any shorthand way of defining and using generic definitions without having to
Is there any way to print an OOXML document (.docx file) without having MS
Is there any way to install Setuptools for Python 2.6 in Windows without having
Are there any free libraries that would print to a PDF without actually having
Is there any way to force an update of software using RunOnce, without having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.