Session automation
Execution of PWR sessions
Standard execution
To launch pre-recorded PWR sessions, we will indicate that the working mode is PWR (with the -exe parameter), and the file containing the session guidelines. With the -script parameter which receives html(v2) and .side(v3) files:
pandora_ux_x64.exe -exe PWR -script tests\std.side
Optionally, we can indicate the directory where we will save the screenshots in case of failure in the check and the ip and port where the selenium hub that will perform the check is hosted.
pandora_ux_x64.exe -exe PWR -script tests\std.side –folder C:\sondas\ -pwr_host 192.168.80.40 –pwr_port 4445
The following modules will be returned:
UX_Time_project_name
UX_Status_project_name
If there is any phase with error, the following module will also be created:
UX_Snapshot_project_name
It will show a snapshot of the web at the time of the error as long as it is running on the same machine where the Selenium server is running.
Example of output with successful execution:
<module>
<name><![CDATA[UX_Status_std.side]]></name>
<type>generic_proc</type>
<data><![CDATA[1]]></data>
<description><![CDATA[Test OK]]></description>
</module>
<module>
<name><![CDATA[UX_Time_std.side]]></name>
<type>generic_data</type>
<data><![CDATA[16.317]]></data>
<description><![CDATA[Test OK]]></description>
</module>
Example of output with failed execution:
<module>
<name><![CDATA[UX_Status_std.side]]></name>
<type>generic_proc</type>
<data><![CDATA[0]]></data>
<description><![CDATA[Failed to execute verifyText]]></description>
</module>
<module>
<name><![CDATA[UX_Time_std.side]]></name>
<type>generic_data</type>
<data><![CDATA[15.463]]></data>
<description><![CDATA[Failed to execute verifyText]]></description>
</module>
<module>
<name><![CDATA[UX_Snapshot_std.side]]></name>
<type>async_string</type>
<data><![CDATA[data:image/png;base64,
iVBORw0KGgoAAAANSUhEUgAA…JRU5ErkJggg==]]></data>
<description><![CDATA[Image (last error)]]></description>
</module>
Transaction-based execution
If the check has been recorded with additional transaction-based information, the system itself will generate the necessary modules to identify each of the phases indicated.
pandora_ux_x64.exe -exe PWR -script tests\std.html –folder C:\sondas
The following modules will be returned per phase*:
- UX_Time_project_name.phase_#order
- UX_Status_project_name.phase_#order
If there is any phase with error, the following module will also be created:
- UX_Snapshot_project_name.phase_#order.
It will show a snapshot of the web at the time of the error.
Global snapshot modules identified with the following names will also be returned:
- UX_Global_Time_project_name.
- UX_Global_Status_Project_Name
- UX_Global_Snapshot_project_name
Will display a snapshot of the web at the time of the error.
*#order represents the number corresponding to the order in which it has been declared (1, 2, 3...).
PDR session execution
Standard execution
To launch pre-recorded PDR sessions, we will indicate that the working mode is the path to the file pdr.cmd, the argument of this file "-r", the file containing the session guidelines (-script), the directory where to store the screenshots (-folder) ending in '-'.
In the following execution the screenshot is also customized to collect only the active window:
pandora_ux_x64 -exe C:\PDR\pdr.cmd -args -r -script C:\pandora_ux\calculadora.sikuli -folder C:\pandora_ux\ -ss_config active
The following modules will be returned:
- UX_Time_project_name
- UX_Status_project_name
- UX_Control_Snapshot_project_name*
If there is any phase with error, the following module will also be created:
- UX_Snapshot_project_name.
It will show an image of the active window (with -ss_config active) at the time of the error.
Example of output with successful execution:
<module>
<name><![CDATA[UX_Status_calculadora.sikuli]]></name>
<type>generic_proc</type>
<data><![CDATA[1]]></data>
<description><![CDATA[C:\pandora_ux\calculadora.sikuli
completed
Control snapshot rebuilt
]]></description>
<tags>UX</tags>
<module_group>UX</module_group>
</module>
<module>
<name><![CDATA[UX_Time_calculadora.sikuli]]></name>
<type>generic_data</type>
<data><![CDATA[20.204]]></data>
<description><![CDATA[C:\pandora_ux\calculadora.sikuli
execution
completed
Control snapshot rebuilt
]]></description>
<tags>UX</tags>
<module_group>UX</module_group>
<module_parent>UX_Status_calculadora.sikuli</module_parent>
</module>
<module>
<name><![CDATA[UX_Control_Snapshot_calculadora.sikuli]]></name>
<type>async_string</type>
<data><![CDATA[data:image/png;base64,
IBCAIAAAAOCnfhAAAAAXNSR…/4x79e/7757f8H2C00s1C73yMAAAAASUVORK5CYII=]]></data>
<description><![CDATA[Control image rebuilt]]></description>
<tags>UX</tags>
<module_group>UX</module_group>
<module_parent>UX_Status_calculadora.sikuli</module_parent>
</module>
* Only in the first run
Example of output with failed execution:
<module>
<name><![CDATA[UX_Status_std.html]]></name>
<type>generic_proc</type>
<data><![CDATA[0]]></data>
<description><![CDATA[Failed to execute verifyText]]></description>
<tags>UX</tags>
<module_group>UX</module_group>
</module>
<module>
<name><![CDATA[UX_Time_std.html]]></name>
<type>generic_data</type>
<data><![CDATA[15.463]]></data>
<description><![CDATA[Failed to execute verifyText]]></description>
<tags>UX</tags>
<module_group>UX</module_group>
<module_parent>UX_Status_std.html</module_parent>
</module>
<module>
<name><![CDATA[UX_Snapshot_std.html]]></name>
<type>async_string</type>
<data><![CDATA[data:image/png;base64,
iVBORw0KGgoAAAANSUhEUgAA…JRU5ErkJggg==]]></data>
<description><![CDATA[Image (last error)]]></description>
<tags>UX</tags>
<module_group>UX</module_group>
<module_parent>UX_Status_std.html</module_parent>
</module>
Transaction-based execution
If we have recorded different processes with PDR and we have tested that they work by playing them continuously, we will execute as follows:
pandora_ux_x64.exe -exe C:\PDR\pdr.cmd -args -r -t calculadora_trans -script C:\PDR\calc.sikuli,C:\PDR\savecalc.sikuli,C:\PDR\savefile.sikuli
-folder C:\PDR\ -ss_config active
As can be seen, we will simply indicate the path of the new script in the -script parameter separated by a comma from the previous script and we will use the -t parameter with the name of the transaction that will encompass the different phases. If we had a process with more phases we would follow the same logic; for example:
pandora_ux_x64.exe -exe C:\PDR\pdr.cmd -args -r -t proceso_transaccional -script C:\PDR\script1,C:\PDR\script2,C:\PDR\script3,C:\PDR\script4 -folder C:\PDR\ -ss_config active
The line to add to the agent configuration file, for this case, will be the following:
module_plugin pandora_ux_x64.exe -exe C:\PDR\pdr.cmd -args -r -t calculadora_trans -script C:\PDR\calc.sikuli,C:\PDR\savecalc.sikuli,C:\PDR\savefile.sikuli -folder C:\PDR\ -ss_config active -checkpoint -post "taskkill /F /IM calc.exe"
Thanks to the -checkpoint parameter we will be able to see screenshots of the final result of each phase in the Pandora FMS console.
The following modules per phase* will be returned:
- UX_Time_project_name.phase_#order.
- UX_Status_project_name.phase_#order
If there is any phase with error, the following module will also be created:
- UX_Snapshot_project_name.phase_#order.
It will show a snapshot of the web at the time of the error.
Global snapshot modules identified with the following names will also be returned:
- UX_Global_Time_project_name.
- UX_Global_Status_Project_Name
- UX_Global_Snapshot_project_name
Will display a snapshot of the web at the time of the error.
*#order represents the number corresponding to the order in which it has been declared (1, 2, 3...).
Remark: Error captures will only be displayed when the UX client (PWR) and the PWR server are running on the same machine. Otherwise, the directory where the images are delivered by the PWR server must be accessible by the client in order to display the image in Pandora.