Retry command / Lost background heartbeat

Hello everyone,

I am back with a full test case for this issue.
How to use it:
1 - Unzip the “PageTestCase.zip” file
2 - Open “Éditer DRAFT.PHYTO.2022.0015392 - Lot - TRACES NT.htm” with Firefox
3 - Add the following script to UI Vision
4 - Click “Play”

I also included 2 videos, one of the normal running of the test case (UI Vision isn’t showing, I just select the following macro and hit play) and one of the issue happening.

{
  "Name": "TestMacroTrace",
  "CreationDate": "2022-9-13",
  "Commands": [
    {
      "Command": "store",
      "Target": "nodisplay",
      "Value": "!replayspeed",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "5",
      "Value": "!timeout_wait",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "Counters to loop on multiple articles",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "1",
      "Value": "cpt",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "2",
      "Value": "uidCpt",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "",
      "Value": "articleCpt",
      "Description": ""
    },
    {
      "Command": "while_v2",
      "Target": "${cpt} < 100",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "Filling article informations",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"commoditiesBox\"]/div[2]/div[2]/section/ng-form[2]/div/div[2]/ul/li${articleCpt}/div/div[3]/div/div[2]/div/div/descriptor-column/ng-include/descriptor-column-taxon-selector/div/ul",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"commoditiesBox\"]/div[2]/div[2]/section/ng-form[2]/div/div[2]/ul/li[2]/div/div[3]/div/div[2]/div/div/descriptor-column/ng-include/descriptor-column-taxon-selector/div/ul",
        "xpath=//li[2]/div/div[3]/div/div[2]/div/div/descriptor-column/ng-include/descriptor-column-taxon-selector/div/ul",
        "css=#commoditiesBox > div.panel-body > div:nth-child(2) > section > ng-form.ng-valid-phyto-edit-consignment-identification-required.ng-valid-editable.ng-valid-min.ng-valid-max.ng-valid-pattern.ng-valid-parse.ng-dirty.ng-valid-float.ng-valid.ng-valid-required > div > div.descriptorRowForms > ul > li:nth-child(2) > div > div.descriptorRowColumnsContainer > div > div.col-md-2.descriptorColumn.TAXON_ID > div > div > descriptor-column > ng-include > descriptor-column-taxon-selector > div > ul"
      ],
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "id=uid-${uidCpt}-search",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "id=uid-${uidCpt}-search",
      "Value": "e",
      "Description": ""
    },
    {
      "Command": "waitForElementVisible",
      "Target": "xpath=//*[@id=\"uid-${uidCpt}-search\"]/ancestor::div/ul/li/a/span",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"uid-${uidCpt}-search\"]/ancestor::div/ul/li/a/span",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"typeahead-4747-6422-option-0\"]/a/span",
        "xpath=//descriptor-column-taxon-selector/div/div/div/ul/li/a/span",
        "css=#typeahead-4747-6422-option-0 > a > span.label.label-success"
      ],
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"commoditiesBox\"]/div[2]/div[2]/section/ng-form[2]/div/div[2]/ul/li${articleCpt}/div/div[3]/div/div[4]/div/div/descriptor-column/ng-include/descriptor-column-quantity/div/div/input",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"commoditiesBox\"]/div[2]/div[2]/section/ng-form[2]/div/div[2]/ul/li/div/div[3]/div/div[4]/div/div/descriptor-column/ng-include/descriptor-column-quantity/div/div/input",
        "xpath=//input[@type='number']",
        "xpath=//descriptor-column-quantity/div/div/input",
        "css=#commoditiesBox > div.panel-body > div:nth-child(2) > section > ng-form.ng-pristine.ng-invalid.ng-valid-phyto-edit-consignment-identification-required.ng-valid-editable.ng-valid-min.ng-valid-max.ng-invalid-required.ng-valid-pattern.ng-valid-parse > div > div.descriptorRowForms > ul > li > div > div.descriptorRowColumnsContainer > div > div.col-md-2.descriptorColumn.NET_WEIGHT > div > div > descriptor-column > ng-include > descriptor-column-quantity > div > div > input"
      ],
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "xpath=//*[@id=\"commoditiesBox\"]/div[2]/div[2]/section/ng-form[2]/div/div[2]/ul/li${articleCpt}/div/div[3]/div/div[4]/div/div/descriptor-column/ng-include/descriptor-column-quantity/div/div/input",
      "Value": "12",
      "Targets": [
        "xpath=//*[@id=\"commoditiesBox\"]/div[2]/div[2]/section/ng-form[2]/div/div[2]/ul/li/div/div[3]/div/div[4]/div/div/descriptor-column/ng-include/descriptor-column-quantity/div/div/input",
        "xpath=//input[@type='number']",
        "xpath=//descriptor-column-quantity/div/div/input",
        "css=#commoditiesBox > div.panel-body > div:nth-child(2) > section > ng-form.ng-pristine.ng-invalid.ng-valid-phyto-edit-consignment-identification-required.ng-valid-editable.ng-valid-min.ng-valid-max.ng-invalid-required.ng-valid-pattern.ng-valid-parse > div > div.descriptorRowForms > ul > li > div > div.descriptorRowColumnsContainer > div > div.col-md-2.descriptorColumn.NET_WEIGHT > div > div > descriptor-column > ng-include > descriptor-column-quantity > div > div > input"
      ],
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "xpath=//*[@id=\"commoditiesBox\"]/div[2]/div[2]/section/ng-form[2]/div/div[2]/ul/li${articleCpt}/div/div[3]/div/div[5]/div/div/descriptor-column/ng-include/descriptor-column-quantity/div/div/input",
      "Value": "30",
      "Targets": [
        "xpath=//*[@id=\"commoditiesBox\"]/div[2]/div[2]/section/ng-form[2]/div/div[2]/ul/li/div/div[3]/div/div[5]/div/div/descriptor-column/ng-include/descriptor-column-quantity/div/div/input",
        "xpath=//div[5]/div/div/descriptor-column/ng-include/descriptor-column-quantity/div/div/input",
        "css=#commoditiesBox > div.panel-body > div:nth-child(2) > section > ng-form.ng-invalid.ng-valid-phyto-edit-consignment-identification-required.ng-valid-editable.ng-valid-min.ng-valid-max.ng-invalid-required.ng-valid-pattern.ng-valid-parse.ng-dirty.ng-valid-float > div > div.descriptorRowForms > ul > li > div > div.descriptorRowColumnsContainer > div > div.col-md-2.descriptorColumn.PACKAGE_COUNT > div > div > descriptor-column > ng-include > descriptor-column-quantity > div > div > input"
      ],
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "This is where the bug occurs, the type command repeats itself \"Web page connection issue. Retrying last command.\"",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "xpath=//*[@id=\"commoditiesBox\"]/div[2]/div[2]/section/ng-form[2]/div/div[2]/ul/li${articleCpt}/div/div[3]/div/div[12]/div/div/descriptor-column/ng-include/descriptor-column-string/div/div/input",
      "Value": "12548896 - EXPORT POUR LES PETITS CANARDS BIEN DODUS",
      "Targets": [
        "xpath=//*[@id=\"commoditiesBox\"]/div[2]/div[2]/section/ng-form[2]/div/div[2]/ul/li/div/div[3]/div/div[12]/div/div/descriptor-column/ng-include/descriptor-column-string/div/div/input",
        "xpath=//descriptor-column-string/div/div/input",
        "css=#commoditiesBox > div.panel-body > div:nth-child(2) > section > ng-form.ng-valid-phyto-edit-consignment-identification-required.ng-valid-editable.ng-valid-min.ng-valid-max.ng-valid-pattern.ng-valid-parse.ng-dirty.ng-valid-float.ng-valid.ng-valid-required > div > div.descriptorRowForms > ul > li > div > div.descriptorRowColumnsContainer > div > div.col-md-2.descriptorColumn.DISTINGUISH_MARK > div > div > descriptor-column > ng-include > descriptor-column-string > div > div > input"
      ],
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "BUG",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "Counters update for the next loop",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return Number(${cpt}) +1;",
      "Value": "cpt",
      "Description": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return Number(${uidCpt}) +3;",
      "Value": "uidCpt",
      "Description": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return \"[\" + ${cpt} + \"]\";",
      "Value": "articleCpt",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"commoditiesBox\"]/div[2]/div[2]/section/ng-form/div/div/div/div[2]/div/div/button",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"commoditiesBox\"]/div[2]/div[2]/section/ng-form/div/div/div/div[2]/div/div/button",
        "xpath=//ng-form/div/div/div/div[2]/div/div/button",
        "css=#commoditiesBox > div.panel-body > div:nth-child(2) > section > ng-form.ng-pristine.ng-valid.ng-valid-phyto-edit-consignment-commodities-required > div > div > div > div.col-md-5 > div.pull-right > div > button:nth-child(1)"
      ],
      "Description": "Add article"
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    }
  ]
}

Thank you for your time

PageTestCase.zip (807.9 KB)
TestCaseRunning.zip (19.8 MB)
IssueHappening.zip (15.4 MB)

Thanks! You mention Firefox - does the problem also show in V8.0.1 in Chrome?

I am unable to test, UI vision on chrome doesn’t seem to work on a .htm opened in a tab:

[error]
Line 9: Error #101: UI.Vision RPA is not connected to a browser tab(more info)

I am also unable to run the macro I work with because of this error:

[error]
Line 37: undefined is not a function

The code is:

 {
      "Command": "executeScript_Sandbox",
      "Target": "var marchandise = ${phyto}[0].trim(); \nreturn marchandise.length > 8 ? marchandise.slice(0, -(Number(marchandise.length) -8)).padStart(8,'0') : marchandise.padStart(8,'0');",
      "Value": "marchandise ",
      "Description": ""
    },

And the “phyto” variable is equal to:

["09030000","ZINOF / ILEPA","0.60","2","Egypte / Chine / Etats Unis / France","29050788","L.TISANIER.20S MATE VIT.B3 30G"]

Which is the reason why I switched to firefox in the first place

Version 8.0.1 all XModules installed, vesions v1.0.12, v1.0.31, v1.0.42 respectively
Chrome updated to the last version 105.0.5195.127

The problem is the padStart command, it is not supported by ES5, so not support in executeScript_Sandbox

For more details & solutions please see this post.

I recommend you make this change and then try with V8.0.1 in Chrome.

The error is different using Chrome, the action is performed but the type command is fails:

[error][ignored]
Line 10 (Sub: SigneDistinctif): ipcPromise: onAsk timeout 2000 for cmd "PANEL_CALL_PLAY_TAB", args {"ipcTimeout":100,"ipcNoLaterThan":3326485755436,"payload":{"command":"RUN_COMMAND","args":{"command":{"cmd":"type","target":"xpath=//*[@id=\"commoditiesBox\"]/div[2]/div[2]/section/ng-form[2]/div/div[2]/ul/li[79]/div/div[3]/div/div[12]/div/div/descriptor-column/ng-include/descriptor-column-string/div/div/input","value":"40151043 CIGALOU THYM  15G POT VERRE","description":"Remplis la description produit","extra":{"playHighlightElements":true,"playScrollElementsIntoView":true,"timeoutPageLoad":60,"timeoutElement":2,"timeoutDownload":60,"timeoutDownloadStart":10,"lastCommandOk":true,"errorIgnore":true,"waitForVisible":false,"retryInfo":{"retryCount":0}}}}}}
At Line 69 in Phytos

I ignored the error to be able to complete the macro but it is very slow since it fails once each time despite the type command working fine

image