在测试开始之前通过弹出窗口传递参数 [英] passing parameters through a popup before test begins
问题描述
好吧,现在,我设置一个测试,其中用户名/通行证/位置值将根据用户的输入动态,一旦用户获得他们的信息, 我需要在测试运行之前弹出一个命令提示符,用户可以手动输入username / pass /
ect,测试可以使用这些参数来运行测试。 并且创建它并将其集成到测试运行中的参考将是有帮助的
ok so right now, im setting up a test where user name/pass/location values will be dynamic based upon input from user, well once user gets their info generated, I need a command prompt to popup before the test run that user can manually put in username/pass/ ect and the test can use those parameters to run the test with. and references to create that and itergrate it into the test run would be helpful
所以下面是将登录到应用程序的基本代码,我需要能够获得提示对于 用户名//密码// locaton因为它会被生成而我们现在无法自动获取该信息(需要在回归测试运行之前进行一些手动测试
)
so below is basic code that will log into out app, and i need to be able to get a prompt that asks for username//password//locaton because it will be generated and We are unable to automate grabbing that info for right now (requires some manual testing before regression test run)
  ;
[
TestMethod
TestMethod
]
]
public
void
public void
iOTestMethod1()
iOTestMethod1()
{
//登录
这个 .login.loginParams.UIUSER_NAMEEditText
=( " Wbooo" );
//用户名
this.login.loginParams.UIUSER_NAMEEditText = ("Wbooo"); //username
这个 .login.loginParams.UIPasswordEditPassword
= 播放 。EncryptText( " bob"
this.login.loginParams.UIPasswordEditPassword = Playback.EncryptText("bob"
); //密码
); //password
这个 .login.loginParams.UIClient_numberEditText
=( " NC"
this.login.loginParams.UIClient_numberEditText = ("NC"
); // location
); //location
//登录
login.login();
login.login();
}
推荐答案
我有在测试运行之前需要设置许多不同的设置,我创建了一个标准表单然后在测试开始时我写了一些东西。
I had a number of different settings that needed to be set before the test ran and i created a standard form and then at the begining of the test i wrote something along the lines of.
  ;
if(!settings.IsAlreadySet)
{
Form myForm = new Form(Settings);
myForm.ShowDialog();
}
//Use settings here
//Note when you use the password you will probably have to do something like
this.UIMap.LoginParams.PasswordSendKeys = Playback.EncryptText(settings.password);
这篇关于在测试开始之前通过弹出窗口传递参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!