No, unfortunately it's not possible to obtain that in an overridden method.
You should be instead using navigator events support added in 3.2 (see
https://gebish.org/manual/current/#listening-to-navigator-events). The
navigator passed to NavigatorEventListener#afterClick will be an instance
of geb.content.TemplateDerivedPageContent (note its getRootContainer() and
getContentType() methods) when a page content element is clicked.

On Sat, Nov 23, 2019 at 1:48 PM Jeevan Adiga <[email protected]> wrote:

> Hi Marcin,
>
> Follow-Up Question,
>
> Provided below page representation,
> class LoginPage extends BasePage {
>
>     static  at = {
>        username.displayed
>    }
>
>     static content = {
>        username(wait:true) { $("#username input", 0) }
>        password(wait: true) { $("#password input")}
>        signIn(wait:true) { $("#confirmButton button") }
>    }
> }
>
> Is it possible to retrieve *Navigator name* and *Page class name* in
> overridden method(click) in NonEmptyCustomNavigator??
> ie,
>  @Override
>  Navigator click() {
>      ensureContainsSingleElement("click")
>      contextElements.first().click()
>      log.info("[" + <<NAVIGATOR NAME>> + "] Click element")
>      this
>  }
>
> *Output with above implementation is*
> 2019-11-23 19:09:49 INFO  NonEmptyCustomNavigator - [[[ChromeDriver:
> chrome on XP (72de0f6d86d80aaecb4981bdabb949db)] -> css selector:
> #logi_confirmButton button]] Click element
>
> *Expected output: *Provided navigator *signIn in LoginPage*
> 2019-11-23 19:09:49 INFO  NonEmptyCustomNavigator - [signIn] Click
> element                                         // retrieve navigator name
> *OR*
> 2019-11-23 19:09:49 INFO  NonEmptyCustomNavigator - [LoginPage -> signIn]
> Click element                   // // retrieve navigator name and page name
>
> Thank you
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/geb-user/8942a582-07f4-471f-94d7-44673ab4572c%40googlegroups.com
> <https://groups.google.com/d/msgid/geb-user/8942a582-07f4-471f-94d7-44673ab4572c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/geb-user/CA%2B52dQSOaijLdprGOt-jW%2Bf-rTUFQXEu%2By1w7AJih7SfpPFuBw%40mail.gmail.com.

Reply via email to