在扩展数据报告版本-4.0.3.0中,在报告带有测试步骤的屏幕快照消息的日志消息时,屏幕快照大小显示较小

我正在生成版本4.0.3.0的范围报告,在该报告中,我将测试步骤记录在带有通过/失败消息以及屏幕截图的报告中。 生成报告后,对于各个测试步骤->屏幕截图图像显示得很小,无法正确看到。 ChromeBrower:屏幕截图以小尺寸显示。 IEBrowser:测试步骤不会显示屏幕截图。

请帮助我解决该问题的解决方案,以调整报告中屏幕截图的大小并在IE浏览器中显示屏幕截图。

下面是使用的代码:

public class MerlinBase : Base
    {
        #region Variables

        public string commonDirectoryPath = AppDomain.CurrentDomain.BaseDirectory;
        public string applicationconfigurationPath = AppDomain.CurrentDomain.BaseDirectory + "\\TestData\\Applicationconfigurations.xlsx";
        public static ExtentReports extentReports;
        public static ExtentTest extentTest;

        #endregion Variables

        #region Methods

        /// <summary>
        /// This method runs before start of each test 
        /// </summary>
        [SetUp]
        public void TestInitialize()
        {
            DataTable appDetails = ExcelUtilities.ReadExcel(applicationconfigurationPath,"ApplicationDetails");
            string browserType = appDetails.Rows[0]["Browser"].ToString().Trim();
            string appURL = appDetails.Rows[0]["URL"].ToString().Trim();

            BrowserHandler.LaunchBrowser(browserType,commonDirectoryPath);
            BrowserHandler.DeleteCookies();
            BrowserHandler.NavigateToUrl(appURL); 
            BrowserHandler.MaximizeWindow();

            string TestCaseName = testcontext.CurrentContext.Test.MethodName;
            childDirectoryInfo.CreateSubdirectory(TestCaseName);

            extentReports = new ExtentReports();
            extentTest = extentReports.CreateTest(TestCaseName);
            string pathToSaveExtentReport = reportParentFolderPath + "\\" + reportChildFolderPath;
            ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(pathToSaveExtentReport +"\\"+"AutomationReport"+".html");

            extentReports.AttachReporter(htmlReporter);


        }
public static class ExtentReporting
    {
        static string Screenshot = null;
        public static void Success(this ExtentTest Test,string PassDetails,MediaEntityModelProvider provider = null)
        {
            try
            {
                Screenshot = TakeScreenshot.ScreenshotOfTestStep();
                if (Screenshot != null)
                {
                   var m = MediaEntityBuilder.CreateScreenCaptureFromPath(Screenshot).Build();
                    Test.Pass(PassDetails,m);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }

在扩展数据报告版本-4.0.3.0中,在报告带有测试步骤的屏幕快照消息的日志消息时,屏幕快照大小显示较小

wxc3344 回答:在扩展数据报告版本-4.0.3.0中,在报告带有测试步骤的屏幕快照消息的日志消息时,屏幕快照大小显示较小

我在IE浏览器中打开范围报告时遇到了这个问题,因此IE浏览器存在此问题。 但是当以chrome打开时,尺寸很小,但分辨率有所更新。

htmlReporter.Config.CSS = ".r-img { width: 30%; }";
本文链接:https://www.f2er.com/3169012.html

大家都在问