You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
989 B
41 lines
989 B
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!!")
|
|
|