如何纠正Java空指针异常

时间:2019-05-07 10:58:46

标签: java selenium selenium-webdriver testng

我是硒学习的新手,请有人纠正我在运行测试时遇到的以下错误。

  

失败:在以下位置创建了rafttopportunity java.lang.NullPointerException   com.qa.testcases.CreateOpportunityTest.createdraftopportunity(CreateOpportunityTest.java:35)     在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)

@Test(priority=1)
    public void createdraftopportunity() {
    homepage.create_opportunity();
    createopportunity.draftopportunity();}
public void draftopportunity(){
    driver.findElement(By.id("create-opportunity-save-button")).click();}

0 个答案:

没有答案