or
| [TestMethod] |
| public void LocalSilverlightTest() |
| { |
| Manager.LaunchNewBrowser(BrowserType.InternetExplorer); |
| ActiveBrowser.NavigateTo("http://localhost:1031/SampleSilverlightAppTestPage.aspx"); |
| SilverlightApp app = ActiveBrowser.SilverlightApps()[0]; |
| Assert.IsNotNull(app); |
| SampleSilverlightApp.MyCustomControl ctrl = app.Find.ByName<SampleSilverlightApp.MyCustomControl>("myCustomControl"); |
| Button btn = myCustomControl.Find.ByName<Button>("btnLogin"); |
| btn.User.Click(); |
| } |
| public partial class MyCustomControl : UserControl |
| { |
| public MyCustomControl() |
| { |
| InitializeComponent(); |
| } |
| private void btnLogin_Click(object sender, RoutedEventArgs e) |
| { |
| MessageBox.Show("Custom Control"); |
| } |
| } |
var sizeDropbox = itemSaved.Find.ByXPath<HtmlSelect>("//select[1]"); var selectedSizeIndex = new Random().Next(1, sizeDropbox.Options.Count - 1); var selectedSize = sizeDropbox.Options[selectedSizeIndex]; sizeDropbox.SelectByIndex(selectedSizeIndex);Can anyone help, please?var quantityDropbox = itemSaved.Find.ByXPath<HtmlSelect>("//select[2]"); var selectedQuantityIndex = new Random().Next(1, quantityDropbox.Options.Count - 1); var selectedQuantity = quantityDropbox.Options[selectedQuantityIndex]; quantityDropbox.SelectByIndex(selectedQuantityIndex);(The itemSaved object is the TableRow parent element)
DataGrid grid = app.Find.ByName("cboResident").As<DataGrid>();Grid containerGrid = app.Find.ByText("SomeText").Parent("Grid").As<Grid>();