Hello,
I have 3 different tests with the same purpose, which is: testing the contents of a TextBlock on the landing page of my WPF application.
The first test always fails,no matter how I reshuffle them. This is what the log says:
Overall Result: Fail
------------------------------------------------------------
'4/15/2019 8:13:47 PM' - Executing test: 'DoStuffWithMyApp1', path: 'DoStuffWithMyApp1.tstest.'
'4/15/2019 8:13:47 PM' - Using .Net Runtime version: '4.0.30319.42000' for test execution. Build version is '2019.1.408.0'.
'4/15/2019 8:13:47 PM' - Starting execution....
------------------------------------------------------------
------------------------------------------------------------
'4/15/2019 8:14:06 PM' - Using 'C:\MyApp\Dev\Client\Client.Shell\bin\Debug\Client.Shell.exe' application.
'4/15/2019 8:14:26 PM' - 'Fail' : 1. Verify DevelopmentTextblock.Text 'Equal' 'Development R1.0.0.0'
------------------------------------------------------------
Failure Information:
~~~~~~~~~~~~~~~
Unable to locate element. Details: Attempting to find [Wpf] element using
Find logic
(Wpf): [TextContent 'StartsWith' Development R1.] AND [XamlTag 'Exact' textblock]
Unable to locate element. Search failed!
Learn more about finding elements here:
http://docs.telerik.com/teststudio/troubleshooting-guide/test-execution-problems-tg/unable-to-locate-element
------------------------------------------------------------
'4/15/2019 8:14:26 PM' - Detected a failure. Step is marked 'ContinueOnFailure=True' continuing test execution.
'4/15/2019 8:14:27 PM' - 'Pass' : 2. Verify 'DevelopmentTextblock' text Same 'Development R1.0.0.0'
'4/15/2019 8:14:28 PM' - 'Pass' : 3. Verify 'DevelopmentTextblock' text Equal 'Development R1.0.0.0'
------------------------------------------------------------
'4/15/2019 8:14:28 PM' - Overall Result: Fail
'4/15/2019 8:14:28 PM' - Duration: [0 min: 22 sec: 804 msec]
------------------------------------------------------------
'4/15/2019 8:14:31 PM' - Test completed!
I have tried to play with the timing settings (e.g. Wait on elements) but that didn't help much.
I think it is important to say, the application has a splash screen and I have the sensation that the first test is fired before that it gets closed.
The other tests are launched when the landing page is loaded and they succeed.
Regards