Skip to navigation

Verify & test

Learn how to verify and test your HUMAN SDK integration.

This guide is relevant for the current Mobile SDK. While we highly recommend using the latest version, if you are using a legacy integration, refer to the iOS or Android documentation.

After integrating with the SDK, we recommend verifying and testing the integration before deploying to production. HUMAN has recommended checks that we encourage you follow to ensure your app works as expected and it delivers the best experience for your users.

Verify the integration

The Doctor App is a verification tool that comes with the HUMAN SDK. It simulates a typical user flow in your application and helps you ensure that the SDK is integrated correctly. When you enable it, the Doctor App displays a popup as part of the application flow to guide you on how to simulate a user flow.

The Doctor App includes assets that it uses for its own UI. These assets are only required for the Doctor App and aren’t needed in your production build. To minimize the SDK’s footprint, the SDK loads these assets dynamically at runtime.

1

Load Doctor App assets

The Doctor App loads these assets automatically whenever you run the App with an internet connection.

2

The Doctor App’s Flow

  1. Set the HSDoctorAppPolicy/enabled to true while initializing the SDK.
import android.app.Application
import com.humansecurity.mobile_sdk.HumanSecurity
import com.humansecurity.mobile_sdk.main.HSPolicy
class MainApplication: Application() {
override fun onCreate() {
super.onCreate()
startHumanSDK()
}
private fun startHumanSDK() {
try {
val policy = HSPolicy()
policy.doctorAppPolicy.enabled = true
HumanSecurity.start(this, "<APP_ID>", policy)
}
catch (exception: Exception) {
println("Exception: ${exception.message}")
}
}
}
  1. Run your app. The Doctor App UI will appear.

Retrying blocked requests after the challenge is solved will not work while running the Doctor App. In this case, your request handler will receive a “challenge was solved” error.

  1. Select whether to start a new test or load the summary of a previous test if one exists.

Welcome Screen

  1. Select which product to test:
    • Bot Defender
    • Account Defender

Product Selection Screen

  1. Review the detailed instructions on how to start a new test, what is expected, and steps to resolve issues.

Instruction Screen

  1. Choose between:

    1. Native app framework: To test native URL requests.
    2. Web view framework: To test web view URL requests.

Test Selection Screen

  1. Run the test by using your app according to the instructions.

  2. Review the test results on the summary screen. Explore detailed insights for each test and get troubleshooting tips for failed tests.

Summary Screen

  1. Export the test result to a JSON string from the summary screen. Share it with the support team if needed.

  2. Exit the Doctor App. Your app will also be terminated.

3

Clean up

  1. Set HSDoctorAppPolicy/enabled to false after you finish validating the SDK integration.
  2. If you’re using the Doctor App on a simulator or on a real device with iOS 13 or earlier, remove the HUMAN.bundle file from your project.

Test the integration

To test the SDK, you can simulate challenges on various screens and scenarios in your app.

These tests are relevant for Bot Defender integrations only.

  1. Open Challenge Settings in the HUMAN Console.
  2. Select Testing (Native Mobile) tab.
  3. Retrieve the VID of your device by using one of the following methods:
    • Using the VID Extractor:
      1. Click on Find your VID.
      2. Enter your device’s public IP.
      3. Select the relevant session.
    • Using the SDK’s API:
      1. Use the HumanSecurity/vid(forAppId:) function.
  4. Enter the VID in the appropriate field in the Console.
  5. Click on Start Testing.
  6. In your app, trigger URL requests to your server to display a challenge. If a challenge doesn’t appear:
    1. Move your app to the background
    2. Bring it back to the foreground after few seconds.
    3. Trigger URL requests to your server again.
  7. Solve or cancel the challenge and verify how your app behaves.