I am working in python Page Object for automation. I have a basePageObject(ChangePasswordPage) and it has 4 other child pages which differs by the by the fields on the page. All these change password page runs on the same URL but they differs with the fields and that depends with the use cases. For instance one has , old password field ,other has not , again one comes with security question and answers and like that. That's why I created the different child classes for all these variations.
Now my problem is , I have to write an operation that recursively tries to change the password with the sets of passwords given. I can't write that operation within the child change password page because that recursive operation requires the "changePassword" operation of the child classes. Furthermore , this recursive operation for each child classes is different. Its not the same for all the child classes. So which pattern suits best with this case. Where do I write this new recursive operation , how do I create new class and how can I apply OOP principles.