当我运行测试时,出现以下错误。我对剧作家和编码相当陌生,所以我不确定解决方案是什么
\nError: locator.click: Error: strict mode violation: getByRole(\'button\', { name: \'Statements\' }) resolved to 2 elements:\n1) <button title="Statements" aria-label="Statements" data-\xe2\x80\xa6>Statements</button> aka locator(\'#lp_line_6_a11y_queue\').getByRole(\'button\', { name: \'Statements\' })\n2) <button title="Statements" aria-label="Statements" data-\xe2\x80\xa6>Statements</button> aka locator(\'#lp_line_6\').getByRole(\'button\', { name: \'Statements\' })\nRun Code Online (Sandbox Code Playgroud)\n我刚刚进行了测试,希望不会出现错误。
\ntest(\'test\', async ({ page }) => {\n await page.goto(\'https://www.test.com\'); \n await page.getByPlaceholder(\'Section tag #1\').click();\n await page.getByPlaceholder(\'Section tag #1\').press(\'Control+a\');\n await page.getByPlaceholder(\'Section tag #1\').fill(\'inapptest\');\n\n await page.getByRole(\'button\', { name: \'UPDATE\' }).click();\n await page.getByRole(\'button\', { name: \'Message us\' }).click();\n await page.getByPlaceholder(\'Enter text here\').click();\n await …Run Code Online (Sandbox Code Playgroud)