ERROR]编译错误:[INFO]
  -------------------------------------------------- ----------- [错误] /C:/Users/PoojaPatange/eclipse-workspacepractice/webAutoTest/src/main/java/webAutoTest/CitrussTV/UAEArabicCODClass.java:[19,18]
  软件包org.testng不存在[错误]
  / C:/用户/PoojaPatange/eclipse-workspacepractice/webAutoTest/src/main/java/webAutoTest/CitrussTV/UAEArabicCODClass.java:[20,18]
  软件包org.testng不存在[错误]
  / C:/用户/PoojaPatange/eclipse-workspacepractice/webAutoTest/src/main/java/webAutoTest/CitrussTV/UAEArabicCODClass.java:[21,30]
  软件包org.testng.annotations不存在[错误]
  / C:/用户/PoojaPatange/eclipse-workspacepractice/webAutoTest/src/main/java/webAutoTest/CitrussTV/UAEArabicCODClass.java:[22,30]
  软件包org.testng.annotations不存在[错误]
  / C:/用户/PoojaPatange/eclipse-workspacepractice/webAutoTest/src/main/java/webAutoTest/CitrussTV/UAEArabicCODClass.java:[23,30]
  软件包org.testng.annotations不存在[错误]
  / C:/用户/PoojaPatange/eclipse-workspacepractice/webAutoTest/src/main/java/webAutoTest/CitrussTV/UAEArabicCODClass.java:[24,30]
  软件包org.testng.annotations不存在[错误]
  / C:/用户/PoojaPatange/eclipse-workspacepractice/webAutoTest/src/main/java/webAutoTest/CitrussTV/UAEArabicCODClass.java:[25,39]
  包com.relevantcodes.extentreports不存在[错误]
  / C:/用户/PoojaPatange/eclipse-workspacepractice/webAutoTest/src/main/java/webAutoTest/CitrussTV/UAEArabicCODClass.java:[26,39]
  包com.relevantcodes.extentreports不存在[错误]
  / C:/用户/PoojaPatange/eclipse-workspacepractice/webAutoTest/src/main/java/webAutoTest/CitrussTV/UAEArabicCODClass.java:[27,39]
  包com.relevantcodes.extentreports不存在[错误]
  / C:/用户/PoojaPatange/eclipse-workspacepractice/webAutoTest/src/main/java/webAutoTest/CitrussTV/UAEArabicCODClass.java:[35,9]
  找不到符号符号:类ExtentReports位置:类
  webAutoTest.CitrussTV.UAEArabicCODClass [错误]
  / C:/用户/PoojaPatange/eclipse-workspacepractice/webAutoTest/src/main/java/webAutoTest/CitrussTV/UAEArabicCODClass.java:[36,9]
  找不到符号符号:类ExtentTest位置:类
  webAutoTest.CitrussTV.UAEArabicCODClass [错误]
  / C:/用户/PoojaPatange/eclipse-workspacepractice/webAutoTest/src/main/java/webAutoTest/CitrussTV/SendEMailcitruss.java:[5,1]
  软件包javax.mail不存在[错误]
  / C:/用户/PoojaPatange/eclipse-workspacepractice/webAutoTest/src/main/java/webAutoTest/CitrussTV/SendEMailcitruss.java:[6,1]
  软件包javax.mail.internet不存在[错误]
  / C:/用户/PoojaPatange/eclipse-workspacepractice/webAutoTest/src/main/java/webAutoTest/CitrussTV/UAEArabicCODClass.java:[317,31]
  找不到符号符号:类ITestResult位置:类
  这里的webAutoTest.CitrussTV.UAEArabicCODClassenter图像描述

最佳答案

如下所示在Eclipse中安装TestNG:


Eclipse->帮助-> Eclipse Marketplace
搜索TestNG->搜索结果显示“ TestNG for Eclipse”
安装


安装后,尝试按以下方式导入:

import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;


它应该可以正常工作,没有任何编译错误

10-06 13:36