0

コード化されたUIをWPFアプリケーションに書いています。プロジェクトには約30のテストが含まれており、テストの初期化時にログインをコミットするメソッドがあります。問題は、場合によってはエラーが発生することです。

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'

ほとんどの場合、このエラーは発生しません。

バグの一貫性を見つけるのが困難です。

エージェント サービスを再起動して 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:
4

1 に答える 1

0

この問題は IE に関連しています。更新されたバージョンの IE をアンインストールすることで、一時的に回避策を検討することをお勧めします。
このためには、
(1) IE についてを開き
ます (2) 「IE の新しいバージョンの更新プログラムを自動的にアンインストールする」というチェックボックスをクリックします
(3) [OK] をクリックします。
この新しいバージョン (KBxxxxxxxx) は、インストールされた更新プログラムの Windows セキュリティ更新プログラムとして表示されます。一時的に回避策を検討することもできますが、重要なセキュリティ更新プログラムをアンインストールすることになることに注意してください。

于 2014-05-15T04:58:27.973 に答える