What to do when QTP is not able to identify browse or upload buttons?

Updated On Jul 5, 2013 by

This question was asked by Suresh in the comments field.

I am recording using QTP and for some reason QTP does not recognize any upload buttons. For example, start the recording at this site: http://cgi-lib.berkeley.edu/ex/fup.html
Click on the “Browse” button. Notice this click is not recognized by QTP. Please provide some feedback why QTP is not able to recognize this button. Thanks

This is an interesting question and not a typical object identification issue. I thought I will take it up on the blog to make it available to the wider audience.

If you go on the link mentioned above, you will see QTP is not able to record the click on Browse web button. Web buttons are generally associated with input type=submit object but if you see the source of the browse button, you will notice input type=file object.

qtp-type-file-type-submit

Now According to Microsoft help, input type=file object creates a file upload object with a text box AND Browse button. Notice the AND. So, in case of input type=file, the text box and browse button are considered part of ONE object. There are no separate objects for QTP to identify.

What can we do to solve this issue?

Enter Web Event Recording Configuration.

  1. Object Spy on the text box/ browse button object reveals that it is a WebFile type Object. QTP webfile object
  2. Using Tools > Web Event Recording Configuration, go to WebFile (under Web Objects tree). Add onclick event. When QTP does not recognize buttons
  3. Set the onclick event settings to Always. Click ‘OK’.QTP onclick werc
  4. Done!. Record the click on browse button, now QTP should be able to identify the click on the button.

Welcome new readers: Download the Free eBook!

Ankur JainI am Ankur Jain, the owner of LearnQTP and founder of a software organization. This site is run, maintained and updated by me and my team. Feel free to take a look around, you may want to start with What is QTP? 

You can connect with me on my Google+ page. 

Please enter your first name and email address below to instantly download the eBook on Optimizing QTP Scripts. In future, we will make sure you get new tips & tricks on QTP delivered direct to your email box.



Share This:

40 Comments

  1. Bunny

    Hi
    How to upload an image in the web application by uploading image from the system.

  2. Hi,
    Is it possible to Keep Browser and page in Shared Repository and Object belong to this resides in local repository?

    Regards,
    Rajesh Kumar

  3. Rajesh

    HI Ankur

    wow its works thanks :-)

  4. Mohan

    Hi,

    I am beginner in QTP.

    I have installed QTP and Actitime application in my system(Windows XP). But when i tried to spy Actitime application actual link is not getting spyed but simply firefox.
    Kindly advise i need to open QTP or Actitime application in order to spy correctly.

    Thanks in advance.
    Mohan

  5. Mamta

    Hi Ankur,
    I had a question. I am using descriptive programming to write a script and in one of the screens there are drop down fields I used parameterization for that but all dop down fields when i select doesn’t change the values in the screen but when I clcik in one particular one webcheckbox appears so how do I write that in QTP so it changes.

  6. Div

    I am facing the same prob as kashyap. pls help

  7. Apurv

    Thank you very much for the solution.

  8. kasi

    qtp is unable to recognize web objects…. i have checked web activex as well as visual basic addins .. but still qtp unable to recognize web objects . if spy the items it shows as win objects . reply if anyone can

    regards ,
    kashyap

  9. naveena

    hi,

    I am trying to get date from gmail. But iam unable to recognise the date using object spy.

    Please, help me anyone …

    thanks in advance..

    regards,
    naveena

  10. Rizwan

    Hi Ankur..,
    I have done the above required changes but still QTP is unable to detect the browser its shows “Windows”
    I’m having QTP 11 and i also Turn OFF the user control…
    Pls tell me how to fix this problem..

  11. Asis

    thanks

  12. Madhu

    Hi Ankur,
    I have same issue with windows appication. I have a WPFButton which will alow us to upload a file and not able to record it with QTP. Please advise.
    Thanks,
    Madhu

  13. Thanan

    Hi All,
    I m using QTP 10 version, when i try to identify object by object spy. It shows correct for some object and after that it shows as winobject for every object. I mean…
    In login page, obj spy correctly identify the Username, password and Submit button field…. after navigating in to the next page the object spy not correctly identifies the object

    It shows message as
    WinObject:Internet Explorer server..

    Plz guide me…….

    Thanks in Advance

  14. Thanan

    Hi Ankur,
    I m using QTP 10 version, when i try to identify object by object spy. It shows correct for some object and after that it shows as winobject for every object. I mean…

  15. Ishu

    Hi Ankur,

    Thanks for the make of this blog.it is very helpful for the beginners like me .

    Ankur i am faing some problem while recording the script for web links .Actually i am using QTP11.0 with IE8 and Window 7 and found that QTP is not recording anything i.e. niether the script getting recorded nor the objects .i tried by object py n all but it captures the whole page instead of the button and dit box with winEdit or WinButton class name .i also tried all the basics like
    *Open the QTP with the admnistrative rights.
    *Opens the browser after the QTP recording.
    *Also try to record by IE32 bit.
    but nothing gonnna works .
    Please suggest.
    Thanks in advance.

    Regrads,
    Ishu

  16. Rajeev

    Hi
    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 using descriptive programming.

  17. use the virtual objects if QTP is failed to recognized application objects, Go for Virtual Object
    Navigation:-
    TOOLS-VIRTUAL OBJECT-NEW VIRTUAL OBJECT-IT ILL CREATE OBJECT IN SCRIPTING

  18. Thiru

    Nice Job Ankur , really works great…

  19. sachin

    Hi, I have been working with flex and QTP.. and some how the upload for lfex button seems to be an issue… Record happens fine but replay doesn’t work.

    any help on this will be really appreciated.

    Regards,
    Sachin

  20. Satish

    Hi Ankur,

    I was searching for the webfile usage and its functionality and atlast i found the solution here..Great effort and thanks a lot for helping me out.

    Similarly, Can you pelase give a brief explanation on WEBAREA object with an example?

    Thanks in advance,
    Satish

  21. Hi Harsh, Do yo get any solution for flexbutton on uplaod? I face same problem on QTP9.5. If you have solution for it, would you please post it or send a email to me.

    Thanks

    Xmen

  22. Harsh

    I am facing problem with flex upload button. The replay is not working with the Upload button. It click on normal Flexbutton but with upload flexbutton it only highlight it.
    there are no flex specific events in the event config. the webbutton has the onclick set to always.

  23. Prashanth

    Hi
    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

  24. praj

    I am facing different issue. In my testing application, when we click on image button QTP can not identify any object, not even browser. (after clicking image button another windows opens which has same browser name as previous by calling ajax action methods)
    I found work around as click on back of browser and then click on forward button of browser. Then QTP is able to understand all objects. Do not know is it application problem or QTP?
    Please comment on this. Thanks!

  25. raju

    Nice posting

  26. Siddhesh Patil

    I m not able to enter the content into webfile object
    when i use .set property for Webfile nothing works
    but when i use .click using the same object it clicks on the browse button.
    I can browse to the content i want to using ths approach, but i have a scenario where i need to directly set the value into webfile editbox
    Can someone please elaborate on this?

  27. solomon blessing

    How to study QTP scripting in better and easier way send some links

  28. Smita

    I followed the above steps but in Tools there is no option for WebEvent recording configuration in QTP 9.2,can you tell me from where we get this option.

  29. Raj Yaramala

    This is great example to show we can miss lots of functionality or options when we neglect to browse all available features

  30. Smita

    We dont have any option of Web Event recording in QTP 9.2,Can you suggest how to solve this.

  31. Nil

    Hi Ankur,

    I am using QTP from past two years.,.
    I am facing once issue..
    one web page that I am testing is having webedit box.
    In this web edit box content is seen at run time..
    So I am not able to get any data from this web edit box.. I have tried all method getcelldata, GetROproperty..etc.
    But I am unable to get data…
    can you help me in this case????

    • Ankur

      In this web edit box content is seen at run time.. So I am not able to get any data from this web edit box

      I didn’t understand this. Please elaborate and ask the question on forums

  32. This is simliar to my situation, only I am getting an Adobe error when trying to run or record a script with Flex 3 objects…The error is “Adobe Flex 3 Plug-in for Mercury Quick Test Pro could not find the Flash Player within the HTML page. This can occur when the value of the OBJECT tag’s id attribute is missing or contains a period or dash.” When this error occurs, it precludes QTP’s ability to recognize (and thus, record) any Flex objects. A reinstall of QTP and the Adobe Flash Player 10, Flex builder 3 and Flex 3 Plug-in for QTP did not fix this issue. Any thoughts would be greatly appreciated! Thanks. steve@totalqualityphoto.com

  33. papu

    Hi Ankur,

    I have one doubt.If we will record making the necessary changes you have mentioned,can we run this script on another machine where QTP does not have the similar set up for web event identification.

    If yes then fine,
    If now can you plz give a generalise solution to this problem.

    Thanks in advance

  34. manoj

    hi
    some objects like drop down list “select” is not identified by QTP

  35. ramu

    when i recorded the same operations, it was able to enter the value and correspondingly able to click on BROSER…
    I have even given the descriptive programming of the same operations.it is also working fine.Have a look into he statements and let me know any issues

    ‘Browser(“title:=Sample File Upload Form”).Page(“title:=Sample File Upload Form”).WebFile(“name:=upfile”).Set “ramu”
    ‘Browser(“title:=Sample File Upload Form”).Page(“title:=Sample File Upload Form”).WebFile(“name:=upfile”).Click

    Browser(“Sample File Upload Form”).Page(“Sample File Upload Form”).WebElement(“Sample File Upload FormNOTE:”).FireEvent “onmouseover”
    Browser(“Sample File Upload Form”).Page(“Sample File Upload Form”).WebEdit(“note”).FireEvent “onmouseover”
    Browser(“Sample File Upload Form”).Page(“Sample File Upload Form”).WebFile(“upfile”).FireEvent “onmouseover”
    Browser(“Sample File Upload Form”).Page(“Sample File Upload Form”).WebElement(“File to upload: Notes”).FireEvent “onmouseover”
    Browser(“Sample File Upload Form”).Page(“Sample File Upload Form”).WebFile(“upfile”).FireEvent “onmouseover”
    Browser(“Sample File Upload Form”).Page(“Sample File Upload Form”).WebFile(“upfile”).FireEvent “onmousedown”
    Browser(“Sample File Upload Form”).Page(“Sample File Upload Form”).WebFile(“upfile”).Set “ramu”
    Browser(“Sample File Upload Form”).Page(“Sample File Upload Form”).WebFile(“upfile”).Click

  36. Abhijeet

    How to capture the link urls from google search?
    Scenario:
    1.search for “test” in google.
    2.Capture all link urls from search result page.

  37. Abhijeet

    I have got the solution for the same, Please try below code.

    Set oWebFile = Browser(“Home | Morgan Stanley”).Page(“Submit Edit Reference”).WebFile(“upload_file_text_box_Browse”)
    x = oWebFile.Object.clientHeight \ 2
    y = oWebFile.Object.clientWidth – 5

    oWebFile.Click x,y

  38. Aravind Reddy

    Excellent Ankur…………Very Good Idea :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>