I have to use Selenium to test an application with a live time stamp.
My code is:
String validationmessage=driver.findElement(By.xpath("//div[@id='part_log_details']/p[1]")).getText();
System.out.println(validationmessage);
Assert.assertEquals("12-27-2017 - 23:00:47 : updated inventory from 20 to 21. Reason : Quantity received from PO #SCT1075", validationmessage);
But if I run it again, the time stamp and inventory will change to the following:
12-27-2017 - 23:45:47 : updated inventory from 21 to 22. Reason : Quantity received from PO "#SCT1076"
Any one give me the solution
The HTML is:
<div id="part_log_details" style="">
<p>12-28-2017 - 02:21:21 : updated inventory from 23 to 25. Reason : Quantity received from PO #SCT1077</p>
<p>12-28-2017 - 02:16:05 :updated inventory from 21 to 23. Reason : Quantity received from PO #SCT1076
<p>12-27-2017 - 23:00:47 : updated inventory from 20 to 21. Reason : Quantity received from PO #SCT1075</p>
How do I handle this situation?