Transform Page

Transform Page command transforms part of a web page to make it easier to capture data from the web page. To add this Transform Page Command, part of a web page must be selected as a pre-requisite.

Example

Below screenshot shows the simplest example where the Transform Page command can be used.

TransformPageExample.png

You can choose from the following types of transformations:

• Transform HTML

• Insert HTML

• Replace HTML

• Denormalize HTML Table 

Use the Transform Page command to transform the structure of a web page into a form that will facilitate easier data extraction. The command uses a transformation script to transform existing HTML, or it can insert or replace HTML on a web page. The corresponding web selection for this command is the HTML of the chosen web element that will be transformed.

TransformPage.png
 

The default transformation for this command is Transform HTML, which denormalizes an HTML table. When using the Denormalize HTML Table transformation, the web selection must be an HTML table. The transformation will repeat some table cells and rows to make sure that all rowspan and colspan attributes in the table are set to one.

DenormalizeHTMLTable.png
 

The figure below depicts an HTML table having some cells that span multiple rows. You can use the Denormalize HTML Table transformation to ensure that no cells in the table spans more than one row, which makes it much easier to extract data from the table.

DeNormalizeHTML.png 
Choose the Denormalize HTML Table transformation on this table to ensure that no cells span more than one row

Command Properties

Command

Command Description: A custom description for the command.Default value is Empty.

Command Transformation Script:  A script used to change command properties at run time. The default value is disabled.

Disabled: This property set to True allows user to disable the command. A disabled command will be ignored. The default value is set to False.

ID:  This property indicates the internal unique ID of the command and is always auto- generated e.g. 58c8e4ac-e4c0-48f7-a63d-77064945380b.

Increase Data Count: This property indicates the data count every time this command is processed. The default value is set to False. Set it to TRUE if you want to get the count of the number of times a specific command is executed to get the data. The data count value is increased during data extraction, so it is used to measure agent progress and basis this increased data count, the agent  decides the success criteria.

Name:  This property specifies the name of the command.

Notify On Critical Error:  A notification email is sent at the end of an agent run if the command encounters a critical error, and the agent has been configured to notify on critical errors. Critical errors include page load errors and missing required web selections. Default value is set to False.

Debug

Debug BreakPoint: Debugging will break at this command if the break point is set.Default value is set to False.

Debug Disabled: A disabled command will be ignored during debugging. Default value is set to False.

Debug Error Option: This property specifies what action to take when an error occurs in the debugger. Default value is set to Notify which indicates that when an error occurs at debugging time , then it will be notified. If we want to ignore the error at debug time , then we need to set this property value as Ignore.

Export

Export Enabled: A command with Export Enabled set to false will not save any data to data output. Default value is set to True which indicates that any data will be saved to a data output.

Selection

  • Selection: The selection XPaths of the web elements associated with this command.
    • Paths:  List of selection XPaths.
      • Path:  The selection XPath.
  • Select Hidden Elements:  Selects visible and disabled elements when true. Otherwise selects only visible and enabled web elements.
  • Selection Missing Option:  Specifies what happens if this selection does not exist in the current page.
    • Default: Specifies if  this selection does not exist in the current page then logs error. 
    • Ignore Command but Execute Sub-Commands: Specifies if  this selection does not exist in the current page then it ignores the current command , but executes sub-commands of the command.
    • Ignore Command: Specifies if  this selection does not exist in the current page then it ignores the current command as  well as sub-commands.
    • Log Error and Ignore Command: Specifies if  this selection does not exist in the current page then it ignores the current command as  well as sub-commands and logs an error message.
    • Log Warning and Ignore Command: Specifies if  this selection does not exist in the current page then it ignores the current command as  well as sub-commands and logs a warning message. Note: Warning message will be logged if , Log level is set to either ‘Low’ or ‘High’.
    • Log PageLoad Error and Ignore Command: Specifies if  this selection does not exist in the current page then it ignores the current command as  well as sub-commands and logs a Page Load error.

Transformation

Replace HTML : The HTML to insert when replacing HTML.

Transformation Script : A script used to transform HTML.

  • C# Script: Specifies C# script.
  • Enabled: To use the Script we need to set this Property as True. The default value is set to False, which indicates that the script is disabled.
  • Library Assembly File: The name of a custom assembly file when "Use Default Library" is set to false.
  • Library Method Name: The method to execute when using the default script library.
  • Library Method Parameter: A custom parameter passed to the script library method.
  • Python Script: Specifies Python script.
  • Regex Script: Specifies Regex script.
  • Script Language: Specifies the scripting language which you want to use e.g C#, VB.NET, Python, Script Library, Regular Expressions.
  • Template Name: The template name of the referenced template.
  • Template Reference: Loads this script from a template when the agent is loaded.
  • Use Default Library: Uses the default script library when Script Language is set to Script Library.
  • Use Selection: The script is provided with the selected web element. The script will not be provided with the selected web element if this value is False.
  • Use Shared Library: Uses a script library that is shared among all agents.
  • VB.NET Script: Specifies VB.NET script.

Transformation Type : This property specifies the type of transformation. You can choose from the following types of transformations:

  • Transform HTML: The command uses a transformation script to transform existing HTML, 
  • Insert HTML:  It  inserts HTML on a web page .
  • Replace HTML:  It  replace HTML on a web page .
  • Denormalize HTML Table: The default transformation for this command is Transform HTML, which de-normalizes an HTML table. When using the De-normalize HTML Table transformation, the web selection must be an HTML table. The transformation will repeat some table cells and rows to make sure that all row span and col span attributes in the table are set to one. You can use the Denormalize HTML Table transformation to ensure that no cells in the table spans more than one row, which makes it much easier to extract data from the table.
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.