WebFile object and WinToolBar object - need VBScript to Upload a file into website.

679 views
Skip to first unread message

Rekha

unread,
Nov 28, 2012, 3:08:17 PM11/28/12
to qtp-ele...@googlegroups.com

I am not able to upload a file after selecting Browse button. QTP is able to recognize the browse button but it is not recognizing the path give to upload a file. is there any way for QTP to recognize the path an upload the file provided in the path… during recording or using vbscripting/descriptive programming.

I googled I tried using this object in several different ways, but its not working properly. Can you please see my code below and let me know? How to use WebFile object and WinToolBar object, please let me know if you know.

oPg1.WebFile("upload photo").Click

‘choose file to upload dialog opens…

If Browser("Coffee").Dialog("Choose File to Upload").Exist Then

Reporter.ReportEvent micPass,"Choose File to Upload - Dialog box opened"," "

‘Browser("Coffee").Dialog("Choose File to Upload").WinToolBar("Address: Desktop").Set"C:\Users\xyz\Test Data" ????

Browser("Coffee").Dialog("Choose File to Upload").WinToolBar("Address: Desktop").Press "C:\Users\xyz\Test Data" ????

Browser("Coffee").Dialog("Choose File to Upload").WinEdit("File name:").Set "sample Upload photo.jpg"

Browser("Coffee").Dialog("Choose File to Upload").WinButton("Open").Click

Else

Reporter.ReportEvent micFail,"Choose File to Upload - Dialog box NOT opened"," "

End If

Thank you!

Rekha

QTP Learners

unread,
Nov 28, 2012, 7:04:35 PM11/28/12
to qtp-ele...@googlegroups.com
1. See you have settings in QTP are enable for window application  as well , go to Automation>record and run settings> Window application )for that.
if yes we can look for another solution.
Reply all
Reply to author
Forward
0 new messages