# Testing your widget

Test your widget on a compatible S60 mobile device. Alternatively, you can first use an emulator provided with the S60 C++ SDK and then perform the final testing on the target device.

### Testing a widget on a mobile device

When you have created your widget functionality and the required widget component files, you need to test it on a mobile device that can run widgets. Use a device that supports the Web Runtime version for which you created the widget.

### To run a widget on a mobile device

1. Create a connection from your PC to your mobile device.

   You have several options for connecting your mobile device to your PC, such as a USB cable and Bluetooth connection. Check your mobile device user guide for instructions on how to make a connection. If you choose to use Nokia PC Suite, check the user guide for more information on using this software.

2. Transfer the widget installation package from your PC to your mobile device, for example, using Nokia PC Suite.

3. Activate the widget package to complete the installation.

   The location where the widget package is stored on the mobile device after the transfer, as well as the way to activate the installation, depend on the method of transfer, as shown in the following table.

   Table: Widget installation methods
   Method of transfer | Location on the device | How to activate the installation
   --- | --- | ---
   Transfer via Bluetooth, email or other communication method | Inbox folder of the Messaging application | Using the Messaging application.
   Transfer using a USB cable | Phone memory, the Other folder | Using the File Manager (File mgr.) application.
   Transfer using the Web Browser for S60 |  | If the MIME type is specified correctly for the widget package, the installation will be completed automatically. For more information, see section Deploying widgets.

4. After a successful installation, launch the widget by navigating to it and selecting Open.

   After a successful installation, you can find the widget under the application menu, in the folder that contains installed applications. The name of this folder varies between mobile devices, and can be, for example, Installations or Applications.

   Figure: Installations folder in the application menu

### Testing a widget on an emulator

The benefits of testing a widget on an emulator include:

- You can test the functionality of the widget for free with the emulator.

- The file system is located on your PC. This makes it easy for you to install the widget package, test it, then modify it and test it again.

  For example, you can test the layout and style of the widget by testing the widget, then modifying the CSS or HTML file and then testing again to see how the modifications affected the layout. In the figure below, the color of the menu descriptions is changed from white to red.

  Figure: Modifying and testing layout changes

### To run a widget on the emulator

1. If you have not used the emulator before, launch it by selecting S60 Developer Tools > [S60 platform version] > [SDK version] > Emulator in the Windows Start menu and then close it again.

   This step is required only once, when you launch the emulator for the first time. It creates some folders to the emulator file system, such as the destination folder needed in step 2. You can later run widgets on the emulator by starting from step 2.

   Note: Starting the emulator may take a while.

2. Copy the widget installation package (`wgz` file) to the emulator file system, in folder `<SDK installation folder>\epoc32\winscw\c\Data\Others`.

   Note: The `Data\Others` folder is visible in the emulator file system only when you have launched the emulator for the first time and then closed it.

   Figure: Others folder in the emulator file system (S60 3rd Edition FP2 SDK)

3. Launch the emulator by selecting S60 Developer Tools > [S60 platform version] > [SDK version] > Emulator in the Windows Start menu.

4. If you are using the S60 3rd Edition FP2 SDK emulator, open Organiser in the application menu.

   If you are using the S60 5th Edition SDK emulator, open Applications in the application menu.

5. Open the File Manager (File mgr.) application.

   Figure: Opening the File Manager application (S60 3rd Edition FP2 SDK)

6. Go to Phone memory > Other to manage files in the `Others` folder of the emulator system.

7. Open the widget to launch the installation process.

   The emulator handles the installation of the widget.

   Figure: Launching the installation process (S60 3rd Edition FP2 SDK)

8. When the widget installation is complete, return to the application menu.

9. If you are using the S60 3rd Edition FP2 SDK emulator, open Installations.

   If you are using the S60 5th Edition SDK emulator, open Applications.

   Figure: Installations folder in the application menu (S60 3rd Edition FP2 SDK)

10. Locate the widget in the folder and open it.

    Now the widget should be running on the emulator.

Note: It is recommended that you test the emulator Internet connectivity with the Web browser to ensure that you can access the Internet before testing your widget communications feature. For more information on how to test the connectivity, see the documentation in the S60 C++ SDK.