In order to write automated test cases for web apps which run functional tests in the browser, you have to use a tool such as the Selenium library, as we have in this article. You will also need to use a test framework such as TestNG or JUnit.