This error may come across a coded UI developer while executing test cases. This error is occurred if you are using a same static class across two test cases.
For example in my scenario, I have created a static class called "MainCall". In this class, I have put all the UIMAP class references. So that I can call any test case of any UIMAP from the "MainCall" class.
The class is as below.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SaadAutomation.Maps.UIMap1;
using SaadAutomation.Maps.UIMap2;
using SaadAutomation.Maps.UIMap3;
namespace SaadAutomation
{
class
MainCall
{
private static UIMap1 _spMap;
private static UIMap2 _cMap;
private static UIMap3 _crMap;
public static UIMap1 SPMap
{
get {
if (_spMap == null)
get {
if (_spMap == null)
_spMap = new UIMap1();
return _spMap;
return _spMap;
}
}
public static UIMap2 CMap
{
get{
if (_cMap == null)
get{
if (_cMap == null)
_cMap = new UIMap2();
return _cMap;
}
}
public static UIMap3 CRMap
{
get{
if (_crMap == null)
get{
if (_crMap == null)
_crMap = new UIMap3();
return _crMap;
return _crMap;
}
}
}
}
I was calling functions like this in a test method.
[TestMethod]
public void ExampleTestCase1 ()
{
MainCall.SPMap.Method1();
MainCall.SPMap.Method1();
MainCall.SPMap.Method2();
MainCall.CMap.Method1();
MainCall.CRMap.CloseAllWindows();
MainCall.CMap.Method1();
MainCall.CRMap.CloseAllWindows();
}
[TestMethod]
public
void ExampleTestCase2 ()
{
MainCall.CRMap.Method1();
MainCall.CMap.Method2();
MainCall.SPMap.Method1();
MainCall.CRMap.Method1();
MainCall.CMap.Method2();
MainCall.SPMap.Method1();
}
When I run both of the above test methods together, I got this error message.
System.Runtime.InteropServices.InvalidComObjectException: COM object that has been separated from its underlying RCW cannot be used.
So I searched on the internet and found the solution. It is just a setting change in the local.testsettings file.
Resolution:
To resolve this error, open your .testsettings file in any XML editor. This file is located under solution items.
Add this line (marked bold)
<Description>These are test settings for Trace and Test Impact.</Description>
<Execution>
Don't forget to restart visual studio after that. Now you will be able to run your test cases and this error will not come inshallah.
There is one side effect of adding this line. You will not be able to debug your test. See my another post about the mentioned issue.
What other errors you encounter? Post here as comments and we will try to find the solution together.
very helpful thanks for sharing would be interested in seeing posts like these.
ReplyDeleteship chuyển hàng tới pakistan
ReplyDeletegửi đồ đi pakistan giá rẻ
ship cấp tốc đi pakistan chi phí rẻ
chuyển phát tốc độ đi pakistan
Công ty chuyển phát tốc độ đi pakistan
order đặt hàng mỹ
Great Article. Thank you for sharing! Really an awesome post for every one.
DeleteWhen Road Information Meets Data MiningPrecision Detection for Heading and Width of Roads Project For CSE
A Method for Mining Process Models With Indirect Dependencies via Petri Nets Project For CSE
A New Method to Compute Ratio of Secure Summations and Its Application in Privacy Preserving Distributed Data Mining Project For CSE
Aspect Based Opinion Mining On Student’s Feedback For Faculty Teaching Performance Evaluation Project For CSE
Big Data Analytics and Mining for Effective Visualization and Trends Forecasting of Crime Data Project For CSE
Data Mining Framework to Analyze the Evolution of Computational Thinking Skills in Game Building Workshops Project For CSE
There is no Bold Line that shows the Solution
ReplyDeleteThanks For Sharing Such A great Post.........
ReplyDeleteSelenium Training Online
wow...nice blog, very help full information. Thanks for sharing.
ReplyDeleteBest Software company in New jersey, USA
ReplyDeleteDigital Transformation |Austere Technologies
Very good informative article. Thanks for sharing such nice article, keep on up dating such good articles.
Wow!! What a interesting blog.. Really awesome to read and so informative blog.. Keep ongoing such a great blog..Internet Of Things
ReplyDeleteVERY INFORMATIVE BLOG. KEEP SHARING SUCH A GOOD ARTICLES.
ReplyDeleteBest Cloud Solutions | Austere Technologies
Really great blog, it's very helpful and has great knowledgeable information. Thanks for sharing, keep updating such a good informative blog.
ReplyDeleteBest IT Security Services | Austere Technologies
Great article, really very helpful content you made. Thank you, keep sharing.
ReplyDeleteQuality Managment Services | Austere Technologies
This comment has been removed by the author.
ReplyDeleteExcellent information you made in this blog, very helpful information. Thanks for sharing.
ReplyDeleteBest Commerce College| Avinash college of commerce
Wow...What an excellent informative blog, really helpful. Thank you.
ReplyDeleteBest chartered accountant course in Hyderabad | Avinash college of commerce
Great article, really very helpful content you made. Thank you, keep sharing.
ReplyDeleteBest junior college in Hyderabad | Avinash College of commerce
Hi Thanks for the nice information its very useful to read your blog. We provide Software Development Services
ReplyDeleteGood information.
ReplyDeleteB.com Integrated Courses | Avinash College of commerce
Very informative blog, really helpful. Thank you.
ReplyDeletecs course eligibility | ISFS
Great informative blog, thanks for sharing.
ReplyDeleteBest Blockchain services | Massil Technologies
Wow...Excellent informative blog, really helpful. Thank you.
ReplyDeleteBest CAM Training in hyd | ISFS
Excellent informative blog, keep for sharing.
ReplyDeleteBest System Integration services | Massil Technologies
Best informative blog. Thank you.
ReplyDeletecpa courses in hyderabad | ISFS
Excellent informative blog, Thanks for sharing.
ReplyDeletecs institutes in hyderabad | Avinash College of Commerce
Your article gives lots of information to me. Thanks for sharing.
ReplyDeleteacca course in hyderabad | ISFS
Thanks for sharing this valuable information. Keep sharing.
ReplyDeleteca cpt colleges in hyderabad | Avinash College of Commerce
Thanks for sharing a valuable information to us. Thanks for your blog.
ReplyDeleteCIMA training institute in Hyderabad | ISFS
Thanks for sharing such an informative blog to us, keep on updating.
ReplyDeleteACCA training institute in Hyderabad | ISFS
Thanks for sharing such an informative blog to us, keep on updating.
ReplyDeleteca cpt colleges in hyderabad | Avinash College of Commerce
Very good article post.Much thanks again. Cool.
ReplyDeleteđánh giá Honda Civic 2018
Đánh giá xe Toyota Yaris 2018
Đánh giá xe