Click on Browse button | WebFile in QTP

Click on Browse button | WebFile in QTP:

In QTP,browse button belongs to WebFile class.As you might have wondered earlier that by default QTP doesn’t recognises click event on WebFile. It could be seen on net,no of testers have already faced similar issues.
Forums have loads of questions on the above topic.
The most bugging part is that most of the testers assumes that the text box appears beside the browse button can be used by setting it’s innertext property..hold on …hold! no!
The text box and Button like control together forms WebFile Object.
Neither WebEdit(“index:=0”) nor WebButton(“index:=0”) is going to give some relief on the aching head.
Let’s have a simple workaround (Exactly it’s a approach) to let QTP understand Click operation on WebFile Object.
This  is how it’s HTML source looks like:
Web File in QTP

Browse button HTML Source

Steps to  overcome above issue:

1. Click on Tools>>Web Configuration

2. Select WebFile on tree view listing

3. Go to Event menu and click on add and then select onClick event

4.Click on Ok

Now proceed with normal recording,it works! 🙂


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: