Hi there,

TLDR: Is there a way to call this.refresh() or something from within a geb 
module itself to re-instantiate it the module when its reference is stale?

I have a dynamic web element on my page. A geb module is made for this web 
element, based on a class name.

Single clicking selects the element (gets class 'selected' added to it in 
DOM)
When it's selected, and you doubleclick on this element, it  
'opens'/unfolds. 
In reality, whenever the element is selected, or opened, they disappear for 
a split-second from the page, then reappear.
So, I see it as the same module, but the geb module is now a stale 
reference whenever it's selected or opened.

In my test, the way to deal with this, is to first select (click) on the 
element matching my identifiers, wait a bit, then search for it again and 
doubleclick it.
But I wish to hide all this from the test itself, that's what geb is for 
right?

If I wish to abstract this and just have a custom method 'open()' in this 
geb module that:
- if element is not selected (it has classname: 'selected'): then click it. 
wait a bit
- then if it's selected, double click it

Then in between I need to 'refresh' it, search for the element again. But I 
don't want to have to do this behaviour from 

I see two options
1) Use some sort of this.refresh() command (does it exist?)
2) Move this method to the page object, and re-'instantiate' the geb module 
from there inbetween.

Any advice?


-- 
You received this message because you are subscribed to the Google Groups "Geb 
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/geb-user/6f16b99e-bbbf-464c-af1c-5b88c38c4a32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to