Reputation: 55
I have more than 100's of URL's which will be redirecting (301 redirects) to a new page. Since i do not want to manually verify each link redirection, is there a way any tool/api or script that would aid me in automating these steps. Takes input URL, checks for expected URL and gives me the correct HTTP status.
I did try to write a Java webdriver script which reads excel file to fetch Test URL, Expected URL & Actual URL on execution. Script opens the browser and checks for the page redirection. Sometimes i need to login into the page to check redirection. I felt the entire program was taking more time to execute for 100's of URL's since its browser(GUI) based...
Any script that can help me check for redirection and HTTP status would be great!
Any feedback greatly appreciated. Cheers
Upvotes: 0
Views: 2472
Reputation: 11
So depending on what you mean by "login into the page to check redirection". You could write a script that uses HttpURLConnection: http://docs.oracle.com/javase/7/docs/api/java/net/HttpURLConnection.html
Just write a program with a thread that periodically connects through the HttpURLConnection and checks the status of the request.
Upvotes: 1