{"id":20632129,"url":"https://github.com/the-sdet/test-automation-toolkit","last_synced_at":"2025-04-15T18:59:10.692Z","repository":{"id":230689642,"uuid":"779933855","full_name":"the-sdet/test-automation-toolkit","owner":"the-sdet","description":"Test Automation Toolkit is your comprehensive solution for streamlining test automation across various domains. Whether you're testing Web applications, Mobile Apps, APIs, or interacting with databases, XML, JSON, Excel, our library provides a rich set of reusable utility methods tailored to your needs.","archived":false,"fork":false,"pushed_at":"2024-04-22T15:28:31.000Z","size":200,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T23:51:15.667Z","etag":null,"topics":["appium","java","playwright","selenium","test-automation-framework"],"latest_commit_sha":null,"homepage":"https://github.com/the-sdet/test-automation-toolkit","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/the-sdet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-03-31T07:41:21.000Z","updated_at":"2025-01-18T16:17:17.000Z","dependencies_parsed_at":"2024-04-22T16:38:00.832Z","dependency_job_id":null,"html_url":"https://github.com/the-sdet/test-automation-toolkit","commit_stats":null,"previous_names":["the-sdet/test-automation-toolkit"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-sdet%2Ftest-automation-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-sdet%2Ftest-automation-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-sdet%2Ftest-automation-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-sdet%2Ftest-automation-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/the-sdet","download_url":"https://codeload.github.com/the-sdet/test-automation-toolkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249135814,"owners_count":21218365,"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","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":["appium","java","playwright","selenium","test-automation-framework"],"created_at":"2024-11-16T14:14:58.702Z","updated_at":"2025-04-15T18:59:10.671Z","avatar_url":"https://github.com/the-sdet.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[//]: # (# Test Automation Toolkit)\n\n\u003cimg src=\"src/test/resources/logo.jpg\" alt=\"Test Automation Toolkit\"/\u003e\n\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.the-sdet/test-automation-toolkit)](https://search.maven.org/artifact/io.github.the-sdet/test-automation-toolkit)\n[![javadoc](https://javadoc.io/badge2/io.github.the-sdet/test-automation-toolkit/javadoc.svg)](https://javadoc.io/doc/io.github.the-sdet/test-automation-toolkit)\n\n## Streamlining Test Automation for Web, API, Mobile and Database Testing and more\n\nWelcome to the Test Automation Toolkit – Your comprehensive solution for streamlining test automation across\nvarious domains. Whether you're testing Web applications, Mobile Apps, APIs, or interacting with databases, XML, JSON,\nExcel, our library\nprovides a rich set of reusable utility methods tailored to your needs.\n\nWith support for popular automation frameworks including Selenium, Playwright, Appium, RestAssured, and JDBC, our\ntoolkit empowers testers and developers to write efficient and maintainable automation scripts with ease. Say goodbye to\nrepetitive tasks and boilerplate code – leverage our library to accelerate your testing workflows and ensure the quality\nand reliability of your software products.\n\nStart automating smarter, not harder, with our comprehensive suite of utilities. Join our community of testers and\ndevelopers, and together, let's redefine test automation. Unlock the potential of automation with the Automation Toolkit\ntoday!\n\n## Usage\n\nTest Automation Toolkit requires Java 11 or newer.\n\nTo use Test Automation Toolkit simply add following dependency to your Maven project:\n\n```xml\n\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.the-sdet\u003c/groupId\u003e\n    \u003cartifactId\u003etest-automation-toolkit\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Example\n\nMultiple ways you can use test-automation-toolkit in your test automation framework.\n\nThis code snippet give you a glimpse of how your selenium, playwright, appium code all can look very similar.\n\n### Option 1:\n\nExtend SeleniumUtils/PlaywrightUtils/AppiumUtils to your Page Object Classes.\n\nSeleniumUtils Use in PageObject model\n\n```java\npackage io.github.the_sdet;\n\nimport io.github.the_sdet.web.SeleniumUtils;\nimport org.openqa.selenium.By;\nimport org.openqa.selenium.WebDriver;\n\npublic class LoginPageSelenium extends SeleniumUtils {\n    public LoginPageSelenium(WebDriver driver) {\n        super(driver);\n    }\n\n    By logo = By.id(\"logo\");\n    By username = By.className(\"username\");\n    By password = By.xpath(\"//input[contains(@name,'password')]\");\n    By loginButton = By.id(\"login-btn\");\n\n    public boolean isLogoVisible() {\n        return isVisible(logo);\n    }\n\n    public void login(String email, String pass) {\n        fillText(username, email);\n        fillText(password, pass);\n        click(loginButton);\n    }\n\n}\n```\n\nAppiumUtils Use in PageObject model\n\n```java\npackage io.github.the_sdet;\n\nimport io.appium.java_client.AppiumDriver;\nimport io.github.the_sdet.mobile.AppiumUtils;\nimport org.openqa.selenium.By;\n\npublic class LoginPageAppium extends AppiumUtils {\n    public LoginPageAppium(AppiumDriver driver) {\n        super(driver);\n    }\n\n    By logo = By.id(\"logo\");\n    By username = By.className(\"username\");\n    By password = By.xpath(\"//input[contains(@name,'password')]\");\n    By loginButton = By.id(\"login-btn\");\n\n    public boolean isLogoVisible() {\n        return isVisible(logo);\n    }\n\n    public void login(String email, String pass) {\n        fillText(username, email);\n        fillText(password, pass);\n        click(loginButton);\n    }\n\n}\n```\n\nPlaywrightUtils Use in PageObject model\n\n```java\npackage io.github.the_sdet;\n\nimport com.microsoft.playwright.Page;\nimport io.github.the_sdet.web.PlaywrightUtils;\n\npublic class LoginPagePlaywright extends PlaywrightUtils {\n    public LoginPagePlaywright(Page page) {\n        super(page);\n    }\n\n    String logo = \"#logo\";\n    String username = \".username\";\n    String password = \"//input[contains(@name,'password')]\";\n    String loginButton = \"#login-btn\";\n\n    public boolean isLogoVisible() {\n        return isVisible(logo);\n    }\n\n    public void login(String email, String pass) {\n        fillText(username, email);\n        fillText(password, pass);\n        click(loginButton);\n    }\n}\n```\n\n### Option 2:\n\nCreate an Object of SeleniumUtils/PlaywrightUtils/AppiumUtils wherever you need to use the utils.\n\nSeleniumUtils, PlaywrightUtils and AppiumUtils Use in General Context\n\n```java\npackage io.github.the_sdet;\n\nimport com.microsoft.playwright.Browser;\nimport com.microsoft.playwright.BrowserType;\nimport com.microsoft.playwright.Page;\nimport com.microsoft.playwright.Playwright;\nimport io.appium.java_client.AppiumDriver;\nimport io.github.the_sdet.mobile.AppiumUtils;\nimport io.github.the_sdet.web.PlaywrightUtils;\nimport io.github.the_sdet.web.SeleniumUtils;\nimport org.openqa.selenium.MutableCapabilities;\nimport org.openqa.selenium.WebDriver;\nimport org.openqa.selenium.chrome.ChromeDriver;\n\nimport java.time.Duration;\n\npublic class TestingTestAutomationToolkit {\n    public static void main(String[] args) {\n        String url = \"https://www.selenium.dev/\";\n        String readModeAboutSeleniumWebDriver = \"//a[contains(@class,'selenium-button selenium-webdriver')]\";\n        String getStartedButton = \"//a[contains(text(),'Getting started')]\";\n\n        //Using Selenium Utilities\n        WebDriver driver = new ChromeDriver();\n        SeleniumUtils seleniumUtils = new SeleniumUtils(driver);\n        seleniumUtils.setDefaultTimeOut(Duration.ofSeconds(10));\n        seleniumUtils.openPage(url);\n        seleniumUtils.setScreenSize(1200, 700);\n        seleniumUtils.maximizeScreen();\n        seleniumUtils.javaScriptClick(readModeAboutSeleniumWebDriver);\n        seleniumUtils.waitAndClick(getStartedButton, Duration.ofSeconds(10));\n        seleniumUtils.waitFor(Duration.ofSeconds(1));\n        seleniumUtils.getScreenshot();\n        seleniumUtils.takeScreenshot(\"screenshot-by-selenium.png\");\n        seleniumUtils.takeFullPageScreenshot(\"full-screenshot-by-selenium.png\");\n        driver.quit();\n\n        //Using Playwright Utilities\n        Playwright playwright = Playwright.create();\n        Browser browser = playwright.chromium()\n                .launch(new BrowserType.LaunchOptions().setChannel(\"chrome\").setHeadless(false));\n        Page page = browser.newPage();\n        PlaywrightUtils playwrightUtils = new PlaywrightUtils(page);\n        playwrightUtils.setDefaultTimeOut(Duration.ofSeconds(10));\n        playwrightUtils.openPage(url);\n        playwrightUtils.setScreenSize(1200, 700);\n        playwrightUtils.maximizeScreen();\n        playwrightUtils.javaScriptClick(readModeAboutSeleniumWebDriver);\n        playwrightUtils.waitAndClick(getStartedButton, Duration.ofSeconds(10));\n        playwrightUtils.waitFor(Duration.ofSeconds(1));\n        playwrightUtils.takeScreenshot(\"screenshot-by-playwright.png\");\n        playwrightUtils.takeFullPageScreenshot(\"full-screenshot-by-playwright.png\");\n        page.close();\n        playwright.close();\n\n        //Using Appium Utilities\n        AppiumDriver appiumDriver = new AppiumDriver(new MutableCapabilities());\n        AppiumUtils appiumUtils = new AppiumUtils(appiumDriver);\n        appiumUtils.waitAndClick(getStartedButton, Duration.ofSeconds(10));\n        playwrightUtils.takeScreenshot(\"screenshot-by-playwright.png\");\n        appiumUtils.swipeDownAndRefreshPage();\n        appiumUtils.swipeLeft();\n        appiumUtils.swipeRight();\n        appiumUtils.scrollByPercent(50);\n    }\n}\n```\n\nOther Utils Use in General Context\n\n```java\npackage io.github.the_sdet;\n\nimport io.github.the_sdet.api.APIUtils;\nimport io.github.the_sdet.db.DatabaseUtils;\nimport io.github.the_sdet.json.JSONUtils;\nimport io.restassured.http.ContentType;\nimport io.restassured.response.Response;\n\nimport java.io.IOException;\nimport java.sql.Connection;\nimport java.sql.DriverManager;\nimport java.sql.SQLException;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\nimport static io.github.the_sdet.excel.ExcelUtils.*;\nimport static io.github.the_sdet.excel.ExcelUtils.readExcelSheet;\n\npublic class TestingOtherUtils {\n    public static void main(String[] args) throws IOException {\n\n        // Testing Database Utilities\n        Connection connection;\n        try {\n            connection = DriverManager.getConnection(\"db.url\");\n        } catch (SQLException e) {\n            throw new RuntimeException(e);\n        }\n        DatabaseUtils databaseUtils = new DatabaseUtils(connection);\n        List\u003cList\u003cString\u003e\u003e employeesData = databaseUtils.readDataFromDb(\"Select * from Employees\");\n        List\u003cString\u003e employeeOneData = databaseUtils.readSingleRowFromDb(\"Select * from Employees where Emp_Id=001\");\n        String ageOfEmployeeOne = databaseUtils.readSingleDataFromDb(\"Select Emp_Name from Employees where Emp_Id=001\");\n        List\u003cString\u003e employees = databaseUtils.readSingleColumnFromDb(\"Select Emp_Name from Employees\");\n        System.out.println(employeesData);\n        System.out.println(employeeOneData);\n        System.out.println(ageOfEmployeeOne);\n        System.out.println(employees);\n\n\n        // Testing Excel Utilities\n        System.out.println(readExcelSheet(\"src/test/resources/file.xlsx\", \"sheet1\"));\n        System.out.println(getHeaderList(\"src/test/resources/file.xlsx\", \"sheet1\"));\n        System.out.println(getValuesOfRow(\"src/test/resources/file.xlsx\", \"sheet1\", \"Row 4\", true));\n        System.out.println(getValuesOfColumn(\"src/test/resources/file.xlsx\", \"sheet1\", \"Header 4\", true));\n        System.out.println(readExcelSheet(\"src/test/resources/file.xlsx\", \"sheet1\"));\n        System.out.println(readExcelSheet(\"src/test/resources/file.xlsx\", \"sheet1\", true));\n\n\n        //Testing Rest Assured Utils\n        Response response1 = APIUtils.getRequest(\"url\", ContentType.JSON);\n        System.out.println(response1.statusCode());\n\n        Map\u003cString, String\u003e headers = new HashMap\u003c\u003e();\n        Response response2 = APIUtils.getRequest(\"url\", headers, ContentType.JSON);\n        System.out.println(response2.statusCode());\n\n        Map\u003cString, String\u003e queryParams = new HashMap\u003c\u003e();\n        Response response3 = APIUtils.getRequest(\"url\", headers, queryParams, ContentType.JSON);\n        System.out.println(response3.statusCode());\n\n        Response response4 = APIUtils.postRequest(\"url\", \"request body\", ContentType.JSON);\n        System.out.println(response4.statusCode());\n\n        Response response5 = APIUtils.putRequest(\"url\", \"request body\", ContentType.JSON);\n        System.out.println(response5.statusCode());\n\n        Response response6 = APIUtils.deleteRequest(\"url\", ContentType.JSON);\n        System.out.println(response6.statusCode());\n\n\n        //Testing JSON Utils\n        String firstUserName = JSONUtils.getElementFromJsonString(response1.asString(), \"$.data.user[0].name\");\n        System.out.println(\"First User's Name: \" + firstUserName);\n        List\u003cString\u003e allUserNames = JSONUtils.getElementsFromJsonString(response1.asString(), \"$.data.user[.id\");\n        System.out.println(\"All Users: \" + allUserNames);\n    }\n}\n```\n\n## Authors\n\n\u003ca href=\"https://github.com/the-sdet\"\u003e\u003cimg align=\"center\" src=\"https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png\" alt=\"pabitra-qa\" height=\"40\" width=\"40\" /\u003e\u003c/a\u003e\n[@the-sdet](https://github.com/the-sdet)\n\n\u003ca href=\"https://github.com/the-sdet\"\u003e\u003cimg align=\"center\" src=\"https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png\" alt=\"pabitra-qa\" height=\"40\" width=\"40\" /\u003e\u003c/a\u003e\n[@pabitra-qa](https://github.com/pabitra-qa)\n\n## 🚀 About Me\n\nI'm a dedicated and passionate Software Development Engineer in Test (SDET) trying to help the community in focusing in\nbuilding great automation frameworks rather than writing the same utilities again and again and again...\n\n## Connect With Me\n\n\u003ca href=\"https://linkedin.com/in/pswain7\"\u003e\u003cimg align=\"center\" src=\"https://content.linkedin.com/content/dam/me/business/en-us/amp/brand-site/v2/bg/LI-Logo.svg.original.svg\" alt=\"pabitra-qa\" height=\"35\"/\u003e\u003c/a\u003e\n\u0026nbsp; \u003ca href=\"https://pabitra-qa.github.io/\"\u003e\u003cimg align=\"center\" src=\"https://chromeenterprise.google/static/images/chrome-logo.svg\" height=\"40\" width=\"40\"/\u003e\u003c/a\u003e\n\n## Feedback\n\nIf you have any feedback, please reach out to us at [contact.the.sdet@gmail.com](mailto:contact.the.sdet@gmail.com).\n\n[//]: # (\u003cimg align=\"center\" src=\"https://pabitra-qa.github.io/dp.png\" width=\"200px\"/\u003e)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-sdet%2Ftest-automation-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthe-sdet%2Ftest-automation-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-sdet%2Ftest-automation-toolkit/lists"}