java.lang.ClassCastException: java.lang.StackOverflowError cannot be cast
to java.lang.Exception
Actually m facing the below mentioned error while executing my java program
Exception in thread "pool-1-thread-1" java.lang.ClassCastException:
java.lang.StackOverflowError cannot be cast to java.lang.Exception
Actually i have a java class called Test_A where it contains following
methods called Login() and Logout() and have a another java class called
Test_B where it contains method VerifyValidUser().
class Test_A {
Test_B b = new Test_B();
public void login()
{
driver.findElement(By.name("userName")).sendKeys(userName);
driver.findElement(By.name("password")).sendKeys(password);
driver.findElement(By.name("login")).click();
b.verifyLoginValidUser();
}
public void logout()
{
driver.findElement(By.linkText("SIGN-OFF")).click();
}
}
class Test_B {
Test_A a = new Test_A()
public void verifyLoginValidUser()
{
if(isElementPresent(By.linkText("SIGN-OFF")))
{
}
a.logout();
} }
So while executing the above code it throws me above metioned error message
Can anyone tel me the reason behind it
Thanks
No comments:
Post a Comment