type exactly equal to email?The selector input[type='email'] matches elements whose type attribute is exactly email. The other selectors match partial values: ^= for starts with, $= for ends with, and *= for contains.
data-test='submit-btn' is present on the page?element = driver.find_element(By.CSS_SELECTOR, "button[data-test='submit-btn']")To verify presence and visibility, element.is_displayed() returns True if the element is visible on the page. Checking text or tag name does not confirm presence.
elements = driver.find_elements(By.CSS_SELECTOR, "input[name^='user']") print(type(elements))
The method find_elements returns a list of WebElement objects matching the selector. Therefore, the type is list.
element = driver.find_element(By.CSS_SELECTOR, "input[name='user"]")
The CSS selector string has mismatched quotes causing an invalid selector. Selenium raises InvalidSelectorException when the selector syntax is wrong.
input elements whose id attribute contains the substring email anywhere inside it. Which CSS selector should you use?The *= operator matches if the attribute contains the substring anywhere. ^= matches start, $= matches end, and = matches exact.
