{
  "format": 3,
  "id": "1.1",
  "title": "Numbered Playwright calls and independent browser messages",
  "layers": {
    "client": {
      "label": "Client"
    },
    "server": {
      "label": "Server"
    },
    "browser": {
      "label": "Browser"
    },
    "protocol": {
      "label": "Protocol"
    }
  },
  "lanes": {
    "client": {
      "label": "CLIENT · NODE",
      "layer": "client",
      "y": 16,
      "h": 847.6,
      "x": 16,
      "w": 328
    },
    "server": {
      "label": "SERVER SIDE · NODE",
      "layer": "server",
      "y": 891.6000000000001,
      "h": 397.20000000000005,
      "x": 16,
      "w": 328
    },
    "browser": {
      "label": "CHROMIUM · SEPARATE PROCESS",
      "layer": "browser",
      "y": 1316.8,
      "h": 172,
      "x": 16,
      "w": 328
    }
  },
  "frames": {},
  "nodes": {
    "call": {
      "label": "locator.click()",
      "layer": "client",
      "lane": "client",
      "box": [
        134,
        40,
        109,
        36
      ]
    },
    "await": {
      "label": "matching await",
      "layer": "client",
      "lane": "client",
      "box": [
        211,
        815.6,
        121,
        36
      ]
    },
    "request": {
      "label": "call ID 7 · request",
      "layer": "protocol",
      "lane": "client",
      "box": [
        121,
        152.6,
        135,
        36
      ]
    },
    "reply": {
      "label": "call ID 7 · reply",
      "layer": "protocol",
      "lane": "client",
      "box": [
        129,
        703,
        119,
        36
      ]
    },
    "prefix": {
      "label": "API name on failure",
      "layer": "client",
      "lane": "client",
      "box": [
        32,
        815.6,
        147,
        36
      ]
    },
    "work": {
      "label": "server click",
      "layer": "server",
      "lane": "server",
      "box": [
        140.5,
        915.6000000000001,
        96,
        36
      ]
    },
    "response": {
      "label": "result / error + log",
      "layer": "server",
      "lane": "server",
      "box": [
        118,
        1240.8000000000002,
        141,
        36
      ]
    },
    "input": {
      "label": "Chromium input",
      "layer": "browser",
      "lane": "browser",
      "box": [
        170,
        1340.8,
        126,
        36
      ]
    },
    "browserReply": {
      "label": "browser reply",
      "layer": "browser",
      "lane": "browser",
      "box": [
        178,
        1440.8,
        110,
        36
      ]
    }
  },
  "edges": {
    "request": {
      "from": "call",
      "to": "request",
      "label": {
        "at": [
          200.5,
          118.5
        ],
        "text": "sends"
      },
      "path": "M188.5,76 L188.5,114.3 L188.5,152.6",
      "badge": [
        188.5,
        114.3
      ]
    },
    "dispatch": {
      "from": "request",
      "to": "work",
      "label": {
        "at": [
          127.61100000000003,
          692.6125000000002
        ],
        "text": "call ID 7"
      },
      "path": "M188.5,188.6 L188.5,552.1 L188.5,552.1 L188.5,915.6000000000001",
      "badge": [
        188.5,
        552.1000000000001
      ]
    },
    "input": {
      "from": "work",
      "to": "input",
      "label": {
        "at": [
          189.043,
          1053.1000000000001
        ],
        "text": "browser transport"
      },
      "path": "M188.5,951.6000000000001 L188.5,1146.2 L233,1146.2 L233,1340.8",
      "badge": [
        210.75,
        1146.2
      ]
    },
    "browserReply": {
      "from": "input",
      "to": "browserReply",
      "path": "M233,1376.8 L233,1408.8 L233,1440.8",
      "badge": [
        233,
        1408.8
      ]
    },
    "browserReturn": {
      "from": "browserReply",
      "to": "response",
      "label": {
        "at": [
          236.515625,
          1387.315625
        ],
        "text": "browser ID 42"
      },
      "path": "M233,1440.8 L233,1358.8000000000002 L188.5,1358.8000000000002 L188.5,1276.8000000000002",
      "badge": [
        188.5,
        1328.0500000000002
      ]
    },
    "response": {
      "from": "work",
      "to": "response",
      "path": "M174.27264653641208,951.6000000000001 L144,989.9000000000001 L144,1046.2 L144,1096.2 L144,1146.2 L144,1202.5 L174.27264653641205,1240.8000000000002",
      "badge": [
        144,
        1096.2
      ]
    },
    "return": {
      "from": "response",
      "to": "reply",
      "label": {
        "at": [
          200.5,
          1119.5500000000002
        ],
        "text": "same call ID"
      },
      "path": "M188.5,1240.8000000000002 L188.5,989.9000000000001 L188.5,989.9000000000001 L188.5,739",
      "badge": [
        188.5,
        989.9000000000001
      ]
    },
    "match": {
      "from": "reply",
      "to": "await",
      "path": "M215.03641207815278,739 L271.5,777.3 L271.5,815.6",
      "badge": [
        259.1162679380569,
        768.8999504206338
      ]
    },
    "prefix": {
      "from": "reply",
      "to": "prefix",
      "label": {
        "at": [
          117.50000000000001,
          781.5
        ],
        "text": "adds name"
      },
      "path": "M161.96358792184722,739 L105.5,777.3 L105.5,815.6",
      "badge": [
        105.5,
        777.3
      ]
    }
  },
  "scenarios": [
    {
      "id": "how",
      "label": "How a call returns",
      "display": {
        "counterLabel": false,
        "edges": "progressive",
        "edgeBadges": true,
        "nodeBadges": false,
        "log": "incremental"
      },
      "steps": [
        {
          "id": "a-click-sends-a-numbered-request",
          "title": "A click sends a numbered request",
          "text": "The client sends object, method and parameters with call ID 7. The IDs and #save are example values.",
          "show": [
            "call",
            "request"
          ],
          "current": [
            "request"
          ],
          "edges": [
            "request"
          ],
          "defs": [
            "request"
          ],
          "code": "request",
          "log": [],
          "sources": [
            {
              "label": "connection.ts:194-197",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L194-L197"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        },
        {
          "id": "the-await-waits-for-the-same-num",
          "title": "The await waits for the same number",
          "text": "The client stores resolve and reject handlers under the call ID.",
          "show": [
            "await"
          ],
          "current": [
            "await"
          ],
          "edges": [],
          "defs": [
            "await"
          ],
          "log": [],
          "sources": [
            {
              "label": "connection.ts:220-222",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L220-L222"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        },
        {
          "id": "local-client-and-server-share-no",
          "title": "Local client and server share Node",
          "text": "Local messages dispatch in both directions within Node. Chromium is a separate process.",
          "show": [
            "work"
          ],
          "current": [
            "work"
          ],
          "edges": [
            "dispatch"
          ],
          "defs": [
            "local",
            "work"
          ],
          "log": [],
          "sources": [
            {
              "label": "inprocess.ts:27-32",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/inprocess.ts#L27-L32"
            },
            {
              "label": "inprocess.ts:48-50",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/inprocess.ts#L48-L50"
            },
            {
              "label": "dispatcher.ts:297-299",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/dispatcher.ts#L297-L299"
            },
            {
              "label": "frameDispatcher.ts:146-148",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/frameDispatcher.ts#L146-L148"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        },
        {
          "id": "browser-input-has-independent-id",
          "title": "Browser input has independent IDs",
          "text": "Chromium input uses Input.dispatchMouseEvent. Browser ID 42 is an example, independent of call ID 7.",
          "show": [
            "input",
            "browserReply"
          ],
          "current": [
            "input",
            "browserReply"
          ],
          "edges": [
            "input",
            "browserReply",
            "browserReturn"
          ],
          "defs": [
            "input"
          ],
          "log": [],
          "sources": [
            {
              "label": "crInput.ts:129-138",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/chromium/crInput.ts#L129-L138"
            },
            {
              "label": "crConnection.ts:68-76",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/chromium/crConnection.ts#L68-L76"
            },
            {
              "label": "crConnection.ts:162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/chromium/crConnection.ts#L162-L171"
            },
            {
              "label": "browserType.ts:273-279",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/browserType.ts#L273-L279"
            },
            {
              "label": "input.ts:263-291",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/input.ts#L263-L291"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        },
        {
          "id": "the-server-returns-result-or-err",
          "title": "The server returns result or error",
          "text": "The server retains call ID 7. On failure it sends the error together with this call’s log.",
          "show": [
            "response"
          ],
          "current": [
            "response"
          ],
          "edges": [
            "response"
          ],
          "defs": [
            "response"
          ],
          "log": [],
          "sources": [
            {
              "label": "dispatcher.ts:369-381",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/dispatcher.ts#L369-L381"
            },
            {
              "label": "dispatcher.ts:397-399",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/dispatcher.ts#L397-L399"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        },
        {
          "id": "the-client-matches-the-reply",
          "title": "The client matches the reply",
          "text": "A reply finds the stored callback by call ID. A success resolves it; an error rejects it with the call log.",
          "show": [
            "reply"
          ],
          "current": [
            "reply",
            "await"
          ],
          "edges": [
            "return",
            "match"
          ],
          "defs": [
            "reply"
          ],
          "code": "reply",
          "log": [],
          "sources": [
            {
              "label": "connection.ts:240-263",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L240-L263"
            },
            {
              "label": "connection.ts:327-334",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L327-L334"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        },
        {
          "id": "the-client-adds-the-api-name",
          "title": "The client adds the API name",
          "text": "The client puts locator.click: in front of the error. Keep the original message when adding context.",
          "show": [
            "prefix"
          ],
          "current": [
            "prefix"
          ],
          "edges": [
            "prefix"
          ],
          "defs": [
            "prefix"
          ],
          "code": "keep",
          "log": [],
          "sources": [
            {
              "label": "channelOwner.ts:207-211",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/channelOwner.ts#L207-L211"
            },
            {
              "label": "connection.ts:240-263",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L240-L263"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        },
        {
          "id": "remote-messages-cross-a-websocke",
          "title": "Remote messages cross a WebSocket",
          "text": "With browserType.connect(), the client talks to a Playwright server over a WebSocket. That server can run in another process or in the same one. The Playwright WebSocket and browser transport are different paths.",
          "show": [
            "call",
            "await",
            "request",
            "reply",
            "prefix",
            "work",
            "response",
            "input",
            "browserReply"
          ],
          "current": [
            "request",
            "work"
          ],
          "edges": [
            "dispatch"
          ],
          "defs": [
            "remote"
          ],
          "log": [],
          "sources": [
            {
              "label": "connect.ts:77-99",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connect.ts#L77-L99"
            },
            {
              "label": "browserType.ts:273-279",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/browserType.ts#L273-L279"
            },
            {
              "label": "browserServerImpl.ts:81-90",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/browserServerImpl.ts#L81-L90"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        }
      ]
    },
    {
      "id": "local",
      "label": "Local",
      "display": {
        "counterLabel": true,
        "edges": "all",
        "edgeBadges": false,
        "nodeBadges": true,
        "log": "incremental"
      },
      "whole": {
        "title": "A local click returns",
        "text": "Client and server share Node; Chromium is a separate process."
      },
      "steps": [
        {
          "id": "the-client-sends-object-method-a",
          "title": "The client sends object, method and parameters with call ID 7.",
          "text": "The client sends object, method and parameters with call ID 7. Client and server share Node; Chromium is a separate process.",
          "show": [
            "call",
            "await",
            "request",
            "reply",
            "prefix",
            "work",
            "response",
            "input",
            "browserReply"
          ],
          "current": [
            "request"
          ],
          "edges": [
            "request",
            "dispatch"
          ],
          "defs": [
            "request",
            "await",
            "local"
          ],
          "code": "request",
          "log": [],
          "sources": [
            {
              "label": "connection.ts:194-197",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L194-L197"
            },
            {
              "label": "connection.ts:220-222",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L220-L222"
            },
            {
              "label": "inprocess.ts:27-32",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/inprocess.ts#L27-L32"
            },
            {
              "label": "inprocess.ts:48-50",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/inprocess.ts#L48-L50"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        },
        {
          "id": "the-server-side-finds-the-object",
          "title": "The server side finds the object and performs the click.",
          "text": "The server side finds the object and performs the click.",
          "show": [
            "call",
            "await",
            "request",
            "reply",
            "prefix",
            "work",
            "response",
            "input",
            "browserReply"
          ],
          "current": [
            "work"
          ],
          "edges": [],
          "defs": [],
          "log": [],
          "sources": [
            {
              "label": "dispatcher.ts:297-299",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/dispatcher.ts#L297-L299"
            },
            {
              "label": "frameDispatcher.ts:146-148",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/frameDispatcher.ts#L146-L148"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        },
        {
          "id": "chromium-input-has-its-own-ids-b",
          "title": "Chromium input has its own IDs. Browser ID 42 is one example.",
          "text": "Chromium input has its own IDs. Browser ID 42 is one example.",
          "show": [
            "call",
            "await",
            "request",
            "reply",
            "prefix",
            "work",
            "response",
            "input",
            "browserReply"
          ],
          "current": [
            "input",
            "browserReply"
          ],
          "edges": [
            "input",
            "browserReply",
            "browserReturn"
          ],
          "defs": [],
          "log": [],
          "sources": [
            {
              "label": "crInput.ts:129-138",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/chromium/crInput.ts#L129-L138"
            },
            {
              "label": "crConnection.ts:68-76",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/chromium/crConnection.ts#L68-L76"
            },
            {
              "label": "crConnection.ts:162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/chromium/crConnection.ts#L162-L171"
            },
            {
              "label": "browserType.ts:273-279",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/browserType.ts#L273-L279"
            },
            {
              "label": "input.ts:263-291",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/input.ts#L263-L291"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        },
        {
          "id": "after-browser-input-and-server-w",
          "title": "After browser input and server work finish, call ID 7 returns.",
          "text": "After browser input and server work finish, call ID 7 returns.",
          "show": [
            "call",
            "await",
            "request",
            "reply",
            "prefix",
            "work",
            "response",
            "input",
            "browserReply"
          ],
          "current": [
            "response",
            "reply"
          ],
          "edges": [
            "return"
          ],
          "defs": [],
          "code": "reply",
          "log": [],
          "sources": [
            {
              "label": "dispatcher.ts:369-381",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/dispatcher.ts#L369-L381"
            },
            {
              "label": "dispatcher.ts:397-399",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/dispatcher.ts#L397-L399"
            },
            {
              "label": "connection.ts:240-263",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L240-L263"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        },
        {
          "id": "the-matching-await-returns-succe",
          "title": "The matching await returns. Successful clicks print no required output.",
          "text": "The matching await returns. Successful clicks print no required output.",
          "show": [
            "call",
            "await",
            "request",
            "reply",
            "prefix",
            "work",
            "response",
            "input",
            "browserReply"
          ],
          "current": [
            "await"
          ],
          "edges": [
            "match"
          ],
          "defs": [
            "success"
          ],
          "log": [],
          "sources": [
            {
              "label": "connection.ts:240-263",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L240-L263"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "call",
          "step": "the-client-sends-object-method-a",
          "log": []
        },
        {
          "node": "request",
          "step": "the-client-sends-object-method-a",
          "log": [],
          "edge": "request"
        },
        {
          "node": "work",
          "step": "the-server-side-finds-the-object",
          "log": [],
          "edge": "dispatch"
        },
        {
          "node": "input",
          "step": "chromium-input-has-its-own-ids-b",
          "log": [],
          "edge": "input"
        },
        {
          "node": "browserReply",
          "step": "chromium-input-has-its-own-ids-b",
          "log": [],
          "edge": "browserReply"
        },
        {
          "node": "response",
          "step": "after-browser-input-and-server-w",
          "log": [],
          "edge": "browserReturn"
        },
        {
          "node": "reply",
          "step": "after-browser-input-and-server-w",
          "log": [],
          "edge": "return"
        },
        {
          "node": "await",
          "step": "the-matching-await-returns-succe",
          "log": [],
          "edge": "match"
        }
      ]
    },
    {
      "id": "failure",
      "label": "Failure",
      "display": {
        "counterLabel": true,
        "edges": "all",
        "edgeBadges": false,
        "nodeBadges": true,
        "log": "incremental"
      },
      "whole": {
        "title": "A missing target times out",
        "text": "Example: #save is absent; click({ timeout: 5000 })."
      },
      "steps": [
        {
          "id": "the-client-sends-the-click-reque",
          "title": "The client sends the click request with call ID 7.",
          "text": "The client sends the click request with call ID 7. Example: #save is absent; click({ timeout: 5000 }).",
          "show": [
            "call",
            "await",
            "request",
            "reply",
            "prefix",
            "work",
            "response",
            "input",
            "browserReply"
          ],
          "current": [
            "request"
          ],
          "edges": [
            "request",
            "dispatch"
          ],
          "defs": [
            "request",
            "await",
            "local"
          ],
          "code": "request",
          "log": [],
          "sources": [
            {
              "label": "connection.ts:194-197",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L194-L197"
            },
            {
              "label": "connection.ts:220-222",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L220-L222"
            },
            {
              "label": "inprocess.ts:27-32",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/inprocess.ts#L27-L32"
            },
            {
              "label": "inprocess.ts:48-50",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/inprocess.ts#L48-L50"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        },
        {
          "id": "the-server-waits-for-save-no-bro",
          "title": "The server waits for #save. No browser input is needed.",
          "text": "The server waits for #save. No browser input is needed.",
          "show": [
            "call",
            "await",
            "request",
            "reply",
            "prefix",
            "work",
            "response",
            "input",
            "browserReply"
          ],
          "current": [
            "work"
          ],
          "edges": [],
          "defs": [],
          "log": [],
          "sources": [
            {
              "label": "dispatcher.ts:297-299",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/dispatcher.ts#L297-L299"
            },
            {
              "label": "frameDispatcher.ts:146-148",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/frameDispatcher.ts#L146-L148"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        },
        {
          "id": "call-id-7-returns-with-an-error",
          "title": "Call ID 7 returns with an error and this call’s log.",
          "text": "Call ID 7 returns with an error and this call’s log.",
          "show": [
            "call",
            "await",
            "request",
            "reply",
            "prefix",
            "work",
            "response",
            "input",
            "browserReply"
          ],
          "current": [
            "response",
            "reply"
          ],
          "edges": [
            "response",
            "return"
          ],
          "defs": [],
          "code": "reply",
          "log": [],
          "sources": [
            {
              "label": "dispatcher.ts:369-381",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/dispatcher.ts#L369-L381"
            },
            {
              "label": "dispatcher.ts:397-399",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/dispatcher.ts#L397-L399"
            },
            {
              "label": "connection.ts:240-263",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L240-L263"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        },
        {
          "id": "the-client-adds-locator-click-be",
          "title": "The client adds locator.click: before the error and keeps the call log.",
          "text": "The client adds locator.click: before the error and keeps the call log.",
          "show": [
            "call",
            "await",
            "request",
            "reply",
            "prefix",
            "work",
            "response",
            "input",
            "browserReply"
          ],
          "current": [
            "prefix",
            "await"
          ],
          "edges": [
            "prefix"
          ],
          "defs": [
            "failure"
          ],
          "code": "keep",
          "log": [
            "locator.click: Timeout 5000ms exceeded.",
            "Call log:",
            "waiting for locator('#save')"
          ],
          "sources": [
            {
              "label": "channelOwner.ts:207-211",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/channelOwner.ts#L207-L211"
            },
            {
              "label": "connection.ts:240-263",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L240-L263"
            },
            {
              "label": "connection.ts:327-334",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L327-L334"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "call",
          "step": "the-client-sends-the-click-reque",
          "log": []
        },
        {
          "node": "request",
          "step": "the-client-sends-the-click-reque",
          "log": [],
          "edge": "request"
        },
        {
          "node": "work",
          "step": "the-server-waits-for-save-no-bro",
          "log": [],
          "edge": "dispatch"
        },
        {
          "node": "response",
          "step": "call-id-7-returns-with-an-error",
          "log": [],
          "edge": "response",
          "fail": true
        },
        {
          "node": "reply",
          "step": "call-id-7-returns-with-an-error",
          "log": [],
          "edge": "return"
        },
        {
          "node": "prefix",
          "step": "the-client-adds-locator-click-be",
          "log": [
            "locator.click: Timeout 5000ms exceeded.",
            "Call log:",
            "waiting for locator('#save')"
          ],
          "edge": "prefix"
        }
      ]
    },
    {
      "id": "remote",
      "label": "Remote",
      "display": {
        "counterLabel": true,
        "edges": "all",
        "edgeBadges": false,
        "nodeBadges": true,
        "log": "incremental"
      },
      "whole": {
        "title": "A remote server runs the click",
        "text": "The Playwright WebSocket and browser transport are different paths."
      },
      "steps": [
        {
          "id": "call-id-7-crosses-the-playwright",
          "title": "Call ID 7 crosses the Playwright WebSocket to the remote server.",
          "text": "Call ID 7 crosses the Playwright WebSocket to the remote server. The Playwright WebSocket and browser transport are different paths.",
          "show": [
            "call",
            "await",
            "request",
            "reply",
            "prefix",
            "work",
            "response",
            "input",
            "browserReply"
          ],
          "current": [
            "request"
          ],
          "edges": [
            "request",
            "dispatch"
          ],
          "defs": [
            "request",
            "await",
            "remote"
          ],
          "code": "request",
          "log": [],
          "sources": [
            {
              "label": "connection.ts:194-197",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L194-L197"
            },
            {
              "label": "connection.ts:220-222",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L220-L222"
            },
            {
              "label": "connect.ts:77-99",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connect.ts#L77-L99"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        },
        {
          "id": "at-the-endpoint-the-server-runs",
          "title": "At the endpoint, the server runs the click.",
          "text": "At the endpoint, the server runs the click.",
          "show": [
            "call",
            "await",
            "request",
            "reply",
            "prefix",
            "work",
            "response",
            "input",
            "browserReply"
          ],
          "current": [
            "work"
          ],
          "edges": [],
          "defs": [],
          "log": [],
          "sources": [
            {
              "label": "dispatcher.ts:297-299",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/dispatcher.ts#L297-L299"
            },
            {
              "label": "frameDispatcher.ts:146-148",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/frameDispatcher.ts#L146-L148"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        },
        {
          "id": "server-to-browser-traffic-uses-a",
          "title": "Server-to-browser traffic uses a separate pipe or WebSocket and its own IDs.",
          "text": "Server-to-browser traffic uses a separate pipe or WebSocket and its own IDs.",
          "show": [
            "call",
            "await",
            "request",
            "reply",
            "prefix",
            "work",
            "response",
            "input",
            "browserReply"
          ],
          "current": [
            "input",
            "browserReply"
          ],
          "edges": [
            "input",
            "browserReply",
            "browserReturn"
          ],
          "defs": [],
          "code": "reply",
          "log": [],
          "sources": [
            {
              "label": "crInput.ts:129-138",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/chromium/crInput.ts#L129-L138"
            },
            {
              "label": "crConnection.ts:68-76",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/chromium/crConnection.ts#L68-L76"
            },
            {
              "label": "crConnection.ts:162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/chromium/crConnection.ts#L162-L171"
            },
            {
              "label": "browserType.ts:273-279",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/browserType.ts#L273-L279"
            },
            {
              "label": "input.ts:263-291",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/input.ts#L263-L291"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        },
        {
          "id": "browser-replies-reach-the-server",
          "title": "Browser replies reach the server; call ID 7 returns to the waiting client.",
          "text": "Browser replies reach the server; call ID 7 returns to the waiting client.",
          "show": [
            "call",
            "await",
            "request",
            "reply",
            "prefix",
            "work",
            "response",
            "input",
            "browserReply"
          ],
          "current": [
            "response",
            "reply"
          ],
          "edges": [
            "return"
          ],
          "defs": [
            "success"
          ],
          "log": [],
          "sources": [
            {
              "label": "dispatcher.ts:369-381",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/dispatcher.ts#L369-L381"
            },
            {
              "label": "dispatcher.ts:397-399",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/dispatcher.ts#L397-L399"
            },
            {
              "label": "connection.ts:240-263",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L240-L263"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "call",
          "step": "call-id-7-crosses-the-playwright",
          "log": []
        },
        {
          "node": "request",
          "step": "call-id-7-crosses-the-playwright",
          "log": [],
          "edge": "request"
        },
        {
          "node": "work",
          "step": "at-the-endpoint-the-server-runs",
          "log": [],
          "edge": "dispatch"
        },
        {
          "node": "input",
          "step": "server-to-browser-traffic-uses-a",
          "log": [],
          "edge": "input"
        },
        {
          "node": "browserReply",
          "step": "server-to-browser-traffic-uses-a",
          "log": [],
          "edge": "browserReply"
        },
        {
          "node": "response",
          "step": "browser-replies-reach-the-server",
          "log": [],
          "edge": "browserReturn"
        },
        {
          "node": "reply",
          "step": "browser-replies-reach-the-server",
          "log": [],
          "edge": "return"
        },
        {
          "node": "await",
          "step": "browser-replies-reach-the-server",
          "log": [],
          "edge": "match"
        }
      ]
    }
  ],
  "definitions": {
    "request": {
      "term": "Numbered request",
      "text": "Object GUID, method and parameters travel with call ID 7 (example)."
    },
    "await": {
      "term": "Matching await",
      "text": "The client stores promise handlers under the call ID."
    },
    "success": {
      "term": "Example state",
      "text": "Call ID 7 · await returns ✓; browser ID 42 · reply received."
    },
    "failure": {
      "term": "Example state",
      "text": "Call ID 7 · await rejects ✗; browser ID 42 · unused here. No browser input needed."
    },
    "local": {
      "term": "Local Node",
      "text": "Client and server share Node; Chromium is a separate process."
    },
    "work": {
      "term": "Server click",
      "text": "The dispatcher calls the server Frame.click."
    },
    "input": {
      "term": "Browser messages",
      "text": "Chromium input uses its own IDs; 42 is an example, independent of call ID 7."
    },
    "response": {
      "term": "Server response",
      "text": "The response retains the call ID; an error carries this call’s log."
    },
    "reply": {
      "term": "Matching reply",
      "text": "The client finds the callback by call ID and resolves or rejects it."
    },
    "prefix": {
      "term": "API name",
      "text": "The client puts the API name before the failure message."
    },
    "remote": {
      "term": "Remote connection",
      "text": "The Playwright WebSocket and browser transport are different paths."
    }
  },
  "code": {
    "request": {
      "title": "Inside Playwright · connection.ts",
      "source": {
        "label": "connection.ts:194-194",
        "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L194"
      },
      "lines": [
        "const guid = object._guid;",
        "const type = object._type;",
        "const id =",
        "  options.callId ?? this._nextCallId();",
        "const message = {",
        "  id, guid, method, params",
        "};"
      ]
    },
    "reply": {
      "title": "Inside Playwright · connection.ts",
      "source": {
        "label": "connection.ts:248-248",
        "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L248"
      },
      "lines": [
        "if (error && !result) {",
        "  const parsedError = parseError(error);",
        "  if (callback.signal?.aborted &&",
        "      parsedError instanceof AbortError)",
        "    parsedError.cause =",
        "      callback.signal.reason;",
        "  parsedError.log = log || [];",
        "  rewriteErrorMessage(",
        "    parsedError,",
        "    parsedError.message + formatCallLog(log)",
        "  );"
      ]
    },
    "keep": {
      "title": "In your test · keep the message",
      "lines": [
        "try {",
        "  await save.click();",
        "} catch {",
        "  // ✗ The call log is lost",
        "  throw new Error('Save failed');",
        "}",
        "// ✓ Keep the original text",
        "try {",
        "  await save.click();",
        "} catch (e) {",
        "  throw new Error(`Save: ${e.message}`);",
        "}"
      ]
    }
  },
  "conceptScenario": "how",
  "concepts": [
    {
      "label": "Client",
      "layer": "client",
      "items": [
        {
          "definition": "request",
          "short": "Carries a call ID, object GUID, method and parameters.",
          "nodes": [
            "request"
          ],
          "step": {
            "step": "a-click-sends-a-numbered-request"
          },
          "source": {
            "label": "connection.ts:194-197",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L194-L197"
          }
        },
        {
          "definition": "await",
          "short": "Stores promise handlers under the call ID.",
          "nodes": [
            "await"
          ],
          "step": {
            "step": "the-await-waits-for-the-same-num"
          },
          "source": {
            "label": "connection.ts:220-222",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L220-L222"
          }
        },
        {
          "definition": "reply",
          "short": "Matches a reply to the stored callback by call ID.",
          "nodes": [
            "reply"
          ],
          "step": {
            "step": "the-client-matches-the-reply"
          },
          "source": {
            "label": "connection.ts:240-263",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/connection.ts#L240-L263"
          }
        },
        {
          "definition": "prefix",
          "short": "Puts the API name before the error message.",
          "nodes": [
            "prefix"
          ],
          "step": {
            "step": "the-client-adds-the-api-name"
          },
          "source": {
            "label": "channelOwner.ts:207-211",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/channelOwner.ts#L207-L211"
          }
        }
      ]
    },
    {
      "label": "Server side",
      "layer": "server",
      "items": [
        {
          "definition": "work",
          "short": "Calls the server Frame.click.",
          "nodes": [
            "work"
          ],
          "step": {
            "step": "local-client-and-server-share-no"
          },
          "source": {
            "label": "frameDispatcher.ts:146-148",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/frameDispatcher.ts#L146-L148"
          }
        },
        {
          "definition": "response",
          "short": "Sends the call log when the response contains an error.",
          "nodes": [
            "response"
          ],
          "step": {
            "step": "the-server-returns-result-or-err"
          },
          "source": {
            "label": "dispatcher.ts:397-399",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/dispatcher.ts#L397-L399"
          }
        }
      ]
    },
    {
      "label": "Browser",
      "layer": "browser",
      "items": [
        {
          "definition": "input",
          "short": "Receives Input.dispatchMouseEvent messages.",
          "nodes": [
            "input"
          ],
          "step": {
            "step": "browser-input-has-independent-id"
          },
          "source": {
            "label": "crInput.ts:129-138",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/chromium/crInput.ts#L129-L138"
          }
        }
      ]
    }
  ],
  "callouts": {
    "1": [
      "call",
      "request"
    ],
    "2": [
      "work",
      "input",
      "browserReply"
    ],
    "3": [
      "response",
      "reply",
      "await"
    ],
    "4": [
      "prefix"
    ]
  },
  "deeper": [
    {
      "title": "0.1 API calls leave from Node, page calls from the browser",
      "href": "/0-anatomy/0-1-anatomy-of-a-test/",
      "why": "Where the client, server and browser run."
    },
    {
      "title": "2.1 Two loops behind every click",
      "href": "/2-actions/2-1-two-loops/",
      "why": "How the server resolves and checks the target."
    },
    {
      "title": "1.2 Contexts divide state, pages contain frame trees",
      "href": "/1-messages/1-2-browser-context-page-frame/",
      "why": "The objects named by protocol messages."
    }
  ],
  "viewBox": [
    360,
    1504.8
  ],
  "measurement": {
    "name": "font-table",
    "labels": {
      "request": {
        "width": 31.604999999999997,
        "height": 12.6
      },
      "dispatch": {
        "width": 56.88899999999999,
        "height": 12.6
      },
      "input": {
        "width": 107.45699999999998,
        "height": 12.6
      },
      "browserReturn": {
        "width": 82.17299999999999,
        "height": 12.6
      },
      "return": {
        "width": 75.85199999999999,
        "height": 12.6
      },
      "prefix": {
        "width": 56.88899999999999,
        "height": 12.6
      }
    }
  }
}
