I have tried all the possible things. also, tried searching over tried different combinations and variations. I can get the element clicked which opens the dropdown. but i am not able to select an option in it. I tried with actions, sendkeys, keys.down/enter and multiple things as well. however, it didn't help. That's the only thing I am stuck on.

//selecting office


// attempt with actions
Actions actions = new Actions(driver);

// attempt with sendKeys

driver.findElement(By.id("DG5QEPn")).sendKeys("RTP HQ"); 

// attempt with Keys.Down and Keys.Enter

enter image description here

  • It will be good if you give HTML DOM code instead of screenshot Jul 11 '20 at 1:37
  • <div class="css-fx5u20 react-select__value-container react-select__value-container--has-value"><div class="css-o6m1t9-singleValue react-select__single-value">RTP HQ</div><div class="css-1g6gooi"><div class="react-select__input" style="display: inline-block;"><input autocapitalize="none" autocomplete="off" autocorrect="off" id="select_input_Office" spellcheck="false" tabindex="0" type="text" aria-
    – Safaee
    Jul 13 '20 at 15:08
  • Please add this in your answer Jul 13 '20 at 16:11

Below code worked for me

WebElement selectMyElement = driver.findElement(By.id("DG5QEPn"));



Actions keyDown = new Actions(driver); keyDown.sendKeys(Keys.chord(Keys.DOWN, Keys.DOWN, Keys.ENTER)).perform();

  • Yes, this worked for me. Whereas just doing selectMyElement.sendKeys(Keys.DOWN); over and over did not work. You need to create the Action and use the Keys.chord. THANK YOU.
    – nettie
    Jul 22 at 14:31

Try to use javascript click which will click on the element given it is present unlike the webdriver selenium click which needs the element to be displayed first.

driver.executeScript("arguments[0].click();", element)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.