RFT - Handling Html.Dialog window through scripting.
prakash s chauhan 27000140Y5 Visits (5189)
Rational Functional Tester would recognize the some dialog window/alert windows on Internet explorer as of type Html.Dialog.
This article describes some of the ways Html.Dialog can be handled using the dynamic scripting in RFT.
A web application displays some dialog windows and we want to write code that checks if a particular html dialog with a particular caption is open and if it is then we give the title of the button that we want to click to dismiss that dialog.
Code(VB Scripting but Java would follow the same lines)
'dlgCaption is the caption of the dialog we are looking for
'btnText is the button's text that we are looking for in the dialog, This button will be clicked to dismiss this dialog.(instead of button we can modify it to 'look for ' 'something else too )
Dim dialog As GuiTestObject = GetD
If (dialog Is Nothing) Then
LogInfo("No Dialog found with caption: " + dlgCaption, GetR
Private Function GetD
Dim dialogs As TestObject() = Find
If (dialogs.Length = 0) Then
'LogInfo("No Dialog Found with caption " + caption, GetR
Private Sub Clos
Dim buttons As TestObject() = dlgW
If buttons.Length = 0 Then
LogError("Did not find button with text " + buttonText + " On Dialog with caption " + dlgW
Dim btnGui As GuiTestObject = CType(buttons(0), GuiTestObject)
LogInfo("Closing Dialog", dlgW
The above code could be invoked by a script as follows: