Name | WebTorchX JSON |
Version |
0.0.1
JSON |
| download |
home_page | http://nagipragalathan.pythonanywhere.com/ |
Summary | LCTP is a Selenium-based Low-Code Web Testing Automation tool in Python. It simplifies web testing using JSON configuration files, making it easy for testers and developers to automate test scenarios. Also This module provides a command-line interface for various tasks related to the LCTP application. You can use this CLI to run tests, generate requirements files, format Python files, and perform extra functions. |
upload_time | 2023-09-03 07:56:02 |
maintainer | |
docs_url | None |
author | NagiPragalathan |
requires_python | |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<p align="center">
<img src="https://106714.fs1.hubspotusercontent-na1.net/hubfs/106714/Low%20Code%20Citizen%20Developer.jpg" height="200">
</p>
<div align="center">
<h3 align="center">
WebTorch ( LCTP ) - Selenium Low-Code Web Testing Automation in Python
</h3>
</div>
![GitHub](https://img.shields.io/github/license/NagiPragalathan/WebTorch?style=flat-square&logo=github)
![GitHub contributors](https://img.shields.io/github/contributors/NagiPragalathan/WebTorch?logo=github&style=flat-square)
![GitHub top language](https://img.shields.io/github/languages/top/NagiPragalathan/WebTorch?style=flat-square)
[![Telegram](https://img.shields.io/badge/telegram-nagipragalathan-yellow.svg?logo=telegram)](https://t.me/nagipragalathan)
![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg)
[![Read FAQ](https://img.shields.io/badge/Ask%20Question-Read%20FAQ-000000)](https://www.newton.so/view?tags=LCTP)
![GitHub Repo stars](https://img.shields.io/github/stars/NagiPragalathan/WebTorch?style=social)
[![Twitter Follow](https://img.shields.io/twitter/follow/nagipragalathan?style=social)](https://twitter.com/NagiPragalathan)
<div align="center">
**LCTP** is a Selenium-based Low-Code Web Testing Automation tool in Python. It simplifies web testing using JSON configuration files, making it easy for testers and developers to automate test scenarios.
It's a powerful tool designed to streamline your testing efforts, and we're constantly improving it. However, please note that it's still a work in progress and not ready for production use.
[Getting started](#getting-started) ~ [Supported opcodes](#supported-opcodes) ~
[Build](#build) ~ [Test](#test) ~
[Report a bug](https://github.com/)
~ [Questions](https://www.newton.so/view?tags=LCTP)
</div>
<div align="center">
<img src="https://media3.giphy.com/media/9MbgJKNugBIi6QDwEf/200w.webp?cid=ecf05e474m3sg50anfj1rfi5m8628lnk3tqkd77089nsi4y8&rid=200w.webp&ct=g" height="400" />
</div>
<div align="center">
<h2> Fear of coding the testing files use the LCTP to relieve your complexity and upgrade your automation using LCTP for your application. </h2>
</div>
# Setup:
## Installation:
Install LCTP using the following command: `pip install LCTP`
## Usage:
<hr/>
<pre>
{ <br/>
"setup":{<br/>
"driver_path" : "../../../path", <br/>
"auto_install":"true", <br/>
"browser":"Opera", <br/>
"get":"https://www.saucedemo.com/", <br/>
"window" : "maximize" <br/>
"screen_recorder":"true",
"run_amd_wait":"true"
}<br/>
}<br/>
</pre>
<hr/>
The `setup` keyword is mandatory when using LCTP.
1. `driver_path`: Provide the path to the Selenium Chrome driver executable.
2. `auto_install`: Automatically download and install the Chrome driver if not found.
3. `browser`: Specify the browser to be used (e.g., Chrome, Firefox).
4. `get`: Define the URL of the landing page.
5. `window`: It's recommended to use "maximize" to maximize the browser window. You can also use "minimize" if needed.
6. `screen_recorder`: Enable screen recording of the testing session.
7. `run_and_wait`: Wait for the browser window to run the program.
Auto_install can handle the following browsers:
<pre>
1. Chrome
2. ChromeService
3. Brave
4. BraveService
5. Firefox
6. FirefoxService
7. IE
8. IEService
9. Edge
10. EdgeService
11. Opera
</pre>
## Get Elements
### Supported selectors: ['id', 'name', 'class', 'xpath']
<pre>
'id': Get elements by their ID attribute.
'name': Get elements by their Name attribute.
'class': Get elements by their Class attribute.
'xpath': Get elements by their XPath.
</pre>
### Examples:
<pre>
{
"setup":{
"driver_path" : "../../../path",
"auto_install":"true",
"browser":"Opera", //
"get":"https://www.saucedemo.com/", //
"window" : "maximize" //
},
"login_testing":{
"fill_user_name" : {
"id" : "user-name:sk:minimize",
"data" : "standard_user"
},
"fill_password":{
"id":"password:sk",
"data":"secret_sauce"
},
"click_login_btn":{
"id":"login-button:click"
}
},
}
</pre>
### Click a list of Elements line by line
list_data = ['ls_id_clk', 'ls_name_clk', 'ls_xpath_clk']
<pre>
{
"setup":{
"driver_path" : "../../../path",
"auto_install":"true",
"browser":"Opera", //
"get":"https://www.saucedemo.com/", //
"window" : "maximize" //
},
"login_testing":{
"fill_user_name" : {
"id" : "user-name:sk:minimize",
"data" : "standard_user"
},
"fill_password":{
"id":"password:sk",
"data":"secret_sauce"
},
"click_login_btn":{
"id":"login-button:click"
}
},
"home_page":{
"ls_id_clk" : ["add-to-cart-sauce-labs-backpack","add-to-cart-sauce-labs-bike-light","add-to-cart-sauce-labs-fleece-jacket"],
"ls_name_clk" : ["add-to-cart-test.allthethings()-t-shirt-(red)","add-to-cart-sauce-labs-bolt-t-shirt","add-to-cart-sauce-labs-onesie"]
},
"view_cart":{
"select_select_box":{
"xpath":"//*[@id='header_container']/div[2]/div[2]/span/select:select_by_index@2"
},
"nav_to_view_cart":{
"xpath": "//*[@id='shopping_cart_container']/a:click:minimize",
"window": "maximize"
}
}
}
</pre>
### ScreenShot and ScreenRecorder
`"screen_recorder":"true"`: Enable screen recording from the beginning to the end of the test, and it is implemented only in the setup query. The recordings are stored in the Test_Video folder path.<br/>
`"take":"screenshot"`: Take a screenshot of the task at any line of code. The screenshots are stored in the ScreenShots folder path.
### Keywords
#### Send Keys
1. `sk`: Send keys to input fields. You can send keys using two ways: `:sk` and `:sk@data`. If `:sk` is used alone, then the data should be declared in another line.
2. 'c&sk': Clear the input field and send keys, similar to `sk`.
<pre>
"fill_password":{
"id":"password:sk",
"data":"secret_sauce"
},
"fill_changepassword":{
"id":"changepassword:c&sk",
"data":"secret_sauce"
},
</pre>
#### Window Controller
1. `window`: Use it with any field to maximize or minimize the browser window.
2. `set_window_position`: Set the position of the browser window.
<pre>
"nav_to_view_cart":{
"xpath": "//*[@id='shopping_cart_container']/a:click:minimize",
"window": "maximize"
}
"nav_to_view_cart":{
"xpath": "//*[@id='shopping_cart_container']/a:click:minimize",
"window": "minimize"
}
</pre>
# Selenium Low-Code Web Testing Automation Hot Keys
This Python module simplifies web testing with Selenium WebDriver using a low-code approach. It enables developers or testers to write test scenarios using JSON configuration files. Below is the documentation for the project, along with code examples for each section.
## Table of Contents
1. [Installation](#installation)
2. [Usage](#usage)
- [Setup Configuration](#setup-configuration)
- [Login Testing](#login-testing)
- [Home Page Testing](#home-page-testing)
- [View Cart Testing](#view-cart-testing)
- [Additional Example](#additional-example)
3. [JSON Configuration](#json-configuration)
- [Setup Section](#setup-section)
- [Login Testing Section](#login-testing-section)
- [Home Page Section](#home-page-section)
- [View Cart Section](#view-cart-section)
4. [Advanced Features](#advanced-features)
- [Screen Recording](#screen-recording)
- [Running and Waiting](#running-and-waiting)
- [Taking Screenshots](#taking-screenshots)
- [Executing Python Code](#executing-python-code)
5. [Additional Example Configuration](#additional-example-configuration)
6. [Contributing](#contributing)
7. [License](#license)
## Installation <a name="installation"></a>
You can install this module using pip:
```
pip install selenium-webtest
```
## Usage <a name="usage"></a>
To use this module, follow these steps:
1. Create a JSON configuration file for your test scenarios.
2. Utilize the `WebTestExecutor` class to execute your tests.
Here's how you can structure your JSON configuration file and perform different test actions:
### Setup Configuration <a name="setup-configuration"></a>
The `setup` section in your JSON configuration file is used to set up your test environment. It includes the following parameters:
- `driver_path` (str): The path to your WebDriver executable (e.g., ChromeDriver).
- `auto_install` (str): Automatically install the WebDriver if it's not found (set to `"true"` to enable).
- `browser` (str): Specify the browser to use (e.g., "Opera").
- `get` (str): The URL of the website to be tested.
- `window` (str): Maximize the browser window (set to "maximize" to enable).
**Example:**
<pre>{
"setup": {
"driver_path": "../../../path",
"auto_install": "true",
"browser": "Opera",
"get": "https://www.saucedemo.com/",
"window": "maximize"
},
...
}</pre>
### Login Testing <a name="login-testing"></a>
The `login_testing` section defines actions related to logging into a website. It includes the following parameters:
- `fill_user_name`: Fill the username input field.
- `fill_password`: Fill the password input field.
- `click_login_btn`: Click the login button.
**Example:**
<pre>{
"login_testing": {
"fill_user_name": {
"id": "user-name:sk:minimize",
"data": "standard_user"
},
"fill_password": {
"id": "password:sk",
"data": "secret_sauce",
"take": "screenshot"
},
"click_login_btn": {
"id": "login-button:click"
}
},
...
}</pre>
### Home Page Testing <a name="home-page-testing"></a>
The `home_page` section defines actions for interacting with elements on the home page of the website. It includes the following parameters:
- `set_window_position` (optional): Set the position of the browser window.
- `ls_id_clk`: Click elements by their IDs.
- `ls_name_clk`: Click elements by their names.
**Example:**
<pre>{
"home_page": {
"set_window_position": [10, 10],
"ls_id_clk": [
"add-to-cart-sauce-labs-backpack",
"add-to-cart-sauce-labs-bike-light",
"add-to-cart-sauce-labs-fleece-jacket"
],
"ls_name_clk": [
"add-to-cart-test.allthethings()-t-shirt-(red)",
"add-to-cart-sauce-labs-bolt-t-shirt",
"add-to-cart-sauce-labs-onesie"
]
},
...
}</pre>
### View Cart Testing <a name="view-cart-testing"></a>
The `view_cart` section defines actions for viewing the shopping cart. It includes the following parameters:
- `select_select_box`: Select an option from a dropdown menu by index.
- `nav_to_view_cart`: Navigate to the shopping cart and maximize the window.
**Example:**
<pre>{
"view_cart": {
"select_select_box": {
"xpath": "//*[@id='header_container']/div[2]/div[2]/span/select:select_by_index@2"
},
"nav_to_view_cart": {
"xpath": "//*[@id='shopping_cart_container']/a:click:minimize",
"window": "maximize"
}
},
...
}</pre>
### Additional Example Configuration <a name="additional-example"></a>
Here's an additional example of JSON configuration to perform web testing actions:
<pre>{
"setup": {
"web_driver_location": "path",
"dict": {
"a": {
"id": "hello"
}
}
},
"login_page": {
"msg": "to login into",
"id": "id",
"name": "name",
"xpath": "xpath",
"link_text": "LINK_TEXT",
"tag_name": "TAG_NAME",
"partial_link_text": "PARTIAL_LINK_TEXT",
"class_name": "CLASS_NAME",
"css_selector": "CSS_SELECTOR",
"send_key": "values",
"sleep": "2s"
}
}</pre>
This example illustrates how to configure the web driver location and login page testing actions using various element attributes.
## JSON Configuration <a name="json-configuration"></a>
### Setup Section <a name="setup-section"></a>
The `setup` section includes parameters for configuring the test environment. It must be the first section in your JSON configuration file.
- `driver_path` (str): The path to the WebDriver executable.
- `auto_install` (str): Automatically install the WebDriver if not found (set to `"true"` to enable).
- `browser` (str): Specify the browser to use.
- `get` (str): The URL of the website to test.
- `window` (str): Maximize the browser window after opening.
### Login Testing Section <a name="login-testing-section"></a>
The `login_testing` section defines actions for logging into a website.
- Each action should be a JSON object with a unique name.
- Specify the target element using its attributes (e.g., `id`, `xpath`).
- Use the `data` field to provide input data (e.g., username and password).
- Use `take` to take a screenshot after the action (optional).
- Use `click` to perform a click action (optional).
### Home Page Section <a name="home-page-section"></a>
The `home_page` section defines actions for interacting with elements on the home page of the website.
- `set_window_position` (optional): Set the position of the browser window.
- `ls_id_clk` (list of str): Click elements by their IDs.
- `ls_name_clk` (list of str): Click elements by their names.
### View Cart Section <a name="view-cart-section"></a>
The `view_cart` section defines actions for viewing the shopping cart.
- `select_select_box` (optional): Select an option from a dropdown menu by index.
- `nav_to_view_cart` (optional): Navigate to the shopping cart and maximize the window.
## Advanced Features <a name="advanced-features"></a>
### Screen Recording <a name="screen-recording"></a>
Enable screen recording during testing by setting `"screen_recorder"` to `"true"` in the `setup` section.
### Running and Waiting <a name="running-and-waiting"></a>
Set `"run_and_wait"` to `"true"` in the `setup` section to make the script wait for elements to become visible or clickable before performing actions.
### Taking Screenshots <a name="taking-screenshots"></a>
Take screenshots after specific actions by adding `"take": "screenshot"` to those actions in the `login_testing` section.
### Executing Python Code <a name="executing-python-code"></a>
Execute custom Python code during testing by setting `"code"` to `"true"` in a login action. Specify your Python code in the `"python_code"` field or provide a file path using `"python_code_path"`.
## Additional Example Configuration <a name="additional-example-configuration"></a>
Here's an additional example configuration demonstrating web driver location setup and login page testing actions. You can configure various element attributes for testing different web pages.
## Contributing <a name="contributing"></a>
Contributions to this project are welcome. Feel free to submit bug reports, feature requests, or pull requests on the GitHub repository.
## Usage:
<pre> -h, --help: Show this help message.
--version, --V, --v: Show version information.
-test <test_file>: Run tests based on a JSON configuration file.
-req <requirements_file>: Create a requirements.txt file.
-f <python_file>: Format a single Python file.
-fa <directory>: Format all Python files in a directory.
</pre>
## License <a name="license"></a>
This project is licensed under the MIT License. See the LICENSE file for details.
Change Log
==========
0.0.0.1 (03/09/2023)
--------------------
-First Release
Raw data
{
"_id": null,
"home_page": "http://nagipragalathan.pythonanywhere.com/",
"name": "WebTorchX",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "NagiPragalathan",
"author_email": "nagipragalathan@gmail.com",
"download_url": "",
"platform": null,
"description": "<p align=\"center\">\r\n <img src=\"https://106714.fs1.hubspotusercontent-na1.net/hubfs/106714/Low%20Code%20Citizen%20Developer.jpg\" height=\"200\">\r\n</p>\r\n\r\n<div align=\"center\">\r\n <h3 align=\"center\">\r\n WebTorch ( LCTP ) - Selenium Low-Code Web Testing Automation in Python\r\n </h3>\r\n</div>\r\n\r\n![GitHub](https://img.shields.io/github/license/NagiPragalathan/WebTorch?style=flat-square&logo=github)\r\n![GitHub contributors](https://img.shields.io/github/contributors/NagiPragalathan/WebTorch?logo=github&style=flat-square)\r\n![GitHub top language](https://img.shields.io/github/languages/top/NagiPragalathan/WebTorch?style=flat-square)\r\n[![Telegram](https://img.shields.io/badge/telegram-nagipragalathan-yellow.svg?logo=telegram)](https://t.me/nagipragalathan)\r\n![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg)\r\n[![Read FAQ](https://img.shields.io/badge/Ask%20Question-Read%20FAQ-000000)](https://www.newton.so/view?tags=LCTP)\r\n![GitHub Repo stars](https://img.shields.io/github/stars/NagiPragalathan/WebTorch?style=social)\r\n[![Twitter Follow](https://img.shields.io/twitter/follow/nagipragalathan?style=social)](https://twitter.com/NagiPragalathan)\r\n\r\n<div align=\"center\">\r\n\r\n**LCTP** is a Selenium-based Low-Code Web Testing Automation tool in Python. It simplifies web testing using JSON configuration files, making it easy for testers and developers to automate test scenarios.\r\n\r\nIt's a powerful tool designed to streamline your testing efforts, and we're constantly improving it. However, please note that it's still a work in progress and not ready for production use.\r\n\r\n[Getting started](#getting-started) ~ [Supported opcodes](#supported-opcodes) ~\r\n[Build](#build) ~ [Test](#test) ~\r\n[Report a bug](https://github.com/)\r\n~ [Questions](https://www.newton.so/view?tags=LCTP)\r\n\r\n</div>\r\n\r\n<div align=\"center\">\r\n<img src=\"https://media3.giphy.com/media/9MbgJKNugBIi6QDwEf/200w.webp?cid=ecf05e474m3sg50anfj1rfi5m8628lnk3tqkd77089nsi4y8&rid=200w.webp&ct=g\" height=\"400\" />\r\n</div>\r\n\r\n<div align=\"center\">\r\n<h2> Fear of coding the testing files use the LCTP to relieve your complexity and upgrade your automation using LCTP for your application. </h2>\r\n</div>\r\n\r\n# Setup:\r\n## Installation:\r\nInstall LCTP using the following command: `pip install LCTP`\r\n\r\n## Usage:\r\n<hr/>\r\n<pre>\r\n{ <br/>\r\n \"setup\":{<br/>\r\n \"driver_path\" : \"../../../path\", <br/>\r\n \"auto_install\":\"true\", <br/>\r\n \"browser\":\"Opera\", <br/>\r\n \"get\":\"https://www.saucedemo.com/\", <br/>\r\n \"window\" : \"maximize\" <br/>\r\n \"screen_recorder\":\"true\",\r\n \"run_amd_wait\":\"true\"\r\n }<br/>\r\n}<br/>\r\n</pre>\r\n<hr/>\r\nThe `setup` keyword is mandatory when using LCTP.\r\n\r\n1. `driver_path`: Provide the path to the Selenium Chrome driver executable.\r\n2. `auto_install`: Automatically download and install the Chrome driver if not found.\r\n3. `browser`: Specify the browser to be used (e.g., Chrome, Firefox).\r\n4. `get`: Define the URL of the landing page.\r\n5. `window`: It's recommended to use \"maximize\" to maximize the browser window. You can also use \"minimize\" if needed.\r\n6. `screen_recorder`: Enable screen recording of the testing session.\r\n7. `run_and_wait`: Wait for the browser window to run the program.\r\n\r\nAuto_install can handle the following browsers:\r\n<pre>\r\n 1. Chrome\r\n 2. ChromeService\r\n 3. Brave\r\n 4. BraveService\r\n 5. Firefox\r\n 6. FirefoxService\r\n 7. IE\r\n 8. IEService\r\n 9. Edge\r\n 10. EdgeService\r\n 11. Opera\r\n</pre>\r\n\r\n## Get Elements \r\n### Supported selectors: ['id', 'name', 'class', 'xpath']\r\n<pre>\r\n'id': Get elements by their ID attribute.\r\n'name': Get elements by their Name attribute.\r\n'class': Get elements by their Class attribute.\r\n'xpath': Get elements by their XPath.\r\n</pre>\r\n\r\n### Examples:\r\n<pre>\r\n{ \r\n \"setup\":{\r\n \"driver_path\" : \"../../../path\",\r\n \"auto_install\":\"true\",\r\n \"browser\":\"Opera\", //\r\n \"get\":\"https://www.saucedemo.com/\", //\r\n \"window\" : \"maximize\" //\r\n },\r\n \"login_testing\":{\r\n \"fill_user_name\" : {\r\n \"id\" : \"user-name:sk:minimize\",\r\n \"data\" : \"standard_user\"\r\n },\r\n \"fill_password\":{\r\n \"id\":\"password:sk\",\r\n \"data\":\"secret_sauce\"\r\n },\r\n \"click_login_btn\":{\r\n \"id\":\"login-button:click\"\r\n }\r\n },\r\n }\r\n</pre>\r\n\r\n### Click a list of Elements line by line\r\nlist_data = ['ls_id_clk', 'ls_name_clk', 'ls_xpath_clk']\r\n\r\n<pre>\r\n{ \r\n \"setup\":{\r\n \"driver_path\" : \"../../../path\",\r\n \"auto_install\":\"true\",\r\n \"browser\":\"Opera\", //\r\n \"get\":\"https://www.saucedemo.com/\", //\r\n \"window\" : \"maximize\" //\r\n },\r\n \"login_testing\":{\r\n \"fill_user_name\" : {\r\n \"id\" : \"user-name:sk:minimize\",\r\n \"data\" : \"standard_user\"\r\n },\r\n \"fill_password\":{\r\n \"id\":\"password:sk\",\r\n \"data\":\"secret_sauce\"\r\n },\r\n \"click_login_btn\":{\r\n \"id\":\"login-button:click\"\r\n }\r\n },\r\n \"home_page\":{\r\n \"ls_id_clk\" : [\"add-to-cart-sauce-labs-backpack\",\"add-to-cart-sauce-labs-bike-light\",\"add-to-cart-sauce-labs-fleece-jacket\"],\r\n \"ls_name_clk\" : [\"add-to-cart-test.allthethings()-t-shirt-(red)\",\"add-to-cart-sauce-labs-bolt-t-shirt\",\"add-to-cart-sauce-labs-onesie\"]\r\n },\r\n \"view_cart\":{\r\n \"select_select_box\":{\r\n \"xpath\":\"//*[@id='header_container']/div[2]/div[2]/span/select:select_by_index@2\" \r\n },\r\n \"nav_to_view_cart\":{\r\n \"xpath\": \"//*[@id='shopping_cart_container']/a:click:minimize\",\r\n \"window\": \"maximize\"\r\n }\r\n }\r\n}\r\n</pre>\r\n\r\n### ScreenShot and ScreenRecorder\r\n`\"screen_recorder\":\"true\"`: Enable screen recording from the beginning to the end of the test, and it is implemented only in the setup query. The recordings are stored in the Test_Video folder path.<br/>\r\n`\"take\":\"screenshot\"`: Take a screenshot of the task at any line of code. The screenshots are stored in the ScreenShots folder path.\r\n\r\n### Keywords\r\n#### Send Keys\r\n1. `sk`: Send keys to input fields. You can send keys using two ways: `:sk` and `:sk@data`. If `:sk` is used alone, then the data should be declared in another line.\r\n2. 'c&sk': Clear the input field and send keys, similar to `sk`.\r\n<pre>\r\n \"fill_password\":{\r\n \"id\":\"password:sk\",\r\n \"data\":\"secret_sauce\"\r\n },\r\n \"fill_changepassword\":{\r\n \"id\":\"changepassword:c&sk\",\r\n \"data\":\"secret_sauce\"\r\n },\r\n</pre>\r\n\r\n#### Window Controller\r\n1. `window`: Use it with any field to maximize or minimize the browser window.\r\n2. `set_window_position`: Set the position of the browser window.\r\n<pre>\r\n\"nav_to_view_cart\":{\r\n \"xpath\": \"//*[@id='shopping_cart_container']/a:click:minimize\",\r\n \"window\": \"maximize\"\r\n }\r\n\"nav_to_view_cart\":{\r\n \"xpath\": \"//*[@id='shopping_cart_container']/a:click:minimize\",\r\n \"window\": \"minimize\"\r\n }\r\n</pre>\r\n\r\n# Selenium Low-Code Web Testing Automation Hot Keys\r\n\r\nThis Python module simplifies web testing with Selenium WebDriver using a low-code approach. It enables developers or testers to write test scenarios using JSON configuration files. Below is the documentation for the project, along with code examples for each section.\r\n\r\n## Table of Contents\r\n\r\n1. [Installation](#installation)\r\n2. [Usage](#usage)\r\n - [Setup Configuration](#setup-configuration)\r\n - [Login Testing](#login-testing)\r\n - [Home Page Testing](#home-page-testing)\r\n - [View Cart Testing](#view-cart-testing)\r\n - [Additional Example](#additional-example)\r\n3. [JSON Configuration](#json-configuration)\r\n - [Setup Section](#setup-section)\r\n - [Login Testing Section](#login-testing-section)\r\n - [Home Page Section](#home-page-section)\r\n - [View Cart Section](#view-cart-section)\r\n4. [Advanced Features](#advanced-features)\r\n - [Screen Recording](#screen-recording)\r\n - [Running and Waiting](#running-and-waiting)\r\n - [Taking Screenshots](#taking-screenshots)\r\n - [Executing Python Code](#executing-python-code)\r\n5. [Additional Example Configuration](#additional-example-configuration)\r\n6. [Contributing](#contributing)\r\n7. [License](#license)\r\n\r\n## Installation <a name=\"installation\"></a>\r\n\r\nYou can install this module using pip:\r\n\r\n```\r\npip install selenium-webtest\r\n```\r\n## Usage <a name=\"usage\"></a>\r\n\r\nTo use this module, follow these steps:\r\n\r\n1. Create a JSON configuration file for your test scenarios.\r\n2. Utilize the `WebTestExecutor` class to execute your tests.\r\n\r\nHere's how you can structure your JSON configuration file and perform different test actions:\r\n\r\n### Setup Configuration <a name=\"setup-configuration\"></a>\r\n\r\nThe `setup` section in your JSON configuration file is used to set up your test environment. It includes the following parameters:\r\n\r\n- `driver_path` (str): The path to your WebDriver executable (e.g., ChromeDriver).\r\n- `auto_install` (str): Automatically install the WebDriver if it's not found (set to `\"true\"` to enable).\r\n- `browser` (str): Specify the browser to use (e.g., \"Opera\").\r\n- `get` (str): The URL of the website to be tested.\r\n- `window` (str): Maximize the browser window (set to \"maximize\" to enable).\r\n\r\n**Example:**\r\n\r\n\r\n<pre>{\r\n \"setup\": {\r\n \"driver_path\": \"../../../path\",\r\n \"auto_install\": \"true\",\r\n \"browser\": \"Opera\",\r\n \"get\": \"https://www.saucedemo.com/\",\r\n \"window\": \"maximize\"\r\n },\r\n ...\r\n}</pre> \r\n\r\n### Login Testing <a name=\"login-testing\"></a>\r\n\r\nThe `login_testing` section defines actions related to logging into a website. It includes the following parameters:\r\n\r\n- `fill_user_name`: Fill the username input field.\r\n- `fill_password`: Fill the password input field.\r\n- `click_login_btn`: Click the login button.\r\n\r\n**Example:**\r\n\r\n\r\n<pre>{\r\n \"login_testing\": {\r\n \"fill_user_name\": {\r\n \"id\": \"user-name:sk:minimize\",\r\n \"data\": \"standard_user\"\r\n },\r\n \"fill_password\": {\r\n \"id\": \"password:sk\",\r\n \"data\": \"secret_sauce\",\r\n \"take\": \"screenshot\"\r\n },\r\n \"click_login_btn\": {\r\n \"id\": \"login-button:click\"\r\n }\r\n },\r\n ...\r\n}</pre> \r\n\r\n### Home Page Testing <a name=\"home-page-testing\"></a>\r\n\r\nThe `home_page` section defines actions for interacting with elements on the home page of the website. It includes the following parameters:\r\n\r\n- `set_window_position` (optional): Set the position of the browser window.\r\n- `ls_id_clk`: Click elements by their IDs.\r\n- `ls_name_clk`: Click elements by their names.\r\n\r\n**Example:**\r\n\r\n\r\n<pre>{\r\n \"home_page\": {\r\n \"set_window_position\": [10, 10],\r\n \"ls_id_clk\": [\r\n \"add-to-cart-sauce-labs-backpack\",\r\n \"add-to-cart-sauce-labs-bike-light\",\r\n \"add-to-cart-sauce-labs-fleece-jacket\"\r\n ],\r\n \"ls_name_clk\": [\r\n \"add-to-cart-test.allthethings()-t-shirt-(red)\",\r\n \"add-to-cart-sauce-labs-bolt-t-shirt\",\r\n \"add-to-cart-sauce-labs-onesie\"\r\n ]\r\n },\r\n ...\r\n}</pre> \r\n\r\n### View Cart Testing <a name=\"view-cart-testing\"></a>\r\n\r\nThe `view_cart` section defines actions for viewing the shopping cart. It includes the following parameters:\r\n\r\n- `select_select_box`: Select an option from a dropdown menu by index.\r\n- `nav_to_view_cart`: Navigate to the shopping cart and maximize the window.\r\n\r\n**Example:**\r\n\r\n\r\n<pre>{\r\n \"view_cart\": {\r\n \"select_select_box\": {\r\n \"xpath\": \"//*[@id='header_container']/div[2]/div[2]/span/select:select_by_index@2\"\r\n },\r\n \"nav_to_view_cart\": {\r\n \"xpath\": \"//*[@id='shopping_cart_container']/a:click:minimize\",\r\n \"window\": \"maximize\"\r\n }\r\n },\r\n ...\r\n}</pre> \r\n\r\n### Additional Example Configuration <a name=\"additional-example\"></a>\r\n\r\nHere's an additional example of JSON configuration to perform web testing actions:\r\n\r\n\r\n<pre>{\r\n \"setup\": {\r\n \"web_driver_location\": \"path\",\r\n \"dict\": {\r\n \"a\": {\r\n \"id\": \"hello\"\r\n }\r\n }\r\n },\r\n \"login_page\": {\r\n \"msg\": \"to login into\",\r\n \"id\": \"id\",\r\n \"name\": \"name\",\r\n \"xpath\": \"xpath\",\r\n \"link_text\": \"LINK_TEXT\",\r\n \"tag_name\": \"TAG_NAME\",\r\n \"partial_link_text\": \"PARTIAL_LINK_TEXT\",\r\n \"class_name\": \"CLASS_NAME\",\r\n \"css_selector\": \"CSS_SELECTOR\",\r\n \"send_key\": \"values\",\r\n \"sleep\": \"2s\"\r\n }\r\n}</pre> \r\n\r\nThis example illustrates how to configure the web driver location and login page testing actions using various element attributes.\r\n\r\n## JSON Configuration <a name=\"json-configuration\"></a>\r\n\r\n### Setup Section <a name=\"setup-section\"></a>\r\n\r\nThe `setup` section includes parameters for configuring the test environment. It must be the first section in your JSON configuration file.\r\n\r\n- `driver_path` (str): The path to the WebDriver executable.\r\n- `auto_install` (str): Automatically install the WebDriver if not found (set to `\"true\"` to enable).\r\n- `browser` (str): Specify the browser to use.\r\n- `get` (str): The URL of the website to test.\r\n- `window` (str): Maximize the browser window after opening.\r\n\r\n### Login Testing Section <a name=\"login-testing-section\"></a>\r\n\r\nThe `login_testing` section defines actions for logging into a website.\r\n\r\n- Each action should be a JSON object with a unique name.\r\n- Specify the target element using its attributes (e.g., `id`, `xpath`).\r\n- Use the `data` field to provide input data (e.g., username and password).\r\n- Use `take` to take a screenshot after the action (optional).\r\n- Use `click` to perform a click action (optional).\r\n\r\n### Home Page Section <a name=\"home-page-section\"></a>\r\n\r\nThe `home_page` section defines actions for interacting with elements on the home page of the website.\r\n\r\n- `set_window_position` (optional): Set the position of the browser window.\r\n- `ls_id_clk` (list of str): Click elements by their IDs.\r\n- `ls_name_clk` (list of str): Click elements by their names.\r\n\r\n### View Cart Section <a name=\"view-cart-section\"></a>\r\n\r\nThe `view_cart` section defines actions for viewing the shopping cart.\r\n\r\n- `select_select_box` (optional): Select an option from a dropdown menu by index.\r\n- `nav_to_view_cart` (optional): Navigate to the shopping cart and maximize the window.\r\n\r\n## Advanced Features <a name=\"advanced-features\"></a>\r\n\r\n### Screen Recording <a name=\"screen-recording\"></a>\r\n\r\nEnable screen recording during testing by setting `\"screen_recorder\"` to `\"true\"` in the `setup` section.\r\n\r\n### Running and Waiting <a name=\"running-and-waiting\"></a>\r\n\r\nSet `\"run_and_wait\"` to `\"true\"` in the `setup` section to make the script wait for elements to become visible or clickable before performing actions.\r\n\r\n### Taking Screenshots <a name=\"taking-screenshots\"></a>\r\n\r\nTake screenshots after specific actions by adding `\"take\": \"screenshot\"` to those actions in the `login_testing` section.\r\n\r\n### Executing Python Code <a name=\"executing-python-code\"></a>\r\n\r\nExecute custom Python code during testing by setting `\"code\"` to `\"true\"` in a login action. Specify your Python code in the `\"python_code\"` field or provide a file path using `\"python_code_path\"`.\r\n\r\n## Additional Example Configuration <a name=\"additional-example-configuration\"></a>\r\n\r\nHere's an additional example configuration demonstrating web driver location setup and login page testing actions. You can configure various element attributes for testing different web pages.\r\n\r\n## Contributing <a name=\"contributing\"></a>\r\n\r\nContributions to this project are welcome. Feel free to submit bug reports, feature requests, or pull requests on the GitHub repository.\r\n## Usage:\r\n <pre> -h, --help: Show this help message.\r\n --version, --V, --v: Show version information.\r\n -test <test_file>: Run tests based on a JSON configuration file.\r\n -req <requirements_file>: Create a requirements.txt file.\r\n -f <python_file>: Format a single Python file.\r\n -fa <directory>: Format all Python files in a directory.\r\n</pre>\r\n\r\n## License <a name=\"license\"></a>\r\n\r\nThis project is licensed under the MIT License. See the LICENSE file for details.\r\n\r\nChange Log\r\n==========\r\n\r\n0.0.0.1 (03/09/2023)\r\n--------------------\r\n\r\n-First Release\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "LCTP is a Selenium-based Low-Code Web Testing Automation tool in Python. It simplifies web testing using JSON configuration files, making it easy for testers and developers to automate test scenarios. Also This module provides a command-line interface for various tasks related to the LCTP application. You can use this CLI to run tests, generate requirements files, format Python files, and perform extra functions.",
"version": "0.0.1",
"project_urls": {
"Homepage": "http://nagipragalathan.pythonanywhere.com/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "80a4b05f398a9a09f122f18ab2ee135d51b8c04303ad195cd2b8ab3aae722dff",
"md5": "030d9e19100ba986410d7f5f124eaef4",
"sha256": "9b932964aaf0e8c1c186f8ccf04f5a0ffab9e808b450d26919aa838aa7c701f9"
},
"downloads": -1,
"filename": "WebTorchX-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "030d9e19100ba986410d7f5f124eaef4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 15777,
"upload_time": "2023-09-03T07:56:02",
"upload_time_iso_8601": "2023-09-03T07:56:02.819463Z",
"url": "https://files.pythonhosted.org/packages/80/a4/b05f398a9a09f122f18ab2ee135d51b8c04303ad195cd2b8ab3aae722dff/WebTorchX-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-03 07:56:02",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "webtorchx"
}