We are automating test cases using excel, we write test cases in excel sheet and we make them execute using selenium C# tool.

If I added 5 steps to execute single test case, then I don't want to execute 3rd step without deleting it. Is it possible to do uncomment that 3rd step?


2 Answers 2


I would go with the option of adding "//" at the first of each step I want it to be skipped and in the code write something like:


If I understand you correctly you want sometimes to not execute the 3rd step. In such a way that choose.

You cannot comment in Excel, what you can do is instead of putting the 3rd value in Excel let the testers write "skipstep" in the field.

In your automated C# step code you could do something like this psuedo code:

string thirdValue = getYourDataFromExcelFunction().thirdfield;    
if (thirdValue != 'skipstep') {
  // code for third step

This way it is clear the step should skipped and you handle it neatly in the code.

  • Thanks for suggestion! .That makes us to change every time in the code, takes effort to do . Feb 3, 2017 at 6:29
  • You should prepare the code so that steps can be skipped, not change the code everytime. But really testing requires you to update tests and automated-tests if you change the code. That is just how it works, what did you think instead then? Feb 3, 2017 at 7:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.