Skip to content

Commit 1ff988c

Browse files
authored
Merge pull request #1148 from surishubham/main
Aman's PR 1144,45
2 parents 25fe4b6 + 93633ac commit 1ff988c

15 files changed

+122
-6
lines changed
5.96 MB
Binary file not shown.
97.1 KB
Loading
99 KB
Loading
98.9 KB
Loading
99.9 KB
Loading
98.7 KB
Loading
98.1 KB
Loading
101 KB
Loading

docs/hyperexecute-appium-virtual-device.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
id: hyperexecute-appium-virtual-device
33
title: Appium Testing - Virtual Device On HyperExecute
44
sidebar_label: Appium - Virtual Device
5-
description: Maximize Appium test execution with HyperExecute – Explore LambdaTest's support documentation for seamless automation testing.
5+
description: Execute Appium tests on virtual devices using HyperExecute with TestNG and YAML 0.2. Learn setup, configuration, and seamless test execution steps.
66
keywords:
77
- appium
88
- java
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
id: kane-ai-using-json-variables
3+
title: KaneAI - Utilizing JSON Variables for Assertions
4+
hide_title: false
5+
sidebar_label: JSON Variables Guide
6+
description: Learn how to use JSON variables in the KaneAI test cases for assertions
7+
keywords:
8+
- lambdatest automation
9+
- lambdatest kaneai
10+
- kaneai scroll elements
11+
- kaneai sidebar scroll
12+
url: https://www.lambdatest.com/support/docs/kane-ai-using-json-variables/
13+
site_name: LambdaTest
14+
slug: kane-ai-using-json-variables/
15+
---
16+
17+
<script type="application/ld+json"
18+
dangerouslySetInnerHTML={{ __html: JSON.stringify({
19+
"@context": "https://schema.org",
20+
"@type": "BreadcrumbList",
21+
"itemListElement": [{
22+
"@type": "ListItem",
23+
"position": 1,
24+
"name": "Home",
25+
"item": "https://www.lambdatest.com"
26+
},{
27+
"@type": "ListItem",
28+
"position": 2,
29+
"name": "Support",
30+
"item": "https://www.lambdatest.com/support/docs/"
31+
},{
32+
"@type": "ListItem",
33+
"position": 3,
34+
"name": "KaneAI Jira Integration",
35+
"item": "https://www.lambdatest.com/support/docs/kane-ai-using-json-variables/"
36+
}]
37+
})
38+
}}
39+
></script>
40+
This document outlines the process of using JSON variables in KaneAI to assert specific objects within an API response. The guide provides a step-by-step procedure for executing API calls, examining responses, and performing assertions on both status and body of the response.
41+
42+
## Prerequisites
43+
- Access to KaneAI platform
44+
- Basic understanding of API testing
45+
- Familiarity with JSON structures
46+
47+
## Step 1: Understanding JSON Variable Assertions
48+
In KaneAI, you can use JSON variables to perform detailed assertions on API responses. This allows you to validate specific objects and elements within the response structure.
49+
50+
## Step 2: Initiating an API Call
51+
- Navigate to your desired API endpoint (e.g., a pet store website)
52+
- Configure the necessary API call parameters
53+
- Execute the API request
54+
55+
### Example Workflow:
56+
- Select the appropriate HTTP method (GET, POST, etc.)
57+
- Add required headers
58+
- Input any necessary request body
59+
- Send the request
60+
61+
<img loading="lazy" src={require('../assets/images/kane-ai/knowledge-base/variables/json-variable/image2.jpg').default} alt="Image" className="doc_img img_center"/>
62+
63+
## Step 3: Accessing Response Variables
64+
After executing the API call, KaneAI automatically generates variables containing:
65+
- Response status code
66+
- Response body
67+
- Response headers
68+
- Other relevant metadata
69+
70+
<img loading="lazy" src={require('../assets/images/kane-ai/knowledge-base/variables/json-variable/image3.jpg').default} alt="Image" className="doc_img img_center"/>
71+
72+
## Step 4: Asserting Response Status
73+
To assert the response status:
74+
75+
- Use double curly braces `{{` to access the variable list
76+
- Navigate using arrow keys to select the status variable
77+
- Define your expected status code
78+
79+
<img loading="lazy" src={require('../assets/images/kane-ai/knowledge-base/variables/json-variable/image4.jpg').default} alt="Image" className="doc_img img_center"/>
80+
81+
### Example:
82+
- Expected status: 200
83+
- If actual status is 500, the assertion will fail
84+
85+
<img loading="lazy" src={require('../assets/images/kane-ai/knowledge-base/variables/json-variable/image5.jpg').default} alt="Image" className="doc_img img_center"/>
86+
87+
## Step 5: Asserting Response Body
88+
Navigate through the response body using the same double curly brace method:
89+
- Open the variable selection menu with `{{`
90+
- Browse to the specific JSON element you want to validate
91+
- Create an assertion for that element
92+
93+
<img loading="lazy" src={require('../assets/images/kane-ai/knowledge-base/variables/json-variable/image6.jpg').default} alt="Image" className="doc_img img_center"/>
94+
95+
### Example Validation:
96+
- Check if 'dogs' element exists in the response
97+
- Verify specific property values
98+
- Validate nested JSON structures
99+
100+
<img loading="lazy" src={require('../assets/images/kane-ai/knowledge-base/variables/json-variable/image7.jpg').default} alt="Image" className="doc_img img_center"/>
101+
102+
<br />
103+
104+
## Video Explanation
105+
<video class="right-side" width="100%" controls id="vid">
106+
<source src= {require('../assets/images/kane-ai/knowledge-base/variables/json-variable.mp4').default} type="video/mp4" />
107+
</video>

0 commit comments

Comments
 (0)