Automating a multi-step process on a web application with dynamic elements presents several challenges, it's a live process, you need do maintance often. I often use tools like: Selenium to manipulate the broswer (https://www.selenium.dev/) and behave to write the UI test (https://behave.readthedocs.io/en/latest/)
I have this repo that i using the basic from this tools to test the google and github pages : https://github.com/Douglas019BR/bdd-study