Playwright + Java · Lesson 1 of 38
Module 1: Java Basics
Your task
Complete the TestEnvironment class:
Write it in the editor, then press Check answer (Ctrl + Enter).
javac), tools, and JRE needed to write and compile code..class) across operating systems.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);
}
}Welcome to Playwright with Java! In this first module, we cover the essential Java foundations required for test automation. You will understand the Java Virtual Machine, variables, primitive types, Strings, and arithmetic and logical operators. Let's get started!
Part of the Playwright + Java course (Playwright with Java). Practice this concept live in the Playwright Online Compiler or explore our free automation practice form.
Test automation engineers must install the full JDK because Maven and IDEs need javac to compile your Java test files.
Using 'final' prevents accidental re-assignment of critical configuration values like base URLs and timeout thresholds.
Ready? Solve the task in the editor
Use Check answer to mark it complete. Hints are there if you need them.
___