GCC CRM 'Error on Page' executing CUITe automation

Sep 10, 2013 at 6:25 PM
I'm using CUITe 1.06 (for .NET 4.5) to write test automation for GCC CRM.
I'm using the following code to launch the URL - if I execute with 'Debug Tests' I usually don't have this problem - but executing with 'Run Tests' will consistently generate the 'Error on page.' I'm calling this function with the following URL: https://samsgccrmsqld04
        public BrowserWindow RetrieveGccCrmBrowser(string url)
        {
            const string DialogNameBase = @"Microsoft Dynamics CRM";
            Assert.IsFalse(string.IsNullOrWhiteSpace(url), "RetrieveGccCrmBrowser: 'Url' parameter is NULL or Empty: FAIL.");
            //var uri = new Uri(url);
            //var searchFor = BrowserWindow.Launch(uri);
            var searchFor = CUITe_BrowserWindow.Launch(url);
            Assert.IsNotNull(searchFor, "RetrieveGccCrmBrowser: Could not find Browser Window URL '{0}': FAIL.", url);
            Assert.IsTrue(
                searchFor.Title.Contains(DialogNameBase),
                "RetrieveGccCrmBrowser: Window '{0}' should contain '{1}': FAIL.",
                searchFor.Title,
                DialogNameBase);
            return searchFor;
        }
Details concerning the 'error on page' issue:
Microsoft Dynamics CRM Error Report Contents

<CrmScriptErrorReport>
<ReportVersion>1.0</ReportVersion>
<ScriptErrorDetails>
<Message>Object doesn't support property or method 'setProperty'</Message>
<Line>238</Line>
<URL>/main.aspx</URL>
<PageURL>/main.aspx</PageURL>
<Function>anonymous(){varreadyStateValue=0;//Copyoverthevalues..CopyOverValues();try{readyStateValue=wrapperNode.readyState;}catch(ex){}//Ifthehandlerisnotnull.Invokethehandlerand//storetheexceptionthrown.varexceptionNode=null;if(wrapperNode.onreadystatechange!=nul</Function>
<CallStack>
<Function>anonymous(){varreadyStateValue=0;//Copyoverthevalues..CopyOverValues();try{readyStateValue=wrapperNode.readyState;}catch(ex){}//Ifthehandlerisnotnull.Invokethehandlerand//storetheexceptionthrown.varexceptionNode=null;if(wrapperNode.onreadystatechange!=null){try{wrapperNode.onreadystatechange();}catch(ex){exceptionNode=ex;}}//IfthereadyStateisDONE.Updatetheattributeif(readyStateValue==4){inProgress=0;vartrackingElement=__vsttGetWfrTrackingElement();//updatethetrackinginformation..if(trackingElement){varcounterValue=trackingElement.getAttribute('xmlhttpcount');if(counterValue>0){trackingElement.setAttribute('xmlhttpcount',--counterValue);__vsttAjaxLog("XMLHttpRequestReadyState4Reached:Decrementedcounter");}}}//Re-throwtheexceptionfromthereadystatehandlerif(exceptionNode!=null){throwexceptionNode;}}</Function>
</CallStack>
</ScriptErrorDetails>
<ClientInformation>
<BrowserUserAgent>Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.3)</BrowserUserAgent>
<BrowserLanguage>en-US</BrowserLanguage>
<SystemLanguage>en-US</SystemLanguage>
<UserLanguage>en-US</UserLanguage>
<ScreenResolution>1366x768</ScreenResolution>
<ClientName>Web</ClientName>
<ClientTime>2013-09-10T09:12:09</ClientTime>
</ClientInformation>
<ServerInformation>
<OrgLanguage>1033</OrgLanguage>
<OrgCulture>1033</OrgCulture>
<UserLanguage>1033</UserLanguage>
<UserCulture>1033</UserCulture>
<OrgID>{CF0CF373-45A3-E211-8B10-00155D2A3B25}</OrgID>
<UserID>{0EC6657C-5018-E311-A88E-00155D2A3B25}</UserID>
<CRMVersion>5.0.9690.3448</CRMVersion>
</ServerInformation>
</CrmScriptErrorReport>

Do you have any suggestions?
Thanks!
Greg
Coordinator
Sep 15, 2013 at 4:53 PM
Hi Greg,

This doesn't seem to be a CUITe issue because the code you pasted only launches the web page which seems to work without issue.

The "Error on page" is most probably a result of invalid JavaScript code on the page, specifically line 238 as the error suggests.

What code exists on line 238?

Does the error appear when using Visual Studio's built-in Coded UI Test Recorder?

Does the error appear when launching the web browser manually?

This does not seem related with CUITe and so it might be best to get help in the CRM Development msdn forum here.

Thank you.
Sep 20, 2013 at 1:34 PM
Thank you - I had reached a similar conclusion!
This problem does not repro when launching the browser manually
I hoped you had heard of a similar issue, and might have some suggestions regarding recommended IE settings for executing CUITe test automation
Thank you again - I'll follow-up with the CRM Development msdn forum
Greg
Sep 27, 2013 at 7:43 PM
FYI:
This 'Error on page' occurred when executing tests from a client system with Win8 and IE10
It did not occur when executing tests from a client system with Win2K8 R2 SP1 and IE9

Thought others might be interested!
Thanks!
Greg