We show that robust laser pulses can be obtained by a sampling-based method to achieve a desired photoassociation probability when uncertainties in potential curves and laser amplitudes are considered. Optimal control simulations are performed using a time-dependent wave packet method based on a single electronic state. We use a small number of samples to construct a robust field and test the performance of this field using additional samples. Excellent outcomes are obtained based on the proposed method for different uncertainties. The robust control field achieves higher average photoassociation probabilities over the tested samples, in comparison with the probabilities achieved by the optimal field designed without using the sampling-based method. The sampling-based method may also be promising in the robust control of other molecular control goals.