1. Java Syntax & Core Fundamentals for Automation

Java Execution Architecture

- JDK (Java Development Kit): Compiler (javac), tools, and JRE needed to write and compile code. - JRE (Java Runtime Environment): Libraries and JVM required to run Java bytecode. - JVM (Java Virtual Machine): Executes bytecode (.class) across operating systems.

Variables & Data Types in Automation

public class VariablesDemo {
    public static void main(String[] args) {
        // Primitive types:
        int defaultTimeoutMs = 5000;
        double implicitWaitSec = 2.5;
        boolean isHeadless = true;
        char statusIndicator = 'P';

// Reference types:
String targetUrl = "https://targetqa.com";
final int MAX_RETRIES = 3; // Constant

System.out.println("Running test against: " + targetUrl);
}
}

Task

  • Complete the TestEnvironment class:
  • 1. Declare a final String BASE_URL = "https://targetqa.com".
  • 2. Declare an int timeoutSeconds = 30.
  • 3. Return true if timeoutSeconds is greater than 0 and BASE_URL is not null.
πŸ’‘Common doubts
Did you like the problem?
Lesson 1 of 38
Java
Loading code editor…
Next