Whenever a notice shall have been given of intention to contest an election, as provided in the preceding section, either party may proceed to take testimony of any witness before any judge, clerk of a court, or notary public, on giving to the adverse party or his attorney 10 days' notice of the time and place of taking the same, and one day in addition thereto (Sunday inclusive) for every 50 miles' travel from the place of residence of such party to the place where such deposition is to be taken. If the party entitled to notice resides in the county where the deposition is to be taken, 5 days' notice shall be sufficient.
10 ILCS 5/23-14