What to do when QTP is not able to identify browse or upload buttons?
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.
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?
- Object Spy on the text box/ browse button object reveals that it is a WebFile type Object.
- Using Tools > Web Event Recording Configuration, go to WebFile (under Web Objects tree). Add onclick event.
- Set the onclick event settings to Always. Click ‘OK’.
- 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!
I 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.