The verifyElementPresent command error persist

Altought there is a similar question in the Forum, I am having the same constant error, when I am using the verifyElementPresent command. Sometimes it runs ok, sometimes not.The definition of this command says that it shouldn’t stop when meet an error in the exection of the macro.

verify1

Can you post a short test macro?

Hi!

Sometimes there is the link “Logoff” on the page, in this situation I click on it to return to the login page.
Best,

Leonardo

verify4
verify_erro

{
“Name”: “malote_enviados_nao_lidos”,
“CreationDate”: “2020-9-16”,
“Commands”: [
{
“Command”: “store”,
“Target”: "-> msg read. ",
“Value”: “msg_ja_lido”
},
{
“Command”: “store”,
“Target”: “-> not yet. “,
“Value”: “msg_nao_lido”
},
{
“Command”: “store”,
“Target”: “70”,
“Value”: “!TIMEOUT_WAIT”
},
{
“Command”: “store”,
“Target”: “70”,
“Value”: “!TIMEOUT_PAGELOAD”
},
{
“Command”: “executeScript_Sandbox”,
“Target”: “var today = new Date();\nvar dd = String(today.getDate()).padStart(2, ‘0’);\nvar mm = String(today.getMonth() + 1).padStart(2, ‘0’); //January is 0!\nvar yyyy = today.getFullYear();\nvar segundos = today.getSeconds();\nvar minutos = today.getMinutes();\nvar hora=today.getHours();\ntoday = dd + ‘-’ + mm + ‘-’ + yyyy +’ - ‘+hora+’-’+minutos+’-’+segundos;\nreturn today”,
“Value”: “hoje”
},
{
“Command”: “store”,
“Target”: “conf_leitura_{hoje}", "Value": "arq_csv" }, { "Command": "store", "Target": "true", "Value": "!statusOK" }, { "Command": "comment", "Target": "label // repetir_consulta", "Value": "" }, { "Command": "open", "Target": "https://www3.tjrj.jus.br/malotedigital/inicial.jsf", "Value": "" }, { "Command": "verifyElementPresent", "Target": "linkText=Fazer Logoff", "Value": "" }, { "Command": "if_v2", "Target": "{!statusOK}==true”,
“Value”: “”
},
{
“Command”: “clickAndWait”,
“Target”: “linkText=Fazer Logoff”,
“Value”: “”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “id=Login”,
“Value”: “XXXXXX”
},
{
“Command”: “click”,
“Target”: “id=Senha”,
“Value”: “XXXXXX”
},
{
“Command”: “click”,
“Target”: “id=inicial:formLogin:cmdLogin”,
“Value”: “”
},
{
“Command”: “clickAndWait”,
“Target”: “linkText=» Enviados e Não Lidos”,
“Value”: “”
},
{
“Command”: “prompt”,
“Target”: “Data entrada”,
“Value”: “dent”
},
{
“Command”: “prompt”,
“Target”: “Data saida”,
“Value”: “dsaida”
},
{
“Command”: “click”,
“Target”: “id=listarRecibosDocumentoNaoLido:pesquisa:j_id_jsp_64231238_6pc7”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “id=listarRecibosDocumentoNaoLido:pesquisa:j_id_jsp_64231238_6pc7”,
“Value”: “{dent}" }, { "Command": "click", "Target": "id=listarRecibosDocumentoNaoLido:pesquisa:j_id_jsp_64231238_8pc7", "Value": "" }, { "Command": "type", "Target": "id=listarRecibosDocumentoNaoLido:pesquisa:j_id_jsp_64231238_8pc7", "Value": "{dsaida}”
},
{
“Command”: “store”,
“Target”: “0”,
“Value”: “doc_ja_lidos”
},
{
“Command”: “click”,
“Target”: “id=listarRecibosDocumentoNaoLido:pesquisa:Total_Registros_Por_Pagina”,
“Value”: “”
},
{
“Command”: “select”,
“Target”: “id=listarRecibosDocumentoNaoLido:pesquisa:Total_Registros_Por_Pagina”,
“Value”: “label=30”
},
{
“Command”: “store”,
“Target”: “1”,
“Value”: “num”
},
{
“Command”: “comment”,
“Target”: “onError // #goto”,
“Value”: “tratar_erro”
},
{
“Command”: “comment”,
“Target”: " // Botão pesquisar”,
“Value”: “”
},
{
“Command”: “label”,
“Target”: “repetir_consulta”,
“Value”: “”
},
{
“Command”: “clickAndWait”,
“Target”: “id=listarRecibosDocumentoNaoLido:pesquisa:cmdFiltrarPesquisa”,
“Value”: “”
},
{
“Command”: “comment”,
“Target”: " // Ver se tem a coluna Ler”,
“Value”: “”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!statusOK”
},
{
“Command”: “echo”,
“Target”: “{!statusOK}", "Value": "" }, { "Command": "verifyElementPresent", "Target": "xpath=//*[@id=\"listarRecibosDocumentoNaoLido:pesquisa:dados:0:dados\"]/thead/tr/th", "Value": "" }, { "Command": "if_v2", "Target": "{!statusOK}==false”,
“Value”: “”
},
{
“Command”: “echo”,
“Target”: “Nenhum arquivo Enviado e Não lido”,
“Value”: “#shownotification
},
{
“Command”: “else”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “store”,
“Target”: “1”,
“Value”: “num”
},
{
“Command”: “store”,
“Target”: “Malote digital - Recibo de documentos”,
“Value”: "!csvLine "
},
{
“Command”: “csvSave”,
“Target”: “{arq_csv}", "Value": "" }, { "Command": "store", "Target": "Enviados e Não lidos", "Value": "!csvLine " }, { "Command": "csvSave", "Target": "{arq_csv}”,
“Value”: “”
},
{
“Command”: “store”,
“Target”: “Data emissão: {hoje} - Período: {dent} até {dsaida}", "Value": "!csvLine " }, { "Command": "csvSave", "Target": "{arq_csv}”,
“Value”: “”
},
{
“Command”: “storeXpathCount”,
“Target”: “xpath=//td[@class=“colunaDadosCentro”][5]/a”,
“Value”: “num_docs”
},
{
“Command”: “echo”,
“Target”: “{num_docs}", "Value": "red" }, { "Command": "while_v2", "Target": "{num_docs}>={num}", "Value": "" }, { "Command": "comment", "Target": " // clicar em verificar leitura", "Value": "" }, { "Command": "store", "Target": "true", "Value": "!statusOK" }, { "Command": "comment", "Target": "verifyElementPresent // xpath=(//td[@class=\"colunaDadosCentro\"][5]/a)[{num}]”,
“Value”: “”
},
{
“Command”: “comment”,
“Target”: “echo // status: {!statusOK}", "Value": "red" }, { "Command": "storeText", "Target": "xpath=(//tr[td[@class=\"colunaDadosCentro\"][5]/a]/td[3])[{num}]”,
“Value”: “cod_rastreabilidade”
},
{
“Command”: “gotoIf_v2”,
“Target”: “{cod_rastreabilidade}==\"#LNF\"", "Value": "repetir_consulta" }, { "Command": "echo", "Target": "{cod_rastreabilidade}”,
“Value”: “red”
},
{
“Command”: “verifyElementPresent”,
“Target”: “xpath=(//td[@class=“colunaDadosCentro”][5]/a)[{num}]", "Value": "" }, { "Command": "if_v2", "Target": "{!statusOK}==false”,
“Value”: “”
},
{
“Command”: “gotoLabel”,
“Target”: “repetir_consulta”,
“Value”: “”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “clickAndWait”,
“Target”: “xpath=(//td[@class=“colunaDadosCentro”][5]/a)[{num}]", "Value": "" }, { "Command": "comment", "Target": "O documento ainda não foi lido pelo destinatário", "Value": "" }, { "Command": "comment", "Target": "store // true", "Value": "!errorignore" }, { "Command": "verifyElementPresent", "Target": "xpath=//*[@id=\"alertas:j_id_jsp_274156450_1pc5\"]/div[2]", "Value": "" }, { "Command": "if_v2", "Target": "{!statusOK}==true”,
“Value”: “”
},
{
“Command”: “store”,
“Target”: “{cod_rastreabilidade}", "Value": "!csvLine" }, { "Command": "store", "Target": "{msg_nao_lido}”,
“Value”: “!csvLine”
},
{
“Command”: “else”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “store”,
“Target”: “{cod_rastreabilidade}", "Value": "!csvLine " }, { "Command": "store", "Target": "{msg_ja_lido}”,
“Value”: “!csvLine”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “csvSave”,
“Target”: “{arq_csv}", "Value": "" }, { "Command": "executeScript_Sandbox", "Target": "return Number({num})+1”,
“Value”: “num”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “executeScript_Sandbox”,
“Target”: “({num}<=1?x=0:x={num}-1); return x”,
“Value”: “num”
},
{
“Command”: “if_v2”,
“Target”: “{num}==0", "Value": "" }, { "Command": "echo", "Target": "Não há nenhum arquivo: \"Enviados e Não lidos\"", "Value": "#shownotification" }, { "Command": "else", "Target": "", "Value": "" }, { "Command": "echo", "Target": "Há {num} arquivos: “Enviados e Não lidos””,
“Value”: “#shownotification
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “echo”,
“Target”: “Macro executada com sucesso”,
“Value”: “#shownotification
},
{
“Command”: “gotoLabel”,
“Target”: “tudo_ok”,
“Value”: “”
},
{
“Command”: “comment”,
“Target”: “label // tratar_erro”,
“Value”: “”
},
{
“Command”: “echo”,
“Target”: “Ocorreu um erro na macro”,
“Value”: “#shownotification
},
{
“Command”: “label”,
“Target”: “tudo_ok”,
“Value”: “”
},
{
“Command”: “comment”,
“Target”: “”,
“Value”: “”
}
]
}

Hi Ulrich!

I’ve desinstalled the ui.vision and reinstall it to try if the problem of VerifyElementPresent command would be solved, but goes on giving error . In the past this command runs ok without any error.
Thanks,
Leonardo