SDET: JUnit interview questions for automation engineer

Carvia Tech | September 09, 2019 | 1 min read | 2 views

In this article we will cover important interview questions around Junit 4 and Junit 5 for every automation SDET engineer.

  1. How will you write a simple Junit program?

  2. Why do you write Unit tests in isolation?

  3. Can we only write unit tests using Junit?

  4. How does Junit compares with TestNG and other frameworks like BDD/Cucumber/etc?

  5. How will you group Junit 5 testcases based on functionality or other parameters?

  6. How to create custom Junit 5 meta annotation for a Tag?

  7. How to programmatically run Junit 5 testcases for a specific Tag/Class/Package using Java/Kotlin code?

  8. How to make certain testcase run on a specific environment/machine/os only, skip otherwise?

  9. How to write integration testcase using Junit 5?

  10. How to write API testcases using Junit 5?

  11. How to specify order of execution for testcases? Should’d testcase be written in such a way that they can be run independent of execution order?

  12. How to write dynamic testcase in Junit 5? Write dynamic testcases for asserting recently developed palindrome function.

  13. What are parameterized tests in Junit 5? How to write a simple Parameterized test? When to use parameterized tests?

  14. How will you compare parameterized tests with dynamic tests?

  15. Write a simple Junit 5 testcase that checks a REST API for unauthorized access?

Top articles in this category:
  1. Top 50 SDET Java Programming Interview Questions & Answers
  2. SDET: Rest Assured Interview Questions
  3. How to reverse a number in Java
  4. Junit 5 Platform Launcher API
  5. SDET Java Role - Essential Skills
  6. Write a program to reverse a string using recursion in Java
  7. Write a program to reverse the order of words in a string

Find more on this topic:
SDET Interviews image
SDET Interviews

SDET Java Interview pattern and collection of questions covering SDET coding challenges, automation testing concepts, functional, api, integration, performance and security testing, junit5, testng, jmeter, selenium and rest assured

Last updated 1 week ago

Recommended books for interview preparation:

This website uses cookies to ensure you get the best experience on our website. more info