In this paper, we present the macro stress test with a credit risk approach for banking system of Iran during the period 2004Q1-2019Q4. The goal is to evaluate the vulnerability of the banking system through credit risk to the country economic shocks. In this regard , the developed method of Wilson (1997) Credit Portfolio View model including macroeconomic variables and default rate has been used. The results of the applied analysis show that the nominal exchange rate has a significant and positive effect on default rate or credit risk and the variables of the inflation rate, economic growth, loan growth, and liquidity rate have a less negative effect and considering that the economic recession during the studied period, the unemployment rate has had the most positive and destructive effect on the credit risk. Using Mont Carlo simulation and calculating the risk value and expected losses for each of the economic variables, the capital required by banks to cover losses is obtained. The results of the credit risk stress test show that an adverse scenario due to nominal exchange rate shock with a standard deviation has the greatest impact on the amount of capital required to cover unexpected losses compared to the baseline scenario and banks need less capital to cover their losses. But to cover the losses caused by the shocks of other variables, it is necessary to increase their capital. In general, according to the obtained results from the simulation and checking the distribution of credit losses, the banking system except for the nominal exchange rate variable is not resilient to cover losses due to shocks from other variables.