This is a migrated thread and some comments may be shown as answers.

Is XamlFindExpression applicable to WPF Desktop applications?

1 Answer 58 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Georgi
Top achievements
Rank 1
Georgi asked on 04 Aug 2014, 11:57 AM
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:

Console.WriteLine(profit.Find.ByName<Button>("PART_BuyButton").ToXml());

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>
        </contentpresenter>
      </border>
    </grid>
  </button>
</tradebutton>


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?

1 Answer, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 07 Aug 2014, 10:28 AM
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.

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Georgi
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Share this question
or