Near the top of your steps:
String js;
(EDIT) Enregistrer:
js = "document.querySelector('#twittcompta-creditnote-sentat-modal input[type=submit]').click();"
WebUI.executeJavaScript(js, null);
(EDIT) Valider:
js = "document.querySelector('#twittcompta-invoice-sentat-modal input[type=submit]').click();"
WebUI.executeJavaScript(js, null);
When you have it working, you should investigate WebUI.enhancedClick()
which will fall back to trying JavaScript without you needing to write the JavaScript yourself.