While I can't speak to the middle ages specifically, Pliny the Elder suggests that gold mining in the first century CE did involve randomly tunneling when seeking deposits at depth:
The miners gaze as conquerors upon the collapse of Nature. And nevertheless even now there is no gold so far, nor did they positively know there was any when they began to dig; the mere hope of obtaining their coveted object was a sufficient inducement for encountering such great dangers and expenses.
(Emphasis mine, from Natural History book 33, volume 9 page 57 of <PERSON>'s 1938 translation.)
General placement of a mine would indeed be guided by surrounding geology (page 53):
People seeking for gold begin by getting up segullum -- that is the name for earth that indicates the presence of gold. This is a pocket of sand, which is washed, and from the sediment left an estimate of the vein is made.
Though <PERSON> does not detail the method of locating a silver deposit, he does state it is only found in deep shafts (p. 73) and describes a number of other minerals found in the same mines. Similarly, copper and iron are described in terms of the geology in which they may be found and are said to be found both on the surface and at depth, but both in easily-identified ores (book 34; p. 543
215, 233).
<PERSON> (p. 17) states that hydraulic mining of surface deposits was much more common than shaft mining and refers to <PERSON>'s statements, where water would be collected or redirected over areas known to contain deposits to expose ore at the surface or in runoff. <PERSON> also estimates that the scale of Roman mining was unmatched until the industrial revolution (p. 26), which may suggest similar techniques were used through the entire period up to the development of mechanized mining.
Interestingly, <PERSON> also observes that Roman industrial-scale mining generally ceased around the third century CE, possibly due to the immense cost of constructing infrastructure for hydraulic mining. Given suitable construction capability, hydraulic mining might have been more common throughout the intervening time. 543