使用Chrome 54运行编码的UI测试无法正常工作 [英] Running Coded UI tests using Chrome 54 is not working
问题描述
我使用chrome创建了一个简单的测试.以下是脚本:
I have created a simple Test using chrome. Following is the script:
public void CodedUITestMethod1()
{
BrowserWindow.CurrentBrowser ="Chrome";
BrowserWindow.Launch("www.google.com");
}
public void CodedUITestMethod1()
{
BrowserWindow.CurrentBrowser = "Chrome";
BrowserWindow.Launch("www.google.com");
}
运行脚本时,出现以下错误:
While running the script it's giving following error:
测试名称: CodedUITestMethod1
测试FullName: TestChrome.CodedUITest1.CodedUITestMethod1
测试源: c:\ users \ an035go \ documents \ visual studio 2015 \ Projects \ TestChrome \ TestChrome \ CodedUITest1.cs:第27行
测试结果: 失败
测试持续时间: 0:00:03.3389976
结果StackTrace:
在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(String [] args)
at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.CrossBrowserFactory.Launch(String [] arguments)
at Microsoft.VisualStudio.TestTools.UITesting.BrowserWindow.LaunchPrivate(String [] arguments)
在Microsoft.VisualStudio.TestTools.UITesting.BrowserWindow中.<> c__DisplayClass3_0.<启动> b__0()
Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod [T](Func`1函数,UITestControl控件,布尔型firePlaybackErrorEvent,布尔型logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.BrowserWindow.Launch(String [] arguments)
在c:\ users \ an035go \ documents \ visual studio 2015 \ Projects \ TestChrome \ TestChrome \ CodedUITest1.cs:line 29中的TestChrome.CodedUITest1.CodedUITestMethod1()
结果消息:
测试方法TestChrome.CodedUITest1.CodedUITestMethod1引发异常:
System.ArgumentNullException:值不能为null.
参数名称:windowHandle
Test Name: CodedUITestMethod1
Test FullName: TestChrome.CodedUITest1.CodedUITestMethod1
Test Source: c:\users\an035go\documents\visual studio 2015\Projects\TestChrome\TestChrome\CodedUITest1.cs : line 27
Test Outcome: Failed
Test Duration: 0:00:03.3389976
Result StackTrace:
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(String[] args)
at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.CrossBrowserFactory.Launch(String[] arguments)
at Microsoft.VisualStudio.TestTools.UITesting.BrowserWindow.LaunchPrivate(String[] arguments)
at Microsoft.VisualStudio.TestTools.UITesting.BrowserWindow.<>c__DisplayClass3_0.<Launch>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(String[] arguments)
at TestChrome.CodedUITest1.CodedUITestMethod1() in c:\users\an035go\documents\visual studio 2015\Projects\TestChrome\TestChrome\CodedUITest1.cs:line 29
Result Message:
Test method TestChrome.CodedUITest1.CodedUITestMethod1 threw exception:
System.ArgumentNullException: Value cannot be null.
Parameter name: windowHandle
使用的Chrome版本:54
Chrome Version Used: 54
Chrome浏览器驱动程序已使用以下链接更新到2.25版:
Chrome driver was updated to version 2.25 using the following link:
https://chromedriver.storage.googleapis.com/index.html?path=2.25/
https://chromedriver.storage.googleapis.com/index.html?path=2.25/
使用的Visual Studio版本:带有更新3的VS 2015 Enterprise
Visual Studio Version Used: VS 2015 Enterprise with Update 3
任何帮助将不胜感激.
推荐答案
嗨Anshul1Goel,
Hi Anshul1Goel,
有很多人遇到此问题,请参考以下链接.因为在编码的用户界面和硒之间存在一些兼容性.
There are many people have encountered this issue, please refer to the following link. Because there are some compatibility between Coded UI and selenium.
据我所知,关于您的问题只有一处走动,您可以使用Chrome V53测试您的项目.请离线安装chrome v53,然后 禁用 Chrome自动更新.
As far as I know, there is one walk around about your issue, you could use Chrome V53 to test your project. Please install chrome v53 offline, and disable chrome automatic updates.
此致
奥斯卡
这篇关于使用Chrome 54运行编码的UI测试无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!