Selenium IDE: How to Pass Variables

爷,独闯天下 提交于 2019-12-18 11:40:52

问题


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

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?

Thank you.

Best,


回答1:


You can go with parameterization

For parameterization you need to create js file

For eg. Js file contains

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

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

Sample script for parameterization




回答2:


Try this way of using Selenium IDE - http://greenlanternautomationframework.blogspot.com/p/selenium-ide.html



来源:https://stackoverflow.com/questions/11588508/selenium-ide-how-to-pass-variables

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!