maybe you should use the full xpath to locate element, it is absxpath
abs-xpath like this /html/body/div[3]/div/div/div/div/div[2]/form/input, which from the https://ecas.ec.europa.eu/cas/login website
you should write codes like this:
driver.find_element(By.XPATH, r"/html/body/div[3]/div/div/div/div/div[2]/form/input")
WebDriverWait(driver, timeout=10).until(EC.element_to_be_clickable((By.XPATH, r"/html/body/div[3]/div/div/div/div/div[2]/form/div[2]/div[2]/button")))
driver.find_element(By.XPATH, "/html/body/div[3]/div/div/div/div/div[2]/form/div[2]/div[2]/button").click()
besides, you can use another method to locate element, like:
driver.find_elements(By.CLASS_NAME, "username-input")[0]
driver.find_elements(By.TAG_NAME, 'a')[0]
driver.find_elements(By.ID, 'userSkin')[0]
the last, maybe you should use EC.* of selenium to wait for something happen
you click and html reload, then some element can be located
like login or logout some website, you should wait until page reload and some element can be located.
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
WebDriverWait(driver, timeout=10).until(EC.element_to_be_clickable((By.XPATH, r"")))
WebDriverWait(driver, timeout=10).until(EC.visibility_of_all_elements_located((By.XPATH, r"")))
WebDriverWait(driver, timeout=10).until(EC.presence_of_element_located((By.XPATH, r"")))
WebDriverWait(driver, timeout=10).until(EC.title_contains((By.XPATH, r"")))
WebDriverWait(driver, timeout=10).until(EC.text_to_be_present_in_element((By.XPATH, r"")))