{"id":23300523,"url":"https://github.com/thivyashreens/pat-task-11","last_synced_at":"2026-05-16T13:06:09.285Z","repository":{"id":267408561,"uuid":"901149185","full_name":"ThivyashreeNS/PAT-Task-11","owner":"ThivyashreeNS","description":"Drag and Drop Automation using Python Selenium ","archived":false,"fork":false,"pushed_at":"2024-12-10T13:17:36.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-26T04:26:40.337Z","etag":null,"topics":["action-chains","automation-testing","python","selenium"],"latest_commit_sha":null,"homepage":"https://jqueryui.com/droppable/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThivyashreeNS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-10T06:05:57.000Z","updated_at":"2024-12-10T13:17:39.000Z","dependencies_parsed_at":"2024-12-10T07:37:35.155Z","dependency_job_id":"2211154f-a7e1-458b-a2d4-ed8868019b87","html_url":"https://github.com/ThivyashreeNS/PAT-Task-11","commit_stats":null,"previous_names":["thivyashreens/pat-task-11"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ThivyashreeNS/PAT-Task-11","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThivyashreeNS%2FPAT-Task-11","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThivyashreeNS%2FPAT-Task-11/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThivyashreeNS%2FPAT-Task-11/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThivyashreeNS%2FPAT-Task-11/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThivyashreeNS","download_url":"https://codeload.github.com/ThivyashreeNS/PAT-Task-11/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThivyashreeNS%2FPAT-Task-11/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33103977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["action-chains","automation-testing","python","selenium"],"created_at":"2024-12-20T09:16:53.714Z","updated_at":"2026-05-16T13:06:09.266Z","avatar_url":"https://github.com/ThivyashreeNS.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Drag-and-Drop Automation Using Python Selenium\n\n## Overview:\nThis project demonstrates a web automation task using Selenium to perform a drag-and-drop action on the jQuery UI's draggable and droppable demo page. The task is wrapped in a class that interacts with a browser to automate the drag-and-drop action and verify its successful completion. The solution is divided into methods for validating the iframe and performing the drag-and-drop operation,\n\n## Table of Contents:\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Project Structure](#project-structure)\n- [Code Explanation](#Code-Explanation)\n- [Running the test](#Running-the-test)\n\n## Prerequisites\n- Python 3.x\n- Required libraries:\n  - `selenium`\n  - `pytest`\n  - `webdriver-manager`\n\n ## Installation:\nTo successfully set up and run the Selenium Automation Testing Project, follow these steps:\n\n1. Ensure that you have Python 3.x installed on your machine. You can download it from  [python.org](https://www.python.org/).\n\n2. Familiarity with command-line interface (CLI) tools is recommended for executing commands.\n\n3. Set Up a Virtual Environment (Optional but Recommended):\n   - It's best practice to create a virtual environment to manage dependencies for your project:\n     \n     - Verify Python Virtual Environment: `Virtualenv --version`\n       \n     - Create Virtual Environment:  `virtualenv cd`\n       \n     - Activate Virtual Environment:  `Scripts\\Activate`\n       \n     - Deactivate Virtual Environment: `Scripts\\Deactivate`\n       \n4.  Install Required Libraries:\n    - Install the necessary Python libraries using pip. The required libraries for this project include:\n      - __Selenium :__ For web browser automation.\n        Install Python Selenium Module: `pip install selenium`\n        \n      - __Pytest :__ For running test cases and managing test execution.\n        `pip install pytest`\n         Pytest Report: `pip install pytest-html`\n        \n      - __Webdriver-manager :__ To automatically manage browser drivers.\n          Install WebDriver Manager Module: `pip install webdriver-manager`\n\n## Project Structure\n```python\nPAT-Task-11/\n│\n├── Task_11.py                        # Contains the main logic for automating the drag-and-drop task using Selenium.\n│   ├── class Data:                   # Contains the URL of the page to automate.\n│   ├── class Locators:               # Contains locators for the draggable and droppable elements.\n│   └── class DragAndDrop:            # Main class to automate the drag-and-drop action.\n│       ├── def validate_iframe():    # Method to validate the iframe presence on the page.\n│       └── def drag_drop():          # Method to perform the drag-and-drop action.\n│  \n├── test_DragAndDrop.py               # Contains the test cases using pytest to verify the drag-and-drop functionality.\n│    ├── def test_validate_iframe():  # Test to validate the iframe presence.\n│    └── def test_drag_drop():        # Test to perform the drag-and-drop and verify success.\n│  \n├── drag_drop.html                    # Pytest html report\n└── README.md                         # This README file\n```\n\n## Code Explanation\n### Task_11.py\nThis script contains the main logic for automating the drag-and-drop task using Selenium.\n\n- __Data class:__ This class contains the URL of the web page to automate.\n\n- __Locators class:__ This class contains the locators for the draggable and droppable elements.\n\n- __DragAndDrop Class:__ Contains the logic to perform the drag-and-drop action and interact with the web page.\n\n### Methods in `DragAndDrop` class:\n- __ __init()__:__\n  \n  - Initializes the WebDriver, ActionChains (for simulating actions), and waits for elements to be interactable.\n\n  - Opens and maximize the DragAndDrop page (https://jqueryui.com/droppable/).\n\n- __validate_iframe():__\n    - This method checks if the iframe is present on the page.\n\n    - It waits for the iframe element and returns True if it is found, otherwise False.\n\n- __drag_drop():__\n    - Open the URL (https://jqueryui.com/droppable/), which contains draggable and droppable elements inside an iframe.\n\n    - Switch to the iframe containing the draggable and droppable elements.\n\n    - Perform a drag-and-drop action from the source element (draggable) to the target element (droppable).\n\n    - Verify if the drop was successful by checking if the target element's text changes to \"Dropped!\".\n\n    - Handles exceptions if anything goes wrong during the drag-and-drop action.\n \n- __close_driver():__\n    - Closes the browser after the operation is complete.\n\n### test_DragAndDrop.py\n\n- __test_validate_iframe():__\n\n    - A test case that calls the validate_iframe() method to ensure the iframe is present.\n\n- __test_drag_drop():__\n    - Instantiate the DragAndDrop class.\n\n    - Call the drag_drop method to perform the drag-and-drop action.\n\n    - Validate that the target element's text is \"Dropped!\", which signifies that the drag-and-drop operation was successful.\n   \n    - Close the browser after the test is complete.\n \n## Running the test:\n- The project uses pytest to test the drag-and-drop functionality. To run the tests:\n  \n  - Make sure the project and dependencies are properly set up.\n\n  - Run the following command to execute the test cases:\n    ```\n     pytest -v -s --capture=sys --html=Reports\\drag_drop.html test_DragAndDrop.py\n    ```\n\n\n\n\n\n\n\n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthivyashreens%2Fpat-task-11","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthivyashreens%2Fpat-task-11","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthivyashreens%2Fpat-task-11/lists"}