我收到以下异常,请检查是否可以帮助我。
java.lang.NullPointerException
at com.cucumber.framework.stepdefinition.PersonalInfo.Personal_InfoSD.enter_the_EmpID(Personal_InfoSD.java:30)
代码:
package com.cucumber.framework.stepdefinition.PersonalInfo;
import com.cucumber.framework.PageObject.AddEmployeeForm;
import com.cucumber.framework.PageObject.Personal_InfoPage;
import com.cucumber.framework.configreader.ObjectRepo;
import com.cucumber.framework.helper.TestBase.TestBase;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
public class Personal_InfoSD {
Personal_InfoPage personalinfo;
AddEmployeeForm AddEmployee;
@Given("^navigate to application$")
public void navigate_to_application() throws Throwable {
TestBase.driver.get(ObjectRepo.reader.getWebsite());
}
@When("^user clicks on the Add employee button$")
public void user_clicks_on_the_Add_employee_button() throws Throwable {
AddEmployeeForm AddEmployee = new AddEmployeeForm(TestBase.driver);
AddEmployee.Click_Add_Emp_Button();
}
@When("^enter the EmpID \"([^\"]*)\"$")
public void enter_the_EmpID(String arg1) throws Throwable {
personalinfo.EnterEmpID(arg1);
}
}
对不起,如果我在提问时犯了错误,我是黄瓜工具的新手,请帮助我