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

Exception by SelectByText

1 Answer 155 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Serdar
Top achievements
Rank 1
Serdar asked on 04 Mar 2019, 01:58 PM

Hi,

I have such an code:

 

var dropDownWorkflow = SelectTable_Column(0);

dropDownWorkflow.SelectByText((string)parameter_in["workflowValue"], true);

where

internal HtmlSelect SelectTable_Column(int index)

{     

var idString = string.Format("id=?RulesTable_Row{0}TemplateCol", index);    return myBrowser.WaitForElement(new HtmlFindExpression(idString), TestDefinitions.WAIT_TIMEOUT).As<HtmlSelect>();

}

This is the exception:

ArtOfTest.WebAii.Exceptions.ExecuteCommandException : ExecuteCommand failed!
InError set by the client. Client Error:
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at mshtml.HTMLSelectElementClass.IHTMLElement3_FireEvent(String bstrEventName, 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_3d56ac5e-800e-4e93-bba8-e10af338144e',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at mshtml.HTMLSelectElementClass.IHTMLElement3_FireEvent(String bstrEventName, 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.

at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)
at ArtOfTest.WebAii.Controls.HtmlControls.HtmlSelect.SelectByText(String text, Boolean invokeOnChangeEvent)

 

What can be the reason and how can I solve this problem.

Thanks.

 

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 07 Mar 2019, 09:51 AM
Hi Serdar,

I am sorry to hear you have faced such an error and will be glad to assist you on that. 

It seems the application you are testing forces Internet Explorer to act as it is not IE 11. Could you please double check if the browser is in Compatibility mode when started for test execution? If it is please turn of that mode and try the execution again.

If this is not the case then probably the application under test has a meta tag similar to

<meta http-equiv="X-UA-Compatible" content="IE=7">


This will force Internet Explorer to act as IE 7 which will cause the failures you have encountered.

Please if it turns out to be the meta tag discuss this with the developers of the application and what are the possibilities to remove that. Otherwise testing against IE will not be consistent.

As an alternative, you can try executing the same test against Chrome or Firefox and verify what the outcome will be. Please let me know, if further assistance will be required. 

Thanks in advance for your cooperation!

Regards,
Elena Tsvetkova
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Serdar
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or