如何DataDrive我需要输入密码的测试 [英] How to DataDrive the tests where i need to give the input as Password

查看:94
本文介绍了如何DataDrive我需要输入密码的测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

播放时我需要参数化密码并确认密码字段(对于这些字段,它必须从.csv文件中获取输入)。在我的CSV文件中,我有


密码   Confirmpassword


75319              75319


但当我这样做时


   this 。UIMap。 CardsForgottonInternetIDParams.UITextboxscreenreadertEditPassword = TestContext.DataRow [ " Password" ]。ToString ();

 



 



this 。UIMap.CardsForgottonInternetIDParams.UITextboxscreenreadertEdit1Password = TestContext.DataRow [ "确认密码" ]。ToString();


并回放它我得到错误:


测试方法CardsForgotInternetID.CardsForgotInternetID.CardsForgotInterntID引发异常:
Microsoft.VisualStudio.TestTools.UITest.Extension.DecodingFailedException:尝试解码加密文本时发生以下错误:错误数据。


Datadriven测试结果:


数据行:0


其中密码和确认密码字段不是接受CSV文件中的值。在文本框中,它只需要*****。那么我需要做的是为了让密码/确认密码接受这些值?


谢谢

解决方案

 Keyboard.SendKeys(this.UIMap.CardsForgottonInternetIDParams.UITextboxscreenreadertEdit1Password,TestContext.DataRow [" Password"]。ToString();); 

尝试执行上述操作后即可使用。 CUIT不接受密码控制的纯文本。您也可以记录/生成密码控件中设置的值,并将该加密值复制到CSV中。


谢谢,


Vishnu


while play back i need to parametrise the password and confirm password field ( for these field it has to take the input from the .csv file) . In my CSV file iam having

Password   Confirmpassword

75319             75319

But when i do

  this.UIMap.CardsForgottonInternetIDParams.UITextboxscreenreadertEditPassword = TestContext.DataRow["Password"].ToString();

 

 

this.UIMap.CardsForgottonInternetIDParams.UITextboxscreenreadertEdit1Password = TestContext.DataRow["Confirm Passcode"].ToString();

and play back it i got the error :

Test method CardsForgotInternetID.CardsForgotInternetID.CardsForgotInterntID threw exception:
Microsoft.VisualStudio.TestTools.UITest.Extension.DecodingFailedException: The following error occurred while attempting to decode encrypted text: Bad Data.

Datadriven test result :

Data row : 0

Where Password and Confirm password fields is not accepting the value in the CSV file. In the text box it will only takes *****. So what i need to do in order password/Confirm password accept the values?

Thanks

解决方案

Keyboard.SendKeys(this.UIMap.CardsForgottonInternetIDParams.UITextboxscreenreadertEdit1Password, TestContext.DataRow["Password"].ToString(););

Try doing the above and it will work. CUIT doesn't accept plain text for a password control. You can alternatively record/generate the value set in the password control and copy that encrypted value in your CSV.

Thanks,

Vishnu


这篇关于如何DataDrive我需要输入密码的测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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