Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CodedUI null reference exception even when object exists

I have created a coded ui test that checks something in my software. It worked fine, but now I keep getting null reference exception when I try to interact with my UITestControls (that were generated in the uimap). The strange thing is, that the UITestControls 'Exist' property returns true, which means that the control had been found.

I've searched and found this topic: http://social.msdn.microsoft.com/Forums/en/vsautotest/thread/c2e6e5c3-2503-4506-9963-733fd84fbd25, But I have checked in my project, and the 'Copy Local' property of these assemblies is set to false.

I think that this exception first occurred after I have added an app.config file to my project. Maybe this might be the problem? If so, how can I fix this without deleting my app.config file?

Thanks!

like image 968
Roee Avatar asked Aug 09 '26 16:08

Roee


1 Answers

I solved this problem for myself by:

  • setting my System and Microsoft DLLs Copy Local false. The asker did this already, this was important.
  • going to your bin/Debug (or bin/Release) folders and deleting the copies of the System and Microsoft DLLs that are still there! Copy Local may be false, but the DLLs are still there from when Copy Local was true!
like image 53
rythos42 Avatar answered Aug 11 '26 05:08

rythos42



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!