Navigate the browser back in nightwatch tests

1,149 views
Skip to first unread message

Oliwia Golec

unread,
Jul 22, 2014, 11:43:46 AM7/22/14
to nightw...@googlegroups.com
Hi,

I'm trying to navigate the browser back in my tests - it is vital to execute clicking the back button, not just replacing that with executing previous url. I did a small research in API, stackoverflow etc., but everywhere it is driver that is being used, not client. So my question is - I hope that it makes sense - how can I directly use driver in my tests? Or is there any other way to execute "navigate back" action?

Bests,
Oliwia

davidlinse

unread,
Jul 22, 2014, 2:10:00 PM7/22/14
to nightw...@googlegroups.com
One is driven by the other.. So it's actually the same i guess.

Iirc the "navigate back" command/step/api-mapping is currently not implemented, 
but not sure about that. I hope i got you right.. 
~david

Oliwia Golec

unread,
Jul 23, 2014, 6:33:16 AM7/23/14
to nightw...@googlegroups.com
To anyone having the same problem - I just found the solution. First, you need to use the custom selenium command "execute()" and pass the function: "window.history.back()" as a parameter. So it looks like this:

            client.execute(function () {
                window.history.back()
            })
Reply all
Reply to author
Forward
0 new messages