did it also take place in the trenches?
Yes, trench raiding was done by the Canadian Corps.
Battle of Vimy Ridge
Trench raiding involved making small-scale surprise attacks on enemy positions, often in the middle of the night for reasons of stealth. All belligerents employed trench raiding as a tactic to harass their enemy and gain intelligence. In the Canadian Corps trench raiding developed into a training and leadership-building mechanism.
who participated in the battle of vimy ridge Four divisions of the Canadian Corps in the First Army, against three divisions of the German 6th Army. where did it take place? In the Nord-Pas-de-Calais region of France.
wiki:13486873
Battle of Vimy Ridge [SEP] Trench raiding
Trench raiding involved making small-scale surprise attacks on enemy positions, often in the middle of the night for reasons of stealth. All belligerents employed trench raiding as a tactic to harass their enemy and gain intelligence. In the Canadian Corps trench raiding developed into a training and leadership-building mechanism. The size of a raid would normally be anything from a few men to an entire company, or more, depending on the size of the mission. The four months before the April attack saw the Canadian Corps execute no fewer than 55 separate trench raids. Competition between units even developed with units competing for the honour of the greatest number of prisoners captured or most destruction wrought.