There are ways to work around this limitation and achieve case-insensitive text search for elements.
1.Use XPath with translate()
element = driver.find_element(By.XPATH, '//label[contains(translate(text(), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz"), "username")]')
Find All, Then Filter.
Use JavaScript Execution (execute_script)
script = """ return Array.from(document.querySelectorAll("*")) .filter(el => el.innerText.toLowerCase().includes("username")); """ elements = driver.execute_script(script)