Thursday, 20 February 2014

How to verify if the webcheckbox is selected or not in QTP?

Verifying if the web checkbox is selected or not is very easy in QTP.

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

status = Browser("ABC").Page("Mypage").WebCheckBox("mycheck").GetROProperty("Value")

If the checkbox is selected then status will have a value - ON

If the checkbox is not selected then status will have a value - OFF

This is how we can validate if the checkbox is selected or not using QTP.

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

status = Browser("ABC").Page("Mypage").WebCheckBox("mycheck").object.checked

If the checkbox is selected then status will have a value - true

If the checkbox is not selected 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.