Selenium webdriver 机器人框架无法通过硒库找到元素

Selenium webdriver 机器人框架无法通过硒库找到元素,selenium-webdriver,automated-tests,robotframework,Selenium Webdriver,Automated Tests,Robotframework,我想点击google.com上的一个按钮。但它显示元素'//input[@name=“btnI”]'在5秒后不可见。。有人知道怎么做吗 我还尝试先输入搜索字符串,然后单击按钮,效果很好 *** Settings *** Documentation Robot Framework Example Library SeleniumLibrary Library OperatingSystem Suite Setup Ope

我想点击google.com上的一个按钮。但它显示
元素'//input[@name=“btnI”]'在5秒后不可见。
。有人知道怎么做吗

我还尝试先输入搜索字符串,然后单击按钮,效果很好

*** Settings ***
Documentation       Robot Framework Example
Library             SeleniumLibrary
Library             OperatingSystem

Suite Setup         Open Browser    https://www.google.com/   chrome
Suite Teardown      Close Browser

*** Variables ***

*** Test Cases ***
My Test
    Search Web

*** Keywords ***
Click Doodle Button
    [Documentation]    Click button
    Wait Until Element Is Visible   //input[@name="btnI"]
    Click Element   //input[@name="btnI"]    

Search Web
    [Documentation]    Search Web
    Click Doodle Button
有两个元素正确的元素是第二个,使用上面的定位器

Wait Until Element Is Visible   (//input[@name="btnI"])[2]
Click Element   (//input[@name="btnI"])[2]