2

I need to automate the selection for a multidrop down box in selenium. The html code which comprises the dropdown is given below. The html code for each component is taken using firebug.

<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" id="s2id_autogen346" tabindex="-1" placeholder="" style="width: 269px;" aria-activedescendant="select2-result-label-367">

I have the aria-activedescendant="select2-result-label-367" value is changing when i change the select value in the list

enter image description here

enter image description here

rouis
  • 21
  • 5

1 Answers1

1

As per the HTML you have shared to select the multidrop down box you can use the following line of code :

driver.findElement(By.xpath("//li[@class='select2-search-field']//input[@class='select2-input' and contains(@id,'id_autogen')]")).click();
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • I have this erreur : org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (256, 183). Other element would receive the click:
      ...
    – rouis Dec 07 '17 at 14:14
  • this my htm form:
    – rouis Dec 07 '17 at 14:17
  • Great !!! So your original Question of **automate the selection for a multidrop down box** is resolved now. Please **`Accept`** the **`Answer`** by clicking on the tick mark beside my Answer. For **Element is not clickable at point** see this QA [Selenium Web Driver & Java. Element is not clickable at point (36, 72). Other element would receive the click:](https://stackoverflow.com/questions/44912203/selenium-web-driver-java-element-is-not-clickable-at-point-36-72-other-el/44916498#44916498) – undetected Selenium Dec 07 '17 at 14:18
  • Can you help me to make this test please ? – rouis Dec 07 '17 at 14:22
  • how can i select KOKOKO value please :
  • – rouis Dec 07 '17 at 16:08
  • @rouis Can you raise a new Question with your new requirement please? Thanks – undetected Selenium Dec 07 '17 at 16:11