IKivan-kozenko -aqa
Try yourself as a QA tester
Back to topic

Quiz

Handles

Check yourself

  1. 1.You have code that does: const handle = await page.$('button.submit'); // React re-renders; await handle.click(). What's the risk and how do you fix it?
  2. 2.What is the key difference between a Locator and an ElementHandle?
  3. 3.When is a JSHandle useful compared to page.evaluate()?
  4. 4.What does evaluateHandle() return compared to evaluate()?
  5. 5.What happens to all handles when the page navigates to a new URL?
  6. 6.What is the remaining legitimate use case for ElementHandle (over Locator)?
  7. 7.Why should you call handle.dispose() when you're done with a JSHandle?
  8. 8.You want to call multiple operations on a large JavaScript array stored in the browser without serializing it each time. What is the correct approach?