locked
How to verify/validate look and feel of page and its content using coded ui RRS feed

  • Question

  • Hi,

    As per my understanding we cannot compare images pixel by pixel using coded ui but the other automation tools do and it helps a lot in automation testing. So is there any alternative by which we can verify this.

    Below are list of things which i wanted to verify using coded ui, Please suggest appropriate solution:

    1. Verify Image

    2. Verify Font, Color, Position/Dimension of Text.

    3. How to validate if new element added in page, which wasn't there while hand-coding. But test gets passed as it isn't part of test method.

    Will add more once i get into it.

    Thanks,


    @Vj...

    Thursday, September 25, 2014 1:56 PM

Answers

  • Hi VijayG7,

    >>1. Verify Image

    According to your description, could you please tell us if you would like to verify an image’s pixel property using coded UI test.

    If yes, as far as I know, we can’t validate the pixel property of the image directly since there is no property which exposes its “pixel”.

    If no, you mean that you would like to verify the image’s other properties such as the following screen shot display some image properties using coded UI test Builder, am I right?

    If yes, I suggest you could try to use the Add Assertions method to verify if the image control is correct using the Coded UI Test Builder.

    >> Verify Font, Color, Position/Dimension of Text.

    About these issue, I think that there is no direct support for verifying these properties value in coded UI test. As far as I know, if you want to verify a Font/Color of Text in coded UI test, you will have to modify the accessibility implementation to return Font/Color and then write a custom property for the control. I find a similar thread about this issue, maybe you get useful information.

    Reference:

    http://social.msdn.microsoft.com/Forums/en-US/4dd2e71e-eb49-47d1-af71-a0523e09f347/how-to-verify-the-font-properties-of-text-on-web-page?forum=vsautotest

     In addition, I find a blog about coded UI test Extensibility, please see: Series on Coded UI Test Extensibility (see 9 about Extending supported properties set of a control)

    >>3. How to validate if new element added in page, which wasn't there while hand-coding. But test gets passed as it isn't part of test method.

    I suggest you can hand code to add some search properties of the new UI element control to search the new UI element control and then add assert method to verify the new element value in UIMap.Designer.cs file. I find a blog about how to hand code to find a control in coded UI test, please see:

    http://blogs.msdn.com/b/balagans/archive/2009/12/28/9941582.aspx

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.


    • Edited by Tina-Shi Friday, September 26, 2014 5:11 AM
    • Marked as answer by Tina-Shi Monday, October 6, 2014 9:30 AM
    Friday, September 26, 2014 5:11 AM
  • Hi Vijay,

    Glad to receive your reply.

    >> I understand that "CODED UI" doesnt have direct support for many of such UI related properties. Still we named the tool as "CODED UI". Does it suits?

    AS far as I know, coded UI test is used to verify that the UI control to check the user interface if it is correct.

    Generally, if you want to know a UI control have which properties in coded UI test, you can use the Add Assertions method to verify a UI control using coded UI test builder and then the UI control’s all properties are displayed in Property column.

    If the property column didn’t have the property which you want to verify property, you will need to custom the control by writing the extension for the UI control.

    We know that it will require the deep development knowledge, if it is hard for you to write the extension, I suggest you submit this feature request: http://visualstudio.uservoice.com/forums/121579-visual-studio. The Visual Studio product team is listening to user voice there. You can send your idea there and people can vote.

    Thanks for your understanding.

    Have a nice day!

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.


    • Edited by Tina-Shi Tuesday, September 30, 2014 10:33 AM
    • Marked as answer by Tina-Shi Monday, October 6, 2014 9:30 AM
    Tuesday, September 30, 2014 10:33 AM

All replies

  • Hi VijayG7,

    >>1. Verify Image

    According to your description, could you please tell us if you would like to verify an image’s pixel property using coded UI test.

    If yes, as far as I know, we can’t validate the pixel property of the image directly since there is no property which exposes its “pixel”.

    If no, you mean that you would like to verify the image’s other properties such as the following screen shot display some image properties using coded UI test Builder, am I right?

    If yes, I suggest you could try to use the Add Assertions method to verify if the image control is correct using the Coded UI Test Builder.

    >> Verify Font, Color, Position/Dimension of Text.

    About these issue, I think that there is no direct support for verifying these properties value in coded UI test. As far as I know, if you want to verify a Font/Color of Text in coded UI test, you will have to modify the accessibility implementation to return Font/Color and then write a custom property for the control. I find a similar thread about this issue, maybe you get useful information.

    Reference:

    http://social.msdn.microsoft.com/Forums/en-US/4dd2e71e-eb49-47d1-af71-a0523e09f347/how-to-verify-the-font-properties-of-text-on-web-page?forum=vsautotest

     In addition, I find a blog about coded UI test Extensibility, please see: Series on Coded UI Test Extensibility (see 9 about Extending supported properties set of a control)

    >>3. How to validate if new element added in page, which wasn't there while hand-coding. But test gets passed as it isn't part of test method.

    I suggest you can hand code to add some search properties of the new UI element control to search the new UI element control and then add assert method to verify the new element value in UIMap.Designer.cs file. I find a blog about how to hand code to find a control in coded UI test, please see:

    http://blogs.msdn.com/b/balagans/archive/2009/12/28/9941582.aspx

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.


    • Edited by Tina-Shi Friday, September 26, 2014 5:11 AM
    • Marked as answer by Tina-Shi Monday, October 6, 2014 9:30 AM
    Friday, September 26, 2014 5:11 AM
  • Hi Tina,

    Thanks for your comment. As per your replies i understand that "CODED UI" doesnt have direct support for many of such UI related properties. Still we named the tool as "CODED UI". Does it suits?.

    As its mainly used for functional testing and not UI, as per my understanding. It doesnt much concerned about UI.

    Thanks,

    Vijay


    @Vj...

    Tuesday, September 30, 2014 6:50 AM
  • Hi Vijay,

    Glad to receive your reply.

    >> I understand that "CODED UI" doesnt have direct support for many of such UI related properties. Still we named the tool as "CODED UI". Does it suits?

    AS far as I know, coded UI test is used to verify that the UI control to check the user interface if it is correct.

    Generally, if you want to know a UI control have which properties in coded UI test, you can use the Add Assertions method to verify a UI control using coded UI test builder and then the UI control’s all properties are displayed in Property column.

    If the property column didn’t have the property which you want to verify property, you will need to custom the control by writing the extension for the UI control.

    We know that it will require the deep development knowledge, if it is hard for you to write the extension, I suggest you submit this feature request: http://visualstudio.uservoice.com/forums/121579-visual-studio. The Visual Studio product team is listening to user voice there. You can send your idea there and people can vote.

    Thanks for your understanding.

    Have a nice day!

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.


    • Edited by Tina-Shi Tuesday, September 30, 2014 10:33 AM
    • Marked as answer by Tina-Shi Monday, October 6, 2014 9:30 AM
    Tuesday, September 30, 2014 10:33 AM