Clicking "Add a file" triggers input.click() which opens the OS-native file picker that WebDriver can't control, causing send_keys on the underlying input to fail with a message-less exception. The input is already present in the DOM (display:none) so send_keys can target it directly without the click.