Closing an Application (adobe acrobat) via Ranorex

Best practices, code snippets for common functionality, examples, and guidelines.
Posts: 15
Joined: Fri Sep 06, 2019 2:21 pm

Closing an Application (adobe acrobat) via Ranorex

Post by AviatorFly » Wed Apr 22, 2020 3:14 pm

Hi all,

I am automating the test of an application. My application under test creates an pdf file with a random name and opens adobe acrobat. Because it is the application under test that opens adobe acrobat, I do not have a process ID to use the by the close action by WindowProcess ID. I do not think I can use the close application action via CloseWindow or KillProcess either because for that I need to have a repository item for the adobe acrobat window and I do not think I can add it to the repository since the file name for the pdf created is random and not known in advance.

Does anyone have any suggestions on how to get Ranorex to close adobe acrobat given the restrictions above?



User avatar
Ranorex Guru
Ranorex Guru
Posts: 7465
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Closing an Application (adobe acrobat) via Ranorex

Post by odklizec » Wed Apr 22, 2020 8:03 pm


I think you can always prepare a generic repo element, pointing to Adobe Acrobat window and with variable instead of hardcoded file name in the title? Then you can simply fill the variable with random PDF name, created during test. For this, you can use Global Parameter, in which you can store the random name (once created) and then use it for repo element variable (during closing acrobat window).

Eventually, If you know for sure that the test will always open PDF file in Acrobat, I think it's pretty safe to use predefined/hardcoded adobe acrobat process name for kill process procedure? ;) Hope this helps?
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