0

Unfortunately i click run all test classes in my workbench in salesforce test environment,now i would like to stop the those test classes,could you please give me any possible way for this through workbench. Thank you.

  • You can abort test execution from your org, Search for Apex Test Execution here you can abort currently running test execution jobs – Atul Rakate May 28 '18 at 10:31
  • Hi Atul,Here i couldn't found any test classes. – Suresh May 28 '18 at 10:36
  • If test class is running it will display test execution status here, you can even confirm if any test classes are running from developer console. – Atul Rakate May 28 '18 at 11:11
1

There's a lot of ways to stop the tests from running.


In Workbench, you can go to Utilities > Apex Execute, and run the following code:

ApexTestQueueItem[] items = [SELECT Id FROM ApexTestQueueItem WHERE Status IN ('Holding','Queued','Preparing','Processing')];
for(ApexTestQueueItem item: items) {
    item.Status = 'Aborted';
}
update items;

In the Developer Console, you can click on the Tests tab, click on the test group, and then click on Test > Abort to cancel all remaining tests.


In Setup, you can go to the Apex Test Execution area (Custom Code in Lightning Setup, Develop in Classic Setup), check the "select all" box, and click Abort.


In the Force.com IDE, you can go to the Execute Anonymous feature and run the code from above.


There are other tools out there that can also abort tests, anything that can either run tests or execute anonymous code is capable of stopping those tests from running.

  • But i get following error if i execute any classes,even i execute the above code 'Organization Administration Locked The changes you requested require salesforce.com to temporarily lock your organization's administration setup. However, the administration setup has already been locked by another change. Please wait for the previous action to finish, then try again later. ' – Suresh May 28 '18 at 13:23
  • @B.V.Suresh If it's a deployment and not a test run, you would need to cancel the deployment instead (See Monitoring > Deployment Status). – sfdcfox May 28 '18 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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