I want to automate following scenario:
Click on an image
Before destination page, server redirects me to another URL (e.g abc.com).
HTTP response--> 302 Found- There is another redirection URL (e.g def.com).
HTTP response--> 302 Found - Destination URL is reached (e.g XYZ.com)
HTTP response--> 301 Moved Permanently
I am interested in Step2. I just need to verify that (abc.com) received 302 response before xyz.com is reached. Is there any way to do so in Selenium Webdriver? If not, how can we implement in Java?