TPS Interview Question

How the locators are created? How do you handle flaky tests?