I’m attempting to download a file from my QTP script. I want to record my action of clicking on ‘Save’ or ‘Cancel’ button but I’m getting error that object is not visible.
I check Object Repository and see File Download object with following description properties:
text: File Download
nativeclass: #32770
is owned window: True
is child window: False
…and no ordinal identifier.
Here is my script:
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”).WinButton(“Cancel”).Click
I get this error:
Object not visible
>Line (4): “Browser(“Browser”).Dialog(“File Download”).WinButton(“Cancel”).Click”.
What do I need to do to make it visible? I’ve tried adding the ‘visible’ property under Tools – Object Identification – File Dialog. But when I do that I start getting run-time errors on all the objects that have non-unique identifiers, i.e. elements with the same ‘name’ value that appear more than once.
Is there something I’m missing here, or a better way to do this?
Thank you for any help.
A better way to handle this would be by not using specific objects at all(Since you have to run it in multiple machines). Use key strokes to simulate ‘Save’, and copy the file to the desired location from the default location using FilesystemObject.