Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

Do anyone know any tool in which we get broken links of the site?

Open 3 Answers 65 Views
0 3
Do anyone know any tool in which we get broken links of the site but the site has authentication ie username and password?

I tried with Xenu, Link checker but that does not work.
commented by (52 points)
Xenu link checker tool. It is open source and free tool.

3 Answers


This is Xenu link checker tool. easy and effective tool.
answered by (52 points)
Have you tried

Screaming Frog SEO Spider? That lets you find broken link.
answered by
I have  done broker link in selenium web driver and find all link which are broken and also get http codes
answered by (748 points)
commented by (552 points)
Can you provide little more idea of how you did that?
commented by (748 points)
package selenium;

import java.util.List;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.HttpClientBuilder;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class FindBrokenLinkExample {
    private WebDriver driver;
    private int invalidLinksCount;

    public void setUp() {
        System.setProperty("webdriver.firefox.marionette","E://Users//Bharat Varshney//workspace//drivers//geckodriver.exe");
        driver = new FirefoxDriver();

    public void validateInvalidLinks() {

        try {
            invalidLinksCount = 0;
            List<WebElement> anchorTagsList = driver.findElements(By .tagName("a"));
            System.out.println("Total no. of links are "+ anchorTagsList.size());
            for (WebElement anchorTagElement : anchorTagsList) {
                if (anchorTagElement != null) {
                    String url = anchorTagElement.getAttribute("href");
                    if (url != null && !url.contains("javascript"))
                    } else

            System.out.println("Total no. of invalid links are " + invalidLinksCount);

        } catch (Exception e)

    public void tearDown() {
        if (driver != null)

    public void verifyURLStatus(String URL) {

        HttpClient client = HttpClientBuilder.create().build();
        HttpGet request = new HttpGet(URL);
        try {
            HttpResponse response = client.execute(request);
            // verifying response code and The HttpStatus should be 200 if not,
            // increment invalid link count
            ////We can also check for 404 status code like response.getStatusLine().getStatusCode() == 404
            if (response.getStatusLine().getStatusCode() != 200)
        } catch (Exception e) {

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.