{"record":{"id":"e3dd91cb1f873ccb","repo":"grafana/k6","slug":"checking-hit-target-at-v-w","errorCode":null,"errorMessage":"checking hit target at %v: %w","messagePattern":"checking hit target at (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/element_handle.go","lineNumber":96,"sourceCode":"\twidth := math.Max(quad[0], math.Max(quad[2], math.Max(quad[4], quad[6]))) - x\n\theight := math.Max(quad[1], math.Max(quad[3], math.Max(quad[5], quad[7]))) - y\n\n\tposition, err := h.frame.position()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"getting position of parent frame: %w\", err)\n\t}\n\n\treturn &Rect{X: x + position.X, Y: y + position.Y, Width: width, Height: height}, nil\n}\n\n// translatePointToPage translates the point to the page's coordinates if the\n// point is relative to the parent frame.\nfunc (h *ElementHandle) translatePointToPage(apiCtx context.Context, point Position) (Position, error) {\n\th.logger.Debugf(\"ElementHandle:translatePointToPage\", \"point before translation: %v\", point)\n\n\tframe, err := h.ownerFrame(apiCtx)\n\tif err != nil {\n\t\treturn Position{}, fmt.Errorf(\"checking hit target at %v: %w\", point, err)\n\t}\n\n\tif frame == nil || frame.parentFrame == nil {\n\t\th.logger.Debugf(\"ElementHandle:translatePointToPage\", \"no parent frame\")\n\t\treturn point, nil\n\t}\n\n\tel, err := frame.FrameElement()\n\tif err != nil {\n\t\treturn Position{}, err\n\t}\n\n\tbox, err := el.BoundingBox()\n\tif err != nil {\n\t\treturn Position{}, fmt.Errorf(\"getting bounding box of parent frame: %w\", err)\n\t}\n\n\tif box.contains(point) {","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/grafana/k6/blob/3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee/internal/js/modules/k6/browser/common/element_handle.go#L78-L114","documentation":"While translating a click/tap point from frame to page coordinates, the injected hit-target check at the given point failed. The point vector is echoed; usually the point falls outside the frame/viewport or the hit-target verification API rejected it.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/element_handle.go:96 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Scroll the element into view before interacting","Use force: true to bypass hit-target checks when overlays are intentional","Click the element handle instead of raw coordinates"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}