Don't Use assertTrue to Verify Text in Your Test

Don't Use assertTrue to Verify Text in Your Test

It is common, especially in functional tests on any front-end, to include text validation in our tests to verify that the returned value is the expected one. This article has the intent to show the difference between assertTrue and assertEquals to verify any information in an automated test script.

Those commands can be found in Java testing libraries like JUnit or TestNG and we call these methods assertions.

assertEquals

The assertEquals assertion will compare the expected information you have to be equals to the actual information from your target (E.g: a text on a web page).

assertTrue

The assertTrue assertion will compare the expected result against true or false verification. If your result is true you have success, otherwise, an error will be shown.

test automation asserttrue testing

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Top 10 Automation Testing Tools: 2020 Edition

The demand for delivering quality software faster — or “Quality at Speed” — requires organizations to search for solutions in Agile, continuous integration (CI), and DevOps methodologies. Test automation is an essential part of these aspects.

Measure Your Test Automation Maturity

Feel free to grade your team's maturity through my research. By the end of the article, you'll have your Test Automation Maturity Level.

Review — Automated Visual Testing With WebdriverIO

If you use WebdriverIO regularly, and you are unfamiliar with the basics of using Applitools for automated visual testing, you will appreciate this course.

Where To Learn Test Programming — July 2020 Edition

What do you do when you have lots of free time on your hands? Why not learn test programming strategies and approaches?

Automation Testing Tips

Thorough testing is crucial to the success of a software product. If your software doesn’t work properly, chances are strong that most…