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

2
  • 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. Commented Nov 22, 2019 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
    Commented Nov 22, 2019 at 10:17

1 Answer 1

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.

1
  • Thank you for your answer.
    – lemming
    Commented Nov 22, 2019 at 22:46

You must log in to answer this question.

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