This topic explains how to configure and apply the Text Data Bank tool in SOAtest and Virtualize. This tool extract values from any text content (including plain text, HTML, XML, etc.) and makes those values available as parameters in other tools and configurations.
Understanding Text Data Bank
The Text Data Bank can extract values from any text content (including plain text, HTML, XML, etc.) by specifying left-hand and right-hand boundaries that define the value to be extracted. It is useful when you want to extract plain text (e.g., for use in another tool or configuration panel), and cannot use other extraction tools such as the Browser Data Bank, XML Data Bank, JSON Data Bank, and so forth. The Text Data Bank tool is typically configured as an output of another tool (most commonly, a Browser Playback or Message Responder tool) that delivers text output. In this case, the Text Data Bank’s Text Content area will be populated with the text output of the chained tool after tool execution completes. Alternatively, you can create a "standalone" tool using the Text Data Bank tool, then specify a file that contains the desired text content (for instance, a log file or other file that is dynamically updated or created during every tool run).
You can extract any value that appears between specified text boundaries. This allows you to extract values that vary from tool run to tool run. For example, assume you want to extract a session ID, which changes from session to session, and this session ID always appears between "leftboundary" and "rightboundary". You can configure a Text Data Bank tool to extract whatever value appears between "leftboundary" and "rightboundary". Every time this tool is run, the value that appears in the specified location between the given boundaries will be extracted. This way, if the session ID between those boundaries changes from session to session, the value extracted will also change from session to session.
Extracted values are added to the column you specify, and can be used in any tool configuration fields that allow parameterized values.
If the specified boundaries change (as a result of application changes), the configured extractions need to be updated to specify the new boundary values.
What’s Considered Text Content?
The Text Data Bank operates only on content considered to have a text MIME Type. A MIME Type is based on the specified ContentType or by the file extension. You can control what what MIME Types are considered to be "text" by opening Parasoft> Preferences> MIME Types and and selecting the "Text" option for the appropriate MIME Types.
Configuring Text Data Bank
To configure a Text Data Bank tool to extract text during a tool run:
- Add the tool as an output of a tool that provides text output—or add it as a standalone tool (if you want to extract data from a file that is being dynamically updated or created for every tool run).
In the tool configuration panel, go to the Text Content area and select the area of text that you want to extract.
This specific value may not always be extracted
Note that if this value changes during subsequent tool runs, this specific value may not always be extracted. Whatever value appears in this location will be extracted, instead. A new extraction will occur each time this tool is run.
You can also define extractions manually by clicking the Add button and specifying extraction details.
- Click Create Extraction.
- Specify the name of the column you want to contain the extracted data.
The extraction will be added to the table, and can be modified or removed using the available controls.