Pause test with message box ;)

Best practices, code snippets for common functionality, examples, and guidelines.
User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Pause test with message box ;)

Post by odklizec » Tue May 29, 2018 1:47 pm

Hi,

Usually, the test automation is meant to run autonomously, without the need of user intervention. However, there may be causes (usually, during debugging), when we need to pause the test and manually set/check something. The most common way is doing it via breakpoints. However this is often not the fastest/best way how to pause the test! Setting breakpoint means that one needs to go to the code. And if the paused step is located in reusable recording/code module, the test may pause at places you are not interested in. I just experienced this with test I'm currently working on. The solution I came with is using simple custom dialog, which is shown during the test and which contains certain value I need to copy from actual step.

What I did was creating a new code module, which I called PAUSE_EXECUTION. I'm placing it wherever I need to pause the test.
PauseExecution.png
PauseExecution.png (59.98 KiB) Viewed 241 times
Feel free to modify the module according your needs (add more labels/inputs, etc...).
PAUSE_EXECUTION.cs
(3.33 KiB) Downloaded 37 times
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Diddy
Posts: 7
Joined: Tue Feb 09, 2016 4:00 pm

Re: Pause test with message box ;)

Post by Diddy » Mon Jul 23, 2018 10:00 am

That would be a nice candidate for https://github.com/ranorex/Packages/tre ... ionHelpers ...