Warning: "The Type Assert is depecrated" | Selenium Forum
M
Posted on 24/02/2016
Hi Ashish,

I was just executing the module 8 Junit code and I found some warning coming in the line
Line: Assert.assertEquals("Hello", "Hello123") in LoginTest.java.
Could you please tell me how to overcome this warning.

Thanks
Pavan

M
Replied on 24/02/2016

what is the warning?


M
Replied on 25/02/2016

Warning is "The Type Assert is deprecated"


M
Replied on 25/02/2016

You're using junit.framework.Assert instead of org.junit.Assert.


http://stackoverflow.com/questions/24013210/assert-in-junit-framework-has-been-deprecated-what-use-next


M
Replied on 27/05/2018

Even I too faced error but working fine as

package testcases;

import org.junit.Assert;
import org.junit.Test;

public class TestAssert {

@Test
public void run()
{
int a = 1000;
int b = 1001;
/*if(a==b)
{
System.out.println("PASS");
}
else
{
System.out.println("FAIL");
}*/

Assert.assertEquals(a, b);

}

}

Thanks a lot!