Hi ,

Could you please guide through on selecting the menu item from the drop
down list for a input type = "text"

*HTML CODE FOR THE TEXT FIELD:*

<div>

       <label id="ADR_lbl_JQ_CITY" class="floatlabel"
for="txt_JQ_CITY">City/Town/Suburb</label>

               <input id="ADR_txt_JQ_CITY" class="ui-autocomplete-input"
type="text" style="width:336px;" name="ADR$txt_JQ_CITY" autocomplete="off"
role="textbox" aria-autocomplete="list" aria-
                  haspopup="true">

</div>

*ELMENT INSPECTED THROUGH FIREBUG (FOR THE DROP DOWN LIST):*


<ul class="ui-autocomplete ui-menu ui-widget ui-widget-content
ui-corner-all" role="listbox" aria-activedescendant="ui-active-menuitem"
style="z-index: 4993; top: 177px; left: 464.4px; display: block; width:
  344px;">

     <li class="ui-menu-item" role="menuitem">
             <a class="ui-corner-all" tabindex="-1">

                       AARONS PASS (NSW 2850)
              </a>
      </li>

</ul>

Please advise which command can be used to select the option .

Thanks.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/af8763fb-6999-4f0f-b895-4bcd97fc61ec%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Vsharma at Nov 1, 2013 at 6:38 am
    Hi Riya,

    I am a beginner too ...this is what I did may be it helps u
    Steps can be performed like this
    1)driver.findElement(By.xpath("xyz")).sendkeys(); > Here u type the text
    2)Now go for list<webelement> as when u type text u may have
    text1,text2...so on
    eg:-List<WebElement> examples = driver.findElements(By.xpath("Path/a"));
    3)Go in loop
    for(WebElement dropdown:examples)
    {
    if ("AARONS PASS (NSW 2850)".equals(dropdown.getText()))
    {
    dropdown.click();
    break;
    }
    }

    Thanks
    Vaibhav
    On Thursday, October 31, 2013 7:00:28 AM UTC+5:30, Riya Shetty wrote:

    Hi ,

    Could you please guide through on selecting the menu item from the drop
    down list for a input type = "text"

    *HTML CODE FOR THE TEXT FIELD:*

    <div>

    <label id="ADR_lbl_JQ_CITY" class="floatlabel"
    for="txt_JQ_CITY">City/Town/Suburb</label>

    <input id="ADR_txt_JQ_CITY" class="ui-autocomplete-input"
    type="text" style="width:336px;" name="ADR$txt_JQ_CITY" autocomplete="off"
    role="textbox" aria-autocomplete="list" aria-
    haspopup="true">

    </div>

    *ELMENT INSPECTED THROUGH FIREBUG (FOR THE DROP DOWN LIST):*


    <ul class="ui-autocomplete ui-menu ui-widget ui-widget-content
    ui-corner-all" role="listbox" aria-activedescendant="ui-active-menuitem"
    style="z-index: 4993; top: 177px; left: 464.4px; display: block; width:
    344px;">

    <li class="ui-menu-item" role="menuitem">
    <a class="ui-corner-all" tabindex="-1">

    AARONS PASS (NSW 2850)
    </a>
    </li>

    </ul>

    Please advise which command can be used to select the option .

    Thanks.
    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/def3594f-d5da-4bba-ab41-22211d597ef7%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedOct 31, '13 at 9:09a
activeNov 1, '13 at 6:38a
posts2
users2
websiteseleniumhq.org

2 users in discussion

Vsharma: 1 post Riya Shetty: 1 post

People

Translate

site design / logo © 2022 Grokbase