[sikuli]-sikuli与用户的交互

 

popup ( text [title ] )

Display a dialog box with an OK button and text as the message. The script then waits for the user to click the OK button.

Parameters:
  • text – text to be displayed as message
  • title – optional title for the messagebox

Example:

popup("Hello World!\nHave fun with Sikuli!")

A dialog box that looks like below will popup (Note: n can break a line).

_images/popup.png
input ( [ text ] [default ] )

Display a dialog box with an input field, a Cancel button, and an OK button. The optional text can be displayed as a caption. The script then waits for the user to click either the Cancel or the OK button.

Parameters:
  • text – optional text to be displayed as message
  • default – optional preset text for the input field (new in later then X-1.0rc3)
Returns:

 

the text, contained in the input field, when the user clicked OK

None, if the user pressed the Cancel button

 

Example:

name = input("Please enter your name to log in:")

name = input("Please enter your name to log in:", "anonymous") # a preset input text
_images/input.png

A dialog box that looks like above will appear to allow the user to interactively enter some text. This text is then assigned to the variable name, which can be used in other parts of the script, such as paste(name) to paste the text to a login box.

When using the parameter default, the text input field will be pre-populated with the given text, so the user might just click OK/Cancel or edit the content of the input field.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值