无法隐藏的控制异常执行操作 [英] Failed to perform action on hidden control exception

查看:192
本文介绍了无法隐藏的控制异常执行操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想不过来创建IE 8了兼容性模式在VS 2010中的UI测试使用IE 9试图记录动作记录的许多步骤失败的时候。然后,当我手动美元缺少的步骤C $ c和尽量填写日志的形式与用户名和密码,我得到的说,我未能完成对隐藏的控制动作异常。

在UI测试code:

 公共无效Recordedmethod()
{
        BrowserWindow uILogInWindowsInternetWindow = this.UILogInWindowsInternetWindow;
        HtmlHyperlink uILogInHyperlink = this.UILogInWindowsInternetWindow.UIHomePageDocument.UILogInHyperlink;
        HtmlEdit uIUsernameEdit = this.UILogInWindowsInternetWindow.UILogInDocument1.UIUsernameEdit;
        HtmlEdit uIPasswordEdit = this.UILogInWindowsInternetWindow.UILogInDocument1.UIPasswordEdit;
        #endregion        //转到网页的http://本地主机:15856 /的WebSite1 /
        uILogInWindowsInternetWindow.NavigateToUrl(新的System.Uri(this.RecordedMethodParams.UILogInWindowsInternetWindowUrl));        //设置标志,使回放继续,如果非必要的行动失败。 (例如,如果鼠标悬停操作失败。)
        Playback.PlaybackSettings.ContinueOnError = TRUE;        //鼠标悬停'登录'在链接(1,1)
        Mouse.Click(uILogInHyperlink);        //重置标志以确保播放停止,如果有一个错误。
        Playback.PlaybackSettings.ContinueOnError = FALSE;        在//型'测试''用户名:文本框中
        uIUsernameEdit.Text = this.RecordedMethodParams.UIUsernameEditText;        //下面的元素不再可用:IE网络控制;进程ID [6320],窗口句柄[3168166]        //类型********在密码:文本框中
        uIPasswordEdit.Password = this.RecordedMethodParams.UIPasswordEditPassword;        //下面的元素不再可用:IE网络控制;进程ID [6320],窗口句柄[3168166]
}


解决方案

这是链接到在九月发布了Internet Explorer的修补程序的问题。

KB2870699

这会影响VS2010和VS2012。

微软发布了纠正VS2012的问题的修补程序(我已经证实,它解决了这一问题,对我来说)。

<一个href=\"http://blogs.msdn.com/b/visualstudioalm/archive/2013/09/17/$c$cd-ui-mtm-issues-on-internet-explorer-with-kb2870699.aspx\" rel=\"nofollow\">http://blogs.msdn.com/b/visualstudioalm/archive/2013/09/17/$c$cd-ui-mtm-issues-on-internet-explorer-with-kb2870699.aspx

目前为VS2010唯一的解决方法是卸载补丁(KB2870699);但是,与任何类型的安全补丁的你要认真考虑是否拉动它是安全的做给你的情况。

编辑:这不是一个有趣的错误,我来处理。我刚刚升级到VS2012从VS2010和突然间,我发现没有我的previously运行codedUI测试工作。我认为它是与VS2012和敲我的头撞在墙上了一天我发现这是一个补丁的问题更好的一部分后的问题。这只是我的运气,我升级到2012的补丁已经安装在我的系统上同时进行。好时光!

I am trying to create a UI test in VS 2010 using IE 9 in IE 8 compatibilty mode however when trying to record an action recording many of the steps fail. Then when I manually code in the missing steps and try to fill in a log in form with a username and password I get an exception that says I have failed to perform an action on hidden control.

The UI Test code:

public void Recordedmethod()
{
        BrowserWindow uILogInWindowsInternetWindow = this.UILogInWindowsInternetWindow;
        HtmlHyperlink uILogInHyperlink = this.UILogInWindowsInternetWindow.UIHomePageDocument.UILogInHyperlink;
        HtmlEdit uIUsernameEdit = this.UILogInWindowsInternetWindow.UILogInDocument1.UIUsernameEdit;
        HtmlEdit uIPasswordEdit = this.UILogInWindowsInternetWindow.UILogInDocument1.UIPasswordEdit;
        #endregion

        // Go to web page 'http://localhost:15856/WebSite1/'
        uILogInWindowsInternetWindow.NavigateToUrl(new System.Uri(this.RecordedMethodParams.UILogInWindowsInternetWindowUrl));

        // Set flag to allow play back to continue if non-essential actions fail. (For example, if a mouse hover action fails.)
        Playback.PlaybackSettings.ContinueOnError = true;

        // Mouse hover 'Log In' link at (1, 1)
        Mouse.Click(uILogInHyperlink);

        // Reset flag to ensure that play back stops if there is an error.
        Playback.PlaybackSettings.ContinueOnError = false;

        // Type 'test' in 'Username:' text box
        uIUsernameEdit.Text = this.RecordedMethodParams.UIUsernameEditText;

        // The following element is no longer available: IE web control; Process Id [6320], window handle [3168166]

        // Type '********' in 'Password:' text box
        uIPasswordEdit.Password = this.RecordedMethodParams.UIPasswordEditPassword;

        // The following element is no longer available: IE web control; Process Id [6320], window handle [3168166]
}

解决方案

This is an issue linked to an Internet Explorer patch that was released in September.

KB2870699

This affects VS2010 and VS2012.

Microsoft released a patch that corrects the issue for VS2012 (and I've confirmed that it fixed the issue for me).

http://blogs.msdn.com/b/visualstudioalm/archive/2013/09/17/coded-ui-mtm-issues-on-internet-explorer-with-kb2870699.aspx

Currently the only workaround for VS2010 is to uninstall the patch (KB2870699); however, as with any sort of security patch you'll want to consider carefully whether pulling it is safe to do given your situation.

EDIT: This was not a fun bug for me to deal with. I had just upgraded to VS2012 from VS2010 and all of a sudden I found none of my previously functioning CodedUI tests working. I assumed it was an issue with VS2012 and after banging my head against the wall for the better part of a day I found out it was an issue with a patch. It was just my luck that I upgraded to 2012 at the same time the patch had been installed on my system. Good times!

这篇关于无法隐藏的控制异常执行操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆