Forum Discussion

shiva_ranabhat's avatar
shiva_ranabhat
Contributor
9 years ago
Solved

Button.Enabled returning True for disabled button

Hi,    I'm having a trouble checking if a button is disabled or not. Please see the attached image for details  (script, gui & test Log).  Usually this feature works fine but not this time.   Th...
  • AlexKaras's avatar
    9 years ago

    Hi Shiva,

     

    Welcome to the 'creative' world of web development... :)

    Like all other guys have already said, there are usually a lot of ways to do this or that thing with the web object and different approaches might be used within the given tested web application depending on development team, used libraries, etc.

    For example, the object may have .Visible property set to True, but be invisible on the page because: its height or width is set to zero; or because some class or style is applied to it (or its parent) that makes it not visible; or because one of its parents is not visible; or...

    Note, that the opposite is also correct: if the parent of some object is not visible (or disabled) this does not necessarily mean that the object itself is not visible (or disabled) as well. So web test code should not rely on the parent's properties, but also check actual properties of the object itself.