Browse Source

working

afip_input_document_details
rodley82 3 weeks ago
parent
commit
52f17b62e3
  1. 41
      afip_confirmar_automaticamente.lua

41
afip_confirmar_automaticamente.lua

@ -0,0 +1,41 @@
log("Inicio confirmation from LUA!!")
local err
print("BEFORE JSON LOADING payload: " .. json_payload)
local json = require("json")
print("AFTER JSON LOADING")
-- Parse the JSON string
local obj, err = json.decode(json_payload)
local error_on_page
-- We need to click on btngenerar first and then we'll see the confirmar button
err = waitVisibleByQuerySelector("#btngenerar")
if err then
print("Error waiting for btngenerar: " .. err)
return
end
err = clickElementByQuerySelector("#btngenerar")
if err then
print("Error clicking on btngenerar: " .. err)
return
end
waitSecs(3)
js_script = [[
$x("//button[@type='button' and .//span[normalize-space()='Confirmar'] ]")[0].click();
]]
print("About to click on Confirmar using this JS: " .. js_script)
error_on_page, err = evaluateJsWithStringOutput(js_script)
if err then
error("Clicking on Confirmar error: " .. err)
else
print("Clicking on Confirmar success")
end
waitSecs(2)
log("Finishing confirmation from LUA!!")
Loading…
Cancel
Save