This is a migrated thread and some comments may be shown as answers.

First test always failing

3 Answers 60 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alessio
Top achievements
Rank 1
Alessio asked on 15 Apr 2019, 11:29 PM

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

 

3 Answers, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 16 Apr 2019, 08:41 AM
Hello Alessio,

Thank you for sharing the error details for the test execution. 

Your assumption about the splash screen seems to be the correct one as of our perspective as well. However, here are few suggestions, which you may give a try to. 

Execution delay 

The first thing to try will also prove if our assumption is correct - please include as a first step in the test an execution delay. At the beginning you can start with a larger timeout and then decrease it step by step to find out its optimal value. If the test passes successfully that way, it is the splash screen that causes the misbehavior. 

Wait on elements 

You mentioned that you have attempted to fix the misbehavior with Wait on elements - is this the wait steps that you have tested? I guess this is what you have used and this is the other possible option, which is also not hard-coded as the delay, which pauses the execution. 

Though, you mentioned this didn't help as well. So, there is another idea I have. 

Elements Timeout 

Test Studio uses global project timeouts which can be easily accessed in the Test ribbon. However, for cases like the current one, the default 15 seconds may not be sufficient for certain steps. Therefore, each verification step (wait and extract, as well) has its own WaitOnElement property. By default this is greyed out and will be enabled once the UseStepWaitOnElementsTimeout is checked. 

Please, give a try to the above suggestions and let me know, if any of these is useful to cover the specific application behavior. 

Regards,
Elena Tsvetkova
Progress Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Alessio
Top achievements
Rank 1
answered on 20 Apr 2019, 01:18 AM
Lena, adding an execution delay step worked perfectly, thank you
0
Elena
Telerik team
answered on 22 Apr 2019, 02:35 PM
Hello Allesio,

Thanks for your feedback! I am pleased to know that my suggestion helped you to get the tests working as expected. 

Regards,
Elena Tsvetkova
Progress Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Alessio
Top achievements
Rank 1
Answers by
Elena
Telerik team
Alessio
Top achievements
Rank 1
Share this question
or