# Generate Puppeteer Script Without WaitForXXX methods

**URL:** <https://forum.katalon.com/t/generate-puppeteer-script-without-waitforxxx-methods/53479>\
**Category:** Integrations\
**Tags:** plugins, katalon-studio\
**Created:** [April 1, 2021, 1:19pm UTC](https://forum.katalon.com/t/generate-puppeteer-script-without-waitforxxx-methods/53479 "2021-04-01T13:19:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lihao162](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/lihao162/32/16103_2.png) [@lihao162](https://forum.katalon.com/u/lihao162)\
**Post date:** [April 1, 2021, 1:19pm UTC](https://forum.katalon.com/t/generate-puppeteer-script-without-waitforxxx-methods/53479/1 "2021-04-01T13:19:39Z")

</div>

When I use the Katalon Recorder to record some actions in Chrome, I can playback without any problems in the Katalon Recorder plungin, but after I export the test case via Puppeteer and re-run the generated js files, it’s failed. I found it seems like the generated codes are lack of “await page.waitForXxx”, after I added the methods, the code run successfully.  
See the below examples:

```auto
element = await page.$x(`//*[@id="js-signin-btn"]`);
await element[0].click();
// get error that the below element is undefined
element = await page.$x(`//*[@name="email"]`);

```

```auto
element = await page.$x(`//*[@id="js-signin-btn"]`);
await element[0].click();
await page.waitForXPath(`//*[@id="signin"]`); // work fine after I add this line, the below element is ok

element = await page.$x(`//*[@name="email"]`);

```

So I want to ask if you can add the waitForXxx method automatically when I export the js codes? Or I should use the Katalon Recorder with another way which can avoid this problems?

Thanks.
