A party to the record of any civil action or proceeding, or a person for whose immediate benefit such action or proceeding is prosecuted or defended, or the directors, officers, superintendent, or managing agents of any corporation which is a party to the record in such action or proceeding may be examined upon the trial thereof, or upon deposition, or both, as if under cross-examination at the instance of the adverse party and for that purpose may be compelled in the same manner and subject to the same rules for examination as any other witness to testify, but the party calling for such examination shall not be concluded thereby but may rebut it by counter testimony.