The best way to examine the contents of data variables during playback is to make use of the Visual Basic MsgBox function.
Playback causes the contents of the variable to display in a message box. The message box displays until the OK button is clicked, at which point playback continues.
The following example shows a simple use of the command to display the contents of a variable:
Imports SilkTest.Ntf.Wpf
Public Module Main
Dim _desktop As Desktop = Agent.Desktop
Public Sub Main()
Dim sCarmake = "Honda"
MsgBox(sCarmake)
With _desktop.WPFWindow("@caption='WPF Sample Application'")
.Restore()
.WPFMenuItem("@caption='Basic Controls'").Select()
End With
With _desktop.WPFWindow("@caption='Basic Controls'")
.WPFTabControl("@automationId='tabControl'").Select("Text")
.WPFTextBox("@automationId='textBoxSingle'").SetText(sCarmake)
End With
End Sub
End Module
In the preceding example, the sCarmake variable value, which in this case is Honda, displays in the message box during playback.