Thursday, 20 February 2014

How to verify if the edit box is enabled or disabled in QTP?

We can easily check if the given web object like edit box, listbox, weblist, webbutton, webcheckbox is enabled or disabled using 2 ways in QTP 

1. Example - Using getROProperty method of QTP
Below example uses the GetROProperty method to find the checkbox status

status = Browser("ABC").Page("Mypage").WebEditBox("myedit").GetROProperty("Disabled")

If the webeditbox is disabled then status will have a value - 1

If the webeditbox is enabled then status will have a value - 0

This is how we can validate if the editbox is enabled or not using QTP.

2. Example - Using HTML DOM (applies to only web applications)

status = Browser("ABC").Page("Mypage").WebEditBox("myedit").object.disabled

If the editbox is disabled then status will have a value - true

If the editbox is disabled then status will have a value - false

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

No comments:

Post a Comment

Please Leave your reply. We value your feedback and inputs

Best QTP Books

Everything About QTP

Hello Friends,
You can find QTP study material, Multiple choice questions (mcq), QTP question bank, QTP question papers, QTP notes, QTP questionnaire, scenario based QTP interview questions, QTP tutorial and QTP training on this site.

If you are a fresher or experienced QTP professional with (1/2/3/4) years of experience, this blog is just for you.