Economic crisis imposes extensive losses on banks and credit institutions, thereby increasing their credit risk and dissolution. In fact, the economic conditions of countries are the major cause of financial stress, the destructive effects of which can greatly be reduced by accurate risk management in the banking system. This study aims to examine stress testing in the Iranian banking system by using the data of Iranian banks from 2008 to 2017. The results in the panel VAR framework and Monte Carlo simulation by using macroeconomic variables and credit risk show that the Iranian banking system is mostly affected by the scenarios of long-term shock in the macroeconomic factors of the country. In other words, changes in one period of the variables have a minimum effect on credit risk. However, a three-period horizon of interest rate and the inflation rate has the maximum effect, while economic growth has the minimum effect on the degree of default in Iranian banks.