codeD UI错误:下面的元素不再速效 [英] Coded UI error: The following element is not longer availabe

查看:146
本文介绍了codeD UI错误:下面的元素不再速效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我录了一些测试用例在VS2010 CUIT。一切的前一天工作的罚款。所以,今天我再次运行,所有的测试失败,与警告:下面的元素不再可用......,我得到异常:无法隐藏的控制,这是不是真正执行点击,因为所有的该控件不会隐藏。我试图在另一台机器上,他们失败了也。

有谁知道为什么会发生?是不是因为别的东西Web应用程序的?请帮忙,谢谢。

PS:所以我试图用记录,上面写着隐藏控件相同的控制一个新的测试,而新的测试工作!?我不明白为什么。

修改

警告下面的元素等等等等...出现时,我试图捕捉元素或同时记录控制。按钮的源$ C ​​$ C说隐藏

 公共HtmlImage UIAbmeldenImage
    {
        得到
        {
            如果((this.mUIAbmeldenImage == NULL))
            {
                this.mUIAbmeldenImage =新HtmlImage(本);
                #区域搜索条件
                this.mUIAbmeldenImage.SearchProperties [HtmlImage.PropertyNames.Id] = NULL;
                this.mUIAbmeldenImage.SearchProperties [HtmlImage.PropertyNames.Name] = NULL;
                this.mUIAbmeldenImage.SearchProperties [HtmlImage.PropertyNames.Alt] =abmelden;
                this.mUIAbmeldenImage.FilterProperties [HtmlImage.PropertyNames.AbsolutePath] =/webakte-vnext/content/apps/Ordner/images/logOut.png;
                this.mUIAbmeldenImage.FilterProperties [HtmlImage.PropertyNames.Src] =HTTP://localhost/webakte-vnext/content/apps/Ordner/images/logOut.png;
                this.mUIAbmeldenImage.FilterProperties [HtmlImage.PropertyNames.LinkAbsolutePath] =/webakte-vnext/e.consult.9999/webakte/logout/index;
                this.mUIAbmeldenImage.FilterProperties [HtmlImage.PropertyNames.Href] =HTTP://localhost/webakte-vnext/e.consult.9999/webakte/logout/index;
                this.mUIAbmeldenImage.FilterProperties [HtmlImage.PropertyNames.Class] = NULL;
                this.mUIAbmeldenImage.FilterProperties [HtmlImage.PropertyNames.ControlDefinition] =ALT = \\abmelden \\SRC = \\HTTP://本地主机/网络;
                this.mUIAbmeldenImage.FilterProperties [HtmlImage.PropertyNames.TagInstance] =1;
                this.mUIAbmeldenImage.WindowTitles.Add(艾提 - 测试艾提codeD UI VS2010);
                #endregion
            }
            返回this.mUIAbmeldenImage;
        }
    }


解决方案

我虽然运行Visual Studio 2012,我觉得很奇怪的是,我们开始经历在同一天同样的问题,我看不到在DOM任何区别为codeD UI测试我有我的网页,但由于某种原因VS跟它的控制是隐藏的,指定它正在寻找的元素的正确的ID(我证实,该ID还是一样的) 。我甚至试图重新录制的动作,因为我认为必须的东西已经改变了,但我得到了同样的错误。

由于这听起来像同样的问题,在同一时间,我想发生这种情况可能与一些自动更新?这是目前我最好的猜测,我要看看它,我会更新我的职务,如果我想任何东西了。

修改

我删除更新KB2870699,从而消除在IE一些voulnerability,这个固定我与我的测试有问题。在12月加入本更新,所以它适合。希望这可以帮助你。 :)

<一个href=\"https://connect.microsoft.com/VisualStudio/feedback/details/800953/security-update-kb2870699-for-ie-breaks-existing-$c$cd-ui-tests#tabs\" rel=\"nofollow\">https://connect.microsoft.com/VisualStudio/feedback/details/800953/security-update-kb2870699-for-ie-breaks-existing-$c$cd-ui-tests#tabs

I recorded some test cases with CUIT in VS2010. Everything worked fine the day before. So, today I run again, all the test failed, with the warning: The following element is no longer available ... and I got the exception : Can't perform "Click" on the hidden control, which is not true because all the controls are not hidden. I tried on the other machine, and they failed as well.

Does anyone know why it happens? Is it because of the web application for something else? Please help, thanks.

PS: So I tried to record a new test with the same controls that said "hidden controls", and the new test worked!? I don't understand why.

EDIT

The warning "The following element blah blah ..." appears when I tried to capture an element or a control while recording. The source code of the button is said 'hidden'

public HtmlImage UIAbmeldenImage
    {
        get
        {
            if ((this.mUIAbmeldenImage == null))
            {
                this.mUIAbmeldenImage = new HtmlImage(this);
                #region Search Criteria
                this.mUIAbmeldenImage.SearchProperties[HtmlImage.PropertyNames.Id] = null;
                this.mUIAbmeldenImage.SearchProperties[HtmlImage.PropertyNames.Name] = null;
                this.mUIAbmeldenImage.SearchProperties[HtmlImage.PropertyNames.Alt] = "abmelden";
                this.mUIAbmeldenImage.FilterProperties[HtmlImage.PropertyNames.AbsolutePath] = "/webakte-vnext/content/apps/Ordner/images/logOut.png";
                this.mUIAbmeldenImage.FilterProperties[HtmlImage.PropertyNames.Src] = "http://localhost/webakte-vnext/content/apps/Ordner/images/logOut.png";
                this.mUIAbmeldenImage.FilterProperties[HtmlImage.PropertyNames.LinkAbsolutePath] = "/webakte-vnext/e.consult.9999/webakte/logout/index";
                this.mUIAbmeldenImage.FilterProperties[HtmlImage.PropertyNames.Href] = "http://localhost/webakte-vnext/e.consult.9999/webakte/logout/index";
                this.mUIAbmeldenImage.FilterProperties[HtmlImage.PropertyNames.Class] = null;
                this.mUIAbmeldenImage.FilterProperties[HtmlImage.PropertyNames.ControlDefinition] = "alt=\"abmelden\" src=\"http://localhost/web";
                this.mUIAbmeldenImage.FilterProperties[HtmlImage.PropertyNames.TagInstance] = "1";
                this.mUIAbmeldenImage.WindowTitles.Add("Akte - Test Akte Coded UI VS2010");
                #endregion
            }
            return this.mUIAbmeldenImage;
        }
    }

解决方案

Although I am running Visual Studio 2012, I find it odd that we started experiencing the same problem on the same day, I can not see any difference in the DOM for the Coded UI Tests I have for my web page, but for some reason VS is saying the control is hidden and specifies the correct ID of the element it is looking for (I verified that the ID is still the same one). I even tried to re-record the action, because I assumed that something must have changed, but I get the same error.

Since this sounds like the same problem, occurring at the same time I am thinking this might be related to some automatic update? That's my best guess at the moment, I am going to look into it, I will update my post if I figure anything out.

EDIT

I removed update KB2870699, which removes some voulnerability in IE, this fixed the problems I was having with my tests. This update was added on the 12. september, so it fits. Hope this helps you. :)

https://connect.microsoft.com/VisualStudio/feedback/details/800953/security-update-kb2870699-for-ie-breaks-existing-coded-ui-tests#tabs

这篇关于codeD UI错误:下面的元素不再速效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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