Assert for Image in MStest

Few days back while giving an interview in some R&D company. The interviewer who took my interview asked me one question, how will you assert images in test method and I was unable to answer this question, cuz I had never used this in my automation till now. Let me put this in clear way!!

Question: In your test method how will you assert for image. Like assert that two given images are same or equal?

Answer: I was not having clear answer to this question. Just I told that we have to customize our Assert for images assert.

Then I come back and wrote piece of code to assert the image for AreEqual.

Here is the code. Thanks to interviewer who forced me to think about this.

Test Method:

Assert Class for Image(Assert.AreEqual)

Please feel free to provide your Feedback and comments!!
Thanks,
Md. Jawed


http://pagead2.googlesyndication.com/pagead/show_ads.js

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s