Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 无法解决Selenium c中的webdriver错误#_C#_Selenium_Selenium Webdriver_Error Handling_Nunit - Fatal编程技术网

C# 无法解决Selenium c中的webdriver错误#

C# 无法解决Selenium c中的webdriver错误#,c#,selenium,selenium-webdriver,error-handling,nunit,C#,Selenium,Selenium Webdriver,Error Handling,Nunit,在这种情况下,当第一个运行时执行两个测试用例,但是当抛出第二个运行错误时,图像中提到了同样的错误。 为什么会这样?我无法解决这个错误。。请帮忙 [TestFixture] public class ListScenarios : ExtentManager { #region "Variables" IWebDriver webDriver = new FirefoxDriver(); int rowNumber; #endregion

在这种情况下,当第一个运行时执行两个测试用例,但是当抛出第二个运行错误时,图像中提到了同样的错误。 为什么会这样?我无法解决这个错误。。请帮忙

[TestFixture]
public  class ListScenarios : ExtentManager
{
    #region "Variables"
    IWebDriver webDriver = new FirefoxDriver();
    int rowNumber;
    #endregion

    [OneTimeSetUp]
   public void Setup()
    {
                 
       Thread.Sleep(4000);
        webDriver.Manage().Window.Maximize();
        webDriver.Navigate().GoToUrl("https://");
    }
      
    [Test,Order(1)]
  
    public void AdminView()
    {
        rowNumber = 1;
        ExcelReader.PopulateInCollection(@"TestSheet.xlsx");
        test = report.CreateTest("Testcase one");
 
    }

    [Test,Order(2)]
    
    public void ViewSlist()
    {

        rowNumber = 2;
        ExcelReader.PopulateInCollection(@"TestSheet.xlsx");
        test = report.CreateTest("Testcase two");

        
        Thread.Sleep(2000);
        if (!(webDriver.PageSource.Contains("Update")) && !(webDriver.PageSource.Contains("Unlock")))
        {
            test.Log(Status.Pass, "validated");

        }
        else
        {
            
            test.Log(Status.Fail, "Validations didnot verified");

        }
    }


根据此错误,您正在使用远程webdriver服务器,但它无法连接。您启动webdriver服务器了吗?@derloopkat,这应该会解决问题。为多个测试用例报告生成扩展数据块报告的其他方法是什么?nunit是否支持任何其他生成报告的方法?