celerity icon indicating copy to clipboard operation
celerity copied to clipboard

How to get intermediates pages during redirection 302

Open falaise opened this issue 13 years ago • 1 comments

Hi,

For instance, I have something like :

br= Celerity::Browser.new

br.goto foo

and br.url gives bar because foo redirect to bar. I wish to parse also the body of page foo.

If i set a listener on :web_window_event I receive something like :

WebWindowEvent(source=[TopLevelWindow[name=""]] type=[CHANGE] oldPage=[null] newPage[HtmlPage(bar)@920503681]

Regards

falaise avatar Jul 13 '11 09:07 falaise

I saw a posting where the whole redirect chain is visible in HTMLUnit but cucumber specification flowed well by simply breaking the HTML Unit auto redirect processing by

@browser.webclient.setRedirectEnabled(false) where @browser in my Celerity browser

This makes examining the content of the redirect possible and response code

A convenient implementation in cucumber is to put it under its own tag and reduce load in the test steps

Before('@disable-auto-redirect') do @browser.webclient.setRedirectEnabled(false) end

Hope this helps

Matthew

matthewbretherton avatar Nov 23 '11 01:11 matthewbretherton