In my framework, I am getting data from DataProvider but since data has detail about browser detail, I am unable to pass the data to Before Method for WebDriver initialization purpose.
How can we pass data to beforeMethod or other class. My Framework is based on POM design.
-----------------------------Test Class-----------------------------
public class LoginTestSP extends BaseTest {
@Test(dataProvider="getData")
public void test(Hashtable<String,String> data) {
}
----------------------------- Base Test Class-----------------------------
public class BaseTest extends BasePage {
public WebDriver driver;
@BeforeMethod
public void initalize() {
String browser = data.get("Browser");
System.out.println(browser);
}
Instructor
Ashish Thakur Replied on 24/11/2020
No You cant do that..