$x("//button[text()='Submit']")
- CSS: $$("button.submit-btn")
2. Retrieve Browser Console Logs in Java:
import org.openqa.selenium.logging.LogEntries;
import org.openqa.selenium.logging.LogType;LogEntries logs = driver.manage().logs().get(LogType.BROWSER);
logs.forEach(entry -> System.out.println(entry.getLevel() + ": " + entry.getMessage()));