title: node- Use puppeteer to test a website made with react
body: <p>Is possible with puppeteer to test a website that will assign classes to the DOM elements dynamically? the site is made with react and at the moment I'm unable to create a working puppeteer script because of this.</p>
  <p>I have this code:</p>
  <pre class="lang-js prettyprint-override"><code>const puppeteer = require('puppeteer');
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  const navigationPromise = page.waitForNavigation();
  
  await page.goto('https://www.example.com/accounts/emailsignup/');
  
  await page.setViewport({ width: 1280, height: 607 });
  
  await page.waitForSelector('body &gt; .RnEpo &gt; .pbNvD &gt; ._1XyCr &gt; .HoLwm');
  await page.click('body &gt; .RnEpo &gt; .pbNvD &gt; ._1XyCr &gt; .HoLwm');
  
  await navigationPromise;
  
  await page.waitForSelector('body &gt; #react-root &gt; ._9eogI &gt; .SCxLW &gt; .qF0y9');
  await page.click('body &gt; #react-root &gt; ._9eogI &gt; .SCxLW &gt; .qF0y9');
  
  await page.waitForSelector('.XFYOY &gt; .WZdjL &gt; .HlU5H &gt; .f0n8F &gt; ._2hvTZ');
  await page.click('.XFYOY &gt; .WZdjL &gt; .HlU5H &gt; .f0n8F &gt; ._2hvTZ');
  
  await browser.close();
  </code></pre>