Wednesday, 15 January 2014

selenium - Comparing two strings in Java and seeing unknown characters in the Trace -


I am using Selenium WebDriver to log in to a site and checking the date on the page and Ensuring that the date has been updated to Today. I'm getting a comparison error that looks:

  org.junit Compression failer: Expected: [0] As of 3/17/2015 & gt; But it was: & lt; As [] 3/17/2015 & gt; At org.junit.Assert.assertEquals (Assert.java:115) on org.junit.Assert.assertEquals (assert.java:144) at com.example.tests.CubeTime.testCubeTime (CubeTime.java59)  < / Pre> 

I'm not sure where my code resembles my code for comparison with [0] and []

  assertEquals ("as" + datestring, SysDateshort); Square brackets are only those that were expected ( [0]  

) and what was found ( [] ). They are not really part of any string.

Therefore, in this case, a 0 was expected, but instead found an empty space.


No comments:

Post a Comment