Testing the Application
On the Home ribbon tab, click Test Application () in the Test section. A second desktop window opens, and a test run of your application starts. If you click the Test Application button again, the running application is replaced by a fresh copy of your application, taking any recent changes you have made in the builder into account.
If you work with your running application and then click Test Application again in the builder, any unsaved work you have made to your application test run will be lost.
You can also test the application to see how it runs in a web browser. Click the Test in Web Browser button () to launch the application in a web browser using COMSOL Server. The application opens in a new browser window in the default browser. Click the down arrow in the lower-right corner of the Test in Web Browser button () to open a menu where you can choose to test the application in Google Chrome™, Firefox®, or Internet Explorer® browsers, if you have installed those browsers.
Applying Changes to a Running Application
Some changes that you make to your builder model can be applied to the running application without restarting it. This can be convenient if you are developing methods that you need to test or if you want to try out layout changes. A hot code swap mechanism is used to update the running application with new code and settings from the builder application. If there is a conflict between the running application and the builder model, the hot code swap can fail and you have to restart the application instead.
To apply changes, go to the Application ribbon tab and click Apply Changes (). You can add, edit, and remove methods, events, declarations, forms, and widgets. This includes layout changes, editing command sequences, and labels. You can also use this button to change the model — for example, the plot settings. Note that when you change the model, there is a risk of conflicts with the model in the running application, preventing the hot code swap. If this conflict is detected before any code has been swapped into the running application, you can choose to continue running the application without applying the changes or to restart the application.
Figure 2-6: Error message when the hot code swap fails.
The conflicts can go undetected until some code has already been swapped into the running application. You can continue running the application, but its state is generally undefined. You can also choose to continue running, restart, or close the application.