简体   繁体   English

在 Selenium 中使用随机值

[英]Using random values in Selenium

Is it possible to instruct Selenium to use a randomly generated value (name) for further testing?是否可以指示 Selenium 使用随机生成的值(名称)进行进一步测试?

I have only just started using Selenium and have very little knowledge on the program.我刚刚开始使用 Selenium,对该程序知之甚少。 I have created a script that generates a random name, I want to be able to take this name and include it in another test我创建了一个生成随机名称的脚本,我希望能够采用此名称并将其包含在另一个测试中

hope this makes sense!希望这是有道理的! appreciate anyone's input感谢任何人的投入

Capture the random name to a string and make it static.将随机名称捕获为字符串并使其成为静态。 Use in other tests by calling it.通过调用它在其他测试中使用。

Can you please post some code where exactly you stuck?你能在你卡住的地方发布一些代码吗? Are you using Selenium Webdriver?你在使用 Selenium Webdriver 吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM