Ask a Question

how to Skip Onstart event for particular Testcase in Test Complete 12

Varunawasthi
Occasional Contributor

how to Skip Onstart event for particular Testcase in Test Complete 12

Hi,

 

I have a scenario in which an OnStartEvent I want to Skip it for a particular Test case and then again I need for other Test case

 

So generally How can I avoid/Skip using Onstart event ?

 

Thanks in advance for help.

2 REPLIES 2
NisHera
Valued Contributor

You can go to project/ Events / general event and click on OnStartTest event and press new button

It will create a function like 

function GeneralEvents_OnStartTest(Sender)
{
  
}

could  be saved where ever you like.

 

I assume you already have that and you do something in this function.

the trick would be using a if condition....like

 

if (Project.TestItems.Current.Name == "FirstTestItem")
 {  // Do nothing
   null;
  }
else
 {
    // Do my usual stuff
  }   

 

 

 

I managed this with:

if (Project.TestItems.Current != null)
 {  
   //on start test stuff
  }
else
 {
    null;
  }   

 

 

cancel
Showing results for 
Search instead for 
Did you mean: