Narrative:

We arrived at ZZZ and were advised that we had been swapped to an aircraft that just finished maintenance. We went through the terminal to the new gate and after identification's were checked; proceeded to the airplane. The door was closed which is normal for a significant amount of first departures so I looked through the viewing port verified no flag was present and opened the door. After opening the door a mechanic that was inside the airplane asked why I opened it they were running tests including something with the pressurization and that I could have been hurt. I asked him why he didn't put the flag over the window and his response was that isn't their procedure. I had no way to see inside the flight deck and had no reason to believe someone was on the aircraft because I was told maintenance was finished with it by the agents.

Google
 

Original NASA ASRS Text

Title: Flight Crew arriving at airplane parked at gate; was not informed that maintenance was being accomplished.

Narrative: We arrived at ZZZ and were advised that we had been swapped to an aircraft that just finished maintenance. We went through the terminal to the new gate and after ID's were checked; proceeded to the airplane. The door was closed which is normal for a significant amount of first departures so I looked through the viewing port verified no flag was present and opened the door. After opening the door a mechanic that was inside the airplane asked why I opened it they were running tests including something with the pressurization and that I could have been hurt. I asked him why he didn't put the flag over the window and his response was that isn't their procedure. I had no way to see inside the flight deck and had no reason to believe someone was on the aircraft because I was told maintenance was finished with it by the agents.

Data retrieved from NASA's ASRS site and automatically converted to unabbreviated mixed upper/lowercase text. This report is for informational purposes with no guarantee of accuracy. See NASA's ASRS site for official report.