Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Assert element is not visible in front-end (but hidden and exists in DOM)

yiannis
yiannis Posts: 8

I have an element that is either hidden or visible in front-end. How do I verify when this is hidden from the user?

I tried Browser Contents -> Browser validation tool but it's options for expected value only reflect the DOM. The options do not check if the element is hidden or not. Is there another way?

Thanks in advance

Comments

  • jakubiak
    jakubiak Posts: 813 admin

    A hidden element could be hidden in one of two ways:
    1. The element is not present in the DOM
    2. The element is present in the DOM but has a property (or its parent has a property) that causes it to be hidden

    For the first case, you probably would need to add an XML Databank to the Browser Contents to validate that the element is not there. For the 2nd case, you need to know which property causes the element to be hidden, and configure the Browser Validation Tool to check the value of that property.

  • yiannis
    yiannis Posts: 8

    Thank you I did fix it by checking that the class="ng-hide" is not present for the specific element that I search.