I have initilized XLS object in base class @BeforeTest annotation . It is getting null value in second @Test Annotation . i have executed the suite through testng.xml file which is mentioned below .
<?xml version="1.0" encoding="UTF-8"?>
<suite name="jet-Airways">
<test name="regression">
<classes>
<class name="com.framework.flightbooking.LoginTest"/>
<class name="com.framework.flightbooking.FlightTest"/>
</classes>
</test>
</suite>
Instructor
Ashish Thakur Replied on 05/07/2019
Did you try debugging the code?
yes, i debug my code and found that methods of 1st class executed successfully but when 2nd class method is executed it starts from @BeforeMethod , but xls object is initilized in @BeforeTest which is why xls is null .
please advice where to initilize xls object .
Instructor
Ashish Thakur Replied on 05/07/2019
Which module are you referring to?
Hybrid framework with TestNG. Creating basetest class . Where we initilize xls inside @BeforeTest annotation.
Instructor
Ashish Thakur Replied on 08/07/2019
You can try initializing your XLSReader in before Method as well.