Skip to main content
Version: 1.16

TimeoutError

  • extends: [Error]

TimeoutError is emitted whenever certain operations are terminated due to timeout, e.g. Page.WaitForSelectorAsync(selector, options) or BrowserType.LaunchAsync(options).

using System.Threading.Tasks;using Microsoft.Playwright;using System;
class Program{    public static async Task Main()    {        using var playwright = await Playwright.CreateAsync();        await using var browser = await playwright.Chromium.LaunchAsync();        var page = await browser.NewPageAsync();        try        {            await page.ClickAsync("text=Example", new() { Timeout = 100 });        }        catch (TimeoutException)        {            Console.WriteLine("Timeout!");        }    }}