How can I take a screenshot with Selenium WebDriver?

后端 未结 30 2596
不知归路
不知归路 2020-11-21 07:48

Is it possible to take a screenshot using Selenium WebDriver?

(Note: Not Selenium Remote Control)

30条回答
  •  日久生厌
    2020-11-21 08:19

    C# (Ranorex API)

    public static void ClickButton()
    {
        try
        {
            // code
        }
        catch (Exception e)
        {
            TestReport.Setup(ReportLevel.Debug, "myReport.rxlog", true);
            Report.Screenshot();
            throw (e);
        }
    }
    

提交回复
热议问题