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

WPF Application: Assign value in gridviewcell and perform verification

1 Answer 65 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Darshana
Top achievements
Rank 1
Darshana asked on 02 Dec 2013, 07:50 PM
Hi,

Right Now I am working with WPF Application and I spent a lot of time to do some verification, but no success. Help me to do Automation with WPF Application. Our application is not Silverlight it's WPF Application.

Manual testing steps Are:
1) Take value of CurMktVal of one Perticular Fund. 
2) then Enter Value to Proposed alloc Amt ,say $ 50000.
3) Now Value of CurMktVal should be = Value from step 1 + Value From Step 2.
4) Also Want to check for footer Value as well.
5) Compare value of New CurMktVal and New Footer value


Code I tried for step 2 is:

 Telerik.WebAii.Controls.Xaml.Wpf.GridViewCell gCell = ActiveApplication.MainWindow.Find.ByAutomationId<CellElement65Textbox>("CellElement65Textbox");
            gCell.SetFocus();
            gCell.User.Click(MouseClickType.LeftDoubleClick);            
            var PropAlloc = "50000";
            Assert.AreEqual(PropAlloc,gCell.Text);
            gCell.Text = PropAlloc;

Let me know how Should I perform all these Actions. 


Please help me soon, So I can start working on this. I am stuck here.






































1 Answer, 1 is accepted

Sort by
0
Rodney
Telerik team
answered on 05 Dec 2013, 09:27 PM
Hi Darshana,

When you set the value for gCell, you should reference the recorded element in code like this:

Telerik.WebAii.Controls.Xaml.Wpf.GridViewCell gCell = Applications.WPF_Demosexe.Ledgex_Studio__BOFAmerica__Product_groupArbitrage_Products.ContentTextblock;

Notice how the element is named the same way that it is arranged hierarchically in the Elements Explorer. By referencing an element this way, you’ll take advantage of Test Studio’s existing find logic for the element.

For more information on referencing elements in code, you can review this document: How to Reference an Element in Code.

Try referencing your element's this way. Let us know if you continue to have issues. 



Regards,
Rodney
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Darshana
Top achievements
Rank 1
Answers by
Rodney
Telerik team
Share this question
or