在运行Selenium IDE脚本时来自用户的手动输入 [英] Manual input from user while running selenium IDE script

查看:90
本文介绍了在运行Selenium IDE脚本时来自用户的手动输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用户可以在运行Selenium IDE脚本时进行手动输入吗? 对于前.如果有名称字段,那么每次脚本运行时我们都可以打开输入框,以便用户可以输入其名称字段吗?

can user is able to give manual input while running selenium IDE script? For ex. If there is name field then can we open input box everytime script runs so that user can give his input for name field?

让我知道是否可行.

如果是,请给我建议解决方案.

If yes then please suggest me a solution.

预先感谢

推荐答案

您可以使用以下脚本来调用javascript提示以获取值

You can use the following script to invoke a javascript prompt in order to get the value

<tr>
    <td>storeEval</td>
    <td>prompt(&quot;Please enter your FirstName&quot;)</td>
    <td>firstName</td>
</tr>

然后访问值是使用${firstName}的情况.

Then accessing the value is a case of using ${firstName}.

自Selenium IDE 2.5.0起,脚本需要如下所示:

Since Selenium IDE 2.5.0, the script needs to look like this:

<tr>
    <td>storeEval</td>
    <td>javascript{prompt(&quot;Please enter your FirstName&quot;)}</td>
    <td>firstName</td>
</tr>

这篇关于在运行Selenium IDE脚本时来自用户的手动输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆