Activity Forums Salesforce® Discussions How to insert password in apex test class of Salesforce?

  • Mallika

    Member
    July 21, 2020 at 6:11 AM

    Hi Aditya,
    Try this code. Hope it helps!

    @isTest
    public class SampleTest
    {
    	public static testMethod void LoginFail()
    	{
    		Sample  tp=new Sample ();
    		tp.loginPage();
    	}
    	public static testMethod void loginPass()
    	{
    		Account acc = new Account();
    		acc.Name ='mecrin';
    		acc.sic = '12345';
    		insert acc;
    		
    		Sample  tp=new Sample ();
    		tp.userName ='mecrin';
    		tp.password  ='12345';
    		
    		tp.loginPage();
    	}
    }

Log In to reply.

Popular Salesforce Blogs

Why Enroll in a Salesforce Administrator Course? Key Benefits for Your Career Advancement

Blog in

  In today's competitive digital landscape, organizations rely heavily on customer relationship management (CRM) systems to streamline their operations and build stronger customer relationships. As…

Popular Salesforce Videos