Complete the code to find an element by its name attribute.
WebElement element = driver.findElement(By.[1]("username"));
The By.name locator finds elements by their name attribute.
Complete the code to click on the element found by name.
driver.findElement(By.[1]("submitBtn")).click();
Clicking the element found by By.name requires using By.name locator.
Fix the error in the code to correctly find element by name.
WebElement input = driver.findElement(By.[1]("email"));
The correct locator to find by the name attribute is By.name.
Fill both blanks to create a test that finds an element by name and sends keys.
WebElement input = driver.findElement(By.[1]("search")); input.[2]("Selenium");
Use By.name to find the element by name, then sendKeys to type text.
Fill all three blanks to find an element by name, clear it, and enter new text.
WebElement input = driver.findElement(By.[1]("username")); input.[2](); input.[3]("newuser");
Find element by By.name, clear existing text with clear(), then enter new text with sendKeys().
