Hi Folks,
When I was trying to debug and facing problem I went through many blog posts and didn't find even a single post which gave all the steps needed to debug XSJS. Hence I am writing one and hoping someone is happy to see this.
1. To be able to debug you will require following debugger role to your HANA ID:
sap.hana.xs.debugger::Debugger
2. Create Debug Configuration for your XS project.
Click on Apply/Save button to save the debug configuration.
3. Now create breakpoints wherever you want to debug. You can create breakpoints by double clicking on left most side of the code line.
4. Now run your project in a web browser(preferably in Google Chrome). When your XS application runs a unique session id will be generated . The session id can be seen by opening Develeoper tools of web browser. Press "F12" to open developer tools and note down the session id.
5. Now go to HANA Studio and start debugging. Select your project and click debug icon and select the debug configuration you created in earlier stage.
6. Once you start debugging HANA studio will ask which session to debug hence you will have to select a session which you noted down in earlier stage.
7. Now go to the web browser where your application is running and you noted down session id. Just go to the point where you want application to go in debug mode/ to the point where you create breakpoints.
Once the break point reaches you will see in HANA studio a green line indicating debug mode.
I hope it will help someone.
--
Regards,
Rauf