ExtentReports可以在selenium java web驱动程序脚本中使用,以生成好的、丰富的HTML测试报告。我试图在我的selenium python web驱动程序脚本中使用JPype(JPype是一种允许python程序完全访问java类库的努力)。 我的代码就像
from jpype import *
classpath = """lib\\extentreports-2.41.2.jar;lib\\freemarker-2.3.23.jar"""
startJVM(getDefaultJVMPath(), "-Djava.class.path=%s" % classpath)
ExtentReports = JClass('com.relevantcodes.extentreports.ExtentReports')
ExtentTest = JClass('com.relevantcodes.extentreports.ExtentTest')
LogStatus = JClass('com.relevantcodes.extentreports.LogStatus')
extent = ExtentReports("TestResult\\Test_Report.html")
test = extent.startTest("My First Test", "Sample description")
test.log(LogStatus.INFO, "This step shows usage of log(logStatus, details)")
extent.endTest(test)
extent.flush()
shutdownJVM()
它会出错
^{pr2}$我使用的是extentreports-2.41.2.jar和freemarker-2.3.23.jar。Python在3.5.1和java8更新中使用121
有人能帮忙吗?在
我知道答案了。以下代码将起作用:
相关问题 更多 >
编程相关推荐