[英]Can't press enter in selenium2library
I'm trying to make a test that will open Facebook, log in and search something. 我正在尝试进行测试,以打开Facebook,登录并搜索某些内容。 However I'm having trouble getting Facebook to search.
但是我很难让Facebook搜索。 Selenium types whatever it needs in the search bar, but I can't find how to locate the search button or press the enter key.
硒可以在搜索栏中键入所需的任何类型,但是我找不到如何找到搜索按钮或按Enter键的方式。
*** Settings ***
Documentation Tell pui she bitch
Library Selenium2Library
*** Variables ***
*** Test Cases ***
User must tell pui she bitch
open browser http://www.facebook.com
set browser implicit wait 5
input text name=email *****
input text name=pass ****
click button id=u_0_q
input text name=q *****
press key \\13
close browser
*** Keywords ***
Press Key
expects two parameters - the locator, and the actual key; Press Key
需要两个参数-定位器和实际键; you're calling it with only the latter. 您只用后者来称呼它。
Press Key name=q \\13
That should execute pressing an Enter in the search field. 该操作应在搜索字段中按Enter。
Will it work? 能行吗 I don't use FB, can't tell :)
我不使用FB,无法告诉:)
Add the html of the search button - right click on it, Inspect Element, we might be able to get a locator for it. 添加搜索按钮的html-右键单击它,检查元素,我们也许可以找到它的定位器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.