0

I have a number of pages that use JavaScript remoting methods in order to access controller methods. I would like to run some automated tests on these methods and wonder if it's possible to access them from outside of Salesforce?

Basically, is it possible to authenticate with Salesforce and then call a VisualForce remoting method outside the context of a VisualForce page.

Thanks

  • 1
    Are you talking about @RemoteAction methods invocation outside the Salesforce? If so, it is possible to do it. You can debug the invocation of remote actions and simulate it. You just need to open the visualforce page from the external system, parse it in order to get tokens and perform request to Salesforce remoting server. – Raman Silin Nov 22 '19 at 10:12
  • Thanks @RamanSilin. Yes I was talking about RemoteActions. I can see the tokens in the markup now. Seems tricky, but doable. – lemming Nov 22 '19 at 10:17
1

The typical way to do this is by way of a Headless Browser. Such an application has the entire browser engine of the browser, without a user interface, and with additional hooks for calling JavaScript methods from the external application. Do remember, however, that this technique means that any data changes you make to the system will be done "for real", as Salesforce does not know that you're "only" testing the platform in this scenario.

| improve this answer | |
  • Thank you for your answer. – lemming Nov 22 '19 at 22:46

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.