Launching UI5 apps with additional URL parameters in WebIDE
I recently came across the issue of testing a UI5 app in the WebIDE that required URL parameters on launch and although this could be achieved easily on a local server setup, when deployed onto HCP the WebIDE seemed to provide few options for testing.
The WebIDE provides a nice size adjustable Frame layout to test code changed however the URL provided is run from a HCP server and so contains non standard URL parameters.
On a recent project I was required to launch my app with URL parameters after the index.html with a hash followed by multiple parameters.
This can be particularly useful when running apps within environments that pass information into your UI5 app on launch, e.g. custom C4C apps. Or even to test routing mechanisms within HCP without having to commit your untested code to HCP with a version number or push it to HCP with a git tag for versioning.
As it happens, looking closer at the WebIDE settings you can customise how it runs web applications for testing purposes.
Under Run » Run Configurations » New Run Configuration you can specify how you would like to run your app.
Here you can specify settings such as which version of the SAPUI5 SDK you would like to load. You can even provide standard URL parameters which are in turn translated into ASCII characters as standard in your web browser.
Un-ticking the ‘Open with frame’ tick box will force WebIDE to load your app in full screen mode when the button is pressed, you may have to select the ‘Run’ menu and click on your test configuration.
Now that your app has opened you can manipulate the browsers URL and test your code without having to deploy to HCP.