Well this might look little complex to have different class for all the objects & action methods. But it has lot's of benefits following Page Object Model design. It increases code reusability, readability, and gives you more control to maintain and update your test objects. It also makes your test classes clean. Easy to understand. If you put everything within a test class, it would be impossible to manage in real life. To understand better, please go through our 'Page Object Model' related videos. Thanks!
Sir, why do you create objects and methods for everything when the task can be done in a single line within a class?
Well this might look little complex to have different class for all the objects & action methods. But it has lot's of benefits following Page Object Model design. It increases code reusability, readability, and gives you more control to maintain and update your test objects. It also makes your test classes clean. Easy to understand. If you put everything within a test class, it would be impossible to manage in real life. To understand better, please go through our 'Page Object Model' related videos. Thanks!