Hi,
The app I'm trying to test (with CodedUI and VS 2010 sp1) has a button that displays the string 'MyLogin'.
The button was created as a PopupControlContainerTool whose text property is in Login.SharedProps.Caption = 'MyLogin'.
My problem is that I can't access that string, because the code generated by CodedUi for that control is:
WinButton uILoginButton = this.myWindow.UI_frmMain_Toolbars_DoToolBar.UILoginButton;
The project has a reference to Infragistics4.Win.CodedUITest.UIA.VS10.v13.2.
How can I cast that WinButton into a PopupControlContainerTool so I can get the caption to verify it?
Thanks.
Hi Monica,
Thank you for contacting Infragistics Developer Support.
What you could do is to use the Name property of the WinButton:
Assert.IsTrue(UILoginButton.Name == "MyLogin");
This way you will be able to verify what the caption of the clicked button is.
Let me know if you have any additional questions.
Yes, but how can I be sure that the button's name is the same as that Infragistics control's caption?
Thank you for the reply.
From my test it seems that this property corresponds to the caption of the tools on the UltraToolbarsManager. Changing the SharedProps.Caption property of the tools, also changes the WinButton’s Name property in CodedUI. Also the SharedProps.Caption property corresponds to the Name field in the dropdown menu of the UltraToolbarsManger Tools in design time.
Please let me know if you have any additional questions.
Thanks, Dimitar, this is very helpful!
Monica