How would you design a test automation framework from scratch for a web application with dynamic elements?