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
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
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)
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 - 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