Question

teddkw on Tue, 09 Dec 2014 17:57:16


Hello,

I' am running a simple Coded UI test. The recorded actions opens a web application, logins in on the first page by selecting a user from a drop down list. The error below appears when the cuit attempts to select from a drop down on the second page (same happens when any control on the second page is interacted with).

E, 7004, 110, 2014/12/09, 12:34:26.439, 16648668439, QTAgent32.exe, AL: Playback Error:

Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnHiddenControlException: Cannot perform 'SetProperty of SelectedItem with value "RMPS (Domestic - HQ)"' on the hidden control. Additional Details:
TechnologyName:  'Web'
ControlType:  'ComboBox'
Id:  'ctl00_ctl00_UserRoleDropDownList'
Name:  'ctl00$ctl00$UserRoleDropDownList'
TagName:  'SELECT'

FYI...I don't have KB2870699 installed.

Any ideas?

Thanks


Sponsored



Replies

Amanda Zhu on Wed, 10 Dec 2014 03:31:25


Hi Teddkw,

The error below appears when the cuit attempts to select from a drop down on the second page (same happens when any control on the second page is interacted with).

Based on your issue occurred on multiple controls. One possible reason is that something affected IE like KB2870699. If your VS is VS2010 or VS2012, the please install the corresponding fix introduced in this blog: http://blogs.msdn.com/b/visualstudioalm/archive/2013/09/17/coded-ui-mtm-issues-on-internet-explorer-with-kb2870699.aspx

Another possible reason is that the issue is on your test application which has hidden controls.

Please provide us detailed version number of IE and VS on your machine and the installed KB on your IE.

And only controls on the second page were affected??

And if you got the similar issue when you clicked one control on the second page, please use FindMatchingControls() to check whether there are any other matched controls. Reference:

UITestControl control=this.parenet1,pereant2.XXX//define the control

Control.searchproperties.Add[]=””;

UITestControlCollection uic = <Your Object Reference Variable>.FindMatchingControls();

Console.writelIne(uic.Count);

If multiple controls are found. Please use the following code snippet to click the correct control  instead of hidden control to check whether this issue can be resolved:

foreach (UITestControl ui in uic)
{
     if (ui.BoundingRectangle.Width > 0)
     {
              Mouse.Click(ui);
              break;
      }

The same way can be applied to the ComboBox control on your side.

In order to check whether something is affecting IE, please create a new coded UI test through recording some actions on some pages such as www.bing.com on IE and run the test to check whether the same issue will occur.

Best regards,

teddkw on Wed, 10 Dec 2014 19:40:53


Hello Amanda,


I tried using findingMatchingControls() and verified that there is only one control matching the search properties.


I also tried writing another test for www.bing.com and I got the same hiddencontrolExceptionerror. Here is the test is wrote..


BrowserWindow window = BrowserWindow.Launch(http://www.bing.com/);

UITestControluiNewsLink= newUITestControl(window);
uiNewsLink.TechnologyName= "web";
uiNewsLink.SearchProperties.Add("ControlType", "Hyperlink");
uiNewsLink.SearchProperties.Add("TagName", "A");
uiNewsLink.SearchProperties.Add("InnerText", "News");

Mouse.Click(uiNewsLink);

UITestControluiLocalLink= newUITestControl(window);

uiLocalLink.TechnologyName=  "web";

uiLocalLink.SearchProperties.Add("ControlType", "Hyperlink");
uiLocalLink.SearchProperties.Add("TagName", "A");
uiLocalLink.SearchProperties.Add("InnerText", "Local");

Mouse.Click(uiLocalLink);

 


and the error..

E, 680, 14, 2014/12/10, 14:27:39.656, 5749894103, QTAgent32.exe, AL: Playback Error: Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnHiddenControlException: Cannot perform 'Click' on the hidden control. Additional Details:
TechnologyName:  'Web'
ControlType:  'Hyperlink'
Id:  ''
Name:  ''
TagName:  'A'
Target:  ''
InnerText:  'Local'

 

My configuration is Visual Studio 2010 and IE 10

The KB version displayed on the "About Internet Explorer" box is KB2977629


I will try installing the IE fix you suggested earlier and let you know.


Thanks,

teddkw

 

 


Amanda Zhu on Fri, 12 Dec 2014 01:48:44


Hi Teddkw,

Whether installing the fix in VS2010 resolved this issue?

Thanks,

Amanda Zhu on Tue, 16 Dec 2014 07:09:06


Hi Teddkw,

If you have any news, please feel free to let me know.

Thanks,

teddkw on Tue, 16 Dec 2014 18:17:05


Hello Amanda,

The IE window update is for Visual Studio SP 1, since I did not have SP1, I first upgraded my Visual Studio to SP1 and then installed the fix....and i'am glad to say that it worked.

I no longer get that pesky FailedToPerformActionOnHiddenControlException error.

Thanks for all the help