or
DownloadDialogsHandler exportDownload = new DownloadDialogsHandler(Manager.ActiveBrowser, DialogButton.SAVE, fileSave, Desktop);Manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;Manager.DialogMonitor.Start();HtmlControl exportSelectCSV = new HtmlControl(Find.ByAttributes("class=~SiteExportLink"));exportSelectCSV.Click();exportDownload .WaitUntilHandled(); if (File.Exists(fileSave + "export.csv"))
{ File.Delete(fileSave + "export.csv"); } SaveAsDialog saveExport = new SaveAsDialog(ActiveBrowser, DialogButton.SAVE, fileSave + "export.csv", Desktop); Manager.DialogMonitor.AddDialog(saveExport); IEDownloadDialog ieDialog = new IEDownloadDialog(ActiveBrowser, DialogButton.SAVE, Desktop); Manager.DialogMonitor.AddDialog(ieDialog); IEDownloadCompleteDialog dlComplete = new IEDownloadCompleteDialog(ActiveBrowser, DialogButton.CLOSE, Desktop); Manager.DialogMonitor.AddDialog(dlComplete); Manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle; Manager.DialogMonitor.Start(); HtmlControl exportSelectCSV = new HtmlControl(Find.ByAttributes("class=~SiteExportLink")); exportSelectCSV.Click(); ieDialog.WaitUntilHandled(); saveExport.WaitUntilHandled(); dlComplete.WaitUntilHandled();
HtmlControl filterReset = new HtmlControl(Find.ByAttributes("id=FilterActionBarReset")); filterReset.Click();
it is used to find this element
<div class="rightAction" id="FilterActionBarReset" jQuery15206472203044463981="175">
nipTextBox.MouseClick();
browser.Desktop.KeyBoard.TypeText(nip);
browser.RefreshDomTree();
var ul = browser.Find.jQuery().classes("ui-autocomplete").last<HtmlUnorderedList>();
var a = ul.AllItems.First().Find.jQuery().child().first<HtmlAnchor>();
a.MouseClick();
Unfortunatle autocomplete menu doesn't appear.
browser.NavigateTo("http://example.com");// Do some simple interaction with the page, // e.g. using textboxes and buttons to log into the website// [code omitted]// Problem occurs here:// WITHOUT this Sleep statement, the following .Click() is executed correctly.// WITH this Sleep statement, the .Click() ends up on the wrong DOM elementThread.Sleep(4000);var link = browser.Find.ByExpression<HtmlAnchor>("href=some-href-value-in-the-page");link.Click();Hi, I am using upload file dialog to upload files. the upload file dialogs exist in multiple pages. when the dialgo opens, however, sometimes it uses the previous file path from UI. do I do anything wrong? I have debugged and the filePath is correct but from UI I can see the actual file path entered in the dialog is from previous page's upload file dialog. I am using IE8. Thanks!
FileUploadDialog
uploadDialog = new FileUploadDialog(manager.ActiveBrowser, filePath, dismissButton, dialogTitle);
manager.DialogMonitor.AddDialog(uploadDialog);
manager.DialogMonitor.Start();
browsebutton.Click();
uploadDialog.WaitUntilHandled(5000);
manager.DialogMonitor.Stop();
manager.DialogMonitor.RemoveDialog(uploadDialog);
