function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Linga_RaminLinga_Ramin 

Unable to cover below Query in Test class code coverage.Cany anyone ?

Select Account.Owner.Id,Type__c,Id,Name,Account.Id,Account.Name,Owner.Id from Opportunity where Id<>null  
Deepali KulshresthaDeepali Kulshrestha
Hi PM,

Try the below code:-

List<Opportunity> opplist=[Select Account.Owner.Id,Id,Name,Account.Id,Account.Name,Owner.Id,Type from Opportunity WHERE id<>null];
System.debug(opplist);

I hope you find the above solution helpful.If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha