Robinson traveled to Corpus Christi, Texas, in September 1845 to join Gen. Winfield Scott and the Army of Occupation as a regimental and brigade quartermaster. In June 1846, Robinson was promoted to first lieutenant and served in the Mexican–American War, fighting with distinction in the Battle of Monterey. He also was in action at the battles of Palo Alto and Resaca de la Palma. He served as regimental or brigade quartermaster between March 28, 1847 and September 1, 1847 and between January 27, 1849 and August 12, 1850.