CodedUI的Selenium组件无法启动chromedriver.exe

时间:2015-06-11 01:36:19

标签: selenium-webdriver coded-ui-tests selenium-chromedriver

我从https://visualstudiogallery.msdn.microsoft.com/11cfc881-f8c9-4f96-b303-a2780156628d下载了CodedUI的selenium组件,并完成了它提到的所有内容。我将BrowserWindow.CurrentBrowser =" chrome"添加到我在IE中记录的测试中,当我运行测试时,chromedriver.exe没有启动。因此,不打开Chrome窗口,而是打开IE窗口。有人可以帮我吗?

namespace Tests
{

[CodedUITest]
public class CodedUITest1
{
    public CodedUITest1()
    {
    }

    [TestMethod]
    public void CodedUITestMethod1()
    {
        BrowserWindow.CurrentBrowser = "chrome";
        this.UIMap.RecordedMethod1();
        // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
    }

    #region Additional test attributes

    // You can use the following additional attributes as you write your tests:

    ////Use TestInitialize to run code before running each test 
    //[TestInitialize()]
    //public void MyTestInitialize()
    //{        
    //    // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
    //}

    ////Use TestCleanup to run code after each test has run
    //[TestCleanup()]
    //public void MyTestCleanup()
    //{        
    //    // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
    //}

    #endregion

    /// <summary>
    ///Gets or sets the test context which provides
    ///information about and functionality for the current test run.
    ///</summary>
    public TestContext TestContext
    {
        get
        {
            return testContextInstance;
        }
        set
        {
            testContextInstance = value;
        }
    }
    private TestContext testContextInstance;

    public UIMap UIMap
    {
        get
        {
            if ((this.map == null))
            {
                this.map = new UIMap();
            }

            return this.map;
        }
    }

    private UIMap map;
}

}

0 个答案:

没有答案