Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Validate a File Download
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
How can I validate that when a user clicks 'submit' on an HTML form that a windows dialog box with the name of the file to download comes up?

Thanks!
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi,

Do u want to check if file is downloaded or not???


Regards,
Sankalp
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Yes, I'd like to know if it's downloaded. My main concern was getting QTP to click the "save" buttons on the windows dialog boxes.
Reply
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
You can add the windows dialog boxes to your object repository, then record the click on save (or just add using object spy).

I believe you have to setup QTP to accept windows dialog boxes, IIRC it's under [Tools] > [Web Event Recording Settings] > [Custom] > All? and make sure "onclick" is set to "Always"
Reply
#5
Solved: 11 Years, 3 Months, 4 Weeks ago
I've added the windows dialog to my object repository and changed the setting for onclick. However, I'm still getting this error:

Object not visible

Line (5): "Browser("Browser").Dialog("File Download").Activate".

Perhaps I didn't add the object to my repository correctly? It seems to get added automatically as soon as I click on it when I'm recording.
Reply
#6
Solved: 11 Years, 3 Months, 4 Weeks ago
QTP error codes are only semi-useful, as they mostly list just the first line of the code. What is on the 5th line? I find that recording is the fastest and easiest way to add objects to the repository, and have yet to have any real issue on adding them. Descriptive Programming, so far, seems a bit of a waste unless you already know what the identifiers are (which I rarely do).
Reply
#7
Solved: 11 Years, 3 Months, 4 Weeks ago
Code:
Browser("Browser").Page("Page").WebEdit("meetingid").Click
Browser("Browser").Page("Page").WebEdit("meetingid").Set "982"
Browser("Browser").Page("Page").WebEdit("docid").Set "22"
Browser("Browser").Page("Page").WebButton("Submit").Click
Browser("Browser").Dialog("File Download").Activate
Browser("Browser").Dialog("File Download").WinButton("Save").Click
Browser("Browser").Page("Page").Sync
Dialog("0% of get from minime.fmr.com").Dialog("Save As").Activate
Dialog("0% of get from minime.fmr.com").Dialog("Save As").WinButton("Save").Click
Dialog("0% of get from minime.fmr.com").Dialog("Save As").Dialog("Save As").Activate
Dialog("0% of get from minime.fmr.com").Dialog("Save As").Dialog("Save As").WinButton("Yes").Click
Reply
#8
Solved: 11 Years, 3 Months, 4 Weeks ago
My only thought right now is that it's attempting line 5, activate, faster than that dialog can show up. Try inserting Wait (x) between them. Where x is a time in seconds.

edit: From what I understand of this, the user inputs data, then submits it, and then is given a prompt to download the data they were just given? Are there no other screens or actions taken between these? Somtimes QTP misses on some steps if the user directly clicks on functional buttons (login, submit, search, etc..) I have to sometimes click off in a blank area to force QTP to record what I just did, and then delete the empty space click.
Reply
#9
Solved: 11 Years, 3 Months, 4 Weeks ago
Use synchronisation/WAITProperty on the File download dialog box. Its happening because script is trying to activate the dialog where as once you submit a form, it usually takes sometime to popup/display the next window.

Regards,
Ankesh
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Should I download every patch in order to UFT recognize the Chrome and FireFox browse jesusisaac 6 5,343 08-25-2016, 05:03 PM
Last Post: Ankesh
  [UFT][JSON] Validate Json file robertosalemi 0 3,781 02-10-2016, 04:36 PM
Last Post: robertosalemi
  How to validate mandatory filed (*) in web application using balak89 1 4,123 09-13-2015, 12:54 AM
Last Post: ADITI1992
Smile Need to validate a .txt file and .jpeg image. aman8604 0 2,341 04-09-2015, 11:33 AM
Last Post: aman8604
Sad Validate New Employee Creation hello_sanjay 0 1,903 04-07-2015, 06:16 PM
Last Post: hello_sanjay

Forum Jump:


Users browsing this thread: 7 Guest(s)