Forum Discussion

ilkoTest's avatar
ilkoTest
Visitor
50 minutes ago

Running the Execution Plan enabled items via script within TestComplete

Hi,

I have a huge test project that contains hundreds of test items. Unfortunately, TestComplete does not provide a progress indicator for the test execution. The entire project runs for many hours, and it would be great to see how many test items were executed.

I am trying to write a JavaScript script that can execute the enabled test items in the Execution Plan one after another and show me the execution progress.

I am stuck at the point where I am trying to execute the following command block:

if (itemSelected.Enabled)
{
  Log.Message("The selected item is enabled");
  var progress = Math.round((i / count) * 100);
  Log.Message("The progress value is: " + progress);
  
  Indicator.PushText("Running: " + itemSelected.Name + " (" + progress + "% Complete)" + "out of " + count);
  
  try {
    itemSelected.Run();
  }
  catch(e){
    Log.Error("Error executing " + itemSelected.Name + ": " + e.message);

  }
  Indicator.PopText();
}
else
{
  Log.Message("The current item is disabled in the Execution Plan");
}

TestComplete throws the error saying that 

Error executing <itemSelectedName>: itemSelected.Run is not a function

If I remove the brackets after Run, TestComplete ignores this command and iterates to the next item.

 I was wondering if anybody has any idea how to overcome this and run the selected test items via script.

Thanks

No RepliesBe the first to reply