{"id":16535635,"url":"https://github.com/hjsblogger/selenium-automation-python-tutorial","last_synced_at":"2025-08-26T20:09:39.039Z","repository":{"id":247776659,"uuid":"826791446","full_name":"hjsblogger/selenium-automation-python-tutorial","owner":"hjsblogger","description":"This repo contains implementation that uses Selenium and Pytest to get started with Front-End Automated Testing","archived":false,"fork":false,"pushed_at":"2025-01-01T11:33:18.000Z","size":62,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T20:45:27.579Z","etag":null,"topics":["automation","lambdatest","makefile","pytest","pyunit","selenium","selenium-pytest","selenium-python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/hjsblogger.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,"zenodo":null}},"created_at":"2024-07-10T11:39:26.000Z","updated_at":"2025-01-01T11:33:21.000Z","dependencies_parsed_at":"2024-07-31T22:17:11.373Z","dependency_job_id":"7c3f927b-77dd-4eef-b9e2-fd0a4e0cb2c4","html_url":"https://github.com/hjsblogger/selenium-automation-python-tutorial","commit_stats":null,"previous_names":["hjsblogger/seleneium-python-tutorial","hjsblogger/selenium-automation-python-tutorial"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hjsblogger/selenium-automation-python-tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjsblogger%2Fselenium-automation-python-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjsblogger%2Fselenium-automation-python-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjsblogger%2Fselenium-automation-python-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjsblogger%2Fselenium-automation-python-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hjsblogger","download_url":"https://codeload.github.com/hjsblogger/selenium-automation-python-tutorial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjsblogger%2Fselenium-automation-python-tutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272252587,"owners_count":24900688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["automation","lambdatest","makefile","pytest","pyunit","selenium","selenium-pytest","selenium-python"],"created_at":"2024-10-11T18:28:24.411Z","updated_at":"2025-08-26T20:09:38.997Z","avatar_url":"https://github.com/hjsblogger.png","language":"Python","readme":"# Tutorial: Automated Testing using Selenium Python\n\n\u003cimg width=\"700\" height=\"400\" alt=\"Bulb\" src=\"https://github.com/user-attachments/assets/2806cf9b-56ae-418d-88dd-a27a9f7d71a6\"\u003e\n\n\u003cdiv align=\"center\"\u003e\u003ca href=\"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS_utiFN8XiYDKXMtI1UW8YG4buAslJnsuBNw\u0026s\"\u003eImage Credit\u003c/a\u003e\u003c/div\u003e\n\u003cbr/\u003e\n\nIn this 'Automated Testing using Selenium Python Tutorial' repo, we have covered the following usecases:\n\n* \u003cb\u003eExecution of simple Python tests\u003c/b\u003e\n* \u003cb\u003eAutomating keyboard and mouse interactions\u003c/b\u003e\n* \u003cb\u003eSwitching tabs \u0026 windows\u003c/b\u003e\n* \u003cb\u003eHandling drop-downs, radio-buttons, and alerts\u003c/b\u003e\n* \u003cb\u003eAutomating Frame and iFrame interactions\u003c/b\u003e\n\n## Pre-requisites for test execution\n\n**Step 1**\n\nCreate a virtual environment by triggering the *virtualenv venv* command on the terminal\n\n```bash\nvirtualenv venv\n```\n\u003cimg width=\"1418\" alt=\"VirtualEnvironment\" src=\"https://github.com/hjsblogger/web-scraping-with-python/assets/1688653/89beb6af-549f-42ac-a063-e5f715018ef8\"\u003e\n\n**Step 2**\n\nNavigate the newly created virtual environment by triggering the *source venv/bin/activate* command on the terminal\n\n```bash\nsource venv/bin/activate\n```\n\n**Step 3**\n\nProcure the LambdaTest User Name and Access Key by navigating to [LambdaTest Account Page](https://accounts.lambdatest.com/security). You might need to create an an account on LambdaTest since it is used for running tests on the cloud Grid.\n\n\u003cimg width=\"1288\" alt=\"LambdaTestAccount\" src=\"https://github.com/hjsblogger/web-scraping-with-python/assets/1688653/9b40c9cb-93a1-4239-9fe5-99f33766a23a\"\u003e\n\n**Step 4**\n\nAdd the LambdaTest User Name and Access Key in the *Makefile* that is located in the parent directory. Once done, save the Makefile.\n\n![1_Makefile](https://github.com/user-attachments/assets/8c98b44c-efd7-4a50-8647-e5477c007068)\n\n## Dependency/Package Installation\n\nRun the *make install* command on the terminal to install the desired packages (or dependencies) - Pytest, Selenium, etc.\n\n```bash\nmake install\n```\n\u003cimg width=\"1404\" alt=\"Make-Install\" src=\"https://github.com/hjsblogger/web-scraping-with-python/assets/1688653/4cb16443-4411-4f11-8692-aa7290cded0b\"\u003e\n\n\u003cimg width=\"1404\" alt=\"Make-Install-2\" src=\"https://github.com/hjsblogger/web-scraping-with-python/assets/1688653/8c7e8938-5584-480b-ad04-002b53827396\"\u003e\n\nWith this, all the dependencies and environment variables are set. Instead of PyUnit/*unittest*, the Pytest framework is used for test execution. The following websites are used for demonstration:\n\n* [LambdaTest Selenium Playground](https://lambdatest.com/selenium-playground)\n* [LambdaTest E-commerce Playground](https://ecommerce-playground.lambdatest.io/)\n\nFollow the below mentioned steps to run automated tests using Selenium Python:\n\n**Step 1**\n\nSet *EXEC_PLATFORM* environment variable to *cloud*. Trigger the command *export EXEC_PLATFORM=local* on the terminal.\n\n**Step 2**\n\nTrigger the command *make clean* to clean the remove _pycache_ folder(s) and .pyc files\n\n\u003cimg width=\"512\" src=\"https://github.com/user-attachments/assets/62d0a440-3cdb-4721-95a2-f4d3492f2a47\"\u003e\n\n**Step 3**\n\nTrigger the respective *make* command on the terminal to run the test(s). For example, run the command *make mouse_interactions_test* for triggering mouse interaction tests.\n\n\u003cimg width=\"1428\" src=\"https://github.com/user-attachments/assets/96cda0bf-e0ed-4e5e-8b8e-d4416d8246df\"\u003e\n\nAs seen above, the test execution was successful and the status is \"Completed\". You can find the status of test execution in the [LambdaTest Automation Dashboard](https://automation.lambdatest.com/build).\n\n\u003cimg width=\"1440\" src=\"https://github.com/user-attachments/assets/b8c562b4-6e30-49e3-874b-90a150634cf7\"\u003e\n\n\u003cimg width=\"1440\" src=\"https://github.com/user-attachments/assets/b657d060-c09b-482f-8dc7-a1bf2373f15c\"\u003e\n\nSimply type *make help* on the terminal to know the command for running the intended test(s).\n\n\u003cimg width=\"627\" src=\"https://github.com/user-attachments/assets/207c5706-74e7-4508-8a04-e97f251ccfe9\"\u003e\n\n## Have feedback or need assistance?\nFeel free to fork the repo and contribute to make it better! Email to [himanshu[dot]sheth[at]gmail[dot]com](mailto:himanshu.sheth@gmail.com) for any queries or ping me on the following social media sites:\n\n\u003cb\u003eLinkedIn\u003c/b\u003e: [@hjsblogger](https://linkedin.com/in/hjsblogger)\u003cbr/\u003e\n\u003cb\u003eTwitter\u003c/b\u003e: [@hjsblogger](https://www.twitter.com/hjsblogger)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhjsblogger%2Fselenium-automation-python-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhjsblogger%2Fselenium-automation-python-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhjsblogger%2Fselenium-automation-python-tutorial/lists"}