运行编码的ui测试时如何选择子菜单 [英] How to select a sub menu when running coded ui tests
问题描述
尝试为我要设置的codedUI测试选择子菜单时遇到问题.我要遵循的路径突出显示如下.本质上,我将转到管理"菜单所在的页面;然后,我想将鼠标悬停在政府上 菜单以显示子菜单;然后从该子菜单中单击公司详细信息",将我带到公司详细信息"页面.
I have encountered an issue when trying to select a sub menu for a codedUI test I am trying to set up. The path I want to follow is highlighted as below. Essentially I am going to a page where the Administration menu is; I then want to hover over the Administration menu to bring up the sub menu; and then click on Company Details from that sub-menu to take me to the Company Details page.
我遇到的问题是,一旦我将注意力集中在管理"菜单上,便无法再从子菜单中选择公司详细信息".我不断收到错误建议 " FailedToPerformActionOnHiddenControlException.无法在隐藏的控件上执行点击""
The issue I am having is that once I have focus on the Administration menu I can find no way to be able to then select Company Details from the sub-menu. I keep getting an error back advising "FailedToPerformActionOnHiddenControlException. Cannot perform 'Click' on the hidden control"
P 租约,请参见下面有关我一直在使用的代码的细目分类.当我尝试单击公司详细信息"链接时,该部分发生了错误.任何帮助将不胜感激!
Please see below for a breakdown of the code I have been using. The error occurs at the part when I am attempting to click on the 'Company Details' link. Any help would be greatly appreciated!
public void RecordedMethod1()
{
#region Variable Declarations
BrowserWindow uIGoogleInternetExplorWindow = this.UIGoogleInternetExplorWindow;
HtmlInputButton uISysAdminButton = this.UIGoogleInternetExplorWindow.UIAutoIntegrateDocument.UISysAdminButton;
HtmlHyperlink uIAdministrationHyperlink = this.UIGoogleInternetExplorWindow.UIAutoIntegrateDocument1.UINavCustom.UIAdministrationHyperlink;
HtmlHyperlink uICompanyDetailsHyperlink = this.UIGoogleInternetExplorWindow.UIAutoIntegrateDocument1.UINavCustom.UICompanyDetailsHyperlink;
#endregion
// Go to web page 'http://uat.autointegrate.test/'
uIGoogleInternetExplorWindow.NavigateToUrl(new System.Uri(this.RecordedMethod1Params.UIGoogleInternetExplorWindowUrl));
// Click 'SysAdmin' button
Mouse.Click(uISysAdminButton);
// Click 'Administration' link
Mouse.Click(new Point(uIAdministrationHyperlink.BoundingRectangle.X + uIAdministrationHyperlink.BoundingRectangle.Width, uIAdministrationHyperlink.BoundingRectangle.Y + uIAdministrationHyperlink.BoundingRectangle.Height / 2));
// Click 'Company Details' link
Mouse.Click(uICompanyDetailsHyperlink);
}
安德鲁·蒂尔斯顿
推荐答案
您好,安德鲁·蒂尔斯顿,
Hi Andrew Tilston,
感谢您的信息.
如何使用代码UI测试生成器记录此测试并进行回放?是否有相同的问题?
How about recording this test using code UI test builder and playback it? Does it have the same issue?
""FailedToPerformActionOnHiddenControlException".无法在隐藏的控件上执行点击""
对于您的问题,请首先执行ButtonControl.DrawHighlight().检查控件是否被捕获.如果没有,请尝试更改其他搜索属性.
For your issue, first please do a ButtonControl.DrawHighlight(). Check if the control was captured. If not, try to change another search property.
此外,我发现另一个线程与您的问题相同,而Tapas提供了一种解决方法,也许您可以尝试一下,请在下面的线程中找到Tapas的回复:
In addition, I found another thread which has the same issue with yours, and Tapas has given a workaround, maybe you could try it, please find the reply shared by Tapas in the thread below:
最好的问候,
肖湖
这篇关于运行编码的ui测试时如何选择子菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!