In this tutorial, Automate image test using selenium, We are going to show how we can test webpage or website images against pre-defined image and generate test result based on the difference. This will be helpful for test automation where we have to validate if images are correctly displayed in webpage or not.
We have also solved the DeprecationWarning: executable_path has been deprecated selenium python by using chromedriver as a Service object.
If you face issue on final image not being rendered properly for png image, Please convert image to RGB before comparing as shown below
im1 = Image.open(input_logo).convert('RGB')
im2 = Image.open(output_logo).convert('RGB')