使用CSV或Excel文件进行数据驱动的编码UI自动测试 [英] Data-Driven Coded UI Automated Test with CSV or Excel file
问题描述
大家好,
希望一切顺利。
Hope all goes well.
需要有关数据驱动的编码UI的建议自动化测试创建Visual Studio 2015:
Need advice for Data-driven Coded UI Automated test creation on Visual Studio 2015:
使用我们公司的包计算器提供Excel电子表格。软件包包括4-5列并计算课程,考试等,给出包折扣,添加税,最后总和结果
Have Excel spreadsheet with our company packages calculator. Packages included 4-5 columns and calculates courses, exams, ect., gives package discount, adding Taxes and finally Sum Total result
需要帮助将此文件添加到数据驱动的编码UI自动化测试。编码的UI我在MTM上录制,也通过添加断言使用编码的UI测试生成器。 如果可能的话,需要指示,如果可用的话,需要带有步骤的链接
Need help to add this file to Data-Driven Coded UI Automated test. Coded UI I record on MTM and also using Coded UI Test Builder by adding assertions. If possible, need directions, links with steps if available examples
非常感谢
IK
推荐答案
您好IK,
欢迎来到MSDN论坛。
请按照以下步骤操作:
1 。
创建编码的UI测试(基于您的公司套餐
计算器)
1. Create a coded UI test (based on your company packages calculator)
2.   
创建数据集
注意:需要设置
高级保存选项
style ="margin:0px; font-family:'Calibri',sans-serif; font-weight:normal"> 文件
菜单 。
Note: need to set Advanced Save Options on theFile menu.
3.
添加数据源绑定
3. Add data source binding
4.
使用数据编码的UI测试
您可以获得更多详细信息,请参阅此文档:
https://msdn.microsoft.com/en-us/library/ee624082.aspx?f=255&MSPPError=-2147217396
此外,你可以根据您的情况,选择适当的数据源。
https://msdn.microsoft.com/library/ee624082(vs.110).aspx
Excel数据源如:
DataSource("System.Data.Odbc", "Dsn=Excel Files;Driver={Microsoft Excel Driver (*.xls)};dbq=|DataDirectory|\\Data.xls;defaultdir=.;driverid=790;maxbuffersize=2048;pagetimeout=5;readonly=true", "Sheet1
",DataAccessMethod.Sequential),TestMethod]
", DataAccessMethod.Sequential), TestMethod]
您需要在测试方法之前添加它。
you need add it before your test method.
如果我误解,请告诉我。如果您需要更多帮助,请随时询问。
Please let me know if I misunderstood. And feel free to ask if you need more help.
祝你好运,
Fletch
这篇关于使用CSV或Excel文件进行数据驱动的编码UI自动测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!