I am trying to execute a script that uses the .type into the login form or search bar but I keep getting this inline execution failed CSP message.
Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' https://cdn.aibidia.com/pyramid/". Either the 'unsafe-inline' keyword, a hash ('sha256-3oCEUY6pDcTxOj/IfO7xFg9j//NlBbRX1KtksKnUAdo='), or a nonce ('nonce-...') is required to enable inline execution. browser_source=security line_number=16 source=browser stacktrace="<nil>" url="https://func-aibidia-proxies-uat.azurewebsites.net/tpdoc/#/login"
This is my script
//import http from 'k6/http'
import { check } from 'k6'
import {browser} from 'k6/experimental/browser'
export const options = {
scenarios: {
ui:{
executor: 'constant-vus',
duration: '10s',
vus: 1,
options: {
browser: {
type: 'chromium',
},
}
}
}
}
export default async function() {
const page = browser.newPage()
try {
await page.goto("https://func-aibidia-proxies-uat.azurewebsites.net/tpdoc/#/login")
page.locator("//button[@class='a-button right a-primary-btn']").click()
page.locator("#signInName").type("sagar.thetennis")
page.locator('#password').type("hello")
} finally {page.close()
}