0
我有这段代码在Excel表单结果列中写入通过或失败。 我想使它变得很小巧,并在文本中添加以太绿色/红色,或使其变为粗体或两者兼有。使用Java在Webdriver中设置文本样式(颜色,粗体或斜体)
DOMConfigurator.configure("log4j.xml");
sTestCaseName = this.toString();
sTestCaseName = Utils.getTestCaseName(this.toString());
Log.startTestCase(sTestCaseName);
ExcelUtils.setExcelFile(Constant.Path_TestData + Constant.File_TestData,"Sheet1");
iTestCaseRow = ExcelUtils.getRowContains(sTestCaseName,Constant.Col_TestCaseName);
driver = Utils.OpenBrowser(iTestCaseRow);
<some method here...>
//here to write Pass or Fail
ExcelUtils.setCellData("Pass", iTestCaseRow, Constant.Col_Result);
}catch (Exception e){
ExcelUtils.setCellData("Fail", iTestCaseRow, Constant.Col_Result);
Log.error(e.getMessage());
throw (e);
你能建议我该如何处理?
谢谢Scott,我会试试 – Geomatani