The cost of every contested election shall include only the expenses of serving notices, taking depositions and the allowances to witnesses; and shall be noted at the foot of every deposition or set of depositions, by the person taking the same. If the contestant fails in setting aside the election, there shall be awarded against him the amount of such costs incurred or expended by the person who was returned or declared elected. Otherwise, each party shall pay his own costs; unless it appears that the person returned or declared elected was guilty of fraud or malpractice in the election, or in procuring such return or declaration, in which case costs shall be awarded against him in favor of the contestant. Where costs are awarded in favor of either party, the amount thereof shall be ascertained under direction of the house joint session, or court, which decides the case, and a certificate thereof, authenticated by the signature of the presiding officer, shall be delivered to the party in whose favor they are awarded, which certificate shall have the force of a judgment, and if such costs be not paid within ten days after the date thereof, the clerk of the circuit court, of the county in which the party against whom the costs were awarded resides, may issue execution on such certificate, upon its delivery to such clerk, in like manner as upon a judgment of the circuit court. But no person contesting the seat of another in the Legislature shall be entitled to pay or mileage if the contest fails.