硒1文本框自动填充

| 我正在尝试为Google搜索自动填充 以下是我根据Google搜索结果和一些博客条目尝试的代码 我只发布要输入文字的代码
selenium.open(\"/\");
selenium.type(\"q\", \"banga\");
selenium.typeKeys(\"q\", \"lore\");
selenium.keyDown(\"q\", \"\\\\13\");
selenium.waitForCondition(\"selenium.isTextPresent(\'bangalore\')\", \"60000\");
任何对此的建议/建议都会有所帮助 此代码/方法不会自动填充搜索框 我正在IE8中尝试     
已邀请:
selenium.type(\"q\", \"bangalore\")
selenium.Click(//div[2]/div/div/table/tbody/tr[2]/td/b) //selects 2nd option from the Autofill dropdown
。 对于IDE。将此html插入您的源代码中。
<tr>
    <td>click</td>
    <td>//div[2]/div/div/table/tbody/tr[2]/td/b</td>
    <td></td>
</tr>
    
尝试这个。它将打开首页,键入\“ bangalore \”,单击“搜索”,然后等待:
selenium.open(\"/\");
selenium.type(\"q\", \"bangalore\");
selenium.clickAndWait(\"btnG\");
selenium.waitForCondition(\"selenium.isTextPresent(\'bangalore\')\", \"60000\");
    
您是否尝试过使用“选择”选项从自动填充中选择值? 或在要在搜索框中选择的元素上使用\“ click \”命令?     

要回复问题请先登录注册