Hi You are correct the MessageBox functionality is only available for the Classic Agent in SilkTest. With the Open Agent any PopUp Dialog Box will be considered under its own merit rather than be identified via a generic declaration “$MessageBox”. Therefore if you want to have a generic PopUpBox, you will have to create a Window Class which will recognise more than one pop up dialog box. Consider the following Window Declarations for Notepad and the SilkTest Sample Win32 TextEditor [-] window MainWin UntitledNotepad [ ] locator "/MainWin[@caption='Untitled - Notepad']" [-] TextField TextField [ ] locator "//TextField" [-] DialogBox Notepad [ ] locator "Notepad" [-] PushButton DontSave [ ] locator "Don't Save" [-] window MainWin TextEditorUntitled [ ] locator "/MainWin[@caption='Text Editor - (Untitled)']" [-] TextField TextField [ ] locator "//TextField" [-] DialogBox TextEditor [ ] locator "Text Editor" [-] PushButton No [ ] locator "No" Instead of using the Dialog box Object for each application to dismiss it, like so: [-] testcase Test1 () appstate none [ ] TextEditorUntitled.SetActive() [ ] TextEditorUntitled.TextField.TypeKeys("Dummy Text") [ ] TextEditorUntitled.Close() [ ] TextEditorUntitled.TextEditor.No.Click() You could create a generic Class such as PopUp (as shown below) which will dismiss the PushButton regardless if it is called against notepad or the sample Win32 Text Editor, [-] window DialogBox PopUp [-] locator "//DialogBox[@caption='*Notepad*' or @caption='Text*']" [-] PushButton Dismiss [ ] locator "@caption='Don*' or @caption='No'" [-] testcase Test3 () appstate none [ ] UntitledNotepad.SetActive() [ ] UntitledNotepad.TextField.TypeKeys("Dummy Text") [ ] UntitledNotepad.TypeKeys(" ALT-F4 ") [ ] PopUp.SetActive() [ ] PopUp.Dismiss.Click() This is the only way I can think of creating a Generic Class. If this does not suit your scenario then I would recommend that you log a change request borland.uservoice.com/.../163510-silk-test-feature-request Thanks John
↧