Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/kane-ai/app-test/execute-test.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/kane-ai/kane-ai-js-execution.mp4
Binary file not shown.
96 changes: 0 additions & 96 deletions docs/hyperexecute-multi-webdriver-support.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/hyperexecute-use-cases.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ slug: hyperexecute-use-cases/
<h3>How you can seamlessly integrate your tests testing tool with HyperExecute for enhanced Test Orchestration?</h3>
</div>
</a>
<a href="/support/docs/hyperexecute-multi-webdriver-support/">
<div className="support_inners">
<h3>How to perform multi webdriver based parallel execution?</h3>
</div>
</a>
<a href="/support/docs/hyperexecute-build-mobile-apps-using-tools/">
<div className="support_inners">
<h3>How to build your mobile applications via HyperExecute?</h3>
Expand Down
75 changes: 75 additions & 0 deletions docs/kane-ai-app-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
id: kane-ai-app-test
title: Automate your App Testing with KaneAI
hide_title: false
sidebar_label: App Test
description: Learn how to automate app testing with KaneAI. Generate and execute tests in plain English, save cases, and run them seamlessly
keywords:
- lambdatest automation
- lambdatest kaneai
- kaneai app test
url: https://www.lambdatest.com/support/docs/kane-ai-app-agent
site_name: LambdaTest
slug: kane-ai-app-test/
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<script type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify({
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://www.lambdatest.com"
},{
"@type": "ListItem",
"position": 2,
"name": "Support",
"item": "https://www.lambdatest.com/support/docs/"
},{
"@type": "ListItem",
"position": 3,
"name": "KaneAI Web Test",
"item": "https://www.lambdatest.com/support/docs/kane-ai-app-test"
}]
})
}}
></script>
In this guide, we'll walk you through the process of generating, and executing automated tests for your mobile application using KaneAI.

## Steps to generate the test cases

### Step 1: Create an App Test
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.

<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"/>

### Step 2: Write Your Test Cases in Plain English
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.

For example:
- Click on the hamburger menu button.
- Write the test in the text field "This is a sample app".
- Click on the "+" button.

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**.

> **Remember:** The more specific you are, the more accurate KaneAI's generated test cases will be.

<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"/>

### Step 3: Save your Test Case
Now, save all of the test cases you've generated so far.

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.

<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"/>

### Step 4: Execute your test
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.

<img loading="lazy" src={require('../assets/images/kane-ai/app-test/execute-test.gif').default} alt="Image" width="1347" height="616" className="doc_img"/>
117 changes: 117 additions & 0 deletions docs/kane-ai-javascript-execution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
id: kane-ai-javascript-execution
title: KaneAI - JavaScript Execution
hide_title: false
sidebar_label: JavaScript Execution
description: Learn how to execute your tests on Kane AI using custom javascript snippets
keywords:
- lambdatest automation
- lambdatest kaneai
- kaneai guided walkthrough
- kane ai prompts
- kane ai commands
url: https://www.lambdatest.com/support/docs/kane-ai-javascript-execution/
site_name: LambdaTest
slug: kane-ai-javascript-execution/
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<script type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify({
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://www.lambdatest.com"
},{
"@type": "ListItem",
"position": 2,
"name": "Support",
"item": "https://www.lambdatest.com/support/docs/"
},{
"@type": "ListItem",
"position": 3,
"name": "KaneAI JavaScript Execution",
"item": "https://www.lambdatest.com/support/docs/kane-ai-javascript-execution/"
}]
})
}}
></script>
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.

This can be very useful for:
- **Advanced Interactions:** If you need more granular control over interactions that can’t be expressed in plain English.
- **Complex Test Scenarios:** For scenarios that involve manipulating the DOM, testing specific elements, or interacting with APIs directly.
- **Flexibility:** Switch between natural language and JavaScript to suit your testing needs.
- **Precision:** Perform tests that require more detailed code logic.
- **Seamless Execution:** Test JavaScript code directly without any setup.

## How to Execute Custom JavaScript Tests
### Step 1: Click on the "Write a Step" Field
In KaneAI’s test editor, navigate to the "Write a Step" field where you typically write your test scenarios in plain English.

### Step 2: Trigger JavaScript Mode
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.

### Step 3: Write or Paste Your JavaScript Code
Now, you can write or paste your custom JavaScript code snippet directly into the text field. A sample JavaScript code:

```javascript
function simulateTyping(element, text) {
element.value = ''; // Clear any existing value

for (let i = 0; i < text.length; i++) {
let char = text[i];
let keyDownEvent = new KeyboardEvent('keydown', {key: char});
element.dispatchEvent(keyDownEvent);
element.value += char;

let inputEvent = new Event('input', {bubbles: true});
element.dispatchEvent(inputEvent);
let keyUpEvent = new KeyboardEvent('keyup', {key: char});
element.dispatchEvent(keyUpEvent);
}

let changeEvent = new Event('change', {bubbles: true});
element.dispatchEvent(changeEvent);
}

// Example usage
let inputElement1 = document.querySelector('[aria-label="First Name"]');
let inputElement2 = document.querySelector('[aria-label="Last Name"]');
let inputElement3= document.querySelector('[aria-label="Email"]');
simulateTyping(inputElement1, 'Aman');
simulateTyping(inputElement2, 'Chopra');
simulateTyping(inputElement3, 'amanc@lambdatest.com');

return {"First name": "Aman", "Last name": "Chopra", "email": "amanc@lambdatest.com"};
```

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.

### Step 4: Execute the Test
Once your code is ready, simply press Enter. KaneAI will run your custom JavaScript snippet in the current testing environment.

#### Handling Return Values and Variable Usage
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.

For example, in the code snippet provided:

```javascript
return {"First name": "Aman", "Last name": "Chopra", "email": "amanc@lambdatest.com"};
```

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.

> 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.

#### JavaScript Snippets in Generated Code
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.

<video class="right-side" width="100%" controls id="vid">
<source src= {require('../assets/images/kane-ai/kane-ai-js-execution.mp4').default} type="video/mp4" />
</video>
2 changes: 1 addition & 1 deletion docs/kane-ai-web-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Keep adding instructions/commands in plain English as you go; KaneAI will automa
### Step 3: Save your Test Case
Now, save your test cases that you have generated till now.

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.
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.
<img loading="lazy" src={require('../assets/images/kane-ai/save-test.png').default} alt="Image" width="1347" height="616" className="doc_img"/>

### Step 4: Execute your test
Expand Down
7 changes: 6 additions & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,6 @@ module.exports = {
items: [
"hyperexecute-how-smart-caching-boosts-tests-speed",
"hyperexecute-seamless-integration-with-tools",
"hyperexecute-multi-webdriver-support",
"hyperexecute-build-mobile-apps-using-tools",
"hyperexecute-utilizing-custom-libraries",
"hyperexecute-supported-languages-and-packages"
Expand Down Expand Up @@ -1016,6 +1015,11 @@ module.exports = {
"kane-ai-guided-walkthrough",
],
},
{
type: "doc",
label: "App Test",
id: "kane-ai-app-test"
},
{
type: "doc",
label: "Test Plan",
Expand All @@ -1027,6 +1031,7 @@ module.exports = {
label: "Knowledge Base",
items: [
"kane-ai-command-guide",
"kane-ai-javascript-execution"
],
},
{
Expand Down
Loading