In this study, we propose simple test statistics for identifying the source of spatial dependence in spatial autoregressive models with endogenous weights matrices. Elements of the weights matrices are modelled in such a way that endogenity arises when the unobserved factors that affect elements of the weights matrices are correlated with the unobserved factors in the outcome equation. The proposed test statistics are robust to the presence of endogeneity in the weights and can be used to detect spatial dependence in the dependent variable and/or the disturbance terms. The robust test statistics are easy to calculate as computationally simple estimations are needed for their calculations. Our Monte Carlo results indicate that these tests have good size and power properties in finite samples. We also provide an empirical illustration to demonstrate the usefulness of the robust tests in identifying the source of spatial dependence.