Synonyms for By trial and error:

adv.

all (adverb)
empirically, through empirical observation.

n.

by trial and error (noun)
empirically, through empirical observation.