Hi,
I've created a simple test for a WPF application that clicks a button in my main window to open another window and then clicks a button in this window. Half of the time the test executes as expected, half of the time it fails, because the window was not found. I added a delay before clicking the second button to make sure, that the window is fully loaded. The title of the window is always the same.
I've tried to create a test like this for another window, but there I have the same issue.
Why is the Test Studio not able to find the window and is there anything I can do to fix this?
This are the logs:
Overall Result: Fail------------------------------------------------------------
'09.10.2024 11:40:43' - Executing test: '10 - Storage Overview', path: 'Overviews\10 - Storage Overview.tstest.'
'09.10.2024 11:40:43' - Using .Net Runtime version: '4.0.30319.42000' for test execution. Build version is '2024.3.813.1'.
'09.10.2024 11:40:43' - Starting execution....
'09.10.2024 11:40:47' - Detected custom code in test. Locating test assembly: 3S_Tests.dll.
'09.10.2024 11:40:47' - Assembly Found: C:\TestStudio\3S_Tests\bin\3S_Tests.dll
'09.10.2024 11:40:47' - Loading code class: '_S_Tests._0___Storage_Overview'.
------------------------------------------------------------
------------------------------------------------------------
'09.10.2024 11:40:47' - Using 'C:\MLM Apps\3S Debug\ProbenverwaltungV3.exe' application.
'09.10.2024 11:40:57' - 'Pass' : 1. Click BtGenerelOverviewCopyButton
'09.10.2024 11:41:02' - 'Pass' : 2. Wait for '5000' msec.
'09.10.2024 11:42:03' - 'Fail' : 3. Desktop command: LeftClick on HeaderButtonRadtogglebutton
------------------------------------------------------------
Failure Information:
~~~~~~~~~~~~~~~
Unable to find the window 'General Overview' inside application 'C:\Apps\3S Debug\ProbenverwaltungV3.exe'
---- Current Windows: ----
--------------------------
InnerException:
System.Exception: Unable to find the window 'General Overview' inside application 'C:\Apps\3S Debug\ProbenverwaltungV3.exe'
---- Current Windows: ----
--------------------------
---> System.TimeoutException: Wait for condition has timed out
bei ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo, Object target)
bei ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType)
bei ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout)
bei ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Int32 timeout)
bei ArtOfTest.WebAii.Wpf.WpfApplication.WaitForWindow(String caption, Int32 timeout)
--- Ende der internen Ausnahmestapelüberwachung ---
bei ArtOfTest.WebAii.Wpf.WpfApplication.WaitForWindow(String caption, Int32 timeout)
bei ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)
------------------------------------------------------------
'09.10.2024 11:42:03' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
------------------------------------------------------------
'09.10.2024 11:42:03' - Overall Result: Fail
'09.10.2024 11:42:03' - Duration: [1 min: 15 sec: 234 msec]
------------------------------------------------------------
'09.10.2024 11:42:03' - Test completed!