This is a migrated thread and some comments may be shown as answers.

InvokeonChangeEvent is not working in IE9

8 Answers 111 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nahla
Top achievements
Rank 1
Nahla asked on 19 Jun 2013, 06:01 PM
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.

8 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 24 Jun 2013, 04:44 PM
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
0
Nahla
Top achievements
Rank 1
answered on 26 Jun 2013, 09:43 PM
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.
 

0
Cody
Telerik team
answered on 27 Jun 2013, 05:02 PM
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
0
Cody
Telerik team
answered on 27 Jun 2013, 05:04 PM
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
0
Nahla
Top achievements
Rank 1
answered on 01 Jul 2013, 02:43 PM
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.
0
Cody
Telerik team
answered on 01 Jul 2013, 04:49 PM
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
0
Sai
Top achievements
Rank 1
answered on 16 Jul 2015, 02:08 PM

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)​

0
Cody
Telerik team
answered on 17 Jul 2015, 03:26 AM
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
 
Tags
General Discussions
Asked by
Nahla
Top achievements
Rank 1
Answers by
Cody
Telerik team
Nahla
Top achievements
Rank 1
Sai
Top achievements
Rank 1
Share this question
or