public class Button { public RadButton Control; public Button() { } public Button(string automationId) { AutomationId = automationId; Control = Manager.Current.ActiveBrowser.SilverlightApps()[0].Find.ByAutomationId<RadButton>(automationId); } public string AutomationId { get; set; } public void Click() { this.Control.User.Click(); }....}objParent.Find.ByName("txtName").TextContent Output : "" (Empty String) objParent.Find.ByName<TextBox>("txtName").Text Output : String Value Settings.Current.UnexpectedDialogAction = UnexpectedDialogAction.HandleAndFailTest;
manager.DialogMonitor.Start();
// Attempted to check if the line below captures the dialog
int counter= manager.DialogMonitor.Dialogs.Count;
//This actually adds a dialog --- not what is needed
manager.DialogMonitor.AddDialog(new AlertDialog(manager.ActiveBrowser,DialogButton.OK));
Any help appreciated
I have the DOM for a button in the below fashion
<input name="TestButton" class="action-button" id="TestButton" role="button" type="submit" jQuery15109470652432947769="3" value="Test"/>
Im getting the HTMLInputSubmit control by Findexpression (id="TestButton")
If i perform Click Action it is not working.
Tried HTMLInputSubmit.MouseClick and it works in my local machine
And in my test run, which triggers this in remote machines, this fails to perform MouseClick action.
also tried InvokeScript(JqueryScripts.ClickbyID() with script event type set to OnClick - Not Working
Anybody can shed some light on this ??
[Test]public void SampleWebAiiTest(){ Settings.Current.Web.EnableSilverlight = true; // Launch a browser instance Manager.LaunchNewBrowser(BrowserType.InternetExplorer); // The active browser ActiveBrowser.NavigateTo("http://demos.telerik.com/silverlight/#GridView/PagingLargeData"); SilverlightApp app = ActiveBrowser.SilverlightApps()[0]; int verticalOffset = 0; // Holds the current vertical offset in the viewport int viewPortHeight; // The height of the visible part of the grid int extentHeight; // The total height of the grid, visible plus non-visible // Copy the RadGridView into a local variable as a shortcut RadGridView grid = app.Find.ByAutomationId<RadGridView>("GridView"); // Grab the VirtualizingPanel contained in the RadGridView. This is used to control the viewable portion of the grid. FrameworkElement virtualizingPanel = grid.Find.ByType("GridViewVirtualizingPanel"); // Detect the view port height and the extent height viewPortHeight = (int)virtualizingPanel.GetProperty(new AutomationProperty("ViewportHeight", typeof(int))); extentHeight = (int)virtualizingPanel.GetProperty(new AutomationProperty("ExtentHeight", typeof(int))); // Make sure it is scrolled to the very top // Walk through the entire grid verifying the data virtualizingPanel.InvokeMethod("SetVerticalOffset", 0); int index; int totalCount = 0; string rowText; while (verticalOffset < extentHeight) { foreach (GridViewRow r in grid.Rows) { totalCount++; index = r.Index; rowText = string.Join(", ", r.Cells.Select(item => item.Text)); } // Scroll down one page verticalOffset += viewPortHeight; virtualizingPanel.InvokeMethod("SetVerticalOffset", verticalOffset); }}