This is the script for Test Page using data provider :
@Test(priority=6,dataProvider="getEventInfo",enabled=true)
public void addEventDetails(String eventstitle,String calendervalues,String startdates,String enddates,String categorys,String descriptions
,String locations,String deals,String alertbefores,String alertvias,String remindertimes,String assignedtos,String intervals,String days,String finalenddates)
{
dealspage.EditEvent(eventstitle, calendervalues, startdates, enddates,categorys,descriptions,locations,deals,alertbefores,alertvias,
remindertimes,assignedtos,intervals,days,finalenddates);
Page which calls the Utils and also has the locators defined
public void EditEvent(String newtitle,String calender,
String startdates,String enddates,String catvalue,String desc,
String loca,String dealsselection,String alertbefore,
String alertviadrop,String remindtime,String assignedtoselect,String intervalvalue,String dayvalue,
String seldate)
{
try {
elementutils.waitforElementPresent(AddEventbutton);
elementutils.doclick(AddEventbutton);
elementutils.waitforElementPresent(eventtitle);
elementutils.doSendKeys(eventtitle, newtitle);
elementutils.waitforElementPresent(Calenderdropdownclick);
elementutils.doclick(Calenderdropdownclick);
elementutils.selectvaluefromdropdown(calendervalueselection, calender);
elementutils.waitforElementPresent(addnewCalenderName);
elementutils.waitforclickingElement(savecalendername);
elementutils.doclick(savecalendername);
elementutils.waitforclickingElement(Startdateclick);
elementutils.clickonCalender(startdatecolumselection, startdates);
elementutils.waitforElementPresent(enddateclick);
elementutils.doclick(enddateclick);
elementutils.waitforclickingElement(enddatecolumnselection);
elementutils.clickonCalender(enddatecolumnselection, enddates);
elementutils.waitforclickingElement(categoryEvent);
elementutils.doclick(categoryEvent);
elementutils.selectvaluefromdropdown(categoryEventvalue, catvalue);
elementutils.waitforElementPresent(description);
elementutils.doSendKeys(description, desc);
elementutils.waitforElementPresent(location);
elementutils.doSendKeys(location, loca);
elementutils.waitforElementPresent(alldaytoggle);
elementutils.doclick(alldaytoggle);
elementutils.waitforclickingElement(DealSearchicon);
elementutils.doclick(DealSearchicon);
elementutils.selectvaluefromdropdown(dealsdropdownselection, dealsselection);
elementutils.waitforElementPresent(Alertbefore);
elementutils.doclick(Alertbefore);
elementutils.selectvaluefromdropdown(Alertbeforevalue, alertbefore);
elementutils.waitforElementPresent(Alertviadropdown);
elementutils.doclick(Alertviadropdown);
elementutils.selectvaluefromdropdown(Alertviadropdownvalue, alertviadrop);
elementutils.waitforElementPresent(remindertime);
elementutils.doSendKeys(remindertime, remindtime);
elementutils.waitforElementPresent(Assignedto);
elementutils.doclick(Assignedto);
elementutils.selectvaluefromdropdown(Assignedtovalueselection, assignedtoselect);
elementutils.waitforclickingElement(Recurrenceset);
elementutils.doclick(Recurrenceset);
elementutils.waitforElementPresent(intervaldropdownlick);
elementutils.doclick(intervaldropdownlick);
elementutils.selectvaluefromdropdown(intervalvalueselect, intervalvalue);
elementutils.waitforElementPresent(days);
elementutils.doclick(days);
elementutils.selectvaluefromdropdown(daysvalueselect, dayvalue);
elementutils.waitforElementPresent(Endat);
elementutils.doclick(Endat);
elementutils.waitforElementPresent(selectdate);
elementutils.clickonCalender(selectdate, seldate);
elementutils.waitforElementPresent(setbutton);
elementutils.doclick(setbutton);
elementutils.waitforElementPresent(saveevent);
elementutils.doclick(saveevent);
}catch(Exception e)
{
System.out.println("Element is not clickable");
}
}
What I have tried:
have tried to implement waits but there is no solution getting the same error:
below is the stacktrace:
Caused by: java.lang.NullPointerException
at com.qa.FreeCRMPRO.Utils.ExcelUtil.getTestData(ExcelUtil.java:41)
at com.qa.FreeCRMPRO.test.DealsPageTest.getEventInfo(DealsPageTest.java:96)
Error: is caused in this line:
Caused by: data[i][k] = sheet.getRow(i+1).getCell(k).toString();