Hi guys currently i am using Tooling Api to integrate a java app to Salesforce using Soap Api.I am making a callout for runtest() It's working fine with rest api but it doesn't work with soap i don't no how to make request for soap.

Here is code for rest Api which i am able to implement.

/runTestsAsynchronous/ Body: {"tests":<tests array>}
where tests array is
"classId" : "yourClassId",
"testMethods" : ["testMethod1","testMethod2","testMethod3"]
"classId" : "yourOtherClassId",
"testMethods" : ["testMethod1","testMethod2"]

same request for Soap is not working

  • 3
    Why does it matter? If the Rest API is working for you, isn't that enough? What problem are you trying to solve?
    – sfdcfox
    Dec 16, 2015 at 6:38

2 Answers 2


The SOAP version on the Tooling API doesn't currently have an equivalent web method that allows you to specify the testMethods to run in each apex class.

See RunTestsRequest, which is the parameter accepted by runTests().

There is runTestsAsynchronous() in the Tooling API. It doesn't allow you to specify the methods to test (as at Spring '16). You can however defined the Apex class Ids or test Suite Ids. There is also an option to set the maxFailedTests. See the example code in ApexTestQueueItem.


Did you try this example? This will give you the necessary Java class you need to call runtestAsynchronous() soap method whil also setting up the class and suite Ids. Unlike REST API you can not use a Test Array ID List, You can only pass in either suite Ids and/or class Ids. I hope this helps


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .