/// <summary>
        ///     Close UFT
        /// </summary>
        /// <param name="running"></param>
        /// <param name="close"></param>
        /// <param name="quitTool"></param>
        public static void Close(bool running = false, bool close = true, bool quitTool = true)
        {
            try
            {
                var isUftVisible = TestMonitor.IsUftVisible();
                if (isUftVisible)
                {
                    if (running)
                    {
                        UftTest.Stop();
                        Thread.Sleep(5000);
                    }

                    if (quitTool)
                    {
                        if (UftApplication == null)
                        {
                            UftApplication = new Application();
                            UftApplication.Quit();
                            Thread.Sleep(5000);
                            UftApplication = null;
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Log.Error(
                    "Unable to close/stop the long running. Possible with dead lock state. Terminating UFT to clear deadlock.");
                Log.Error(exception);
            }
            finally
            {
                Release();
            }
        }