{"record":{"id":"560721c644e943cd","repo":"grafana/k6","slug":"no-valid-href-attribute-value-found-on-element-s","errorCode":null,"errorMessage":"no valid href attribute value found on element '%s' in response '%s'","messagePattern":"no valid href attribute value found on element '(.+?)' in response '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"js/modules/k6/http/response.go","lineNumber":263,"sourceCode":"\t\t\t\tselector = params.Get(k).String()\n\t\t\tcase \"params\":\n\t\t\t\trequestParams = params.Get(k)\n\t\t\t}\n\t\t}\n\t}\n\n\tresponseURL, err := url.Parse(res.URL)\n\tif err != nil {\n\t\tcommon.Throw(rt, err)\n\t}\n\n\tlink := res.HTML(selector)\n\tif link.Size() == 0 {\n\t\tcommon.Throw(rt, fmt.Errorf(\"no element found for selector '%s' in response '%s'\", selector, res.URL))\n\t}\n\threfAttr := link.Attr(\"href\")\n\tif hrefAttr == sobek.Undefined() {\n\t\terrmsg := fmt.Errorf(\"no valid href attribute value found on element '%s' in response '%s'\", selector, res.URL)\n\t\tcommon.Throw(rt, errmsg)\n\t}\n\threfURL, err := url.Parse(hrefAttr.String())\n\tif err != nil {\n\t\tcommon.Throw(rt, err)\n\t}\n\trequestURL := responseURL.ResolveReference(hrefURL)\n\n\treturn res.client.Request(http.MethodGet, rt.ToValue(requestURL.String()), sobek.Undefined(), requestParams)\n}\n","sourceCodeStart":245,"sourceCodeEnd":274,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/js/modules/k6/http/response.go#L245-L274","documentation":"ClickLink found a matching element, but its 'href' attribute is absent, so there is no URL to navigate to. The element matched the selector yet is not a usable link — e.g. an <a> used as a placeholder or a non-anchor element.","triggerScenarios":"Thrown at js/modules/k6/http/response.go:263 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Target an element that actually has an href attribute (a real hyperlink)","If the navigation is JavaScript-driven, issue the request directly with http.get() instead of ClickLink"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}