Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

Is there a way to find if a link is disabled in QTP? for textboxs and buttons it is easy, we can use GetROProperty and then give the property as disabled or ediable, etc. But in the case of links there is no such property which can show that it is disabled. How can we find out if it is disabled or not.

Thanks for the help in advance.

share|improve this question
add comment

1 Answer

A link (A tag) does not respect the "disabled" property as per the HTML spec, so if you have a "disabled" link then your developers have done something special to make it that way. Generally a "disabled" link is either not a link at all (text with styles applied to it such as a blue color and underline) or where the default behavior is overridden via javascript like so:

$('#link').click(function(e){
   e.preventDefault();
});

There are a number of other ways to get the effect as well. In order to determine whether a link is disabled, you would first have to determine how your developers actually faked the behavior of the "disabled" property. Based on what you find out, you may be able to determine whether the link is disabled by checking the class or other properties.

share|improve this answer
    
Thanks for the information. i will try it. –  Tom Mar 11 '13 at 10:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.