Sobes.tech
Junior — Middle

What tool or language did you use to write automated tests?

sobes.tech AI

Answer from AI

Tools and languages often used for writing automated tests in Java include:

  • JUnit — the main framework for unit testing.
  • TestNG — an alternative to JUnit with extended capabilities.
  • Selenium WebDriver — for automating web interface testing.
  • Cucumber — for BDD (behavior-driven development) testing using the Gherkin language.

Example of a simple test in JUnit 5:

import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

class CalculatorTest {
    @Test
    void addition() {
        assertEquals(5, 2 + 3);
    }
}