Я создаю сценарий, в котором я хочу проверять все веб-ссылки, если они доступны и ошибок нет.В противном случае, если произошла ошибка, будет сделан скриншот страницы.
Я попытался добавить errorignore, но ошибка не игнорируется
{
"Name": "Project_1",
"CreationDate": "2019-5-7",
"Commands": [
{
"Command": "store",
"Target": "2",
"Value": "!csvReadLineNumber"
},
{
"Command": "store",
"Target": "true",
"Value": "!errorignore"
},
{
"Command": "store",
"Target": "0",
"Value": "n"
},
{
"Command": "store",
"Target": "0",
"Value": "number"
},
{
"Command": "csvRead",
"Target": "urls.csv",
"Value": ""
},
{
"Command": "while",
"Target": "${!csvReadLineNumber}!=${!csvreadmaxrow}",
"Value": "!csvReadLineNumber"
},
{
"Command": "storeEval",
"Target": "${number}+1",
"Value": "number"
},
{
"Command": "csvRead",
"Target": "urls.csv",
"Value": ""
},
{
"Command": "storeEval",
"Target": "${!csvReadLineNumber}+1",
"Value": "!csvReadLineNumber"
},
{
"Command": "storeEval",
"Target": "true",
"Value": "!waitforvisible"
},
{
"Command": "open",
"Target": "${!COL3}",
"Value": ""
},
{
"Command": "echo",
"Target": "${number} ${!COL3}",
"Value": ""
},
{
"Command": "storeTitle",
"Target": "",
"Value": "title"
},
{
"Command": "verifyTitle",
"Target": "${title}",
"Value": ""
},
{
"Command": "echo",
"Target": "${title}",
"Value": ""
},
{
"Command": "storeEval",
"Target": "title =\"${title}\".match(404)",
"Value": "match"
},
{
"Command": "if",
"Target": "${MATCH}!=null",
"Value": ""
},
{
"Command": "storeEval",
"Target": "${n}+1",
"Value": "n"
},
{
"Command": "echo",
"Target": "Error 404 Found ${!COL3}",
"Value": ""
},
{
"Command": "captureEntirePageScreenshot",
"Target": "error ${n}",
"Value": ""
},
{
"Command": "endif",
"Target": "",
"Value": ""
},
{
"Command": "endWhile",
"Target": "",
"Value": ""
}
]
}
Цикл должен продолжаться, даже если есть ошибка.Но фактический результат, скрипт останавливается, когда веб-страница «404» или «Страница не найдена» и выдает ошибку
[error][ignored]Error in runEval code: call to eval() blocked by CSP
[error][ignored]Error in runEval condition of if: call to eval() blocked by CSP
[error][ignored]Error in runEval condition of while: call to eval() blocked by CSP