InvokeonChangeEvent is not working in IE9

9 posts, 0 answers
  1. Nahla
    Nahla avatar
    7 posts
    Member since:
    Jun 2013

    Posted 19 Jun 2013 Link to this post

    Hi,
    I am running a script in IE9 where it selects a value from a dropdown list. Based on the value selected, the content of another dropdown list should change.  This code works fine in IE8, but not in IE9.   In IE9, when I select a value from first dropdown list, the content of the 2nd dropdownlist does not change.   I have my SelectByText (value, true).  Is this an issue with IE9?  

    I have tried to use the below code to invoke the jquery manually:
    DropDownList1.AsjQueryControl().InvokejQueryEvent(
    ArtOfTest.WebAii.jQuery.
    jQueryControl.jQueryControlEvents.change);

    However I am getting failures on AsjQueryControl()  and jQueryControl although I am using ArtOfTest.WebAii.jQuery.

    Error 78 'ArtOfTest.WebAii.Controls.HtmlControls.HtmlSelect' does not contain a definition for 'AsjQueryControl' and no extension method 'AsjQueryControl' accepting a first argument of type 'ArtOfTest.WebAii.Controls.HtmlControls.HtmlSelect' could be found (are you missing a using directive or an assembly reference?) 
    Error 79 The type or namespace name 'jQueryControl' does not exist in the namespace 'ArtOfTest.WebAii.jQuery' (are you missing an assembly reference?)

    Thanks in advance for your help.
  2. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 24 Jun 2013 Link to this post

    Hello Nahla,

    First there are no known issues with IE9 versus IE8 with regard to selecting from a drop down. Sometimes we do see the application itself detect which browser version it's running in and behave differently. So this behavior could be application specific.

    If I can get direct access to the application or if you can send me a Fiddler trace of the application running normally in IE9 (no Test Studio involved) then I can troubleshoot why it's not behaving as expected.

    Regarding the compile error, I cannot explain why you're getting it. I just verified this small code snippet compiles perfectly here:

    using ArtOfTest.WebAii.jQuery;
     
    namespace MySampleTests
    {
        public class ScratchTest2 : BaseWebAiiTest
        {
            [CodedStep(@"New Coded Step")]
            public void ScratchTest2_CodedStep1()
            {
                HtmlSelect DropDownList1 = null;
                DropDownList1.AsjQueryControl().InvokejQueryEvent(jQueryControl.jQueryControlEvents.change);
            }

    Which version of Test Studio do you have installed? We did change the name of these methods in version 2012.2.1204. They used to have upper J in them and now they have lower j in them.

    Regards,
    Cody
    Telerik
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Nahla
    Nahla avatar
    7 posts
    Member since:
    Jun 2013

    Posted 26 Jun 2013 Link to this post

    Thanks a lot Cody for your reply.

    I was using v2011 and now  I have upgraded to v2012.2.1420.
    However, when I use DropdownList1.SelectByText(item2select, true), my IE9 browser crashes with the below error message from VS. It seems that it's looking for iHtmlDocument4. Is this an issue with this method in IE9? The developers have looked at the app and could not determine a fault in how this is used. They are thinking maybe Telerik. Can you please confirm where this error is from?

    ExecuteCommand failed!
    InError set by the client. Client Error:
    System.InvalidCastException: Unable to cast COM object of type 'mshtml.HTMLDocumentClass' to interface type 'mshtml.IHTMLDocument4'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{3050F69A-98B5-11CF-BB82-00AA00BDCE0B}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
    at mshtml.HTMLDocumentClass.IHTMLDocument4_CreateEventObject(Object& pvarEventObject)
    at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeEvent(IHTMLElement target, String data)
    at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
    at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
    BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeEvent',Target:'ElementId (tagName: 'select',occurrenceIndex: '0')',Data:'onchange--@@--null',ClientId:'Client_f85b75a9-b53e-47f2-90d7-55338036c91c',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.InvalidCastException: Unable to cast COM object of type 'mshtml.HTMLDocumentClass' to interface type 'mshtml.IHTMLDocument4'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{3050F69A-98B5-11CF-BB82-00AA00BDCE0B}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
    at mshtml.HTMLDocumentClass.IHTMLDocument4_CreateEventObject(Object& pvarEventObject)
    at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeEvent(IHTMLElement target, String data)
    at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
    at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
    InnerException: none.


    After the upgrade I tried manually invoking the event with the below and works.
    DropDownList1.AsjQueryControl().InvokejQueryEvent(
    ArtOfTest.WebAii.jQuery.
    jQueryControl.jQueryControlEvents.change);
    But would need to have the InvokeonChangeEvent to false: DropdownList1.SelectByText(item2select, false).


    Thank you very much in advance.
     

  4. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 27 Jun 2013 Link to this post

    Hello Nahla,

    The stack trace does show the problem is happening inside Telerik code, specifically in our browser add-on for IE. I've never seen this particular error before. I am suspicious something went wrong with the upgrade. Would you try un-installing Test Studio, make sure there is no "Test Studio" folder of any kind contained in "C:\Program Files (x86)\Telerik". Also check C:\Windows\Assembly to make sure all ArtOfTest and Telerik assemblies (as highlighted in the attached screen shots) have been removed. If anything is left behind it can cause conflicts as Test Studio may be trying to use an older incompatible DLL.

    Regards,
    Cody
    Telerik
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  5. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 27 Jun 2013 Link to this post

    Hello,

    Almost forgot to add, once your machine is clean then re-install Test Studio and try again. Don't worry about your existing tests. They'll still be there throughout this process.

    Regards,
    Cody
    Telerik
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  6. Nahla
    Nahla avatar
    7 posts
    Member since:
    Jun 2013

    Posted 01 Jul 2013 Link to this post

    Thanks Cody.
    I have uninstalled Telerik and reinstalled it after cleaning it up per your instructions.  HOwever, I have received the same error as I posted earlier.   This only occurs with dropdowns with onchange events.
  7. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 01 Jul 2013 Link to this post

    Hi Nahla,

    Can you re[pro the problem using this website?
    http://www.asp.net/ajaxlibrary/ajaxcontroltoolkitsamplesite/cascadingdropdown/cascadingdropdown.aspx

    If so, can you send me the test, using that website, that demonstrates this problem?

    Also, are you using Test Studio, our IDE with record and playback, our the free Telerik Testing Framework where you are hand coding your own tests?

    Regards,
    Cody
    Telerik
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  8. Sai
    Sai avatar
    1 posts
    Member since:
    Jul 2015

    Posted 16 Jul 2015 in reply to Cody Link to this post

    Hi Cody

    Selection of value from dropdown failing with following exception.Can you please help

    ExecuteCommand failed!
    InError set by the client. Client Error:
    System.InvalidCastException: Unable to cast COM object of type 'mshtml.HTMLDocumentClass' to interface type 'mshtml.IHTMLDocument4'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{3050F69A-98B5-11CF-BB82-00AA00BDCE0B}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
       at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
       at mshtml.HTMLDocumentClass.IHTMLDocument4_CreateEventObject(Object& pvarEventObject)
       at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeEvent(IHTMLElement target, String data)
       at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
       at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)​

  9. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 16 Jul 2015 Link to this post

    Hi Sai,

    I do not have any idea what could be causing that error. The error message implies something went seriously wrong within the browser itself. I need to be able to reproduce this problem on my machine so that I can investigate and diagnose what may be causing it. Can you send me a test I can run on my machine which reproduce this issue?


    Regards,
    Cody
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top