断言属性返回null

时间:2016-05-11 05:24:46

标签: testing automated-tests coded-ui-tests assertion

我已经为Coded UI开发了Custom Control支持,并且我比较了以下的断言属性值,

Assert.AreEqual(this.AssertMethod2ExpectedValues.UIZoomResetCustomToolBarIconMargin,
 uIZoomResetCustom.ToolBarIconMargin, "Toolbar margin failed");

uIZoomResetCustom.ToolBarIconMargin始终返回null。如何解决此问题。感谢

1 个答案:

答案 0 :(得分:1)

Did you try to debug the tests and/or highlight the toolbar before reaching the assertion? It is quite clear that framework is unable to find the toolbar. Maybe you need to tweak the search properties.