Either party may take proof by depositions according to the rules or orders of the court, or have the witnesses examined in open court at pleasure.