Puppeteer can't find selector

As far as I can tell, #txtCase is an actual selector on the page, so I don't know why puppeteer can't find it.

Try loading the page and using the console to find that element.

document.querySelector('#txtCase')
null

It's not there. I know you can see it when you right-click to inspect that text field, but it's nested in an iframe. You need to access that frame, then find the button, then click on it.

const frame = await page.frames().find(f => f.name() === 'iframe');
const button = await frame.$('#txtCase');
button.click();