cache
Default value: false
The cache option controls whether or not the definition is evaluated each time the content is requested--
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 geb-user+unsubscribe@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/38944bfb-daaf-4eac-a803-93583ea5e0bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Geb indeed evaluates templates on every call but there are multiple situations when results of that evaluation are "cached" in the context of what you're doing. To name three:1. Some operations are not atomic. What I mean by that is what looks like a single Geb call results in multiple WebDriver calls. Take $(".description").text() - it actually results in two calls, one to locate the element(s) having description as the class and one to obtain the text of that element. If the element is removed from the DOM in-between the two calls you will get a StaleElementException.2. Geb's modules have a concept of base element. That element is located when an instance of a module is created and "cached" for the lifetime of that instance. So if you are calling any methods on instance of a module and its base element has been removed from the DOM then you will get a StaleElementException.3. If you assign elements returned from evaluation of content definitions to a variable and then call multiple methods on that variable then you are effectively "caching" that element in that context. If the element is removed from the DOM between being assigned to the variable and the method calls will get a StaleElementException.
On Fri, Sep 22, 2017 at 12:46 AM, Samuel Rossinovic <samuel.r...@gmail.com> wrote:
I am confused about those exceptions I'm seeing on content elements.In Geb's manual, I read:cache
Default value: false
The cache option controls whether or not the definition is evaluated each time the content is requestedSo, if Geb evaluates content templates on every access, how can stale element exceptions occur?Thanks
--
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 geb-user+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+unsubscribe@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/540478f0-3217-43d4-8ddc-8f90b280bd36%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+unsubscribe@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/2eb37c21-5a54-4245-af39-9fb0ec3a28ea%40googlegroups.com.