function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Pritam GajghatePritam Gajghate 

Want to run only failed test cases of Test class

Hi All,

I want to run only failed test cases of Test class. Can anyone share the steps please.

Thanks.  
Ramesh DRamesh D
Hi Pritam,
I dont think we can do this right now, we have to rerun entire test class to if it's failed. 
If you need this functionlity there's an idea posted(https://success.salesforce.com/ideaView?id=0873A000000E5EDQA0), plese vote for it so salesfore would take this for consideration  

Thanks
Ramesh
Pritam GajghatePritam Gajghate
Hi Ramesh,
I got the option to test only failed test cases. Follow below steps:

On Developer Console, Navigate to menu 'Test' >> 'New Run'.

Thanks.
Ajay K DubediAjay K Dubedi
Hi Pritam,
You can run failed cases, follow below steps:
- Go to developer console.
- Click on Test tab.
- Rerun Failed Tests: To rerun only the failed tests from the test run that’s highlighted in the Tests tab, choose this option.

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi