-3

How to verify a logo in webpage using selenium webdriver? I have different user level one is as Admin and another is client, admin can put a different logo for client, so in both level i need to verify that company logo is same or both are different using selenium webdriver with java, so is that possible to compare the image names? any solution for this?

Abhram
  • 49
  • 1
  • 1
  • 6
  • Your code trials please. – undetected Selenium Jan 15 '18 at 14:57
  • Define "verify a logo." Does that mean pixel by pixel comparison of the expected vs actual images to make sure they are the same? or maybe the image name is the same? Size comparison? Add some details and post the code you have tried, the results, and what you expect. – JeffC Jan 15 '18 at 15:26
  • selenium doesn't supports for image comparison, we can only validate the image name, size.. , please add some more details to your question. – Pradeep hebbar Jan 15 '18 at 17:08

2 Answers2

2

First, make sure that the logo image name is always the same. Then check it with a boolean. For c# it would be:

bool logoPresent = driver.FindElement(By.XPath("xpath here")).Displayed;
Assert.IsTrue(logoPresent);
Anand
  • 1,899
  • 1
  • 13
  • 23
1

Sikuli tool can be used to verify images. Actual image should be saved and compared against the expected image