This paper proposes two Hausman-type tests respectively for individual and time effects in a two-way error component regression model by comparing estimators of the variance of the idiosyncratic error at different robust levels. They are both robust to the presence of the other effect, and the test for the individual effect has a larger asymptotic power than the corresponding ANOVA F test when the effects are correlated with covariates. Tests jointly for both effects are also discussed. Monte Carlo evidence shows their good size properties and better power properties than competing tests, and the application to the crime rate study gives further support.