According to the properties of the pine tree trunk and its wide range of applications, finding its defects can play a vital role in reducing costs. Since the ultrasonic test is a non-destructive method, this method is an appropriate alternative to find defects in the pine tree trunks. Optimizing the ultrasonic non-destructive test is necessary because the correct choice of the ultrasonic test affecting factors increases the reliability of the test results. In this paper, at first, a simulation method for non-destructive ultrasonic tests in wooden parts using COMSOL Multiphysics software is presented. Both size and location of the defects have a considerable impact on the signal in the simulation. The defect size has a higher effect on signal amplitude and signal-to-noise ratio changes. So, the location of the defects is detected according to the amplitude of signals received in three points according to the method described in the paper. In the following, using the method of design of experiments, the effect of input factors containing frequency and signal amplitude on responses such as signal-to-noise ratio and loss of signal amplitude has been investigated. Results showed that these have an important effect on the output signal. Finally, the optimal simulation settings have been determined. According to the analysis, if the test frequency is 50 kHz and the amplitude of the input signal is 0.08 mm, the desirability value is equal to 100%, which indicates the high desirability of the ultrasonic test of wooden parts under the mentioned settings.