FormInputLuaScript

The path to a Lua script to use to complete an HTML form.

The Lua script must contain a function named fillForm. This function receives one argument, a LuaClientSession object. You can use the fillFormInput method to complete the form, for example:

Copy
function fillForm(session)
    get_log():write_line(log_level_normal(), "Executing fillForm from Lua script")
    session:fillFormInput("input[id=text1]", "textvalue")
end

When you set this parameter you can still set InputSelector and InputValue, but any field values that you set using the script override those in your configuration file. To submit the form, you must set SubmitSelector.

TIP: When you use the get_log() function in a form input Lua script, do not specify any arguments such as a log type. Form input Lua scripts are executed by the WKOOP process (which runs the connector's embedded browser), and the log messages are passed back to the connector and merged with the relevant log stream.

Type: String
Default:  
Required: No
Configuration Section: Any section that you have defined with the FormsSection parameter, TaskName or FetchTasks or Default
Example: FormInputLuaScript=my-script.lua
See Also: