Welcome, Guest. Please login or register.
Login with username, password and session length

 
Advanced search

18539 Posts in 4847 Topics- by 32743 Members - Latest Member: watty
 

AdvancedQTP forums have been nominated as a finalist in ATI’s 2nd annual automation honors awards!

We’d like to thank you for your continued support and participation, and urge you to hurry and vote.

Make you voice count! 


Pages: [1]   Go Down
Print
0 Members and 1 Guest are viewing this topic.
Author Topic: Does This Functionality Exist in QTP    (Read 1291 times)
Steve Boll
FRProject
User
*
Offline Offline

Posts: 6


« on: August 06, 2008, 02:04:01 PM »

In WinRunner we used a statment - table = create_browse_file_dialog("*.xls")

This will open a file open dialog box for file selection.  You can change drives and directories in this dialog to find the file you want to use.  Is this functionality found in QTP?
Logged
Steve Boll
FRProject
User
*
Offline Offline

Posts: 6


« Reply #1 on: August 12, 2008, 08:32:43 AM »

 Undecided  So it looks like this is not doable in VBscript.   Shocked
Logged
Aaron Silverman
User
*
Offline Offline

Posts: 6


WWW
« Reply #2 on: August 12, 2008, 03:53:33 PM »

Can you elaborate on what you want to do with the file and where you open the file browser?  QTP can interact with the UI of many programs and navigate/open files.  This goes beyond the scope of its Web functionality though.
Logged

Tomer Salem
Active User
**
Offline Offline

Posts: 63


« Reply #3 on: August 13, 2008, 01:26:17 AM »

hi,

try that:

Set var_CreateInstance = DotNetFactory.CreateInstance("System.Windows.Forms.OpenFileDialog", "System.Windows.Forms")
var_CreateInstance.Filter = "Excel Files (*.xls)|*.XLS"
var_CreateInstance.ShowDialog

MsgBox var_CreateInstance.FileName

hope it helped.
Tomer.
Logged
Steve Boll
FRProject
User
*
Offline Offline

Posts: 6


« Reply #4 on: August 18, 2008, 09:26:32 AM »

Tomer, I tried your approach and QTP hangs in a running state when executing the ShowDialog statement. 

Logged
Tomer Salem
Active User
**
Offline Offline

Posts: 63


« Reply #5 on: August 20, 2008, 01:46:56 PM »

hi,

what do you mean by "hangs", it is waiting to your (xls) file selection.
once you select one (and press Enter\Open), you will get it's full path at the message box.

I hope that it what you meant, I tried it, and it worked fine to me.

hope it helped,
Tomer.
Logged
Steve Boll
FRProject
User
*
Offline Offline

Posts: 6


« Reply #6 on: August 22, 2008, 07:40:29 AM »

Thanks Tomer, works like a charm.  I was not looking under the QTP main window for the dialog box.
Logged
Pages: [1]   Go Up
Print
Jump to: