0
votes

When running a Coded UI test against Chrome, the cross browser console appears and the chrome browser pops up (but does not display web page), but then I get an exception:

System.ArgumentNullException: Value cannot be null. Parameter name: windowHandle Test method SFS.Test.CodedUI.Learner.TestCases.CodedUITest1.CodedUITestMethod1 threw exception: System.ArgumentNullException: Value cannot be null. Parameter name: windowHandle at Microsoft.VisualStudio.TestTools.UITesting.UITestControl..ctor(IntPtr windowHandle) at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.CrossBrowserService.InitializeTopLevelWindow() at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.CrossBrowserService.InitializeCrossBrowserService(String[] args) at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.CrossBrowserService.<>c.<.cctor>b__3_0(String[] args) at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.CrossBrowserService.Launch(Uri uri) at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.CrossBrowserFactory.Launch(Uri uri) at Microsoft.VisualStudio.TestTools.UITesting.BrowserWindow.LaunchPrivate(Uri uri) at Microsoft.VisualStudio.TestTools.UITesting.BrowserWindow.<>c__DisplayClass2_0.b__0() at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction) at Microsoft.VisualStudio.TestTools.UITesting.BrowserWindow.Launch(Uri uri) at SFS.Test.CodedUI.Learner.TestCases.CodedUITest1.CodedUITestMethod1() in C:\Source\SFS 2.0\AMS\16.2\SFS.Test.CodedUI\SFS.Test.CodedUI.Learner\TestCases\CodedUITest1.cs:line 28

Line 28 is the BrowserWindow.Launch statement in the code below.

I followed these instructions for installing the Selenium components for Coded UI Cross Browser Testing.

https://visualstudiogallery.msdn.microsoft.com/11cfc881-f8c9-4f96-b303-a2780156628d

The coded UI test is simple:

[CodedUITest]
public class CodedUITest1
{

    [TestMethod]
    public void CodedUITestMethod1()
    {
        BrowserWindow.CurrentBrowser = "chrome";

        var bw = BrowserWindow.Launch(new System.Uri("http://www.google.com"));

        var browser = new BrowserWindow();
        browser.CopyFrom(bw);

    }

}

I read lots of people having success with these tools, so I am thinking it might be an issue with versions. My versions are as follows:

  • VS2015 Update 1 14.0.24720.000
  • chromedriver version June 4, 2016
  • Selenium Browser Components version 2.43.1.0
  • Google Chrome 52.0.2743.116

Do any of you have it working with VS2015? Can you tell me what versions of chromedriver, chrome and selenium browser components you are using?

1

1 Answers

0
votes

Changing chrome driver to a lower version should help. But it doesn't properly work anyway. There is a project on github that is aimed to create an adapter between coded ui and selenium. But work is still in progress. Contributions are highly welcomed and appreciated. https://github.com/YuriGuzun/CodedSelenium