2012-11-11 15 views
0

我正在编写一个WPF应用程序的编码ui。 该项目包含约30测试和在测试initilaize我有提交登录的方法。 的问题是,在某些情况下,我得到的错误:编码的ui - 无法执行'SetProperty'到文本框

Microsoft.VisualStudio.TestTools.UITest.Extension.PlaybackFailureException was unhandled by user code 
    Message=Cannot perform 'SetProperty of Text with value "admin"' on the control. Additional Details: 
TechnologyName: 'UIA' 
ControlType: 'Edit' 
AutomationId: 'UserName' 

大多数的犯规发生这个错误的时间。

我很难找到bug一致性。

我可以说,如果我将重新启动代理服务,并将运行30测试 - 我不会有这个错误。 但如果我将运行10测试 - 没有服务重新启动 - 再次运行10测试我将有可能性错误重现。

完整的错误日志:

Microsoft.VisualStudio.TestTools.UITest.Extension.PlaybackFailureException was unhandled by user code 
    Message=Cannot perform 'SetProperty of Text with value "admin"' on the control. Additional Details: 
TechnologyName: 'UIA' 
ControlType: 'Edit' 
AutomationId: 'UserName' 

    Source=Microsoft.VisualStudio.TestTools.UITesting 
    BasicMessage=Cannot perform 'SetProperty of Text with value "admin"' on the control. 
    HResult=-268111863 
    Action=SetProperty of Text with value "admin" 
    ObjectName=UserName 
    StackTrace: 
     at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowComException(COMException innerException, IPlaybackContext context) 
     at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(SystemException exception, IPlaybackContext context) 
     at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(SystemException exception, String actionName, UITestControl uiControl) 
     at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(SystemException exception, String actionName, Object parameterValue, UITestControl uiControl) 
     at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.SetPropertyValue(String propertyName, Object propertyValue) 
     at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.SetProperty(String propertyName, Object value) 
     at Microsoft.VisualStudio.TestTools.UITesting.WpfControls.WpfEdit.set_Text(String value) 

    InnerException: System.Runtime.InteropServices.COMException 
     Message=Exception from HRESULT: 0xF004F006 
     Source=Microsoft.VisualStudio.TestTools.UITest.Playback 
     ErrorCode=-268111866 
     StackTrace: 
      at Microsoft.VisualStudio.TestTools.UITest.Playback.Engine.IScreenElement.SetValueAsEditBox(String bstrNewValue, Int32 nSetValueAsEditBoxFlag) 
      at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.SetValueAsEditBox(String value, Boolean isEncoded, Int32 flag) 
      at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.SetValueAsEditBox(String value, Boolean isEncoded) 
      at Microsoft.VisualStudio.TestTools.UITesting.TechnologyElementPropertyProvider.SetValueAsEditBox(UITestControl uiControl, String value, Boolean isEncoded, Boolean useCopyPaste) 
      at Microsoft.VisualStudio.TestTools.UITesting.WpfPropertyProvider.SetEditProperty(String propertyName, Object value) 
      at Microsoft.VisualStudio.TestTools.UITesting.WpfPropertyProvider.SetPropertyValue(UITestControl uiControl, String propertyName, Object value) 
      at Microsoft.VisualStudio.TestTools.UITesting.UITestPropertyProvider.SetPropertyValueWrapper(UITestControl uiControl, String propertyName, Object value) 
      at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.SetPropertyValue(String propertyName, Object propertyValue) 
     InnerException: 

回答

0

这个问题与IE浏览器。您可能想要通过卸载IE的更新版本来临时考虑解决方法。
为此,
(1)打开IE简介
(2)点击复选框,上面写着 “自动卸载IE新版本更新”
(3)单击确定。
此新版本(KBxxxxxxxx)是作为安装更新的Windows安全更新提供的。您可能需要暂时考虑解决方法,但请注意,您将卸载重要的安全更新。