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

Test does not have the same behaviour if run "Standalone" vs "Test as step"

4 Answers 36 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joan
Top achievements
Rank 1
Joan asked on 28 Apr 2014, 07:15 AM
We have an app. that sometimes shows a pop-up message on startup (it gives some information to user only when needed)
I have created a test named "accept startup message if any" like the following:

IF (Wait for Exists 'RadMessageBoxWndRadMessagebox') THEN
   Click BtnOkRadbutton
ELSE


I have configured verification timeout to 2 seconds.
This test works perfectly when the message is shown and, when not too, as it only takes the 2 seconds to continue to next step.

I thought it would be nice to add this "accept startup message if any" test as the first step in other tests, in order to reuse it and avoid coding the "IF" every time before starting the test itself.

The problem is that if I use this test as a step in other test, it does not have the same behaviour. In this scenario, if the message appears, it works perfectly, but if the message box does not appear, the test does not follow next step until "CLIENT (FRAME/WINDOW) READY TIMEOUT" is reached (configured in Debugger options or in configuration file), which is a long time. I have tried to configure the test as step with the "WaitOnElementsTimeout" to 2 seconds also with no results.

Am I missing something or doing anything wrong?

Thank you in advance,

Best regards,

Joan

4 Answers, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 01 May 2014, 05:37 AM
Hello Joan,

Please excuse me for the delayed reply.
This is quite weird behavior, and I doubt you are doing something wrong. However only from your explanation I am not able to determine what might be causing this. Is there a way you can provide me with the test so I can execute it on my end and investigate further? This would be the best scenario in this case.
If your application is not public accessible then at least please provide me with a video demonstration so I can take a look. You can use Jing in order to create your screen capture.

Looking forward to hearing from you.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Joan
Top achievements
Rank 1
answered on 06 May 2014, 10:30 AM
Hello Ivaylo,

I have tried to simplify everything by creating a new dummy solution, I hope you could help, because it seems a very simple matter which I don't understand how implement it correctly...

The dummy program has 2 Windows: MainWindow and PopupWindow. Popup window only appears the first time application is launched. This is not the same behaviour I have in the app we want to test, but I thought it could simulate the behaviour. First time app is run, a setting is saved in C:\Users\USERNAME\AppData\Local\DummyApp\ so, to force the popup window appear again, you should empty that folder before.

Then, I have created an "AcceptStartupMsgIfAny" test that should wait for exists the popup window. If Exists, then a click on a button is performed. Otherwise does nothing. This Works perfectly the first time! but, next time I run the test, the popup window does not appear (as expected), and then the wait for exists fails with this error: Unable to determine logical branch to go into. Unable to execute verification.

So I don't know what am I doing wrong. Positive case works well and unfavorable case does not.

Additionally I have created 3 more tests:  Test1 which performs "AcceptStartupMsgIfAny" test as first step and then clicks button1 in the MainWindow, and Test2 which does the same but with button2. Finally a "AllTests" test that runs Test1 and Test2.

First of all, I would like to execute "AcceptStartupMsgIfAny" test properly in both cases (with the popup appearing and not) and then I would like to achieve the nested tests to be run without waiting for "client ready" timeout or "wait on elements" timeout.

I attach all necessary files. (Tests are located in DummyAppTests folder in the main VS project folder)
Any help would be very appreciated.

Thank you in advance,

Best Regards,

Joan
0
Accepted
Ivaylo
Telerik team
answered on 08 May 2014, 03:33 PM
Hello Joan,

Thank you for providing me with the project, so I was able to replicate this behavior. 
Unfortunately the only suitable workaround I found for your issue is to use a coded step for the if else logic. Instead of using the if else steps just add a sample coded step with the following code:

if(Manager.ActiveApplication.Windows.Count > 1)
{
    Applications.DummyAppexe.PopupWindowTitle.PopupBtnButton.User.Click();
}

Hope that helps.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Joan
Top achievements
Rank 1
answered on 12 May 2014, 08:07 AM
Hello Ivaylo,

Thank you for your answer! The solution is a bit tricky but it works.
We will see in a future if we have more than 1 window at the same time...

Best Regards,

Joan
Tags
General Discussions
Asked by
Joan
Top achievements
Rank 1
Answers by
Ivaylo
Telerik team
Joan
Top achievements
Rank 1
Share this question
or