Complete the code to locate a button with the attribute id='submitBtn'.
WebElement button = driver.findElement(By.xpath("//button[@[1]='submitBtn']"));
The XPath expression uses the attribute id to locate the button with id='submitBtn'.
Complete the code to find an input element with attribute type='checkbox'.
WebElement checkbox = driver.findElement(By.xpath("//input[@[1]='checkbox']"));
The XPath uses the attribute type to find the input element of type 'checkbox'.
Fix the error in the XPath to select a div with class='container'.
WebElement container = driver.findElement(By.xpath("//div[@class[1]'container']"));
The correct XPath syntax for attribute equality is @class='container'. The equals sign must be followed by quotes.
Fill both blanks to locate an input element with name='email' and type='text'.
WebElement emailInput = driver.findElement(By.xpath("//input[@[1]='email' and @[2]='text']"));
The XPath selects an input element with name='email' and type='text' attributes.
Fill all three blanks to find a link (<a>) with href containing 'login' and class='nav-link'.
WebElement loginLink = driver.findElement(By.xpath("//a[contains(@[1], '[2]') and @[3]='nav-link']"));
The XPath uses contains(@href, 'login') to find links with 'login' in the href attribute and filters by class='nav-link'.