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

Popular Salesforce Videos