< All Topics

GetUID

GetUID API returns the unique id(TestRunID) corresponding to the given ProjectKey and TestName.

TestRunID is used in Validate API to trigger visual validation

A new TestRunID should be used for every new test execution

Same TestRunID should be used for different steps of same test

URI:
http://<site-url>/api/GetUID
For example, http://192.168.10.13:90/api/GetUID

Content-Type: application/json

Type: Post

Payload (Sample)

{
    "TestName" : "My Test",
    "ProjectKey" : "4db93dff-beef-4f68-b118-2e2358985134"
}

TestName: Desired test name ( Special character’s like #, &, ^, @ are not allowed in name)
ProjectKey: This is a unique identifier of a project where you would want to store executions. It can be found in the project tab as below:

Validate

Validate API queues the request for visual validation.

URI
http://<site-url>/api/Validate
For example, http://192.168.10.13:90/api/Validate

Content-Type: application/json

Type: Post

Payload (Sample)

{
  "StepName": "Step 1",
  "TestRunID":  "4d8a4313-f7bd-440c-bf7a-898a7bff38b7",
  "ImageBase64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+P+/HgAFhAJ/wlseKgAAAABJRU5ErkJggg=="
}
  • StepName: Desired step name ( Special character’s like #, &, ^, @ are not allowed in name)
  • TestRunID: The output from GetUID API
  • ImageBase64: The step screenshot in Base64 format
  • ExcludeRegion: [Optional] The regions to exclude from validation in ‘x,y,width,height’ format (e.g. 0,0,50,50;150,150,100,100)
  • IgnoreArea: [Optional] Ignores the bounding area of specified square pixels (e.g. 25)

For the first run it will create the baseline. Any subsequent runs will be compared against baseline.

It matches the image with same StepName in the baseline

Negative

Validate API queues the request for negative visual validation. It will pass the test if there is a mismatch in the image at the specified location.

URI
http://<site-url>/api/Negative
For example, http://192.168.10.13:90/api/Negative

Content-Type: application/json

Type: Post

Payload (Sample)

{
  "StepName": "Step 1",
  "TestRunID":  "4d8a4313-f7bd-440c-bf7a-898a7bff38b7",
  "ImageBase64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+P+/HgAFhAJ/wlseKgAAAABJRU5ErkJggg=="
}
  • StepName: Desired step name ( Special character’s like #, &, ^, @ are not allowed in name)
  • TestRunID: The output from GetUID API
  • ImageBase64: The step screenshot in Base64 format
  • ExcludeRegion: [Optional] The regions to exclude from validation in ‘x,y,width,height’ format (e.g. 0,0,50,50;150,150,100,100)
  • TargetRegion: [Optional] The regions to specify for negative validation in ‘x,y,width,height’ format (e.g. 0,0,50,50;150,150,100,100)
  • IgnoreArea: [Optional] Ignores the bounding area of specified square pixels at any location (e.g. 25)

Important Notes

  • Starting from Imagium 2.0 exclude regions can be specified at the runtime via API
  • TargetRegion only works with negative testing
  • If no TargetRegion is specified, the the whole image will be considered for negative testing otherwise only the specified region(s) shall be considered
  • TargetRegion and ExcludeRegion can be specified from GUI as well as API or both
Next 2. Multiple Modes
Table of Contents