Tuesday 29 November 2011

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


Friday 25 November 2011

White: An UI Automation tool for windows application

White: An UI Automation tool for windows application


Finaly i wrote an article on White. just now published this article on code project.
below is the link for the same.
Please have a look and provide your feedback.
 
http://www.codeproject.com/KB/testing/WhiteCalculatorTest_cs.aspx
 
 
 
Thanks,
Md. jawed
 
 

Thursday 17 November 2011

Adding a Code Snippet into Visual Studio2010 to enclose a block of code.

While surfing web I came across a nice blog post by PRABATH .


Who has nicely explained about adding the code snippet in visual studio 2010 to enclose the block of code?. The best part about this post is that he tried best to explain all the steps through screen shot which make the blog post more clear and easy to understand.




Thanks to Prabath for this nice work.

Follow the below link to get the details.

http://prabathf.blogspot.com/2010/02/code-snippets-in-visual-studio-2010.html
 
Keep up the good job buddy :)
 
Thanks,
Md. jawed

Tuesday 15 November 2011

Get the Table Header names using watin

The following code will get Table header names.


TableRow tableRow = Browser.Table("headerTable").TableRow("headerRow");
StringCollection headerValues = new StringCollection();

foreach (Element e in tableRow.Elements)
 {
    if (e.TagName.ToUpper()=="TH")
    {
        headerValues.Add(e.Text);
     }
 }

Thanks,
Md. Jawed