Forum Discussion

DevaV's avatar
DevaV
Contributor
14 years ago

To check an application opened or not

Hi,

I am using JScripts in test complete. Before writing scripts for a particular application how can i check whether that application is opened or not and the same for window which i am coding for testing also check whether window is opened or not



Regards,

Deva

2 Replies

  • Hi,



    You can use the script below:

    function Test()

    {

      var p = Sys.WaitProcess("<ProcessName>", 10000);

      if (p.Exists)

      {

        Log.Message("The application is launched");



        var w = p.WaitWindow("<WndClass>", "<WndCaption>", 0, 10000);

        if (w.Exists)

        {

          Log.Message("The window exists");

        }

        else

        {

          Log.Message("The window doesn't exist")

        }

      }

      else

      {

        Log.Message("The application is not launched.");

      }

    }


    See the WaitProcess Method and WaitWindow Method help topics for more information.