Search code examples
grailsgeb

How to make an element visible using Geb?


I have an element with class "popup", which i want to make visible during a functional test. What is the best way to programmatically make the element visible? I am using Geb for functional testing.


Solution

  • If you use Jquery in your web pages. You could use jquery "show" method to make visible an invisible element. The code would look like this

     $(".popup", 0).jquery.show();
    

    Note : As per documentation, the jQuery integration only works when the pages you are working with include jQuery, Geb does not install it in the page for you.