Skip to content
CodeKruPro

Element Screenshot

63/70

Element Screenshot

locator.screenshot({ path }) captures a screenshot of just that element.

Task:

  1. Navigate to https://testkru.com/Elements/Buttons
  2. Find the #leftClick button
  3. Take a screenshot of just that button
  4. Verify the file was created

Expected output:

Element screenshot taken: true
Element screenshot has content: true