Page 1 of 1

How to change the search timeout for all objects globally?

Posted: Fri Jul 04, 2014 2:50 pm
by AdamH
Hi there,

Due to rather poor application under test performance that we are now experiencing on one of our test rigs we need to be able to change the search timeout settings for all objects in all of our repositories.

I know that we can change the search timeout settings for all top level application objects by selecting each one in the repository and changing the timeout setting as per the screenshot "Changing existing objects" that I have attached.
Changing existing objects.jpg
The setting for all future top level application objects can be changed as per the attached screenshot "Changing settings for new objects".
Changing settings for new objects.jpg
My question is: "Is there a way to do this programmatically and with minimal lines of code?"

We may have to change the default timeout setting again due to poor application under test performance and it would nice not to have to manually change each existing top level application object to achieve this goal...

Thanks

Re: How to change the search timeout for all objects globally?

Posted: Mon Jul 07, 2014 2:10 pm
by krstcs
You could select all of the desired objects and hit 'F4'. This will bring up the properties dialog for those objects. Just change the Search Timeout value and it will update all of the selected objects.

If you want to do it programmatically (which means "in-code") then you can update each of the elements in a user-code module using a Global Parameter in the test suite. You need to update the repo item's SearchTimeout property, which is a Duration type.

In your suites, add a new Global Parameter, lets say "CustomTimeout". It will be a string type, so you will need to convert it so Duration accepts it. If you set it to "5000" then you can do this:

Code: Select all

repo.AAAAdministrationPortalHome.SearchTimeout = new Duration(int.Parse(CustomTimeout)); //Sets the search to 5 seconds.
You would need to do it for each repo object. Also, there are different places where this property lives, you have to use the right one for the object type you are working with. Some are directly under the object (like the one above), some are under the "Info" object (rooted folders), so make sure you change the correct one or it will make you pull your hair out trying to figure out why it isn't changing. :D