Functional size measurement provides a solid ground throughout software projects to estimate planning parameters and track progress. Since it is time-consuming and costly when functional size measurement is made manually, automating the process of measurement has gained importance. In order to measure COSMIC functional size, in this study we propose a measurement procedure that automatically installs measurement library code into an application and calculates size during the execution of user scenarios at run-time. The procedure is targeted to measure functional size of three-tier web applications developed in Java by following an iterative methodology in a software development institute. The procedure has been implemented as a software package and tested to measure functional size of a part of software product currently in use by a government-based organization. We report that functional sizes measured manually and automatically were %94 convergent and that automatic measurement took 8 minutes which was 1/34 of manual measurement effort. This study explains measurement library, procedure and software together with example measurement and its verification.