私はそのようなコードを書きました:
int timeOut = 300000; //milliseconds
string _displayTextProp = "DisplayText";
WpfText screenResult = MainWindow.UITableStatusControlCustom.ScreenResultLabelValue;
screenResult.WaitForControlExist(timeOut);
screenResult.WaitForControlPropertyNotEqual(_displayTextProp, null, timeOut);
screenResult.WaitForControlPropertyNotEqual(_displayTextProp, "0", timeOut);// (1)
この(1)メソッドでは、例外UITestControlNotAvailableExceptionが発生しました
テストメソッドが例外をスローしました:Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotAvailableException:コントロールが使用できないか、無効です。---> System.Runtime.InteropServices.COMException:HRESULTからの例外:0x80042002 at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode、IntPtr errorInfo)at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)at MS .Internal.Automation.UiaCoreApi.CheckError(Int32 hr)at MS.Internal.Automation.UiaCoreApi.UiaGetPropertyValue(SafeNodeHandle hnode、Int32 propertyId、Object&value)at System.Windows.Automation.AutomationElement.GetCurrentPropertyValue(AutomationProperty property、Boolean ignoreDefaultValue)at System.Windows.Automation.AutomationElement。DisplayClass4。<WaitForControlPropertyNotEqual>b_3(UITestControl ctrl)at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.WaitForCondition [T](T conditionContext、Predicate 1 conditionEvaluator, Int32 millisecondsTimeout)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.WaitForControlCondition(Predicate
1 conditionEvaluator、Int32 mmolsTimeout)at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.WaitForControlPropertyNot文字列propertyName、Object propertyValue、Int32ミリ秒タイムアウト)
そのような行動をとることができる理由は何ですか?
よろしくお願いします!