Selenium IDE:如何传递变量 [英] Selenium IDE: How to Pass Variables

查看:586
本文介绍了Selenium IDE:如何传递变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网站上有3个不同的帐户,我想每天登录并打印报告.

I have 3 different accounts in a website that I want to login and print a report every single day.

我已经完成了Selenium IDE记录,可以登录并打印报告,但是,每天我必须将变量更改3次(对于3种不同的用户名和密码).

I've done a Selenium IDE recording that allows me to login and print the report, however, every day I have to change the variable 3 times (for the 3 different usernames and passwords).

如何将变量传递给类型"命令的值"字段?

How can I pass a variable to the "value" field of the "type" command?

谢谢.

最好

推荐答案

您可以进行参数化

要进行参数化,您需要创建js文件

For parameterization you need to create js file

例如js文件包含

var username = ["parameterization1@mailinator.com", "parameterization2@mailinator.com");
var password = ["parameterization1", "parameterization2"];

您可以将此JS文件上传到选项">选项...">常规"选项卡> Selenium IDE扩展.

You can upload this JS file to Options > Options... > General tab > Selenium IDE extension.

用于参数化的示例脚本

这篇关于Selenium IDE:如何传递变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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