- Welcome to Pcloudy!
- Existing Users
- Mobile Testing
- Getting Started
- Live Testing - Mobile
- Setting up Google Pay on Android Devices
- Uploading Apps & Installation
- App Activation for Readiness
- Reports & Analytics
- Test Management & Logging
- Debugging Apps
- Local Testing
- Additional Features
- Testing Apple Pay on iOS Devices
- Device Planner
- Accessibility Testing
- Enabling iOS Settings
- Android Image Injection
- iOS Image Injection
- OCR Testing
- Appium
- XCTest
- Espresso
- Automation Studio
- DevOps
- Web Testing
- Mobile Testing
- New Users to Pcloudy Unified Platform
- Pcloudy Unified Documentation
- Quality Lifecycle Management - QLM
- Analyzing Test Runs on QLM
- Introduction to My Space
- Creating and Managing Tickets in QLM
- Creation and Execution of Automated Test Runs
- Understanding Test Runs Dashboard in QLM
- Creating Manual Test Case in QLM
- Creating and Managing Test Suites in QLM
- Creating a Release & Adding Milestones in QLM
- Creating User Story in QLM
- No-Code Test Automation
- Opkey License Request & Upload
- Opkey Execution Agent Installation
- Using Mobile Recorder to Create a Test Case for Mobile Application
- Creating Automated Test Case in QLM
- Creating and Calling a Reusable component in Test Case
- Creating Reusable Component Using Keywords
- Creating a Local Data Repository in a Test Case
- Creating a Global Data Repository and Adding Encryption
- Working with Global Variables
- Creating SOAP API Test in Automate
- Creating REST API Test in pCloudy
- Schedule a Test Suite
- Quality Lifecycle Management - QLM
- Existing Users
- AI Tools
- App Performance Testing
- Cloud Administration
- API Documentation
- Integrations
- Release Note
- Release Note 5.7
- Release Note 5.8
- Release Note 5.9
- Release Note 6.0
- Release Note 6.1
- Release Note 6.2
- Release Note 6.3
- Release Note 6.4
- Release Note 6.5
- Release Note 6.6
- Release Note 6.7
- Release Note 6.8
- Release Note 6.9
- Release Note 6.10
- Release Note 6.11
- Release Note 6.12
- Release Note 6.14
- Release Note 6.13
- Release Note 7.0
- Release Note 7.1
- FAQs
Visual Testing Using API
Performing Visual Testing through API
- Authorization - This API enables users to authenticate. On successful authentication, the user will get a token.
curl -u "email:apiKey"< Cloud_URL>/api/access
Parameters -
- email-your email id
- accessKey-your access key (you will get it from Account Settings->API)
Response -
{"result":{"token":"yz8jn9********whbfgj","code":200}}
- Get Device
request POST < Cloud_URL>/api/devices
curl -H "Content-Type: application/json" -d '{ "token":"authToken","duration":10, "platform":"platform", "available_now":"true"}'
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 -
{
"result": {
"token": "yz8jn9********whbfgj",
"code": 200,
"models": [
{
"index": 1,
"full_name": "Apple_iPadPro3rdGen_Ios_14.6.0_3f939",
"id": 780,
"alias_name": "3f939",
"model": "iPadPro3rdGen",
"display_name": "iPad Pro 3rd Gen",
"platform": "ios",
"version": "14.6.0",
"cpu": "Octa Core",
"bucket": 4,
"manufacturer": "Apple",
"mobile_number": "",
"dpi": "xxxhdpi",
"url": "https://device.pcloudy.com/device_images/small/iPad_Pro_3rdgen.png",
"ram": 6144,
"resolution": "2048x2732",
"display_area": 12.9,
"available": true
}
]
}
}
- Book Device
request POST <Cloud_URL>/api/book_device
curl -H 'ContentType:application/json' -d '{"token":"authToken","duration":minutes, "id":device_id}'
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 -
{"result":{"token":"yz8jn9k********mwhbfgj","code":200,"rid":2320557}}
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 -
{
"requestId": "566315c0-6827-485f-9667-255c356db66d",
"statusCode": 200,
"status": "success",
"message": "image.png uploaded successfully",
"data": {
"fileId": "5566fb19-0a23-420c-8d5c-851771152594",
"filename": "image.png"
}
}
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 -
{
"requestId": "1bb75b3e-a7e9-4e82-9d5a-1a18044a65d5",
"statusCode": 200,
"status": "success",
"message": "OK",
"data": "No Service\n6:23 pmn\nAA\nfacebook.com\nfacebook\nMobile number or email address\nPassword\nLog In\nForgotten password?\nor\nCreate New Account\nEnglish (UK)\n93\nHRTST\nf\nAbout Help More\nMeta 2022"
}
- 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
--header 'token: 75c4g6**********smkpbhdyy'
--body '
{
"imageId":"5566fb19-0a23-420c-8d5c-851771152594",
"word":"amazon",
"rid":2320383
}'
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 -
{
"requestId": "862e515c-9caa-4bd4-8448-b80be834650b",
"statusCode": 200,
"status": "success",
"message": "OK",
"data": false
}
- 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
---header 'token: 75c4g6*********kpbhdyy'
--data-raw '{"imageId":"97256bf5-f3dc-4098-8a65-808b2d7c874c","word": "FACEBOOK", "rid": 2320389} '
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 -
{
"requestId": "862e515c-9caa-4bd4-8448-b80be834650b",
"statusCode": 200,
"status": "success",
"message": "OK",
"data": [
{
"WordText": "FACEBOOK",
"Left": 259,
"Top": 909,
"Height": 33,
"Width": 217
}
]
}
Note: if the user gives any word that is not there then they will get an empty response
{
"requestId": "7a1f7ab1-fb6f-4e23-92a2-d87dd244df2c",
"statusCode": 200,
"status": "success",
"message": "OK",
"data": []
}
- 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
--header 'token: 75c4g6r3********kpbhdyy'
----body '{
"firstImageId":"7f8c1426-48b0-467e-a05c-f9af917a09c8",
"secondImageId":"0e6a80da-8b34-4855-9208-961c647680d5",
"rid":2320383
}'
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 -
{
"requestId": "276fa242-4d92-4e0f-a5da-ccb308a230e1",
"statusCode": 200,
"status": "success",
"message": "OK",
"data": < base64>
Note: User needs to convert base64 to png. Differences will be highlighted