使用Selenium网格在多个浏览器上运行用C#实现的测试

使用Selenium网格在多个浏览器上运行用C#实现的测试,c#,selenium,grid,C#,Selenium,Grid,我使用Visual Studio 2015创建了包含10个测试用例的测试套件。测试是使用WebDriver在C#中实现的。 现在,我的目标是利用网格技术在Selenium中实现分布式测试的概念。测试套件将在3种不同的浏览器中运行:IE、Chrome、Firefox parallely 我认为我的网格设置是成功的,但我需要扩展在WebDriver中实现的测试。我只找到了一些C#的教程,但没有一本适合我。 如果有人能帮助我创建测试或者给我发一个带有C#教程的网站,我将不胜感激 我的错误来自VS-中执

我使用Visual Studio 2015创建了包含10个测试用例的测试套件。测试是使用WebDriver在C#中实现的。 现在,我的目标是利用网格技术在Selenium中实现分布式测试的概念。测试套件将在3种不同的浏览器中运行:IE、Chrome、Firefox parallely

我认为我的网格设置是成功的,但我需要扩展在WebDriver中实现的测试。我只找到了一些C#的教程,但没有一本适合我。 如果有人能帮助我创建测试或者给我发一个带有C#教程的网站,我将不胜感激 我的错误来自VS-中执行的TC。 我在win10机器上有一个集线器,本地有两个节点,第三个节点也在VM Win 8.1网格控制台预览上启动- 多谢各位

我将在此处添加代码:

using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.UI;
using OpenQA.Selenium.Remote;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit;
using NUnit.Framework;

namespace TestOfGrid

{
    [TestFixture]
    public class Driver
    {
        IWebDriver driver;

    [SetUp]
    public void Setup()
    {
        // Create a new instance of the Firefox driver
        driver = new FirefoxDriver();

        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities = DesiredCapabilities.Firefox();
        capabilities.SetCapability(CapabilityType.BrowserName, "firefox");
        capabilities.SetCapability(CapabilityType.Platform, new Platform(PlatformType.Windows));


        driver = new RemoteWebDriver(new Uri("http://192.168.56.1:4444/wd/hub"), capabilities);

    }

    [TearDown]
    public void Teardown()
    {
        driver.Quit();
    }

    [Test]
    public void GoogleSearch()
    {
        string homepage = "http://www.google.co.uk";
        //Navigate to the site
        driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10));
        driver.Navigate().GoToUrl(homepage);

    }
}
}


此测试应在3个浏览器中并行运行。如果我评论了所需的功能,那么该站点将成功打开,但我希望在单独的浏览器上并行启动测试

要求我们推荐或查找教程或其他非现场资源的问题与堆栈溢出无关。相反,请描述这个问题以及迄今为止为解决它所做的工作。我已经添加了我的代码、错误和网格控制台图片。谢谢你的回复