Forum Discussion

WesWhit's avatar
WesWhit
Occasional Contributor
9 months ago

Checking Whether a TestedApp is Running or Not

I am desktop testing, and my application has an option to either close or restart itself or one of the connected applications. I am trying to create a check as to whether the closed/restarted app is running or not but I have be unsuccessful. 

Has anyone had any luck with this? any help would be greatly appreciated, thank you.  

  • thank you rraghvani  I have got it now.

    function gdpIsNotRunning()
    {
      gdp = Sys.Process("GraphicsDisplayProcessor");
      
      if(gdp.Exists === false){
        Log.Checkpoint('GDP window is closed');
      }
      else{
        Log.Error('GDP Window is open');
      };

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    What exactly have your tried? Please provide any coding, if possible.

  • WesWhit's avatar
    WesWhit
    Occasional Contributor

    I have tried aqObject.CheckProperty(TestedApps.App,"Exists",cmpEqual, false); 

    this obviously doesn't work and I didn't expect it to. I can't think of any other way and there is nothing I can find on it in TestComplete documentation.

      • WesWhit's avatar
        WesWhit
        Occasional Contributor

        thank you, I need a hard assertion. so that the test passes or fails. I can do what the app is open as I can check for an object on the screen. But I'm struggling to assert that it is closed.  

  • WesWhit's avatar
    WesWhit
    Occasional Contributor

    thank you rraghvani  I have got it now.

    function gdpIsNotRunning()
    {
      gdp = Sys.Process("GraphicsDisplayProcessor");
      
      if(gdp.Exists === false){
        Log.Checkpoint('GDP window is closed');
      }
      else{
        Log.Error('GDP Window is open');
      };