Is XamlFindExpression applicable to WPF Desktop applications?

2 posts, 0 answers
  1. Georgi
    Georgi avatar
    1 posts
    Member since:
    Jul 2014

    Posted 04 Aug 2014 Link to this post

    Is this location method applicable for WPF Desktop applications?

    I am asking this question because it is defined under namespace 'ArtOfTest.WebAii.Silverlight', and it does not seems to work.

    Here is my test.

    Consider this call:


    It returns:

    ​<tradebutton Name="PART_BuyButton" Uid="10313144">
      <button Uid="38447936">
        <grid Name="grid" Uid="25709437">
          <border Name="Regular" Uid="30058349" />
          <border Name="OverlayRegular" Uid="2089687" />
          <border Name="OverlayHover" Uid="18807190" />
          <border Name="Pressed" Uid="35046986" />
          <border Name="Disabled" Uid="46987420" />
          <border Name="ContentHolder" Uid="20233597">
            <contentpresenter Uid="47884646">
              <textblock Uid="28308632">Buy</textblock>

    While the next one returns null:

    Console.WriteLine(profit.Find.ByExpression(new XamlFindExpression("TagName=tradebutton")));

    Is this:

      - a bug
      - unsupported feature
      - error on my side?

  2. Boyan Boev
    Boyan Boev avatar
    1025 posts

    Posted 07 Aug 2014 Link to this post

    Hi Georgi,

    Thank you for contacting us.

    You should make a slight change in your code. There is no TagName in WPF. Please change TagName with XamlTag:

    Console.WriteLine(profit.Find.ByExpression(new XamlFindExpression("XamlTag=tradebutton")));

    Hope this helps.

    Boyan Boev
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top