Awesome Marcin!. This works :)  Many thanks for your detailed explanation.

On Tue, 9 Aug 2016 at 21:24 Marcin Erdmann <[email protected]>
wrote:

> Hi Bala,
>
> This is not working anymore because modules now resolve their bases
> eagerly. To make this work again you will need to ensure that your module
> base resolves into an element within the frame by wrapping its definition
> in a withFrame block:
>
> class BasePage extends Page {
>     static at = { abc.pageTitle == "XYZ" }
>      static content = {
>         abc {
>             withFrame('body') {
>                 module AbcModule
>             }
>         }
>     }
> }
>
> Note that I'm using a different signature of withFrame(), one that takes a
> frame name or id - this is to avoid a problem of element that backs the $()
> method being scoped inside the wrong frame. You will also have to do that
> inside of your module class:
>
> class AbcModule extends Module {
>     static content = {
>         pageTitle {
>             withFrame('body') {
>                 $(".pagetitle").text()
>             }
>         }
> }
>
> Hope this helps,
> Marcin
>
> On Tue, Aug 9, 2016 at 7:55 AM, Balaji KM <[email protected]> wrote:
>
>> Hi Marcin,
>>
>> Thanks for responding. To reproduce this issue, I created a small geb
>> project.
>>
>> https://gitlab.com/balajilinks/GebModuleError
>>
>> I used the following website to reproduce this error.
>> http://www.quackit.com/html/templates/frames/frames_example_3.html
>>
>>
>> In the above project, At checking works fine with 0.9.3 version but it
>> fails with 0.13.1.
>> I got element not found exception.
>>
>> Regards,
>> Bala
>>
>>
>> On Monday, 8 August 2016 21:10:14 UTC+1, Marcin Erdmann wrote:
>>>
>>> Hi Bala,
>>>
>>> Can you please explain in detail what "no longer working" means in this
>>> case? What is the error your seeing? Are you seeing an exception with a
>>> stacktrace? I would expect the code you posted to work just fine.
>>>
>>> Marcin
>>>
>>> On Thu, Aug 4, 2016 at 11:42 AM, Balaji KM <[email protected]> wrote:
>>>
>>>> Hi Guys,
>>>>
>>>> Currently I am in the process of migrating from 0.9.3 to 0.13.1.
>>>>
>>>> My web application got 2 frames.  I defined Modules for both the
>>>> frames.
>>>>
>>>> Module Class
>>>> class AbcModule extends Module {
>>>>
>>>>     static content = {
>>>>         bodyFrame { $("frame",name:'body')}
>>>>         pageTitle {
>>>>             withFrame(bodyFrame) {
>>>>                 $(".pagetitle").text()
>>>>             }
>>>>         }
>>>>
>>>> }
>>>>
>>>>
>>>>
>>>> Page Class
>>>>
>>>>
>>>> class BasePage extends Page {
>>>>
>>>>     static at = { abc.pageTitle == "XYZ" }
>>>>
>>>>      static content = {
>>>>         abc { module AbcModule}
>>>>     }
>>>>
>>>> }
>>>>
>>>>
>>>> This code works fine in 0.9.3.
>>>>
>>>>
>>>> In 0.13.1, this code no longer working.
>>>>
>>>>
>>>> From 0.13.1 onwards, It works only If I specify withFrame(abc.bodyFrame) 
>>>> inside my Page class. I tried setting base for my module with frame name,
>>>>
>>>> which didn't work.
>>>>
>>>>
>>>> I would like to call module elements in Page class, without calling 
>>>> withFrame everytime. Is this possible?
>>>>
>>>>
>>>> Any pointers will be much appreciated.
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Bala
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> 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/a2658feb-4e56-4035-af5e-d561c2096d08%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/geb-user/a2658feb-4e56-4035-af5e-d561c2096d08%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> --
>> 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/3f04ee3e-d2b8-4791-a5e9-cb651751c2e8%40googlegroups.com
>> <https://groups.google.com/d/msgid/geb-user/3f04ee3e-d2b8-4791-a5e9-cb651751c2e8%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Geb User Mailing List" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/geb-user/uxgcgWgmGYE/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CA%2B52dQRVgGCkHQaLOwcRdR9cO0vCVn%3DxYYYFBnCqtKcfTSjLDg%40mail.gmail.com
> <https://groups.google.com/d/msgid/geb-user/CA%2B52dQRVgGCkHQaLOwcRdR9cO0vCVn%3DxYYYFBnCqtKcfTSjLDg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAH768Lo76Li05MqZ_mF5horuNL7Huh%3D%2BCtONRZqSY8vuvyP6eA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to