Completed
Last Updated: 30 Mar 2015 13:27 by ADMIN
ADMIN
Cody
Created on: 13 Feb 2015 22:55
Type: Bug Report
0
Specific WPF test fails with Unable to find the window
Using the attached sample WPF application:

1) Record a test that clicks the button, selects a real Excel file from your computer and clicks Continue on the popup window
2) Playback the test'

Expected: The test to pass
Actual: The test errors out with:
Overall Result: Fail
------------------------------------------------------------
'2/13/2015 4:47:26 PM' - Executing test: 'Scratch WPF Test', path: 'Scratch WPF Test.tstest.'
'2/13/2015 4:47:26 PM' - Using .Net Runtime version: '4.0.30319.34209' for test execution. Build version is '2014.4.1411.0'.
'2/13/2015 4:47:26 PM' - Starting execution....
------------------------------------------------------------
------------------------------------------------------------
'2/13/2015 4:47:27 PM' - Using 'F:\Dropbox\Support Issues\ed7d8fb2-f049-435a-b371-51a6c1c08e59_radwindowfreeze\bin\Debug\RadWindowFreeze.exe' application.
'2/13/2015 4:47:28 PM' - 'Pass' : 1. LeftClick on ClickMeTextblock
'2/13/2015 4:47:31 PM' - 'Pass' : 2. Handle 'OpenFile' dialog.
'2/13/2015 4:48:01 PM' - 'Fail' : 3. Click OKRadbutton
------------------------------------------------------------
Failure Information: 
~~~~~~~~~~~~~~~
Unable to find the window 'Continue?' inside application 'F:\Dropbox\Support Issues\ed7d8fb2-f049-435a-b371-51a6c1c08e59_radwindowfreeze\bin\Debug\RadWindowFreeze.exe'
---- Current Windows: ----
MainWindow
--------------------------

InnerException:
System.Exception: Unable to find the window 'Continue?' inside application 'F:\Dropbox\Support Issues\ed7d8fb2-f049-435a-b371-51a6c1c08e59_radwindowfreeze\bin\Debug\RadWindowFreeze.exe'
---- Current Windows: ----
MainWindow
--------------------------
 ---> System.TimeoutException: Wait for condition has timed out
   at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo, Object target)
   at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType)
   at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout)
   at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Int32 timeout)
   at ArtOfTest.WebAii.Wpf.WpfApplication.WaitForWindow(String caption, Int32 timeout)
   --- End of inner exception stack trace ---
   at ArtOfTest.WebAii.Wpf.WpfApplication.WaitForWindow(String caption, Int32 timeout)
   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)
------------------------------------------------------------
'2/13/2015 4:48:01 PM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
------------------------------------------------------------
'2/13/2015 4:48:01 PM' - Overall Result: Fail
'2/13/2015 4:48:01 PM' - Duration: [0 min: 34 sec: 423 msec]
------------------------------------------------------------
'2/13/2015 4:48:03 PM' - Test completed!

Attached Files:
3 comments
ADMIN
Iliyan Panchev
Posted on: 30 Mar 2015 13:27
Hi, the bug is fixed. The fix will be part of all the upcoming internal and official Test Studio releases.
Mike
Posted on: 20 Feb 2015 15:33
Hi Iliyan
I posted this original issue via Cody.
I have tried this workaround and it didn't work initially, but if I use this command instead it does: Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Control);
Is there any reason why KeysFromString("ctrl") doesn't work for me? I have tried this function previously and couldn't get to work then either.
Thanks,
Mike.
ADMIN
Iliyan Panchev
Posted on: 17 Feb 2015 12:48
The child window somehow appears behind the Main Window when Test Studio is executing the test. A simple workaround is to bring the window back to the front with a coded step that simply presses ctrl - Manager.Desktop.KeyBoard.KeyPress(ArtOfTest.WebAii.Win32.KeyBoard.KeysFromString("ctrl"), 200);
The window goes to the front and the test continues normal execution.