The invention discloses an
automatic testing method for on-demand card swiping through a
metronome, and belongs to the field of
automatic testing. The method specifically comprises the steps that firstly, the negative
electrode of the
metronome is connected with an output port of auxiliary equipment, and power-on and power-off of the
metronome are controlled through the auxiliary equipment; then, a control script is developed by utilizing a
Python programming language, and the state of an output port is remotely controlled; then, the NFC card is fixed on a metronome pointer, and it is ensured that the card is close to or makes contact with a reading area of the tested card swiping device in the swinging process; key parameters needed by testing are preset in the control script or input through command line parameters, the control script is started, after connection of the auxiliary equipment and the tested card swiping equipment is initialized, a metronome is controlled to conduct simulated card swiping according to the preset card swiping frequency and frequency, and meanwhile a testing result is monitored and recorded; and after the test is finished, the script automatically summarizes
test data to generate a
test report. According to the invention, the accurate
simulation of the card swiping process is realized, and the flexibility and
controllability of the test are greatly improved.