SendKeys(Keys.ARROW_DOWN)无法用于选择Google Map API下拉菜单

时间:2019-06-11 10:44:35

标签: java selenium

我需要在将文本传递到文本框中时,从google map API动态产生的建议中选择第一个下拉值。我已经尝试了以下代码,但是actions.sendKeys(Keys.ARROW_DOWN)无法正常工作。请帮助

public void enterFeilds(String Attribute0,WebElement Attribute1)
    {
        waitForVisible(driver,Attribute1);--fuction to wait untill element become visible
        Actions actions=new Actions(driver);
        actions.moveToElement(Attribute1);--passed the web element here
        actions.click();
        actions.sendKeys(Attribute0).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ENTER);
        actions.build().perform();

    }

0 个答案:

没有答案