1

I have a coded UI Test that was working fine running locally in debug mode, and randomly just stopped. It still works on other dev pc's but no longer on my PC.

I don't appear to have received any Windows updates or VS updates from when it worked and didn't . What its now doing is clicking the incorrect menu item or not finding a button to click even though its present. The mappings are correct and do work on other machines and its not a timing issue as valid waits are in place and as i said it is working fine on other machines.

Visual Studio Version 15.8.6 Enterprise 2017

Internet Explorer 11.0.90

The exception on the output where it doesn't work seems to indicate an exception with zoom, but the test shouldn't be trying to zoom

IEDOM : ZoomPercentage: Exception when trying to get zoom

The debug output from when it works is as follows

W, 2964, 13, 2018/10/11, 08:48:22.121, 672892725381, QTAgent32_40.exe, Playback - {8} [SUCCESS] EnsureVisible - "[Web]ControlType='ComboBox' && TagName='SELECT' && Id='ctl00_ContentPlaceHolder1_ddlStore' && Name='ctl00$ContentPlaceHolder1$ddlStore' && FilterCondition(LabeledBy='', Size='0', Title='', ItemCount='545', Class='form-control05', ControlDefinition='name="ctl00$ContentPlaceHolder1$ddlStore', TagInstance='1')" < Element is clickable > W, 2964, 13, 2018/10/11, 08:48:27.489, 672946394526, QTAgent32_40.exe, IEDOMPlugin: Cannot add property Src as the validity check failed. Disable ApplySmartConfiguration flag to bypass validity checks. W, 2964, 13, 2018/10/11, 08:48:27.664, 672948150154, QTAgent32_40.exe, Playback - {9} [SUCCESS] MouseButtonClick - "[Web]ControlType='Button' && TagName='INPUT' && Id='ctl00_ContentPlaceHolder1_btnNext' && Name='ctl00$ContentPlaceHolder1$btnNext' && FilterCondition(DisplayText='Next', Type='submit', Title='', Class='btn btn-success m-r-5 m-b-5 btn-xs m-r-5', ControlDefinition='name="ctl00$ContentPlaceHolder1$btnNext"', TagInstance='8')" The thread 0x1ce4 has exited with code 0 (0x0). E, 2964, 13, 2018/10/11, 08:48:37.846, 673049974977, QTAgent32_40.exe, Exception: System.Runtime.InteropServices.COMException Message: Error HRESULT E_FAIL has been returned from a call to a COM component. Stack Trace: at Accessibility.IAccessible.get_accRole(Object varChild) at Microsoft.VisualStudio.TestTools.UITest.Extension.Msaa.AccWrapper.get_RoleInt() BaseExceptionMessage: Error HRESULT E_FAIL has been returned from a call to a COM component.

E, 2964, 13, 2018/10/11, 08:48:37.853, 673050042429, QTAgent32_40.exe, Exception: System.Runtime.InteropServices.COMException Message: Error HRESULT E_FAIL has been returned from a call to a COM component. Stack Trace: at Accessibility.IAccessible.get_accState(Object varChild) at Microsoft.VisualStudio.TestTools.UITest.Extension.Msaa.AccWrapper.get_State() BaseExceptionMessage: Error HRESULT E_FAIL has been returned from a call to a COM component.

E, 2964, 13, 2018/10/11, 08:48:37.857, 673050081579, QTAgent32_40.exe, Exception: System.Runtime.InteropServices.COMException Message: Error HRESULT E_FAIL has been returned from a call to a COM component. Stack Trace: at Accessibility.IAccessible.get_accRole(Object varChild) at Microsoft.VisualStudio.TestTools.UITest.Extension.Msaa.AccWrapper.get_RoleInt() BaseExceptionMessage: Error HRESULT E_FAIL has been returned from a call to a COM component.

E, 2964, 13, 2018/10/11, 08:48:37.860, 673050111131, QTAgent32_40.exe, Exception: System.Runtime.InteropServices.COMException Message: Error HRESULT E_FAIL has been returned from a call to a COM component. Stack Trace: at Accessibility.IAccessible.get_accRole(Object varChild) at Microsoft.VisualStudio.TestTools.UITest.Extension.Msaa.AccWrapper.get_RoleInt() BaseExceptionMessage: Error HRESULT E_FAIL has been returned from a call to a COM component.

W, 2964, 13, 2018/10/11, 08:48:38.247, 673053976659, QTAgent32_40.exe, Playback - {10} [SUCCESS] MouseButtonClick - "[Web]ControlType='Hyperlink' && TagName='A' && Id='' && Name='' && Target='' && InnerText='Clubs' && FilterCondition(AbsolutePath='/test.aspx', Title='', 'test.aspx', Class='', ControlDefinition='href="test', TagInstance='5')" The thread 0x4b50 has exited with code 0 (0x0). E, 2964, 13, 2018/10/11, 08:48:46.403, 673135533276, QTAgent32_40.exe, Exception: System.Runtime.InteropServices.COMException Message: Error HRESULT E_FAIL has been returned from a call to a COM component. Stack Trace: at Accessibility.IAccessible.get_accRole(Object varChild) at Microsoft.VisualStudio.TestTools.UITest.Extension.Msaa.AccWrapper.get_RoleInt() BaseExceptionMessage: Error HRESULT E_FAIL has been returned from a call to a COM component.

E, 2964, 13, 2018/10/11, 08:48:46.407, 673135575029, QTAgent32_40.exe, Exception: System.Runtime.InteropServices.COMException Message: Error HRESULT E_FAIL has been returned from a call to a COM component. Stack Trace: at Accessibility.IAccessible.get_accState(Object varChild) at Microsoft.VisualStudio.TestTools.UITest.Extension.Msaa.AccWrapper.get_State() BaseExceptionMessage: Error HRESULT E_FAIL has been returned from a call to a COM component.

E, 2964, 13, 2018/10/11, 08:48:46.411, 673135615631, QTAgent32_40.exe, Exception: System.Runtime.InteropServices.COMException Message: Error HRESULT E_FAIL has been returned from a call to a COM component. Stack Trace: at Accessibility.IAccessible.get_accRole(Object varChild) at Microsoft.VisualStudio.TestTools.UITest.Extension.Msaa.AccWrapper.get_RoleInt() BaseExceptionMessage: Error HRESULT E_FAIL has been returned from a call to a COM component.

E, 2964, 13, 2018/10/11, 08:48:46.414, 673135644030, QTAgent32_40.exe, Exception: System.Runtime.InteropServices.COMException Message: Error HRESULT E_FAIL has been returned from a call to a COM component. Stack Trace: at Accessibility.IAccessible.get_accRole(Object varChild) at Microsoft.VisualStudio.TestTools.UITest.Extension.Msaa.AccWrapper.get_RoleInt() BaseExceptionMessage: Error HRESULT E_FAIL has been returned from a call to a COM component.

W, 2964, 13, 2018/10/11, 08:48:46.524, 673136740553, QTAgent32_40.exe, IEDOMPlugin: Cannot add property Src as the validity check failed. Disable ApplySmartConfiguration flag to bypass validity checks. W, 2964, 13, 2018/10/11, 08:48:46.712, 673138627073, QTAgent32_40.exe, Playback - {11} [SUCCESS] MouseButtonClick - "[Web]ControlType='Button' && TagName='INPUT' && Id='ctl00_ContentPlaceHolder1_btnNewClub' && Name='ctl00$ContentPlaceHolder1$btnNewClub' && FilterCondition(DisplayText='Add Club', Type='submit', Title='', Class='btn btn-success m-r-5 m-b-5 btn-xs m-r-5', ControlDefinition='name="ctl00$ContentPlaceHolder1$btnNewCl', TagInstance='8')"

And the output from when it doesnt is

W, 10996, 13, 2018/10/11, 09:09:59.532, 685866771965, QTAgent32_40.exe, Playback - {8} [SUCCESS] EnsureVisible - "[Web]ControlType='ComboBox' && TagName='SELECT' && Id='ctl00_ContentPlaceHolder1_ddlStore' && Name='ctl00$ContentPlaceHolder1$ddlStore' && FilterCondition(LabeledBy='', Size='0', Title='', ItemCount='545', Class='form-control05', ControlDefinition='name="ctl00$ContentPlaceHolder1$ddlStore', TagInstance='1')" < Element is clickable > W, 10996, 13, 2018/10/11, 09:10:04.900, 685920458422, QTAgent32_40.exe, IEDOMPlugin: Cannot add property Src as the validity check failed. Disable ApplySmartConfiguration flag to bypass validity checks. W, 10996, 13, 2018/10/11, 09:10:05.075, 685922211403, QTAgent32_40.exe, Playback - {9} [SUCCESS] MouseButtonClick - "[Web]ControlType='Button' && TagName='INPUT' && Id='ctl00_ContentPlaceHolder1_btnNext' && Name='ctl00$ContentPlaceHolder1$btnNext' && FilterCondition(DisplayText='Next', Type='submit', Title='', Class='btn btn-success m-r-5 m-b-5 btn-xs m-r-5', ControlDefinition='name="ctl00$ContentPlaceHolder1$btnNext"', TagInstance='8')" W, 10996, 13, 2018/10/11, 09:10:15.374, 686025189722, QTAgent32_40.exe, IEDOM : ZoomPercentage: Exception when trying to get zoom: System.Runtime.InteropServices.InvalidComObjectException: COM object that has been separated from its underlying RCW cannot be used. at System.StubHelpers.InterfaceMarshaler.ConvertToNative(Object objSrc, IntPtr itfMT, IntPtr classMT, Int32 flags) at Microsoft.VisualStudio.TestTools.UITest.Extension.IE.Communication.Interop.IECommunicatorClass.PageZoom(Object punkWebBrowser) at Microsoft.VisualStudio.TestTools.UITest.Extension.IE.DocumentManager.get_ZoomPercentage() W, 10996, 13, 2018/10/11, 09:10:15.419, 686025645733, QTAgent32_40.exe, IEDOM : ZoomPercentage: Exception when trying to get zoom: System.Runtime.InteropServices.InvalidComObjectException: COM object that has been separated from its underlying RCW cannot be used. at System.StubHelpers.InterfaceMarshaler.ConvertToNative(Object objSrc, IntPtr itfMT, IntPtr classMT, Int32 flags) at Microsoft.VisualStudio.TestTools.UITest.Extension.IE.Communication.Interop.IECommunicatorClass.PageZoom(Object punkWebBrowser) at Microsoft.VisualStudio.TestTools.UITest.Extension.IE.DocumentManager.get_ZoomPercentage() W, 10996, 13, 2018/10/11, 09:10:15.544, 686026897425, QTAgent32_40.exe, IEDOM : ZoomPercentage: Exception when trying to get zoom: System.Runtime.InteropServices.InvalidComObjectException: COM object that has been separated from its underlying RCW cannot be used. at System.StubHelpers.InterfaceMarshaler.ConvertToNative(Object objSrc, IntPtr itfMT, IntPtr classMT, Int32 flags) at Microsoft.VisualStudio.TestTools.UITest.Extension.IE.Communication.Interop.IECommunicatorClass.PageZoom(Object punkWebBrowser) at Microsoft.VisualStudio.TestTools.UITest.Extension.IE.DocumentManager.get_ZoomPercentage() W, 10996, 13, 2018/10/11, 09:10:15.546, 686026913893, QTAgent32_40.exe, IEDOM : ZoomPercentage: Exception when trying to get zoom: System.Runtime.InteropServices.InvalidComObjectException: COM object that has been separated from its underlying RCW cannot be used. at System.StubHelpers.InterfaceMarshaler.ConvertToNative(Object objSrc, IntPtr itfMT, IntPtr classMT, Int32 flags) at Microsoft.VisualStudio.TestTools.UITest.Extension.IE.Communication.Interop.IECommunicatorClass.PageZoom(Object punkWebBrowser) at Microsoft.VisualStudio.TestTools.UITest.Extension.IE.DocumentManager.get_ZoomPercentage() W, 10996, 13, 2018/10/11, 09:10:15.566, 686027113668, QTAgent32_40.exe, IEDOM : ZoomPercentage: Exception when trying to get zoom: System.Runtime.InteropServices.InvalidComObjectException: COM object that has been separated from its underlying RCW cannot be used. at System.StubHelpers.InterfaceMarshaler.ConvertToNative(Object objSrc, IntPtr itfMT, IntPtr classMT, Int32 flags) at Microsoft.VisualStudio.TestTools.UITest.Extension.IE.Communication.Interop.IECommunicatorClass.PageZoom(Object punkWebBrowser) at Microsoft.VisualStudio.TestTools.UITest.Extension.IE.DocumentManager.get_ZoomPercentage() W, 10996, 13, 2018/10/11, 09:10:15.576, 686027216184, QTAgent32_40.exe, IEDOM : ZoomPercentage: Exception when trying to get zoom: System.Runtime.InteropServices.InvalidComObjectException: COM object that has been separated from its underlying RCW cannot be used. at System.StubHelpers.InterfaceMarshaler.ConvertToNative(Object objSrc, IntPtr itfMT, IntPtr classMT, Int32 flags) at Microsoft.VisualStudio.TestTools.UITest.Extension.IE.Communication.Interop.IECommunicatorClass.PageZoom(Object punkWebBrowser) at Microsoft.VisualStudio.TestTools.UITest.Extension.IE.DocumentManager.get_ZoomPercentage() W, 10996, 13, 2018/10/11, 09:10:15.725, 686028707079, QTAgent32_40.exe, Playback - {10} [SUCCESS] MouseButtonClick - "[Web]ControlType='Hyperlink' && TagName='A' && Id='' && Name='' && Target='' && InnerText='Store Clubs' && FilterCondition(AbsolutePath='/test.aspx', Title='', Href='test.aspx', Class='', ControlDefinition='href="test', TagInstance='5')"

Benjamin RD
  • 11,516
  • 14
  • 87
  • 157
Rachael M
  • 92
  • 1
  • 10
  • Since it ran fine before, something must have changed. Do you run the exact same IE version as on those other machines? The exception mentions RCW. You can find more info on that object here: https://en.wikipedia.org/wiki/Runtime_Callable_Wrapper – PixelPlex Oct 11 '18 at 12:41
  • Another things I'm thinking of is that something on your system might be corrupted, resulting in that error. Does the Event Viewer show any errors that might have something to do with IE. You could also use DISM.exe and FSC.exe to check your system and make repairs. Did you try turning the IE feature off and on in "Turn Windows features on or off"? – PixelPlex Oct 11 '18 at 13:00
  • @PixelPlex Yes i have tried turning off IE and putting it back on, unfortunately made no difference and yes Im running the same version of IE as other machines. There was an error in event viewer Fault bucket 1819647644825307050, type 5 Event Name: IENonFatalError Response: Not available Cab Id: 0 Problem signature: P1: iexplore.exe P2: 11.0.17134.1 P3: c9403716 P4: Network Tool P5: 11.0.17134.1 P6: 24674e02 P7: common/editor/vs/loader.js P8: 4 P9: Check dependency list! Synchronous require cannot resolve module 'serviceHub'. This is the first mention of this module! P10: F12 – Rachael M Oct 11 '18 at 13:47
  • @PixelPlex it seems random but if the mesage "Would you like to store your password" is on screen it seems to find the controls and when its hidden or disappears it seems to have issues ? any idea? – Rachael M Oct 11 '18 at 13:55
  • Your comment made me think about [this](https://stackoverflow.com/questions/27526163/control-exists-within-a-loop-works-for-first-time-and-not-for-second-time-in-c/27527105#27527105) answer I read from @AdrianHHH. I'm not sure how to connect this to your exception about the zoom. – PixelPlex Oct 11 '18 at 14:30
  • Yes it is not finding the correct control, it highlights the incorrect one for some reason, but when the "store password" message is on screen it highlights the right one. really strange, ive tried turning it off in settings but the test only finds the control when its showing – Rachael M Oct 11 '18 at 14:59
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/181683/discussion-between-pixelplex-and-rachael-m). – PixelPlex Oct 11 '18 at 15:05

1 Answers1

0

Eventually i found the cause of this, it looked like my IE browser was set to 110% zoom(inadvertently by keyboard i suspect), changing back to 100% and the tests start debugging again successfully

Rachael M
  • 92
  • 1
  • 10