Software Engineering

If software projects still followed a “code everything first, test at the end” model, modern teams would be drowning in last-minute bugs, missed launch dates, and emergency hot-fixes. Customers have little patience for broken features, and competitors ship improvements weekly sometimes daily. To keep pace, engineering leaders have embraced Shift Left Testing: moving software testing
The post Shift Left Testing Principles: Catch Bugs Early, Deliver Faster appeared first on Codoid.

 
Data-driven testing is a robust testing methodology that focuses on testing the functionality of an application using multiple sets of data. Instead of hardcoding input values and expected results, this approach separates test logic from the test data, enhancing reusability and maintainability. Selenium, being a popular automation tool, supports data-driven testing seamlessly when integrated with testing frameworks like TestNG or JUnit.
In this blog, we’ll delve into the concept of data-driven testing, explore its benefits, and demonstrate how to implement it using Selenium with detailed coding examples.

What is Data-Driven Testing?
Data-driven testing involves executing test scripts multiple times with different sets of input data. The test data is typically stored in external sources such as:

Excel files

CSV files

Databases

JSON or XML files

This approach is particularly useful for validating applications where the same functionality needs to be tested with various input combinations.

Benefits of Data-Driven Testing

Reusability: Test scripts are reusable for different data sets.

Maintainability: Test logic is separated from test data, making maintenance easier.

Scalability: Allows extensive test coverage with diverse data.

Efficiency: Reduces redundancy in writing test scripts.

Tools Required

Selenium WebDriver: For browser automation.

Apache POI: To read/write data from Excel files.

TestNG/JUnit: For test execution and data provider functionality.

Setting Up Your Project
Add Dependencies
Include the following dependencies in your pom.xml if you’re using Maven:<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.8.0</version>
</dependency>
</dependencies>

Code Example: Data-Driven Testing Using Excel and TestNG
Step 1: Create the Test Data
Create an Excel file named TestData.xlsx with the following columns:

Username
Password

user1
pass1

user2
pass2

Save this file in the project directory.
Step 2: Utility Class to Read Excel Data
Create a utility class ExcelUtils.java:import java.io.FileInputStream;
import java.io.IOException;
import org.apache.poi.ss.usermodel.*;

public class ExcelUtils {
private static Workbook workbook;
private static Sheet sheet;

public static void loadExcel(String filePath) throws IOException {
FileInputStream fis = new FileInputStream(filePath);
workbook = WorkbookFactory.create(fis);
}

public static String getCellData(int row, int column) {
sheet = workbook.getSheetAt(0);
Row rowData = sheet.getRow(row);
Cell cell = rowData.getCell(column);
return cell.toString();
}

public static int getRowCount() {
return sheet.getLastRowNum();
}
}
Step 3: Test Class with Data Provider
Create a test class LoginTest.java:import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.*;

public class LoginTest {

WebDriver driver;

@BeforeClass
public void setup() {
System.setProperty(“webdriver.chrome.driver”, “path_to_chromedriver”);
driver = new ChromeDriver();
driver.get(“https://example.com/login”);
}

@DataProvider(name = “loginData”)
public Object[][] loginData() throws Exception {
ExcelUtils.loadExcel(“TestData.xlsx”);
int rowCount = ExcelUtils.getRowCount();
Object[][] data = new Object[rowCount][2];

for (int i = 1; i <= rowCount; i++) {
data[i – 1][0] = ExcelUtils.getCellData(i, 0);
data[i – 1][1] = ExcelUtils.getCellData(i, 1);
}
return data;
}

@Test(dataProvider = “loginData”)
public void testLogin(String username, String password) {
WebElement usernameField = driver.findElement(By.id(“username”));
WebElement passwordField = driver.findElement(By.id(“password”));
WebElement loginButton = driver.findElement(By.id(“login”));

usernameField.sendKeys(username);
passwordField.sendKeys(password);
loginButton.click();

// Add assertions here to verify login success or failure
}

@AfterClass
public void teardown() {
driver.quit();
}
}

Best Practices for Data-Driven Testing

Use External Data: Store test data in external files to reduce script changes.

Parameterize Test Cases: Avoid hardcoding data in test scripts.

Error Handling: Implement robust error handling for file operations.

Optimize Performance: Load test data only once if possible.

Clear Test Data: Ensure the test environment is reset before each run.

Advantages of Data-Driven Testing with Selenium

Flexibility: Easily test multiple scenarios by changing input data.

Enhanced Coverage: Test edge cases by providing varied data sets.

Reduced Redundancy: Write fewer scripts for multiple test cases.

Conclusion
Data-driven testing is a vital strategy for efficient and thorough test automation. By combining Selenium with tools like Apache POI and TestNG, you can create scalable and maintainable test suites that cover a wide range of scenarios. Implement this approach to enhance your testing process and ensure high-quality software delivery.

Keywords: Data-Driven Testing, Selenium, TestNG, Apache POI, Automation Testing, Excel Integration, Test Automation Framework.

 
API testing has become an integral part of software quality assurance. Automating REST APIs ensures the robustness and reliability of web applications by validating backend functionality. In this blog, we will explore how Selenium and Postman can be used to automate REST APIs, providing both flexibility and scalability in your testing processes.

Why Automate REST APIs?
Automating REST APIs brings several benefits, including:

Speed: Automated tests execute faster compared to manual testing.

Accuracy: Minimizes human error in repetitive tasks.

Efficiency: Allows simultaneous testing of multiple endpoints.

Integration: Fits seamlessly into CI/CD pipelines.

Key Concepts in REST API Automation
Before diving into automation, let’s understand some key concepts:

API Endpoint: A URL that specifies where an API resource is located.

HTTP Methods: Common methods include GET, POST, PUT, DELETE.

Status Codes: Responses like 200 (OK), 404 (Not Found), 500 (Server Error).

Request Payload: The data sent with a request, often in JSON format.

Response: Data received from the server, including status and body.

Tools Overview: Selenium and Postman

Selenium: Best suited for UI testing but can complement API testing by validating front-end integration with APIs.

Postman: A powerful API testing tool that supports request creation, test scripting, and automation through Newman CLI.

Practical Applications of API Testing

Authentication: Validating login and token-based authentication mechanisms.

Data Integrity: Ensuring the correctness of data returned by APIs.

Error Handling: Checking proper error messages and status codes.

Load Testing: Simulating multiple users accessing APIs simultaneously.

Setting Up Selenium and Postman for API Automation
1. Installing Selenium
Ensure you have Java and Maven installed. Add Selenium dependencies to your pom.xml:<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.10.0</version>
</dependency>2. Installing Postman
Download Postman from Postman’s official website. For automation, install Newman:
npm install -g newman

Coding Examples: Automating REST APIs with Selenium and Postman
Example 1: Sending API Requests Using Java (RestAssured Library)import io.restassured.RestAssured;
import io.restassured.response.Response;

public class ApiTest {
public static void main(String[] args) {
RestAssured.baseURI = “https://jsonplaceholder.typicode.com”;

// GET Request
Response response = RestAssured.given().get(“/posts/1”);
System.out.println(“Status Code: ” + response.getStatusCode());
System.out.println(“Response Body: ” + response.getBody().asString());

// Assert Status Code
assert response.getStatusCode() == 200;
}
}
Example 2: Running Postman Collections via Newman

Export your Postman collection as a JSON file.

Use Newman CLI to execute the collection:newman run my-collection.json
Example 3: Integrating Selenium with API Responses
This example demonstrates how to combine API testing with UI testing by validating that the data returned from an API call is correctly displayed on a web application’s UI. Here’s a breakdown of the code:import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import io.restassured.RestAssured;

public class SeleniumApiIntegration {
public static void main(String[] args) {
// API Call
RestAssured.baseURI = “https://api.example.com”;
String apiData = RestAssured.given().get(“/data”).getBody().asString();

// Selenium Test
WebDriver driver = new ChromeDriver();
driver.get(“https://example.com”);

WebElement element = driver.findElement(By.id(“apiDataField”));
assert element.getText().equals(apiData);

driver.quit();
}
}

1. API Call with RestAssured
The first step involves using RestAssured to interact with the API. A base URL is set, and a GET request is sent to a specific endpoint. The response body is retrieved as a string, which will later be compared with the data displayed on the web page.

2. Selenium Test
The Selenium WebDriver is initialized to open the browser and navigate to the target URL. This ensures that the web page containing the UI element to be validated is loaded and ready for interaction.

3. Finding the Web Element
A specific element on the web page is located using a unique identifier (like an ID attribute). This UI element is expected to display the same data that was fetched from the API.

4. Validating the Data
The text content of the located UI element is retrieved and compared with the API response. If the values match, the test passes, indicating consistency between the API and UI. If they don’t match, it signals a potential bug or data discrepancy.

5. Closing the Browser
Finally, the browser session is terminated to ensure no resources are left open after the test execution.

Use Case
This approach is used to verify the consistency of data between the backend (API response) and the frontend (UI). For example:

Validating that product details provided by an API, such as name or price, are displayed accurately on a webpage.

Benefits

End-to-End Testing: Ensures seamless integration between the backend and frontend.

Early Bug Detection: Detects mismatches between API and UI during testing phases.

Reusable: Can be extended to validate multiple API endpoints and corresponding UI elements.
Step-by-Step Guide to Automate API Testing

Understand API Requirements: Review API documentation to understand endpoints, methods, and payloads.

Create Test Cases: Identify scenarios such as response validation, status codes, and data formats.

Use Postman for Initial Testing: Verify API responses manually.

Automate with Java: Use RestAssured or HttpClient libraries for scripting.

Integrate with Selenium: Combine API data validation with UI testing.

Leverage CI/CD: Incorporate automated tests into Jenkins or GitHub Actions.

Conclusion
By integrating Selenium and Postman, you can create a comprehensive automation suite that tests APIs and ensures seamless integration between backend and frontend systems. API testing not only improves the reliability of web applications but also accelerates the development cycle, allowing teams to deliver high-quality products efficiently.

CTA: Have questions about API testing with Selenium and Postman? Share them in the comments below!

I know that stateless in REST means that the client and server are separate, but I thought that it should always be the case. What would be an example of an API that is not stateless. Can those also be tested by QA?

Insurers today have gone beyond the role of merely safeguarding and compensating for losses. They have moved into the role of prevention, becoming a ubiquitous entity in people’s lives. The insurance sector has come a long way from being paper based to prioritizing operational excellence and cost efficiency. Since the emergence of Insurtech, insurers have … Why Guidewire Programs Fail: The Missing Layer of Assurance Enterprises Must Know
The post Why Guidewire Programs Fail: The Missing Layer of Assurance Enterprises Must Know first appeared on TestingXperts.

The blog discusses how AI-native product development redefines how digital solutions are built. It focuses on intelligence, automation, and real-time user value. This blog breaks down core pillars like AI-first design, MLOps, data analytics, and governance. Learn how best practices and frameworks like Tx-DevSecOps and Tx-Insights help organizations create scalable, ethical, and innovation-driven products ready for the AI-powered future.
The post AI-Native Product Development: 5 Pillars That Matter first appeared on TestingXperts.

I never had to use Cucumber hooks in all my experience. I had to admit though, that I didn’t write the framework from scratch. At my last job, there framework was TestNG with Cucumber (that is why never had to use TEST annotation). Am I right, that if you have TestNG, you don’t need to use hooks, because you use TestNG Before/After annotation. In other words, you can’t use both. You can use ones or the others. And I think that using HOOKS defeats the purpose of having TestNG

In the Test Runner class I don’t fully understand this line ”’@RunWith(Cucumber.class)”’. If I am not mistaken, @RunWith is TestNG (and also JUnit) annotation. So, if you have Cucumber without those frameworks, how do you make your test cases run? Besides, what is in parenthesis defines a class Cucumber (that is what class keyword does), however that Class already exists. It is not a predefined class (like HashMap under utils). What is the purpose of creating a brand new class without any body?

In today’s fast-paced development world, AI agents for automation testing are no longer science fiction they’re transforming how teams ensure software quality. Imagine giving an intelligent “digital coworker” plain English instructions, and it automatically generates, executes, and even adapts test cases across your application. This blog explains what AI agents in testing are, how they
The post AI Agents for Automation Testing: Revolutionizing Software QA appeared first on Codoid.

The blog discusses how Agentic AI is upscaling software testing through autonomous agents that learn, adapt, and optimize the testing process. It also explores key trends, tools and why Tx is a preferred partner for businesses embracing this transformation.
The post Intelligent QA at Scale: How Agentic AI Delivers Faster & Safer Software Releases first appeared on TestingXperts.

For decades, testers have been handed tools made for developers and told to “make it work.” That’s changing. As Agile and DevOps methodologies become the norm, quality assurance is no longer a post-development gatekeeperit’s a core contributor to the product lifecycle. But many testing tools haven’t caught up. Traditional testing environments require days of setup.
The post Firebase Studio: Testing’s New IDE appeared first on Codoid.

A Test Automation Center of Excellence (TA CoE) centralizes and scales QA processes, driving higher software quality, faster releases, and lower risk. This blog explores its components, strategic benefits, a case study from the insurance sector, and why select Tx to set up your TA CoE.
The post Breaking the QA Barrier: Build a Test Automation CoE That Scales Excellence first appeared on TestingXperts.

In the digital era where speed, quality, and agility define success, test automation has become essential to software development lifecycles. Organizations must deliver faster without compromising on quality, and manual testing often becomes a bottleneck. Enter Tosca a comprehensive continuous testing platform from Tricentis that enables enterprises to automate testing at scale efficiently. Tosca stands
The post Tosca : Guidelines and Best Practices appeared first on Codoid.

When every click behaves exactly as a product owner expects, it is tempting to believe the release is rock‑solid. However, real users and real attackers rarely follow the script. They mistype email addresses, paste emojis into form fields, lose network connectivity halfway through checkout, or probe your APIs with malformed JSON. Negative testing exists precisely
The post Negative Scenarios in Testing: Proven Ways to Bulletproof Your Software appeared first on Codoid.

In an increasingly digital world, accessibility is no longer a luxury or an afterthought it is a necessity. More than one billion people, or about 15% of the global population, live with some form of disability. These disabilities range from visual and auditory impairments to motor and cognitive challenges, each presenting unique obstacles to interacting
The post Pa11y for Automated Accessibility Testing appeared first on Codoid.

I have used Selenium for several years to automate UI tests, one of our new devOps guys used to be a QA and he introduced me to Playwright recently. On the surface it seems like Playwright solves a bunch of the issues that I’ve had with Selenium. Built in waits, a test builder that’s actually useful for grabbing stubborn locators, etc. So I then presented the advantages to my manager while making sure to let her know that Selenium can still be used so we don’t have to re-write all the existing automation. However, she’s hesitant to make any changes, partly because playwright is so new and there’s not as much community support. I’m curious if there are more advantages to playwright that people have come across while using it to strengthen my argument? Thanks in advance.

The blog discusses how predictive analytics can transform performance engineering by enabling teams to detect and resolve software bottlenecks before they impact users. By leveraging historical data and real-time metrics, enterprises can forecast issues, optimize systems, and improve application reliability.
The post Predictive analytics in Performance Engineering: Identifying Bottlenecks Before They Happen first appeared on TestingXperts.

The blog discusses how Agentic AI can upscale DevSecOps by enabling autonomous security testing, continuous risk assessment, and intelligent decision-making within CI/CD pipelines. It proactively detects vulnerabilities, adapts testing workflows based on context, and supports instant incident response.
The post DevSecOps with Agentic AI: Autonomous Security Testing in CI/CD Pipelines first appeared on TestingXperts.

I’m working with Java and REST Assured to test REST APIs. I was trying the example with JSON schema validation but it throws this error:
java.lang.IllegalArgumentException: Schema to use cannot be null

at io.restassured.module.jsv.JsonSchemaValidator.validateSchemaIsNotNull(JsonSchemaValidator.java:270)
at io.restassured.module.jsv.JsonSchemaValidator.access$300(JsonSchemaValidator.java:75)
at io.restassured.module.jsv.JsonSchemaValidator$JsonSchemaValidatorFactory.create(JsonSchemaValidator.java:281)
at io.restassured.module.jsv.JsonSchemaValidator.matchesJsonSchema(JsonSchemaValidator.java:166)
at io.restassured.module.jsv.JsonSchemaValidator.matchesJsonSchemaInClasspath(JsonSchemaValidator.java:117)
at suites.SchemaFollowupTest.ContractFollowUpTestSuccess(SchemaFollowupTest.java:44)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

My test code is:
given()
.header(“Content-Type”, ContentType.JSON)
//.header(“Authorization”, “Bearer ” + ConfigEnvironments.TOKEN_K8S)
.body(jsonBody)
.when()
.post(ConfigEnvironments.BASE_URL_CLAIMENGINE +”/api/v1/FollowUp”)
.then().log().all()
.statusCode(202)
.and()
.body(matchesJsonSchemaInClasspath(“src/test/resource/followup-schema.json”));

My strucuture folder is here:
[1]: https://i.sstatic.net/K9m2UjGy.png

In a groundbreaking move that underscores a pivotal shift in financial policy, the Trump administration has unveiled a bold pro-cryptocurrency stance, setting the stage for the United States to emerge as a global leader in the digital financial revolution. This policy pivot not only reflects the administration’s recognition of cryptocurrency’s transformative potential but also signals a new era of economic innovation and empowerment.The Context: Why Now?Cryptocurrency has transitioned from a niche interest to a mainstream financial instrument, with Bitcoin and other digital currencies capturing the imagination of investors, businesses, and governments worldwide. The Trump administration’s endorsement comes at a time when cryptocurrencies are gaining traction as viable assets for hedging against inflation, facilitating cross-border transactions, and fostering financial inclusion.Vice President JD Vance’s recent address at the Bitcoin 2025 conference in Las Vegas was a watershed moment, as he articulated the administration’s commitment to supporting the crypto ecosystem. His declaration that cryptocurrency represents a “hedge against poor policymaking and inflation” encapsulates the administration’s strategic vision.Key Policy InitiativesTax Incentives for Crypto Adoption:
The administration plans to introduce tax breaks for businesses and individuals transacting in cryptocurrencies. This initiative aims to encourage wider adoption while bolstering the U.S. economy’s digital transformation.Regulatory Clarity:
In a move to attract blockchain startups and fintech firms, the administration has committed to creating a regulatory framework that balances innovation with investor protection. This approach is designed to eliminate ambiguities that have historically deterred investment in the crypto sector.Integration of Cryptocurrency in 401(k) Plans:
The Department of Labor’s revised guidance empowers fiduciaries to include cryptocurrencies in retirement portfolios, offering Americans diversified investment options for their future.Public-Private Partnerships:
To accelerate blockchain adoption, the administration is fostering collaborations between federal agencies and private-sector innovators. These partnerships aim to explore applications in supply chain management, cybersecurity, and beyond.Strategic ImplicationsThe Trump administration’s pro-crypto stance is not merely a policy decision; it’s a strategic move to position the United States as a trailblazer in the global crypto economy. By embracing digital currencies, the administration aims to:Enhance Financial Sovereignty:
Reducing reliance on traditional banking systems aligns with the broader goal of fostering a resilient and self-reliant economy.Attract Foreign Investment:
A crypto-friendly environment is expected to draw significant investment from global tech giants and blockchain startups.Strengthen Geopolitical Standing:
As nations like China and the European Union intensify their focus on central bank digital currencies (CBDCs), the U.S. seeks to maintain its competitive edge by championing decentralized finance (DeFi).Public Reception and CriticismWhile the policy shift has been lauded by crypto enthusiasts and industry leaders, it has also faced criticism from skeptics who highlight concerns about market volatility, fraud, and environmental impact. The administration’s challenge lies in addressing these issues without stifling innovation.Looking AheadThe Trump administration’s pro-crypto stance marks a significant milestone in the evolution of financial policy. By embracing the potential of cryptocurrencies and blockchain technology, the U.S. is poised to lead a global economic transformation. However, the success of this strategy will depend on the administration’s ability to navigate challenges and build a robust, inclusive framework that benefits all stakeholders.As the world watches, the United States stands at the forefront of a financial revolution. The question remains: Will this bold gamble pay off in securing economic prosperity and technological leadership for generations to come? Only time will tell, but the foundation has been laid for an exciting future.