20 nested and combined condition problems, ideal for developing test-case logic flow

20 nested and combined condition problems, ideal for developing test-case logic flow and more realistic SDET automation practice.

  1. Check if a password is valid (8-16 chars, at least 1 uppercase, 1 lowercase, 1 digit, no spaces).

  2. Validate if an entered date (dd, mm, yyyy) is valid, including leap year check.

  3. Check if an email is valid (must not start with special char, must contain '@', domain must be '.com' or '.org').

  4. Check user login input: username must be 6-15 letters, password rules apply, and both must not be empty.

  5. Determine if an entered time (hh:mm) is valid and whether it’s AM or PM (12-hour format).

  6. Check if a triangle is equilateral, isosceles, scalene, or invalid (sum of angles = 180).

  7. Validate shipping eligibility: country must be 'US' or 'CA', total amount must be over $50, and item count less than 10.

  8. Check if a user qualifies for discount: member status is 'gold' or 'silver', and purchase amount exceeds thresholds.

  9. Check if an input string is a palindrome while ignoring case and white spaces.

  10. Validate credit card number: must start with '4' (Visa) or '5' (Mastercard), must have 16 digits.

  11. Determine if an entered score qualifies: score between 0-100 and grade assigned (A, B, C, D, F).

  12. Validate phone number: starts with country code '+1', total length 12, contains only digits after '+'.

  13. Check file upload eligibility: size < 5MB, extension allowed, and filename does not contain spaces.

  14. Check if two times entered form a valid start-end pair (start < end).

  15. Validate booking input: selected date is in the future and time is within working hours (9 AM - 6 PM).

  16. Check if entered promo code is valid and not expired (today's date before expiry).

  17. Verify user input fields: first name and last name only alphabets, age is a valid integer 0-120.

  18. Check if an order qualifies for express shipping (location 'US' and order weight under 10kg).

  19. Validate survey input: rating is between 1-5 and comment is not empty if rating < 3.

  20. Check if a login attempt should be blocked: wrong attempts > 3 AND last attempt within 5 minutes.

This is the level where test automation scripts start checking combined rules, multiple fields, and nested if-else flow. It’s also excellent prep for SDET coding rounds or real-world test logic in Selenium/API scripts.

Comments

Popular posts from this blog

10 automation test cases for https://www.saucedemo.com/ (Sauce Demo)

Java Roadmap for SDET Superstars!

Mastering XPath in Selenium 4 ๐Ÿš€ – Supported Functions & Axes Explained