Hi Tarun,
Please refer the attached files.
My Test class.
PageObjectExample.javaIt has the test method "testRegistrationNew" which takes the value from the data provider class. We have created the object Registration object. Suppose If I have another test scenario in the same Homepage, with different sets of data provider ( Eg. Some fields blank), the verification should be checking the error page. I need to write a separate test method for this verification. For this , do I need to create a new Registration object as defined in the first verify method?
I tried to initialize the Registration object in the constructor of PageObject, which can be used across multiple test methods as we do in normal java programs. Am I not allowed to do that ?
Let me know If I am not clear in my question or need any other .java files for your reference.
Thanks
Krithi