java.lang.AssertionError:

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

java.lang.AssertionError:

monika16jha
HI,

I am getting below error , Please help me to resolve the issue.

java.lang.AssertionError: expected [Fields with Clear Icon] but found [Clear Icon]
at org.testng.Assert.fail(Assert.java:96)
at org.testng.Assert.failNotEquals(Assert.java:776)
at org.testng.Assert.assertEqualsImpl(Assert.java:137)
at org.testng.Assert.assertEquals(Assert.java:118)
at org.testng.Assert.assertEquals(Assert.java:453)
at org.testng.Assert.assertEquals(Assert.java:463)


Code:- 
@Test(dataProvider = "byColumnName", description = "Verify displaying clear icon", priority = 1)
  public void verifyDisplayingClearIconComponent(ControlTestData data, TestData testdata) {
    driver = getDriver();
    driver.get(url);
    objHomePage = new LoginPage(driver)
      .enterCredentials(testdata.username, testdata.password)
      .loginSuccess();
    logStep(StepStatus.PASS, "User should be able to login", "APP Login is Successful", true);
    logStep(StepStatus.PASS, "It should display Clear Icon fields on the page", "Clear Icon component is displaying all fields successfully", true);
    Assert.assertEquals(objClearIconPage.hasClearIconTitleDisplayed(), testdata.getComponentTitle());
    logStep(StepStatus.PASS, "It should display Clear Icon Title", " Title is matching as expected", true);
  }

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/70efc294-a2c8-40b2-a4f0-8a094dd32da1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.AssertionError:

total QA
Hi,

Its clear that the expected Value is not matching with the Actual value being fetched. There is an issue in your below code:

   Assert.assertEquals(objClearIconPage.hasClearIconTitleDisplayed(), testdata.getComponentTitle());

Regards,
total-qa.com


On Wednesday, July 11, 2018 at 1:27:44 PM UTC+5:30, monika16jha wrote:
HI,

I am getting below error , Please help me to resolve the issue.

java.lang.AssertionError: expected [Fields with Clear Icon] but found [Clear Icon]
at org.testng.Assert.fail(Assert.java:96)
at org.testng.Assert.failNotEquals(Assert.java:776)
at org.testng.Assert.assertEqualsImpl(Assert.java:137)
at org.testng.Assert.assertEquals(Assert.java:118)
at org.testng.Assert.assertEquals(Assert.java:453)
at org.testng.Assert.assertEquals(Assert.java:463)


Code:- 
@Test(dataProvider = "byColumnName", description = "Verify displaying clear icon", priority = 1)
  public void verifyDisplayingClearIconComponent(ControlTestData data, TestData testdata) {
    driver = getDriver();
    driver.get(url);
    objHomePage = new LoginPage(driver)
      .enterCredentials(testdata.username, testdata.password)
      .loginSuccess();
    logStep(StepStatus.PASS, "User should be able to login", "APP Login is Successful", true);
    logStep(StepStatus.PASS, "It should display Clear Icon fields on the page", "Clear Icon component is displaying all fields successfully", true);
    Assert.assertEquals(objClearIconPage.hasClearIconTitleDisplayed(), testdata.getComponentTitle());
    logStep(StepStatus.PASS, "It should display Clear Icon Title", " Title is matching as expected", true);
  }

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c2ffae66-ac91-4c12-8687-ed46b644dc08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.