{"record":{"id":"a657aaa724bd4a0f","repo":"grafana/k6","slug":"cannot-do-key-down-w","errorCode":null,"errorMessage":"cannot do key down: %w","messagePattern":"cannot do key down: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/keyboard.go","lineNumber":270,"sourceCode":"\t\t\tkey = \"Meta\"\n\t\t} else {\n\t\t\tkey = \"Control\"\n\t\t}\n\t}\n\treturn key\n}\n\nfunc (k *Keyboard) comboPress(keys string, opts KeyboardOptions) error {\n\tif opts.Delay > 0 {\n\t\tif err := wait(k.ctx, opts.Delay); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tkk := split(keys)\n\tfor _, key := range kk {\n\t\tif err := k.down(key); err != nil {\n\t\t\treturn fmt.Errorf(\"cannot do key down: %w\", err)\n\t\t}\n\t}\n\n\tfor i := range kk {\n\t\tkey := kk[len(kk)-i-1]\n\t\tif err := k.up(key); err != nil {\n\t\t\treturn fmt.Errorf(\"cannot do key up: %w\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// This splits the string on `+`.\n// If `+` on it's own is passed, it will return [\"+\"].\n// If `++` is passed in, it will return [\"+\", \"\"].\n// If `+++` is passed in, it will return [\"+\", \"+\"].\nfunc split(keys string) []string {","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/keyboard.go#L252-L288","documentation":"Wrap of Keyboard.down inside Keyboard.comboPress: for a compound key string like 'Control+A', each key is pressed in order before any is released. This wrap means one of the down presses failed — most often the first key component is an invalid layout key (e.g., typo in 'Cntrl'), or the CDP dispatch failed on a dead session before the combo completed.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/keyboard.go:270 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check every component of the combo string for valid, correctly-cased key names","Keep the session alive for the full combo duration","Use press('Control+A') instead of manual down/up orchestration"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}