How to press Down Arrow key followed by “Enter” button in Selenium WebDriver?

后端 未结 6 824
没有蜡笔的小新
没有蜡笔的小新 2021-02-19 05:56

I am using Selenium Java. I need to enter value into text box and press down arrow to select suggestions and then press Enter key.

So, my question is how to press Down A

6条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-19 06:32

    Even you can concatenate both the Down and Enter in a single statement.

    import org.openqa.selenium.Keys
    WebElement.sendKeys(Keys.DOWN + Keys.ENTER);
    

提交回复
热议问题