0

I'am trying to fill stripe forms and typing is not working correctly, I'am facing the following scenario, puppeteer starts typing but stops before finishing or completely not typing in the field. I'am doing something like this:

// the issue appears when using the following
const iframe = await page.waitForSelector('iframe', { visible: true });
const iframeContent = await iframe.contentFrame();
await iframeContent.type('#cardNumber', value, { delay: 150 });
// adding timeout works
await page.waitForTimeout(5000);
const iframe = await page.waitForSelector('iframe', { visible: true });
const iframeContent = await iframe.contentFrame();
await iframeContent.type('#cardNumber', value, { delay: 150 });

I tried using page.waitForFrame() and it did not work

Erwin Smith
  • 65
  • 2
  • 11
  • Waiting for a frame waits for a frame, not the content in it. Can you share the site you're working with and a runnable [mcve]? If not, you can try `waitForSelector` or `waitForFunction` on whatever predicate you're waiting for inside the frame, or if that doesn't work, keep polling the HTML of the frame until it stops changing for 500ms or something like that as shown in [Puppeteer wait until page is completely loaded](https://stackoverflow.com/questions/52497252/puppeteer-wait-until-page-is-completely-loaded/72537739#72537739). – ggorlen Dec 02 '22 at 14:59

0 Answers0