public void CheckName() { IE ie = new IE("http://localhost:4066/SampleWebSite/Default.aspx"); ie.TextField(Find.ById("txtNickName")).TypeText("Suresh"); ie.Button(Find.ById("btnCheck")).Click(); AlertAndConfirmDialogHandler myHandler = new AlertAndConfirmDialogHandler(); //Declare an object of HTMLDialog HtmlDialog myModalHandler; ie.AddDialogHandler(myHandler); //The button that opens the HTML dialog must be clicked with NO WAIT ie.Link(Find.ByText("File Download")).ClickNoWait(); //Hook the PopUp by title/name/type etc. myModalHandler = ie.HtmlDialog(Find.ByTitle(new Regex("Do you want to open or save this file?"))); //Click on button which is on PopUp window. myModalHandler.Button(new Regex("BtnSubmit")).ClickNoWait(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)