CodedUI测试失败 - 单元测试适配器无法连接到数据源 [英] CodedUI Test Failure - unit test adapter failed to connect to the data source

查看:127
本文介绍了CodedUI测试失败 - 单元测试适配器无法连接到数据源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过DataSource属性将XML附加到我的CodedUI测试方法时出现以下错误:

I get the following error when attaching my XML to my CodedUI test method through the DataSource attribute:

单元测试适配器无法连接到数据源或读取数据。有关解决此错误的详细信息,请参阅"数据驱动的单元测试疑难解答"。 ( http://go.microsoft.com/fwlink/?LinkId=62412
in MSDN Library。

错误详细信息:对象引用未设置为对象的实例。

The unit test adapter failed to connect to the data source or to read the data. For more information on troubleshooting this error, see "Troubleshooting Data-Driven Unit Tests" (http://go.microsoft.com/fwlink/?LinkId=62412) in the MSDN Library.
Error details: Object reference not set to an instance of an object.

但如果我删除< sendkeys>或将其移动到另一个位置,它工作正常。 它与< sendkeys>有关。节点位于< Continue>的第三个实例中节点。

But if I remove the <sendkeys> or move it to another location, it works fine.  It has to do with the <sendkeys> node being in the third instance of the <Continue> node.

 

<?xml version="1.0" encoding="utf-8" ?>
<iterations>
 <iteration>
  <InitialOrder>
 <Continue>
  <value>Click</value>
 </Continue>
 </InitialOrder>
  <ProductOrderForm_Buttons>
    <Continue>
  <value>Click</value>
    </Continue>
  </ProductOrderForm_Buttons>
 <ProviderSelection>
 <Continue>
  <sendkeys target="parent" keys="{PageDown}"/>
  <value>Click</value>
   </Continue>
 </ProviderSelection>
 </iteration>
</iterations>

推荐答案

xml的格式不正确。您需要将SendKeys元素添加到所有Continue元素。请参阅
http://msdn.microsoft.com/en- us / library / 3b4194wc(v = VS.71).aspx  有关xml格式的详细信息。
The xml is not in correct format. You will need to add SendKeys element to all Continue elements. See http://msdn.microsoft.com/en-us/library/3b4194wc(v=VS.71).aspx for details on the xml formats.


这篇关于CodedUI测试失败 - 单元测试适配器无法连接到数据源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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