0

I am doing automation testing and while writing the test cases I don't want to go looking at the logs after the testing is done, because I sit in front of my PC when the automation tests are run.

Is there any way that I can make pop up dialogs?

Like if a button is clicked, the pop up dialog should appear saying the button is clicked, but the program execution shouldn't be stopped. I tried with messagebox.show but the problem is it stops execution of the program.

Is there anyway to do this without stopping the execution of the program?

pnuts
  • 58,317
  • 11
  • 87
  • 139
Roshan Vincent
  • 89
  • 1
  • 12
  • What test harness are you using for writing test automation? – Rufus L Mar 18 '15 at 05:21
  • Im using CodedUI... But i dont think that makes any difference. I wanted to know if there is a way to jus make pop up dialogs appear show the message and then disappear... – Roshan Vincent Mar 18 '15 at 05:27
  • I was just thinking that you could use something like Debug.WriteLine() and then you would see the messages in the Output window while the tests are running. – Rufus L Mar 18 '15 at 05:31
  • oh is that possible? Thanks for that. But the problem is My software takes the whole window and i cannot see the output window also as it is in the background so i was jus thinking that there could be some pop up box that appears shows the msg and goes away... – Roshan Vincent Mar 18 '15 at 05:37
  • How about having a second program that just accepts cross-process input and creates a window that it displays on top of your program's window, but without stealing focus? Send the data from your program to the new program using some kind of inter-process communications, named pipe or TCP/IP socket, for example. – RenniePet Mar 18 '15 at 06:28
  • I was thinking somewhere on the same lines .. Thanks @RenniePet – Roshan Vincent Mar 18 '15 at 06:40
  • Here's a couple of (identical) links about how to make a window that is topmost but doesn't steal focus: http://stackoverflow.com/a/25219414/253938 and http://stackoverflow.com/a/25219399/253938 As for the inter-process communications, I'd recommend a named pipe, but there are several alternative techniques. – RenniePet Mar 18 '15 at 07:06
  • I didn't try it but that sample may work for you. See that [link](http://stackoverflow.com/questions/14522540/close-a-messagebox-after-several-seconds) – Orkun Bekar Mar 18 '15 at 08:57

1 Answers1

0

Simply use modeless dialogs. See here.

in essence: Use form.Show() instead of form.ShowDialog().

Thomas Weller
  • 11,631
  • 3
  • 26
  • 34