Forum Discussion

krainevsky's avatar
krainevsky
Contributor
14 years ago

TC 7.52 bugs with ProjctSuite.Variables

Hi,



Please confirm the following bugs:



[JScript]




function Main() {

  //This code works fine

  var myVar = new Array();

  myVar.someProp = new Object();

  

  //Same code but for ProjectSuite's temporary variable fails

  try {

    ProjectSuite.Variables.myVar = new Array();

    ProjectSuite.Variables.myVar.someProp = new Object();

  } catch (exception) {

    Log.Error("got exception", exception.message);

  }

}




The second bug is more specific:

//I have one test function

//Inside the Project Test Items editor I have several TestItems that call this function and also they have timeout option set to 1 minute

//So this function will never and properly


function test1() {

  aqUtils.Delay(65000);

}


//Beside the above function a have 3 event handlers like the following:


function GeneralEvents_OnTimeout(Sender, Params) {

  Runner.Stop(true);

}





function GeneralEvents_OnStartTest(Sender) {

  if (ProjectSuite.Variables.myVar == undefined)

    ProjectSuite.Variables.myVar = new Array();

}





function GeneralEvents_OnStopTest(Sender) {

  try {

    var test = new Object();

    test.name = Project.TestItems.Current.Name;

    Log.Message(ProjectSuite.Variables.myVar.length);

    ProjectSuite.Variables.myVar.push(test);

  } catch (exception) {

    Log.Error(exception.message, exception.description);

  }

}




The point is that OnStopTest handler works fine only first time, and it fails on push() call at the second time. I have an empty exception.message and exception.description, so I can't find out what exactly I'm doing wrong. I've attached ProjectSuite with this post. Simply run it and wait for some time.



Please let me know if this is a bugs really and if it is so when can we have a bugfix for this?



Thanks in advance

7 Replies