+ Start a Discussion
Satyananda YeluriSatyananda Yeluri 

How to load test data into login history object for testing a class


  My requirement is - check partner user's lastlogin date and see if it is exceeded 180 days from today. So, i have schedulable apex class and checking records from user object by above condition and it is working fine. 
Now, how do we cook test data for above query ( lastlogindate is readonly field on user object and even, i cannot use login history to populate some test data due to same issue (read-ony) object. 

So, i am running with actual data however, it may be an issue going forward. Can anybody have suggestion on this.