Performing Visual Testing through API
- Authorization - This API enables users to authenticate. On successful authentication, the user will get a token.
Parameters -
- email-your email id
- accessKey-your access key (you will get it from Account Settings->API)
Response -
- Get Device
request POST < Cloud_URL>/api/devices
Parameter Description
- token: Authtoken (you can get this from the authenticate response)
- duration: Duration in minutes (How many minutes you want the device for).
- platform: Which platform devices (Android or iOS) you want to view.
- available_now true or false.: True means display the available devices and false means display all devices (including busy and available).
Response -
- Book Device
request POST <Cloud_URL>/api/book_device
Parameter Description
- token: Authtoken (You will get this from the authenticate response)
- duration: Duration in minutes (How many minutes do you want to book the device for?).
- id: Device id (You will get this from the get devices api response).
Response -
-
Upload image
request POST <Cloud_URL>/api/v2/visual/upload-imageheader 'token: ******************'
form 'file=@"/file_path”
Parameter Description
- token: Authtoken (You will get this from the authenticate response)
- Image(.png file)(Image that you wish to test)
Response -
-
Get all text of the uploaded image: This api is used to get all the text present in the uploaded image
request POST <Cloud_URL>/api/v2/ocr/textbody '{"imageId":"b23e03ce-1cf2-41ab-9e0c- b8e91b8ed384","rid":2320539}'
Parameter Description
- token: Authtoken (You will get this from the authenticate response)
- ImageID:(You will get this from the Upload image response.ie fileId)
- Rid:(You will get this using book device api)
Response -
- To verify a word is present in the image-This API enables the user to check if the word is there or not in the image
request POST <Cloud_URL>/api/v2//ocr/text-exists
Parameter Description
- token: Authtoken (You will get this from the authenticate response)
- ImageID:(You will get this from the Upload image response.ie fileId)
- Rid:(You will get this using book device api)
- word( Enter the word that you wish to verify)
Response -
- To get the coordinates of a particular word
Note: There should not be space between the words.
request POST <Cloud_URL>/api/v2//ocr/text-coordinate
Parameter Description
- token: Authtoken (You will get this from the authenticate response)
- ImageID:(You will get this from the Upload image response.ie fileId)
- Rid:(You will get this using book device api)
- word( Enter the word that you wish to verify)
Response -
Note: if the user gives any word that is not there then they will get an empty response
- Compare two images - This API is used to compare two images and find the difference between the two images
request POST <Cloud_URL>/api/v2/visual/imagecompare
Parameter Description
- token: Authtoken (You will get this from the authenticate response)
- First ImageID:(You will get this from the Upload image response.ie fileId)
- Second ImageID:(You will get this from the Upload image response.ie fileId)
- Rid:(You will get this using book device api)
Response -
Note: User needs to convert base64 to png. Differences will be highlighted