org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":"#username"}
(Session info: chrome-headless-shell=123.0.6312.87)
For documentation on this error, please visit:
https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exceptionBuild info: version: '4.17.0', revision: 'e52b1be057*'
System info:
os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '14.2.1', java.version: '21.0.2'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [71b96c3533417ab6fb5bdeec6ba98a7f, findElement {value=username, using=id}]
Capabilities {acceptInsecureCerts: true, browserName: chrome-headless-shell, browserVersion: 123.0.6312.87, chrome: {chromedriverVersion: 123.0.6312.86 (9b72c47a0536..., userDataDir: /var/folders/5h/yfsjql21275...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:61184}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: mac, proxy: Proxy(), se:cdp: ws://localhost:61184/devtoo..., se:cdpVersion: 123.0.6312.87, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
Session ID: 71b96c3533417ab6fb5bdeec6ba98a7f
If I comment out the headless option the elements are found and the test works correctly. Ideas?