Complete the code to create a new ChromeDriver instance in Selenium with Java.
WebDriver driver = new [1]();The ChromeDriver class is used to create a new Chrome browser instance in Selenium with Java.
Complete the code to open the URL 'https://example.com' using Selenium WebDriver.
driver.[1]("https://example.com");
The get method opens the specified URL in the browser.
Fix the error in the code to click a button with id 'submitBtn'.
driver.findElement(By.id([1])).click();The By.id method requires the id as a string in double quotes.
Fill both blanks to wait up to 10 seconds for an element with id 'username' to be visible.
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds([1])); wait.until(ExpectedConditions.[2](By.id("username")));
We wait 10 seconds and check for the element's visibility using visibilityOfElementLocated.
Fill all three blanks to create a test that opens Google, searches for 'Selenium', and submits the search.
driver.get("https://www.google.com"); WebElement searchBox = driver.findElement(By.[1]("q")); searchBox.sendKeys([2]); searchBox.[3]();
The search box is located by name 'q', we send keys "Selenium", then submit the form.