Completed
Last Updated: 20 Aug 2013 07:40 by ADMIN
ADMIN
Plamen
Created on: 07 Jun 2013 12:04
Type: Bug Report
0
Javascript error when selecting an option from dropdown menu. Fix for this is included in our latest internal build(1527), however it seems that the issue still occurs in some specific cases.
I am running version 2012.2.1527.0 
 
Error information (full exception is pasted below):
Javascript call failure on some dropdown menu test steps using IE 9.0
It looks like the 2012.2.1527.0 build fixed only a portion of the problem. 
Some of my test steps utilizing dropdown menus pass with no issue and other steps fail. This only occurs in playback on IE 9.0. I can playback test cases in Chrome with no errors. 

Steps to reproduce:
Sample test is attached to the internal bug description. 

Failure Information: 

~~~~~~~~~~~~~~~
 
ExecuteCommand failed!
 
InError set by the client. Client Error:
 
System.InvalidOperationException: Javascript call [$(document.getElementsByTagName(\'select\')[7]).change();] failed! Please make sure the function exists and the call is using the correct prototype signature. Javascript error: TypeError: Unable to get value of the property 'srcElement': object is null or undefined 

   at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
 
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
 
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
 
BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeJsFunction',Target:'ElementId (tagName: '',occurrenceIndex: '-1')',Data:'$(document.getElementsByTagName(\'select\')[7]).change();',ClientId:'Client_6d0b837d-cf17-4524-8780-a9cb27070796',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.InvalidOperationException: Javascript call [$(document.getElementsByTagName(\'select\')[7]).change();] failed! Please make sure the function exists and the call is using the correct prototype signature. Javascript error: TypeError: Unable to get value of the property 'srcElement': object is null or undefined 

   at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
 
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
 
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
 
InnerException: none.
4 comments
ADMIN
Daniel Djambov
Posted on: 20 Aug 2013 07:39
The above code will execute the selection and if there is an exception will handle it properly. This way the whole test will pass.
ADMIN
Daniel Djambov
Posted on: 20 Aug 2013 07:38
 public void Add_Grade_2_Class_Test_Case_CodedStep()
        {
            try
            {
                Pages.MindPlayManager26.ContentTabContainerTabGeneralDdlGradeSelect.SelectByValue("2", true);
            }
            catch
            {
                ArtOfTest.WebAii.jQuery.jQueryControl jQueryControl = Pages.MindPlayManager26.ContentTabContainerTabGeneralDdlGradeSelect.AsjQueryControl();
            jQueryControl.InvokejQueryEvent(ArtOfTest.WebAii.jQuery.jQueryControl.jQueryControlEvents.change);
            }
     }
ADMIN
Daniel Djambov
Posted on: 20 Aug 2013 07:38
In this case even there is an exception, the value of the dropdown is changed properly. So a possible workaround of the problem could be to convert the step (Select 'ByValue' option '2' on 'ContentTabContainerTabGeneralDdlGradeSelect') to Code and catch the exception like this: 
ADMIN
Daniel Djambov
Posted on: 20 Aug 2013 07:36
Telerik: The problem is out of our hands even you call the 'change' directly from the JS Console (no Test Studio involved) you get the same error. It relates to either wrong handler signature or a bug in the jQuery - http://bugs.jquery.com/ticket/10078