In this study, we propose a Rao's score (RS) statistic (Lagrange multiplier (LM) statistic) to test for endogeneity of the spatial weights matrix in a spatial autoregressive model. To achieve this, we start with a spatial autoregressive model with an acceptable form for the generating process for the elements of the endogenous spatial weights matrix as in Qu and Lee (2015). Our test statistic is simple to calculate because it requires computationally simple estimations. By construction, the test statistic is robust in the sense that its asymptotic null distribution is a centered chi-square distribution regardless of the (local) presence of a spatial autoregressive parameter in the alternative model. We summarize the asymptotic properties of our test statistic under the null and the alternative hypotheses. To investigate its finite sample size and power properties, we conduct a Monte Carlo study. The results are in line with our theoretical findings and indicate that the robust test has good size and power properties.