Skip to content

Commit 8274dd0

Browse files
authored
Merge pull request #1012 from surishubham/main
Aman's PR 983, 1008, 09, 10, 11
2 parents 69ac16b + f6a85b0 commit 8274dd0

11 files changed

+199
-103
lines changed
624 KB
Loading
1.69 MB
Loading
76.2 KB
Loading
127 KB
Loading
46.8 MB
Binary file not shown.

docs/hyperexecute-multi-webdriver-support.md

Lines changed: 0 additions & 96 deletions
This file was deleted.

docs/hyperexecute-use-cases.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ slug: hyperexecute-use-cases/
4949
<h3>How you can seamlessly integrate your tests testing tool with HyperExecute for enhanced Test Orchestration?</h3>
5050
</div>
5151
</a>
52-
<a href="/support/docs/hyperexecute-multi-webdriver-support/">
53-
<div className="support_inners">
54-
<h3>How to perform multi webdriver based parallel execution?</h3>
55-
</div>
56-
</a>
5752
<a href="/support/docs/hyperexecute-build-mobile-apps-using-tools/">
5853
<div className="support_inners">
5954
<h3>How to build your mobile applications via HyperExecute?</h3>

docs/kane-ai-app-test.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
id: kane-ai-app-test
3+
title: Automate your App Testing with KaneAI
4+
hide_title: false
5+
sidebar_label: App Test
6+
description: Learn how to automate app testing with KaneAI. Generate and execute tests in plain English, save cases, and run them seamlessly
7+
keywords:
8+
- lambdatest automation
9+
- lambdatest kaneai
10+
- kaneai app test
11+
url: https://www.lambdatest.com/support/docs/kane-ai-app-agent
12+
site_name: LambdaTest
13+
slug: kane-ai-app-test/
14+
---
15+
16+
import Tabs from '@theme/Tabs';
17+
import TabItem from '@theme/TabItem';
18+
19+
<script type="application/ld+json"
20+
dangerouslySetInnerHTML={{ __html: JSON.stringify({
21+
"@context": "https://schema.org",
22+
"@type": "BreadcrumbList",
23+
"itemListElement": [{
24+
"@type": "ListItem",
25+
"position": 1,
26+
"name": "Home",
27+
"item": "https://www.lambdatest.com"
28+
},{
29+
"@type": "ListItem",
30+
"position": 2,
31+
"name": "Support",
32+
"item": "https://www.lambdatest.com/support/docs/"
33+
},{
34+
"@type": "ListItem",
35+
"position": 3,
36+
"name": "KaneAI Web Test",
37+
"item": "https://www.lambdatest.com/support/docs/kane-ai-app-test"
38+
}]
39+
})
40+
}}
41+
></script>
42+
In this guide, we'll walk you through the process of generating, and executing automated tests for your mobile application using KaneAI.
43+
44+
## Steps to generate the test cases
45+
46+
### Step 1: Create an App Test
47+
Navigate to the [KaneAI homepage](https://kaneai.lambdatest.com/objective) and click on the **Create an App Test** button to initiate the process of generating test cases for your mobile app. Now select your desired operating system (Android, iOS) and upload your application to the platform to start testing.
48+
49+
<img loading="lazy" src={require('../assets/images/kane-ai/app-test/create-app-test.gif').default} alt="Image" width="1347" height="616" className="doc_img"/>
50+
51+
### Step 2: Write Your Test Cases in Plain English
52+
In this step, you'll describe your desired test outcomes using plain English. Don't worry about writing specific code or scripts – KaneAI will handle that for you.
53+
54+
For example:
55+
- Click on the hamburger menu button.
56+
- Write the test in the text field "This is a sample app".
57+
- Click on the "+" button.
58+
59+
Continue to add instructions/commands in plain English as you go; KaneAI will automatically queue them for execution, eliminating the need to wait for one test to finish before writing the next. Click the **Fininsh Test**.
60+
61+
> **Remember:** The more specific you are, the more accurate KaneAI's generated test cases will be.
62+
63+
<img loading="lazy" src={require('../assets/images/kane-ai/app-test/write-test-case.png').default} alt="Image" width="1347" height="616" className="doc_img"/>
64+
65+
### Step 3: Save your Test Case
66+
Now, save all of the test cases you've generated so far.
67+
68+
Select your Project and the folder where you want to save your test cases. The **Test Name** and **Description** will be generated automatically, but you can also edit them. Select your test's **Type** and **Status**, as well as the necessary tags that will allow you to search for it later.
69+
70+
<img loading="lazy" src={require('../assets/images/kane-ai/app-test/save-test-cases.png').default} alt="Image" width="1347" height="616" className="doc_img"/>
71+
72+
### Step 4: Execute your test
73+
To execute your test, click on the **HyperExecute** button and you will be redirected to the [HyperExecute dashboard](https://hyperexecute.lambdatest.com/hyperexecute/jobs) where your tests will be executed.
74+
75+
<img loading="lazy" src={require('../assets/images/kane-ai/app-test/execute-test.gif').default} alt="Image" width="1347" height="616" className="doc_img"/>
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
id: kane-ai-javascript-execution
3+
title: KaneAI - JavaScript Execution
4+
hide_title: false
5+
sidebar_label: JavaScript Execution
6+
description: Learn how to execute your tests on Kane AI using custom javascript snippets
7+
keywords:
8+
- lambdatest automation
9+
- lambdatest kaneai
10+
- kaneai guided walkthrough
11+
- kane ai prompts
12+
- kane ai commands
13+
url: https://www.lambdatest.com/support/docs/kane-ai-javascript-execution/
14+
site_name: LambdaTest
15+
slug: kane-ai-javascript-execution/
16+
---
17+
18+
import Tabs from '@theme/Tabs';
19+
import TabItem from '@theme/TabItem';
20+
21+
<script type="application/ld+json"
22+
dangerouslySetInnerHTML={{ __html: JSON.stringify({
23+
"@context": "https://schema.org",
24+
"@type": "BreadcrumbList",
25+
"itemListElement": [{
26+
"@type": "ListItem",
27+
"position": 1,
28+
"name": "Home",
29+
"item": "https://www.lambdatest.com"
30+
},{
31+
"@type": "ListItem",
32+
"position": 2,
33+
"name": "Support",
34+
"item": "https://www.lambdatest.com/support/docs/"
35+
},{
36+
"@type": "ListItem",
37+
"position": 3,
38+
"name": "KaneAI JavaScript Execution",
39+
"item": "https://www.lambdatest.com/support/docs/kane-ai-javascript-execution/"
40+
}]
41+
})
42+
}}
43+
></script>
44+
With KaneAI’s new JavaScript Execution feature, you now have the flexibility to write or paste custom JavaScript code snippets to perform tests. This allows for more advanced and customized test scenarios alongside KaneAI’s plain English test-writing format.
45+
46+
This can be very useful for:
47+
- **Advanced Interactions:** If you need more granular control over interactions that can’t be expressed in plain English.
48+
- **Complex Test Scenarios:** For scenarios that involve manipulating the DOM, testing specific elements, or interacting with APIs directly.
49+
- **Flexibility:** Switch between natural language and JavaScript to suit your testing needs.
50+
- **Precision:** Perform tests that require more detailed code logic.
51+
- **Seamless Execution:** Test JavaScript code directly without any setup.
52+
53+
## How to Execute Custom JavaScript Tests
54+
### Step 1: Click on the "Write a Step" Field
55+
In KaneAI’s test editor, navigate to the "Write a Step" field where you typically write your test scenarios in plain English.
56+
57+
### Step 2: Trigger JavaScript Mode
58+
To switch to JavaScript execution mode, type the forward slash `/` or click on the `+` icon. You will see a JavaScript Pop-up Option appear. Click on the JavaScript option to switch the input mode to custom JavaScript.
59+
60+
### Step 3: Write or Paste Your JavaScript Code
61+
Now, you can write or paste your custom JavaScript code snippet directly into the text field. A sample JavaScript code:
62+
63+
```javascript
64+
function simulateTyping(element, text) {
65+
element.value = ''; // Clear any existing value
66+
67+
for (let i = 0; i < text.length; i++) {
68+
let char = text[i];
69+
let keyDownEvent = new KeyboardEvent('keydown', {key: char});
70+
element.dispatchEvent(keyDownEvent);
71+
element.value += char;
72+
73+
let inputEvent = new Event('input', {bubbles: true});
74+
element.dispatchEvent(inputEvent);
75+
let keyUpEvent = new KeyboardEvent('keyup', {key: char});
76+
element.dispatchEvent(keyUpEvent);
77+
}
78+
79+
let changeEvent = new Event('change', {bubbles: true});
80+
element.dispatchEvent(changeEvent);
81+
}
82+
83+
// Example usage
84+
let inputElement1 = document.querySelector('[aria-label="First Name"]');
85+
let inputElement2 = document.querySelector('[aria-label="Last Name"]');
86+
let inputElement3= document.querySelector('[aria-label="Email"]');
87+
simulateTyping(inputElement1, 'Aman');
88+
simulateTyping(inputElement2, 'Chopra');
89+
simulateTyping(inputElement3, '[email protected]');
90+
91+
return {"First name": "Aman", "Last name": "Chopra", "email": "[email protected]"};
92+
```
93+
94+
The provided code snippet simulates typing into text fields programmatically by dispatching key-related events such as keydown, input, keyup, and change. It mimics real user interaction by typing each character into the field and updating its value accordingly. The example provided fills in the first name, last name, and email fields with specific values and returns them in an object format.
95+
96+
### Step 4: Execute the Test
97+
Once your code is ready, simply press Enter. KaneAI will run your custom JavaScript snippet in the current testing environment.
98+
99+
#### Handling Return Values and Variable Usage
100+
If your JavaScript snippet contains return values, KaneAI will automatically save these values in a variable that can be used later in the test. The output from your JavaScript code will be captured and assigned to a variable. This variable will be available for use throughout your test execution.
101+
102+
For example, in the code snippet provided:
103+
104+
```javascript
105+
return {"First name": "Aman", "Last name": "Chopra", "email": "[email protected]"};
106+
```
107+
108+
The returned object with the keys `First name`, `Last name`, and `email` will be stored in a variable. You can reference this variable later in your test to validate or reuse the values.
109+
110+
> Variables created from return values can be used in subsequent test steps. To use the variable, simply refer to the specific property (e.g., First name) in your test steps for verification or further actions.
111+
112+
#### JavaScript Snippets in Generated Code
113+
When your test is executed, the JavaScript code snippet you provided will be added directly into the generated test code. This ensures that any custom interactions performed with JavaScript are part of the overall test logic. The inclusion of JavaScript in the generated code allows for easy tracking, debugging, and modification if needed.
114+
115+
<video class="right-side" width="100%" controls id="vid">
116+
<source src= {require('../assets/images/kane-ai/kane-ai-js-execution.mp4').default} type="video/mp4" />
117+
</video>

docs/kane-ai-web-test.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Keep adding instructions/commands in plain English as you go; KaneAI will automa
6363
### Step 3: Save your Test Case
6464
Now, save your test cases that you have generated till now.
6565

66-
Select your Project, and the folder in which you want to store your test cases. The **Test Name** and the **Description** will be generated automatically, and you can also edit it. Select the **Type** of your test, and the status, and define the necessary tags which will help ypu to search your tests later.
66+
Select your Project, and the folder in which you want to store your test cases. The **Test Name** and the **Description** will be generated automatically, and you can also edit it. Select the **Type** of your test, and the **Status**, and define the necessary tags which will help ypu to search your tests later.
6767
<img loading="lazy" src={require('../assets/images/kane-ai/save-test.png').default} alt="Image" width="1347" height="616" className="doc_img"/>
6868

6969
### Step 4: Execute your test

0 commit comments

Comments
 (0)