Robot Framework 文本字段清除和输入

Kse*_*eva 3 automation input textfield robotframework selenium2library

我正在使用 Robot Framework 自动化网页。该页面具有异常的文本字段,这些字段会在输入无效值时按 Enter接收自动输入(不是占位符值)。

这是文本字段:

<div class="bound_value">
	<input id="ember475" size="5" type="text" class="ember-view ember-text-field">
	<input id="ember476" type="checkbox" class="ember-view ember-checkbox">
</div>
Run Code Online (Sandbox Code Playgroud)

我尝试过处理Input TextPress Key。我是一个初学者程序员,所以请原谅我的措辞。

  • 使用Input Text:行为就像我单击字段,清除内容,按 Enter 然后输入值。

  • 使用Press Key的行为就像我点击了字段 add 刚刚输入的输入添加到我已经包含的内容中。

Clear Element Text + Press Key 的工作方式与Input Text相同。

我需要一种方法来单击文本字段,删除内容,不按 Enter 键,输入文本,然后按 Enter 键。

如何使用 RIDE 自定义库执行此操作?

预先感谢您的努力。

小智 6

您是否尝试过使用关键字Clear Element Text

 Clear Element Text  xpath=//input[@id='ember475']
Run Code Online (Sandbox Code Playgroud)

更多信息在这里http://robotframework.org/Selenium2Library/doc/Selenium2Library.html#Clear%20Element%20Text