in same class I have 10+ methods which represent test scenarios. So my testing starts with method Setup that basically gets parameters sent from testng.xml where I have defined them. Setup method all it does besides creating drivers etc. is to login on webapp, because that is something that is same for every test.
As I am doing testing by roles (Parent, Assistant, Doctor) every role has its own class and test scenarios. But role doctor has 2 login ( lets say there are 2 doctors but same tests for both). From the start Setup method gets login parameters for doc1 ,at one point one or 2 methods need to login to doc2.
Is there any way to have ONE class for Doctors but to be able to login to desired one(doc1 or doc 2 , all test should be the same for both) . Is it possible to have one testng.xml that has one or two tests where each have certain pair of params , but that could go to desired methods.
I tried making more in testng.xml so i had and same for "doc2" , both were looking at same and inside i defined which each had to include
This was mainly my approach for this problem , any other solution is accepted.
BDW I am using tesng,selenium,java Hope you understand , tnx in advance