7

I am testing an application which loads a powerpoint (.ppt or .pptx) file insert it. Application gives same look an feel like powerpoint with some extra setting when the file is loaded inside the application. When I try to automate the application, I click a button to load the powerpoint file into the application. After the loading process white framework fails to continue playback.

When I restart the same test again I got "NonComVisibleBaseClass was detected" exception.

I can only continue my testing after restarting the entire application. Does anyone face this kind of issue? your answers will really helpful to continue my testing.

S.Roshanth
  • 1,499
  • 3
  • 25
  • 36

2 Answers2

14

It's known issue.
http://social.msdn.microsoft.com/Forums/en-US/27c3bae8-41fe-4db4-8022-e27d333f714e/noncomvisiblebaseclass-was-detected?forum=Vsexpressvb

  1. Navigate to Debug->Exceptions...
  2. Expand "Managed Debugging Assistants"
  3. Uncheck the NonComVisibleBaseClass Thrown option.
  4. Click [Ok]
drets
  • 2,583
  • 2
  • 24
  • 38
  • Thanks for your answer,but I have tried it. Now there is no "NonComVisibleBaseClass was detected" exception but now I got "Null reference Exception". This only happens once the button click loads the powerpoint slides inside the application. – S.Roshanth Mar 14 '14 at 06:01
  • I think that you should add waiters (simple variant is Thread.Sleep(1000)) into some places. This exception could happen if you trying to click on the button that is not appeared yet (e.g. myButton.Click()). – drets Mar 14 '14 at 07:32
  • OK,but when I click the button it loads the new window. After that tests getting fail. Is there any possibility what application status (internal process changes) does not support for testing after PowerPoint loads inside the application. – S.Roshanth Mar 14 '14 at 10:33
  • According to my analysis I found that,after PowerPoint loads inside the application all the controls are change to "custom controls". Is there any way to handle custom controls inside White framework? – S.Roshanth Mar 19 '14 at 11:19
  • @S.Roshanth: I'm also facing same issue while identifying the control using UI Automation. Can you please let me know if you got any solution for this issue. After Unchecking the NonComVisibleBaseClass Thrown option, i also started getting Null reference exception. I'm trying to identify Excel Addin controls in Excel 2019. Previously we were using excel 2016 and same controls were identified using UI Automation but after migrating to excel 2019. now this control are throwing error "NonComVisibleBaseClass was detected". – pasupati Jan 22 '20 at 11:36
1

I stumbled upon this page after having the same problem. Although I'm not sure this solution may help you it helped me and maybe can be useful to someone else.

My WPF application needed to run with elevated privileges and if I tried to run VS without elevated privileges my tests broke with the aforementioned error. What I did was simply restar VS as Administrator and the tests started working.

One thing I noticed was that when I was running without elevated privileges the Window.Framework was 'Win32' and the Window.Items was empty. After running VS as Administrator The Framework propery was 'Wpf' and the Items list was filled correctly. I don't know what is the real cause of the problem here. But it worked for me and maybe it'll work for someone else.