Forum Discussion

vinodkumar_chau's avatar
vinodkumar_chau
Contributor
10 years ago

Message is getting printed twice in logs of testcomplete

Hi Team , Below mentioned code for my project is creating problem. Log.Message(finalPath); is getting printed twice in the logs. First with correct path and second time with \\..\\..\\undefined in t...
  • joseph_michaud's avatar
    10 years ago

    To run the Include() routine, the entire file is first processed.  In this phase, you run the eval() command and define the Include() function.  You are probably trying to run this routine by right-clicking in the routine and selecting "Run current routine", or perhaps you defined a Project Test Item to call the Include() routine and then running the project.  What you are doing is effectively this:

     

     

     

    Include("GlobalConstants.js");
    Include();

     

     

    The second call has no arguments.  Attempting to reference them produces the "undefined".

     

    The Include() routine needs the argument defined.  Rewrite as:

     

    function Runme()
    {
      Include("GlobalConstants.js");
    }
    
    function Include(file)
    {
    ...
    }