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