12 Replies - 1608 Views - Last Post: 11 August 2014 - 08:52 AM Rate Topic: -----

#1 rockkrose  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 25-November 12

UI Automation - unexpected dialog that appears during test execution

Posted 28 January 2013 - 06:51 AM

Hi everybody!

I'm using UIA API for test automation.
I have an issue with an unexpected dialog that appears during test execution. This window is generated by Windows and is a #32770 class window. I'm trying to find a solution to close this window in case it appears, because the tests fail where this unexpected dialog appears. I would appreciate any help. Thanks!
Is This A Good Question/Topic? 0
  • +

Replies To: UI Automation - unexpected dialog that appears during test execution

#2 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3617
  • View blog
  • Posts: 11,269
  • Joined: 05-May 12

Re: UI Automation - unexpected dialog that appears during test execution

Posted 28 January 2013 - 07:03 AM

According to MSDN, that window is a dialog box.

http://msdn.microsof...4(v=vs.85).aspx

Assuming that the dialog follows the Windows UI Guidelines, pressing the Escape key should cancel and close the dialog.

On the other hand, there should be a logical reason why the dialog is popping up. Your test should probably not just ignore that dialog because it maybe indicative of a more serious problem in the program you are testing.
Was This Post Helpful? 1
  • +
  • -

#3 rockkrose  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 25-November 12

Re: UI Automation - unexpected dialog that appears during test execution

Posted 28 January 2013 - 08:45 AM

View PostSkydiver, on 28 January 2013 - 07:03 AM, said:

According to MSDN, that window is a dialog box.

http://msdn.microsof...4(v=vs.85).aspx

Assuming that the dialog follows the Windows UI Guidelines, pressing the Escape key should cancel and close the dialog.

On the other hand, there should be a logical reason why the dialog is popping up. Your test should probably not just ignore that dialog because it maybe indicative of a more serious problem in the program you are testing.

Hi,
Thanks for the answer! The reason why the dialog is popping up is logical but it's generated by Windows randomly, and it causes the test to fail because it block the other windows. the solution would be to close the dialog box but i don't know how because i don't know when is popping up.
Was This Post Helpful? 0
  • +
  • -

#4 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2267
  • View blog
  • Posts: 9,480
  • Joined: 29-May 08

Re: UI Automation - unexpected dialog that appears during test execution

Posted 28 January 2013 - 09:37 AM

It won't be random. The code will do what ever you coded it to do, show the code.
Was This Post Helpful? 2
  • +
  • -

#5 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3617
  • View blog
  • Posts: 11,269
  • Joined: 05-May 12

Re: UI Automation - unexpected dialog that appears during test execution

Posted 28 January 2013 - 09:40 AM

If you are using the UI automation APIs, I was under the impression that you also got notifications when the dialog comes up. If so, then you can simply handle that event. If I am mistaken and the API does not give you a notification, then you can install a Windows hook to be notified when windows come up.

Unless you are doing stress testing on a system at the same time you are doing your UI automation tests, I'm completely puzzled by why the dialog would come up randomly. You (or the data the program is operating on( must have done some operation that would cause the dialog to come up.

If you are doing fuzz testing and throwing random inputs into the program, and the program is correctly throwing errors due to those random inputs, then it behooves you know what random conditions those are because how will you know the cases when a random input is supposed to cause an error but the program accepted the input as valid?
Was This Post Helpful? 1
  • +
  • -

#6 rockkrose  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 25-November 12

Re: UI Automation - unexpected dialog that appears during test execution

Posted 28 January 2013 - 10:22 AM

The test I run, clicks on a button that launches an Internet page. This button is present on the UI only when the application under test is running without license key.
The dialog that pops up randomly is an error message sent by the application service that informs the user that service will stop unless a license key is provided. This error appears only on OS older than Vista. Unless this dialog box doesn't show up , test is working fine, but when the error is generated the test fails.
Was This Post Helpful? 0
  • +
  • -

#7 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3617
  • View blog
  • Posts: 11,269
  • Joined: 05-May 12

Re: UI Automation - unexpected dialog that appears during test execution

Posted 28 January 2013 - 01:41 PM

Seems to me you know when it is supposed to pop up: when OS is older than Vista. Shouldn't your automation account for that?
Was This Post Helpful? 1
  • +
  • -

#8 rockkrose  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 25-November 12

Re: UI Automation - unexpected dialog that appears during test execution

Posted 29 January 2013 - 12:48 AM

View PostSkydiver, on 28 January 2013 - 01:41 PM, said:

Seems to me you know when it is supposed to pop up: when OS is older than Vista. Shouldn't your automation account for that?

The dialog pops up after service is restarted. Thanks for the help :)
Was This Post Helpful? 0
  • +
  • -

#9 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3617
  • View blog
  • Posts: 11,269
  • Joined: 05-May 12

Re: UI Automation - unexpected dialog that appears during test execution

Posted 29 January 2013 - 06:12 AM

And what operation when the OS is older than Vista did you do that caused the service to restart? Services don't just restart randomly. Remember that computers are deterministic state machines.
Was This Post Helpful? 0
  • +
  • -

#10 rockkrose  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 25-November 12

Re: UI Automation - unexpected dialog that appears during test execution

Posted 29 January 2013 - 08:08 AM

View PostSkydiver, on 29 January 2013 - 06:12 AM, said:

And what operation when the OS is older than Vista did you do that caused the service to restart? Services don't just restart randomly. Remember that computers are deterministic state machines.

yes i know, but for the application that I test, if the service is stopped is restarted automatically after 15-20 minutes. This happens also on OS newer than vista but the OS is different and the message doesn't show up.
Was This Post Helpful? 0
  • +
  • -

#11 NayanTejani  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 07-August 14

Re: UI Automation - unexpected dialog that appears during test execution

Posted 11 August 2014 - 04:54 AM

hi Rockkrose,

i read through this topic and understand that you are running some automated tests using UIA API's. Can you please elaborate more on what exactly the UIA API are and where can i find them.

I am trying to do a similar activity but through creation of a well-defined Automation Framework. I want to capture my test cases in C# based GUI and also trigger the automated test execution through the same GUI.

Thanks in advance

Regards,
Nayan
Was This Post Helpful? 0
  • +
  • -

#12 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3617
  • View blog
  • Posts: 11,269
  • Joined: 05-May 12

Re: UI Automation - unexpected dialog that appears during test execution

Posted 11 August 2014 - 07:05 AM

Here's the link you are looking for: Windows Automation API
Was This Post Helpful? 0
  • +
  • -

#13 NayanTejani  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 07-August 14

Re: UI Automation - unexpected dialog that appears during test execution

Posted 11 August 2014 - 08:52 AM

View PostSkydiver, on 11 August 2014 - 07:05 AM, said:

Here's the link you are looking for: Windows Automation API


Many Thanks for the link. It does have quite a lot of info that i can try understand and leverage tactfully to work towards my goal.
highly appreciate your prompt response !
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1