Results 1 to 3 of 3
  1. #1

    unable to download a file using QTP script


    I am trying to download a file by running a QTP script. The application is a web based application. While downloading, I am getting a certificate error issue. Please find the screenshot attached for the issue I am facing.

    But I am surprised because, this ceritificate error is not happening when tryting to manually download the same file.

    -proxy settings are all the same for both Manual and Automation runs.
    -Spoof is the same for both manual and automation runs
    -Browser settings are all the same


    This happens only in IE and not in firefox browser. Please let me know if there is a setting which we need to do in QTP to avoid this certificate error. Any help in this regard is appreciated.

    Please let me know if you need any information in this regard. Thanks in advance for your help.

    Attached Images Attached Images

  2. #2

    Re: unable to download a file using QTP script


    I have faced this issue many times. One work around that has always worked for me is -

    -> Use Object.Focus to move the focus on the link/button used to download the file.
    -> After focus is set on your control, use SendKeys method to simulate hitting Enter key on the Keyboard.

    With this method you may not get the Certificate Error. Below is the sample code -

    [ QUOTE ]

    Set WshShell = CreateObject("WScript.Shell")
    Browser("b").Page("p").WebButton("btn").Object.foc us
    WshShell.SendKeys "{ENTER}"

    If Browser("b").Dialog("dlgFileDownload").Exist(30) Then
    WshShell.SendKeys "s" 'Click on "S" key to save the file
    End If
    Set WshShell = Nothing

    [/ QUOTE ]
    A n i s h

    [My QTP Blog]

  3. #3

    Re: unable to download a file using QTP script

    Change the Replay Event to Mouse and try again.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 03:37 PM.

Copyright BetaSoft Inc.