code for Open Test Dialoge qtp
I am trying to make my own small application simillar to QTP Batch runner in VB.
For selecting the files, I added a browse file button on form. It open the select-file dialog box.
But problem is that in QTP, qtp script is not a file but a folder. So I am not able to select the test file.
I wanted to create a select file dialog box simillar to one we get when we click on 'Open' in QTP. In this Open Test dialog in QTP, search filter is 'QuickTest Tests'.
Attached is the screenshot of qtp 'Open Test' dialog which I wanted to access
Please help me.
Re: code for Open Test Dialoge qtp
I can see two possibilities (but I'm sure there are many others) :
1. Use the BrowseForFolder method of a Shell.Application object (see this page). You may want to verify that the selected folder is indeed a QTP script. This can be done by using the FileExists method of a Scripting.FileSystemObject object to verify that the selected folder contains a file named <foldername>.usr.
2. Use the ShowOpen method of a UserAccounts.CommonDialog object (see for instance this page). You may want to restrict the allowed file suffixes to *.usr for instance.