Re: [geb-dev] Re: Testing spring security protected pages

Skip to first unread message

Marcin Erdmann

Nov 29, 2016, 4:41:54 PM11/29/16
You shouldn't be passing your password and username as arguments to the via/to methods as these are used for advanced page navigation:

You should add a void login(String username, String password) method to your LoginPage which will perform the necessary actions to log in and then call it after reaching the LoginPage:

to(LoginPage).login("", "my_pwd")
at SitePage.


P.s. Please ask similar usage questions on the user list ( in the future. User list is followed by more people and this is a dev list intended for discussion about development of Geb itself.

On Fri, Nov 25, 2016 at 8:04 AM, Sohaiba Qazi <> wrote:
P.S: Currently I am getting the error:
Illegal character in path at index 11: login/auth/[, my_pwd]

On Friday, November 25, 2016 at 1:00:45 PM UTC+5, Sohaiba Qazi wrote:
Hi everyone!

I am using Geb version 0.9.1 and I want to be able to test Spring Security protected web pages. My goal is to access a 'site' page to perform some action through the 'login' page by using the correct username and password to login.This is what my test looks like:
 def "do_something_on_site_page"() {
        via LoginPage, ["", "my_pwd"]
        at SitePage

        //do something

        //verify action performed
I want to know two things:
1. how do we input multiple parameters when using the 'via' keyword?
2. how do we handle multiple redirects? Is there a better way to achieve this?

Thank you!

You received this message because you are subscribed to the Google Groups "Geb Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
To view this discussion on the web visit

For more options, visit

Reply all
Reply to author
0 new messages