(If you’re not interested in my short story and want to skip ahead to the issue being faced and the resolution go to THE PROBLEM heading.)
Upon Googling (This hasn’t been added to the dictionary yet? Whaatttt?) Problems with CUITS and AJAX, we discovered that the version of AJAX we were using causes conflicts with the CUITs.
Enough Short Story.
The problem I’ve been exhibiting is that when I record a test through Visual Studio’s Test Recorder, the playback of the test would be incorrect. Events were not being executed upon clicking certain elements on the page and therefore the data wouldn’t be sent or retrieved correctly.
The website in question, uses AJAX calls when the button I was attempting to test is clicked. The AJAX calls were responsible for correctly transporting the data to the DB and letting it know I was adding something to the page and then displaying the results on the page. CUITs don’t play nice with the version of JQuery on the web page (v2.0.3), thus concluding in unexpected test results.
The solution to the issue was simple. One line of code resolved all my issues. Inside the list of local variables (empty by default) for your CUIT.cs file, a single app setting is required.
ConfigurationManager.AppSettings["WebWaitForReadyLevel"] = "3";
Is what is required to make the CUIT play nice with AJAX calls to the server. With this single line of code, the doors to Web Page Automation shall be open and rainbows will emit unicorns that twirl sparklers throughout the sky. Seriously, it’s that awesome.
Hopefully someone will be able to make sense of my ramblings here and will prove useful!