Any or all of the attesting witnesses to any will may, at the request of the testator or, after the testator's death, at the request of the executor or any person interested under the will, make and sign an affidavit before any officer authorized to administer oaths in or out of this state, stating the facts to which they would be required to testify in court to prove the will, which affidavit shall be written on the will or, if that is impracticable, on some paper attached to the will, and the sworn statement of any such witness so taken shall be accepted by the court of probate when the will is not contested as if it had been taken before the court.