A real weakness for CodedUI Test
By using a table in a database, we are able to dynamically change (overload) Expected Values (Hoorah!). However, when it comes to changing the values of the xml file called *.uitest which contains the search and find values to find elements on a page, this does not seem to be an option. Most developers I know have been using a manual technique. We cannot fire a seperate instance of recorder and have it step through the process to fire off another recorder to implement the tasks that we need. We cannot pass a C# variable into the xml inner text fields to make the find/search more dynamic.
The best solution I have found and I am currently working on is a test set that collects the data I need from a database and re-writes the *.uitest files to accomodate changing of domains or web paths. The changing of sessionIDs which are stored in URLs, Application variables that are stored in URLs, etc. The system appears to be designed to statically test 1 given page, on one server or web dom. If you want to achieve this, you have to change the values, recompile the tests and setup the run again. Even worse, there are no plugins or API to work with to make this process more dynamic.
This is a great concept and I got behind it with my company and got all the teams on board with it, but I am finding it to be shall we say, too much in it's infancy. Furthermore, I don't see a lot of support on these sites for "HOW TO's" to help you figure out how to do these things. You have a great idea, but no sign of improvement based on requests I have seen. In fact, I see more rejections than anything.
Here is my specific request:
I am interested in being able to programmatically call Test builder to iterate through a web page and collect document elements and recording them into a UIMap. I have attempted a multiple instance of VS having one click through the process to enable the recorder, but when I get to this point, the recorder refuses to fire a second instance. I can understand why, but if I really need a way to do something of this nature. Basically, our system creates a UIMap that is empty, then populates it, but it cannot complete the process of the .cs map and .designer.cs map and provide the content to touch the elements int eh document DOM. The only way we figure we can do this is by forcing the recorder to record the steps. We know what elements we want, but again cannot perform the record to fill in the missing data in the missing UIMap files.
Larry H commented
Here is another good suggestion:
Think in the terms of multiple browsers open at the same time. For example, testing the test environment web app against the results of a production environment web app. Try doing this with the same IE browser and you begin to see issues that crop up. For example, if a link on page A on the first invokes a popup/popupbehind or second window, It will overwrite the location of page A on the second browser.
It cannot tell the difference between browser instance 1 and browser instance 2, and sends commands to browser instance 1 when 1 has already been loaded and you are attempting to repeat the same steps in browser instance 2.
Larry H commented
I forgot to add, that when I create a test set to change the *.uitest files, of the actual test run, we have to then recompile it, then go through the build process. It is sad that we need a tool just to work around the tool you have provided.
Stop Thinking about processing a single page, start thinking about processing multiple sites. This scope really opens your tool system up to a professional level that would really be beneficial.