type of testing

Search

Total Views

Total Views:

Automation Testing

๐Ÿ” What is Automation Testing?

Automation Testing is the process of using software tools and scripts to run tests automatically on an application. It checks whether the application works as expected without manual intervention.

๐Ÿงช Instead of clicking buttons or entering data manually, automation testing does it programmatically — fast and repeatedly.


๐ŸŽฏ Why Do We Use Automation Testing?

Benefit Explanation
✅ Faster Execution Tests run much faster than manual testing
♻️ Repeatable Run the same test multiple times across builds
๐Ÿž Early Bug Detection Find bugs early during development
๐Ÿ’ต Cost Saving Long-Term Reduces time and effort after initial setup
๐Ÿ“ˆ Increases Coverage Test large sets of data, browsers, and devices
๐Ÿ”— Supports CI/CD Integrates with Jenkins, GitHub Actions, etc. for automatic testing in pipelines

⚙️ How Automation Testing Works

  1. Create test scripts using a programming/scripting language.

  2. Run scripts using an automation tool (like Selenium or Cypress).

  3. The tool interacts with the application (e.g., clicks, types, checks text).

  4. The tool verifies expected results vs. actual output.

  5. Generates reports (pass/fail, screenshots, logs).


๐Ÿ“‚ Types of Tests Suitable for Automation

Test Type Description
Regression Testing Re-running existing test cases after code changes
Smoke Testing Verifying basic app stability after a new build
Sanity Testing Narrow testing for specific functions
Data-Driven Testing Testing with multiple sets of data
Cross-Browser Testing Run the same tests on different browsers
API Testing Automating REST/SOAP API validations
Performance Testing Checking load, stress, and response times

๐Ÿงฐ Types of Automation Tools

Automation tools can be divided into categories:

๐Ÿ–ฅ️ Web UI Automation Tools

Tool Description
Selenium Most popular open-source tool for automating web browsers. Supports Java, Python, C#, etc.
Cypress JavaScript-based, fast automation for modern web apps. Great for front-end developers.
Playwright Microsoft’s browser automation tool, supports Chromium, Firefox, WebKit
Puppeteer Node.js tool for controlling headless Chrome
TestCafe End-to-end testing for web apps, Node.js-based

๐Ÿ“ฑ Mobile Automation Tools

Tool Description
Appium Open-source tool to automate Android and iOS apps using Selenium-like commands
Espresso Google’s native UI test framework for Android
XCUITest Apple’s UI test framework for iOS apps
Detox Automation for React Native apps

๐ŸŒ API Automation Tools

Tool Description
Postman (Newman) Manual and automated REST API testing
Rest Assured Java-based DSL for REST API testing
Karate DSL API + UI testing with BDD style (based on Cucumber)
SoapUI For SOAP and REST services testing

๐Ÿ“Š Performance & Load Testing Tools

Tool Description
JMeter Apache’s tool for load, performance, and stress testing
Gatling Developer-friendly performance testing for web apps
Locust Python-based tool for scalable load testing
k6 Modern performance testing tool with JavaScript scripting

๐Ÿ“‹ BDD (Behavior Driven Development) Tools

Tool Description
Cucumber Allows writing tests in plain English (Gherkin) and connecting with code
SpecFlow Cucumber for .NET
Behave BDD tool for Python

๐Ÿ“ฆ Test Management & Integration Tools

Tool Purpose
TestNG / JUnit Java-based testing frameworks
Allure / ExtentReports Reporting tools for automation
Maven / Gradle Build tools for Java projects
Jenkins / GitHub Actions CI/CD tools for automating test pipelines
Git Version control for test scripts
Docker Containerize test environments

๐Ÿงฑ Common Automation Framework Types

Framework Description
Linear Scripting Simple scripts run step by step, no reusability
Modular Testing Break into reusable modules
Data-Driven Input/output stored in Excel, CSV, JSON, DB
Keyword-Driven Keywords like ClickButton, EnterText used
Hybrid Combines data-driven + keyword-driven
POM (Page Object Model) UI pages modeled as classes with locators and actions

๐Ÿงช Example: Automation Test Flow (Selenium + Java + TestNG)

  1. Open browser

  2. Navigate to website

  3. Enter username/password

  4. Click login

  5. Assert dashboard title

  6. Log result and close browser

@Test
public void loginTest() {
driver.get("https://example.com/login");
driver.findElement(By.id("username")).sendKeys("admin");
driver.findElement(By.id("password")).sendKeys("admin123");
driver.findElement(By.id("loginBtn")).click();
Assert.assertEquals(driver.getTitle(), "Dashboard");
}

✅ When to Use Automation vs Manual Testing

Criteria Automation Manual
Repetitive Tests ✅ Best suited ❌ Time-consuming
One-time Tests ❌ Not worth it ✅ Ideal
Visual Testing ❌ Limited ✅ Best
Exploratory Testing ❌ Cannot adapt ✅ Flexible
Large Test Data ✅ Easy to scale ❌ Hard
Release Regression ✅ Very effective ❌ Slow

๐Ÿ“Œ Summary Table

Area Details
What Automated testing using tools/scripts
Why Faster, repeatable, more reliable
Test Types Regression, API, Performance, Cross-Browser
Popular Tools Selenium, Cypress, Appium, Postman, JMeter, Cucumber
Languages Java, Python, JavaScript, C#
Frameworks Data-driven, POM, BDD, Hybrid
Challenges Initial setup cost, maintenance, dynamic UI

✅ What is Automation Testing?

Automation Testing is a type of software testing where test cases are executed automatically using software tools, instead of manual human efforts.

It is mainly used to:

  • Check whether the application behaves as expected

  • Save time during repetitive or large-scale testing

  • Increase accuracy by avoiding human errors

๐Ÿ”„ In simple terms: You write scripts once → Run them multiple times automatically.


๐Ÿ”Ž Why Do We Need Automation Testing?

๐Ÿš€ Benefit ๐Ÿ“˜ Explanation
✅ Fast Execution Scripts run tests much faster than humans
๐Ÿ” Reusable Same script can be reused again and again
๐Ÿ’ฐ Cost-effective (long term) Saves money by reducing manual labor
๐Ÿ“ˆ Increases Test Coverage You can test large amounts of data, browsers, and devices
๐Ÿ”— Integration Friendly Works with CI/CD tools like Jenkins, GitHub Actions
๐Ÿž Early Bug Detection Bugs are found and fixed early in development
๐Ÿ“Š Reports & Logs Automatically generate test reports with status and screenshots

๐Ÿงช Types of Testing Suitable for Automation

Automation is not for every type of testing. It works best for:

Test Type Use for Automation? Why?
Regression Testing ✅ Yes Repeat testing after code changes
Smoke Testing ✅ Yes Check core app functionality
Sanity Testing ✅ Yes Quick checks for modules
Performance Testing ✅ Yes Load, stress, volume testing
Data-Driven Testing ✅ Yes Test same flow with multiple data sets
Exploratory Testing ❌ No Requires human creativity
Usability Testing ❌ No Involves user behavior and feelings

⚙️ How Does Automation Testing Work?

๐Ÿ’ก Basic Steps:

  1. Choose an automation tool (e.g., Selenium, Cypress)

  2. Write test scripts using a programming language (like Java or Python)

  3. Run scripts — they open the app, simulate clicks, inputs, etc.

  4. Compare actual vs expected result

  5. Generate report showing pass/fail

๐Ÿง  Simple Example Flow:

  • Open browser

  • Go to login page

  • Enter username/password

  • Click Login

  • Verify dashboard is loaded

All the above steps can be coded and run automatically.


๐Ÿงฑ Types of Automation Testing Frameworks

Framework Type Description
Linear Simple script with hardcoded values (not reusable)
Modular Scripts broken into small, reusable modules
Data-Driven Test data stored separately (Excel, JSON, DB)
Keyword-Driven Keywords used like Click, EnterText, etc.
Hybrid Combines keyword + data-driven + modular
POM (Page Object Model) Each web page is represented by a class for better structure

๐Ÿ’ผ Who Performs Automation Testing?

  • Automation Test Engineers / SDETs (Software Development Engineers in Test)

  • QA Engineers with coding skills

  • Developers (in some Agile teams)

They write scripts in languages such as:

  • Java

  • Python

  • JavaScript

  • C#

  • Ruby


๐Ÿงฐ When to Use Automation Testing

Use Case Automate?
Test runs frequently (e.g., daily) ✅ Yes
Test requires large data sets ✅ Yes
Multiple browsers or environments ✅ Yes
One-time test or UI look and feel ❌ No
Unstable or changing UI ❌ Avoid

⚠️ Challenges in Automation Testing

Issue Why it Happens
๐Ÿ” Test Maintenance UI changes → script needs update
⏱ Timing Issues Scripts may fail if app loads slowly
๐Ÿ”€ Dynamic Elements Changing element IDs or positions
❌ Over-Automation Automating everything wastes time
๐Ÿงช Learning Curve Need coding + tool knowledge

๐Ÿง‘‍๐Ÿ’ป Common Languages Used

Tool Language
Selenium Java, Python, C#, JS
Cypress JavaScript, TypeScript
Playwright JS, Python, Java, C#
Appium Java, Python, JS, Ruby
Rest Assured Java
Postman JavaScript (via Newman CLI)

๐Ÿงช Example (Manual vs Automation)

Manual Testing:

  • Open browser

  • Type URL

  • Enter username and password

  • Click login

  • Check dashboard

Automation Testing (Java + Selenium):

WebDriver driver = new ChromeDriver();
driver.get("https://app.example.com");
driver.findElement(By.id("username")).sendKeys("admin");
driver.findElement(By.id("password")).sendKeys("admin123");
driver.findElement(By.id("login")).click();
Assert.assertEquals(driver.getTitle(), "Dashboard");
driver.quit();

๐Ÿ Final Summary

Key Point Explanation
Definition Testing using tools/scripts instead of doing it manually
Main Goal Save time, increase accuracy, test faster
When to Use Regression, smoke, large data, cross-browser
Languages Java, Python, JS, C#
Frameworks POM, Data-driven, Hybrid
Skills Needed Programming + testing concepts
Not Ideal For UI/UX testing, exploratory testing

๐Ÿ” What is Selenium?

Selenium is the most widely used open-source automation testing tool for web applications. It allows testers to automate browser actions like clicking buttons, entering text, navigating between pages, and verifying results.

Originally developed by Jason Huggins in 2004 at ThoughtWorks, Selenium has grown into a powerful suite of tools that support testing across different browsers (Chrome, Firefox, Edge, Safari) and platforms (Windows, macOS, Linux).


๐Ÿ”ง Why Use Selenium?

Feature Description
๐ŸŽฏ Open-source Free to use with no licensing cost
๐ŸŒ Cross-browser Supports Chrome, Firefox, Safari, Edge
๐Ÿงช Language support Java, Python, C#, JavaScript, Ruby, Kotlin
๐Ÿ” Integration-ready Works with TestNG, JUnit, Maven, Jenkins, Git, etc.
๐Ÿ“ธ Real-browser testing Tests run in actual browsers, not emulators

๐Ÿงฉ Selenium Suite Components

Selenium is not a single tool, but a suite of tools:

1. Selenium WebDriver

  • The main component used to automate web browsers.

  • Works directly with browser drivers (like chromedriver.exe) to perform actions like clicking, entering text, etc.

2. Selenium IDE (Integrated Development Environment)

  • A browser extension for recording and playing back test scripts without writing code.

  • Good for beginners, but limited in flexibility.

3. Selenium Grid

  • Used for parallel test execution across multiple browsers and machines.

  • Ideal for cross-browser and cross-platform testing.


✅ How Selenium WebDriver Works

  1. You write test scripts in a programming language (e.g., Java).

  2. The script uses the Selenium WebDriver API to send commands.

  3. WebDriver communicates with the browser driver (e.g., chromedriver).

  4. The browser executes the actions (click, input, etc.).

  5. Selenium captures the output, results, or errors.


๐Ÿ’ป First Simple Selenium Script in Java

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class FirstTest {
    public static void main(String[] args) {
        System.setProperty("webdriver.chrome.driver", "path/to/chromedriver");

        WebDriver driver = new ChromeDriver();
        driver.get("https://www.google.com");

        System.out.println("Page Title: " + driver.getTitle());

        driver.quit();
    }
}

๐Ÿงญ Basic Selenium Commands

Command Description
driver.get(url) Open a web page
driver.getTitle() Get the title of the current page
driver.findElement(By.id()) Find a web element by ID
element.click() Click on an element
element.sendKeys("text") Enter text into input fields
driver.quit() Close the browser and end session

๐Ÿ” Locators in Selenium

Selenium uses locators to find elements on a web page. Common locators include:

Locator Type Example
ID By.id("username")
Name By.name("password")
Class Name By.className("btn")
Tag Name By.tagName("input")
Link Text By.linkText("Click here")
Partial Link By.partialLinkText("Click")
XPath By.xpath("//input[@id='user']")
CSS Selector By.cssSelector("#user")

⏳ Handling Waits in Selenium

Web pages take time to load. You can use waits to handle dynamic elements.

  • Implicit Wait – waits for a certain amount of time before throwing "NoSuchElementException":

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
  • Explicit Wait – waits for a specific condition to occur:

WebDriverWait wait = new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.elementToBeClickable(By.id("submit")));

⚙️ Selenium Test Lifecycle (Simplified)

  1. Launch browser

  2. Navigate to application

  3. Locate elements

  4. Perform actions (click, input, verify)

  5. Capture results

  6. Close browser


๐Ÿ“ฆ Tools Commonly Used with Selenium

Tool Purpose
TestNG Test structure, grouping, reporting
Maven Build management, dependency setup
Extent Reports Fancy HTML test reports
Log4j Logging of test execution
Jenkins CI/CD and scheduled test runs

๐Ÿง  Summary

  • Selenium WebDriver is the backbone of web automation.

  • It supports multiple browsers and languages.

  • You can control elements using locators and interact with them through Selenium commands.

  • TestNG, Maven, and other tools integrate well with Selenium to build robust test frameworks.

  • Now that we know Selenium, it’s time to explore how to structure test code better — and that’s where Page Object Model (POM) begins.



Comments

๐ŸŒŸ๐ŸŒŸ๐ŸŒŸ๐ŸŒŸ☆ Great platform with helpful onboarding! Some areas could be streamlined, but overall a very positive experience.