Skip to content
CodeKruPro

Custom Timeout

41/70

Custom Timeout

By default, Playwright waits up to 30 seconds. You can override this per action using the timeout option.

On Appearing Elements, #appearing5sec appears after 5 seconds and #appearing10sec after 10 seconds.

Task:

  1. Navigate to https://testkru.com/Interactions/AppearingElements
  2. Wait for #appearing5sec with a timeout of 8 seconds
  3. Print its text
  4. Check if #appearing10sec is visible (it should still be hidden at this point)

Expected output:

First element: Message appeared after 5 seconds
Second still hidden: true