Geo-fence testing using set location and notification features

Geo-fencing is a technology you can test using the Set Location and Notification open features. We have uploaded a sample project that shows the test strategy to follow, including the server configuration and how to test the client feature scenarios. 

To test geo-fencing, you create user profiles per dwelling time in geo-fence ranges/area. This requires:

  • A Virtual area in a real geographical location
  • Push notifications when the user enters and exits the geo-fence area
  • An application installed and enabled with GPS, Wi-Fi, and cellular data interfaces
Important: This article is not related to Perfecto's geolocation feature.

Step-by-step Instructions

The following procedure describes how to test geo-fencing using the Set Location and notification open features.

  1. Go through the slides in the following PDF file, which includes these sections:

    GeoFencingAndPerfecto.pdf

    1. Geo-Fencing Overview

    2. Geo-Fencing Architecture and notification

    3. Testing Strategy for testing Geo-Fencing notification by using Set Location

    4. Adv/Disadvantages of Geo-Fencing

    5. Vitals of Geo-Fencing

    6. Reference links for Developing Geo-Fencing enabled Application for Android, iOS, Windows.

  2. Watch the following video. It illustrates a sample automation test scenario.

    1. The user launches a geo-fence enabled app, in this case as an admin user (adding Geo-fence, configuring notifications, dis/enabling Bluetooth / WiFi, and so on) and then as a client user (to be able to use Geo-fencing, the user will receive a notification on entering/exiting the Geo-fence area).

    2. The user adds Geo-fencing and configures notification alerts to appear when the user enters or exits the Geo-fence area.

    3. The user uses the Set Location feature to mock a location. The user appears to be entering or exiting a specific geo-fence area.

    4. When the user enters the area, the user receives a notification and confirms/validate the entry.

    5. When the user exits the area, the user receives a notification and confirms/validates the exit.

    6. The user deletes the geo-fence area created earlier.

  3. Work with the Geo-Fencing sample test project, as follows:

    1. Clone or download projects from here: https://github.com/PerfectoCode/Community-Samples
    2. Import the project PerfectoGeoFencingDemo into the Eclipse IDE.
    3. Open Perfecto device.
    4. From the Google Play store, install the app GeoAlert. You will use this app with our geo-fence demo automation code.
    5. Open file the following file: PerfectoGeoFencingDemo/src/com/perfecto/demo/GeoFencing/GoeFencingDemo.java 
    6. Update the following information with your own details:
    7. Copy
      String host = "MyHost.perfectomobile.com";
      capabilities.setCapability("user", "user@perfectomobile.com");
      capabilities.setCapability("securityToken", "tokenNeedToBeAddedHere");
      capabilities.setCapability("deviceName", "");

      where:

      • MyHost is the name of your Perfecto cloud
      • user@perfectomobile.com is your user's email address.
      • tokenNeedToBeAddedHere is your Perfecto security token.
      • The deviceName parameter requires the name of the device you are testing.