none
How to find the elements in Silverlight Application by C# Code?

    Question

  • I am a Software Tester and for doing automation i need to find the elements and their controls. Please help me "How to write the code for getting the elements from Silverlight Application by C# Code."
    Friday, August 16, 2013 5:55 AM

All replies

  • Hi,

    probably you want this.

    Let me know if that helped or you need something else.


    One good question is equivalent to ten best answers.

    Friday, August 16, 2013 6:10 AM
  • Thanks for responding. Your answer was somehow matching. But i want that how to find the elements in the silverlight application by C# coding. Please share some basic tutorials link or some way for finding the element.

    Friday, August 16, 2013 7:16 AM
  • Hi,

    var textBoxes = rootControl.GetVisualChildren.OfType<TextBox>(); // only direct children ("flat")
    var textBoxes = rootControl.GetVisualDescendents.OfType<TextBox>(); // all children (recursively)

    these are I think C# code. What else do you need?


    One good question is equivalent to ten best answers.

    Friday, August 16, 2013 11:03 AM