jim calhoun1 on Fri, 28 Mar 2014 20:56:13

Why am I getting this exception:  "Invalid value for parameter. Value: -1. Parameter: SearchTimeout.\r\nParameter name: SearchTimeout"


This is in VS2013, but I could not find a forum for that.  The failure happens nearly instantly.  Where is searchtimeout set?  Is it some global thing?  Do I need to add it?  Is so where?  This used to work fine, but now just throws all the time.

I created a new uimap and have the same problem.

Any idea?



Amanda Zhu on Mon, 31 Mar 2014 06:28:04


Based on your description, did you get this issue when you start to create a new UIMap? Or did you get the issue when you record actions/drag the crosshair on a control? Or did you get the error when you run coded UI test? Please clarify it, it is import to analyze the issue.

As far as I know, there is a playback setting which represents how long the Coded UI engine attempts to locate a control: SearchTimeout in coded UI test. By default, 2 mins.

Best regards,

jim calhoun1 on Thu, 03 Apr 2014 19:54:08


The project was working fine with a separate UI map, but the application under test changed and we needed to update the ui map with the changes in the control.  We deleted some of the portions that were no longer valid by deleting from the uimap gui.  We then used to record tool to add the changes into the uimap  Somewhere along the way I started getting failures with the timeout when executing the tests.  If I go into the ui map and "find control", it detects the control in the app under test.  But when running it seems to fail instantly.

I created a new csproj in a new solution with a new ui map and it works.  I have so much other code in the previous ui map that is not really feasible to start over again.  The failures I have are related to the first screen of our application. 

I am not sure if this is enough to go on or not.  I opened the map in a text editor and did not immediately see anything

Amanda Zhu on Fri, 04 Apr 2014 01:58:10


Thank you for your response.

We deleted some of the portions that were no longer valid by deleting from the uimap gui. 

I doubt that deleted portions affected other portions in coded UI test. For example you deleted the parent control of a control, then it is possible that CodedUI can’t find the control during playback.

I suggest figuring out the problematic control after testing, creating a new coded UI test, recording actions on the problematic control in the UIMap of the new coded UI test, and then comparing the control hierarchy of the problematic control in the new UIMap and the old UIMap.

Best regards,

jim calhoun1 on Tue, 08 Apr 2014 21:34:29

This whole things gets stranger and stranger.  I have isolated the problem some more.  The very simple action will work if we create a new project and do not inherit the codeduitest class.  The problem appears when we inherit from our regular testclass base classes.

Our Base Class is decorated with a [TestClass] attribute whilst our codedUI test has the [CodedUITest] attribute.  So, if I inherit from my base class, does the base class's [testclass] attribute overwrite the [CodedUITest] attribute?

Can I use



Amanda Zhu on Wed, 09 Apr 2014 09:07:49


I don't recommend you to create coded UI test inherited from a [TestClass] attribute test class. Coded UI test class need [CodedUITest] attribute to declare.

Best regards,

jim calhoun1 on Wed, 09 Apr 2014 16:31:59

My solution was to remove the [TestClass] attribute on our base class.  We did not really need it at the highest level and instead moved it to one layer below.