Viewing binary data
You can view binary data in tests. Use the binary editor to inspect test data, to determine if the binary data is of interest or should be transformed so that it can be correlated. You can also edit binary data in tests. To edit binary data you need to have in-depth knowledge of the data format in question. Typically, you do not edit binary data in tests.
Before you begin
Record a test that contains binary data.
Procedure
-
In the Test Navigator, browse to the test, and double-click
it.
The test opens.
- Select a test element that contains binary data.
-
In the Test Element Details area,
press the Ctrl key and click in the Content field.
Alternately, type Ctrl+Shift+Space.
The Test Editor - Content window opens.
-
Select the bytes to inspect, and then right-click to manipulate
the selected data.
Option Description Select Use this page to programmatically select binary data by string or by specifying the number of characters to select. Click Null terminated string from caret to make a selection that starts at the current cursor position and ends at the next null character. If you select Select NULL character also, the null character is included in the selection.
Click characters from caret, and type a number to select that number of characters starting from the current cursor position.
Click Selection contains number of characters to select to select the number of characters specified by the current selection in the binary editor. For example, if you have 08 selected in the binary editor, this will select the next eight characters after the 08 byte. This control is not available if no data is selected in the binary editor.
Click Sign to choose signed or unsigned data.
Click Endianness to choose between big endian or little endian representation.
Edit Integer value Use this page to edit data that you have selected in the binary editor. This page is available only when the binary editor is not in read-only mode. Select Update contents from editor selection to update the Value field when you change the selection in the Test Editor window. Clear this check box to prevent the Value field from being updated when you change the selection in the Test Editor window.
Type the new data in the Value field. Select the appropriate base, such as decimal or hexadecimal, from the list.
Click negate to negate the value of the selected data.
Click Size to choose the size, in bytes, of the selected data.
Click Sign to choose signed or unsigned data.
Click Endianness to choose between big endian or little endian representation.
The Preview area shows how the bytes will change in the binary editor after you click Apply or OK.
Show Integer value Use this page to show the integer value of selected binary data in different formats. This page is available only when the binary editor is in read-only mode. Select the appropriate base, such as decimal or hexadecimal, from the list. The input field is not available.
Click Size to choose the size, in bytes, of the selected data.
Click Sign to choose signed or unsigned data.
Click Endianness to choose between big endian or little endian representation.
Binary Padding Use this page to insert and overwrite binary data. Type the data to insert in the Pad with field. Select the appropriate format, such as bytes or ASCII, from the list.
Click Pad selection only to replace the bytes that you have selected in the binary editor. This control is not available if you have not selected any bytes in the binary editor.
Click Number of occurrences, and then type the number of times to repeat the binary padding.
Go to Offset Use this page to move the cursor to a different position in the binary data. Type the offset in the Enter offset field.
Select Make selection with previous and new offset so that the bytes between the current cursor position and new cursor position are selected when you click OK.
Click Absolute or Relative to choose an absolute offset or relative offset. An absolute offset starts with the first byte of data. A relative offset is measured from the current cursor position.
Click Forward or Backward to choose the direction for relative offsets. This control is not available for absolute offsets.
Find/Replace Use this page to search for binary data and to replace binary data, if necessary. This page is available only when the binary editor is not in read-only mode. Type the data to search for in the Find field. Select the appropriate format, such as bytes or ASCII, from the list.
Type the replacement data in the Replace field. Select the appropriate format, such as bytes or ASCII, from the list.
Click Forward or Backward to choose the direction to search from the cursor position.
Click All or Selection to choose between searching all of the binary data or searching only the data selected in the binary editor.
Find Use this page to search for binary data. This page is available only when the binary editor is in read-only mode. Type the data to search for in the Find field. Select the appropriate format, such as bytes or ASCII, from the list.
Click Forward or Backward to choose the direction to search from the cursor position.
Click All or Selection to choose between searching all of the binary data or searching only the data selected in the binary editor.
Encodings Select from the list the encoding to use for displaying binary data. Read-only Click Read-only to toggle between read-only and writable states. If the binary data contains a data-correlation reference, it is read-only and cannot be changed to writable. Paste This page is displayed only if you attempt to paste data from the clipboard into the editor and the data on the clipboard includes characters that are not valid in the current encoding scheme. For example, this page is displayed if you attempt to paste accented characters when the encoding is set to ASCII.
Click Paste only the valid character to paste only the characters that are valid in the current encoding scheme. All characters that are invalid in the current encoding scheme will be discarded.
Click Replace invalid character by 00 byte to paste the string from the clipboard, replacing all characters that are invalid in the current encoding scheme with a null character.