Forum Discussion

murugans1011's avatar
Regular Contributor
11 years ago

Running Project test item

Hi, I have a scenario where i need to run the same project test item several times(say for 10).  so i just increased count to 10.  in some situation if there is an error posted in to the test l...
  • TanyaYatskovska's avatar
    10 years ago
    There is another approach you can try:

    1. Get the name of the currently run test item:

    var test = Project.TestItems.Current.ElementToBeRun.Caption;


    It returns the name in the following format: Script\Unit1 - Main. So:

    2. You need to parse the string and obtain the name of the test and the name of the script unit:

    var arr = test.split("\\")[1].split("-");

    var unitName = aqString.Trim(arr[0]);

    var name = aqString.Trim(arr[1]);


    3. Now, you can call the function:

    Runner.CallMethod(unitName + "." + name);