我收到以下错误:
[实用程序] [错误] [错误] java.lang.NullPointerException
at com.qa.FreeCRMPRO.Utils.ExcelUtil.getTestData(ExcelUtil.java:38) at com.qa.FreeCRMPRO.test.DealsPageTest.getEventInfo(DealsPageTest.java:96) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
这是我正在运行的代码
测试页
@DataProvider public Object[][] getEventInfo() { 对象数据[][] = ExcelUtil.getTestData(AppConstants.Add_Event_Sheet_Name); 返回数据;}
@Test(priority=6,dataProvider="getEventInfo") public void addEventDetails(String title,String calendervalue,String calender, String selectcalendervalue,String startdate,String enddate,String category, String description,String location,String deal,String alertbefore,字符串警报,字符串提醒时间,字符串分配给,字符串间隔,字符串天,字符串结束日期){交易页面。编辑事件(标题,日历值,日历,日历值,开始日期,结束日期,类别,描述,位置,交易,alertbefore,alertvia,a提醒时间,分配给,间隔,天,结束日期);
}
Pages.Java 类中定义的方法
public void EditEvent(String title,String calender,String addnewcalender,String calender1,
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)
{
elementutils.waitforElementPresent(AddEventbutton);
elementutils.doclick(AddEventbutton);
elementutils.waitforElementPresent(eventtitle);
elementutils.doSendKeys(eventtitle, title);
elementutils.waitforElementPresent(Calenderdropdownclick);
elementutils.doclick(Calenderdropdownclick);
elementutils.selectvaluefromdropdown(calendervalueselection, calender);
elementutils.waitforElementPresent(addnewCalenderName);
elementutils.doSendKeys(addnewCalenderName, addnewcalender);
elementutils.waitforclickingElement(savecalendername);
elementutils.doclick(savecalendername);
elementutils.selectvaluefromdropdown(calendervalueselection, calender1);
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);
}
Excel Util 在下面的行中显示错误 -
data[i][k] = sheet.getRow(i+1).getCell(k).toString();
- 有人可以让我知道问题出在哪里吗?