This study is dedicated to develop an on-line automatic optical bench tester (OBT) machine for evaluating the image quality of a camera lens that is used in a lens module of a cell phone. This tester is not only suitable for conventional solid lens, but also applicable to the developing cutting-edge tunable liquid crystal lens. The testing is accomplished via a specially-designed OBT machine, which is able to automatically move the test lens based on feedback images in the optical system in the OBT to the axial position that leads to best imaging quality and also successfully measure its focus length. In the designed OBT, a commercial inspection chart is employed, along with an automatic lens-feeding machine for a quick estimate on the best possible focusing quality, which is evaluated by the well-known modulation transfer function (MTF). For actuating the feeding machine, an algorithm, assisted by the feedback MTFs, is proposed to move the test lens to the particular position that renders the best quality. In this way, the focus length - effective focal length (EFL) - of the test lens can be obtained. The proposed algorithm in fact needs much less time of actuation than a traditional tester to obtain EFL of the test lens. The designed and constructed tester is capable of measuring varied optical performance indices for the next-generation tunable lens, like liquid crystal lens.