Some of the key issues in educational psychology are the way of students' engagement at school, controlling anxiety, and academic achievement. In line with that, the purpose of the present study is to determine the relationship between variables that are basic psychological needs, academic engagement, and test anxiety with regard to structural equation modeling. Therefore, the cluster sampling of 289 female students of Hamedan province was carried out in some phases. Also, the participants were supposed to fill some questionnaires on aspects of academic engagement (Reeve & Tseng, 2011), basic psychological needs (La Guardia, 2000), and Ahwaz inventory test anxiety (2002). The results of structural equation modeling show that exogenous variable of basic psychological needs effects directly positive and significantly on academic engagement; also, effects directly negative and meaningfully on test anxiety. However, the indirect effect on test anxiety because of academic engagement is not significant. The justification is that the relationship between academic engagement and test anxiety is not meaningful. According to findings, basic psychological needs can be highlighted as the most important factor so as to increase academic engagement of students, and decrease their test anxiety.