/// <summary> /// Clicks the specified button on the <see cref="MessageBox"/>. /// </summary> /// <param name="driver">The <see cref="WisejWebDriver"/> to use.</param> /// <param name="resultButton">The result button to click.</param> /// <param name="timeoutInSeconds">The number of seconds to wait for the MessageBox (default is 5).</param> public static void MessageBoxButtonClick(this WisejWebDriver driver, DialogResult resultButton, int timeoutInSeconds = 5) { MessageBox messageBox = driver.GetMessageBox(true, timeoutInSeconds); messageBox.ButtonClick(resultButton); }
/// <summary> /// Clicks the specified button on the <see cref="MessageBox"/> with the specified parameters. /// </summary> /// <param name="driver">The <see cref="WisejWebDriver"/> to use.</param> /// <param name="title">The title of message box to search for.</param> /// <param name="icon">The MessageBox icon to look for.</param> /// <param name="message">The message to search for.</param> /// <param name="resultButton">The result button to click.</param> /// <param name="timeoutInSeconds">The number of seconds to wait for the MessageBox (default is 5).</param> public static void MessageBoxButtonClick(this WisejWebDriver driver, string title, MessageBoxIcon icon, string message, DialogResult resultButton, int timeoutInSeconds = 5) { MessageBox messageBox = driver.GetMessageBox(title, icon, message, true, timeoutInSeconds); messageBox.ButtonClick(resultButton); }
/// <summary> /// Clicks the specified button on the <see cref="MessageBox"/> with the specified title. /// </summary> /// <param name="driver">The <see cref="WisejWebDriver"/> to use.</param> /// <param name="title">The MessageBox title to search for.</param> /// <param name="resultButton">The result button to click.</param> /// <param name="timeoutInSeconds">The number of seconds to wait for the MessageBox (default is 5).</param> public static void MessageBoxWithTitleButtonClick(this WisejWebDriver driver, string title, DialogResult resultButton, long timeoutInSeconds = 5) { MessageBox messageBox = driver.GetMessageBoxWithTitle(title, true, timeoutInSeconds); messageBox.ButtonClick(resultButton); }
/// <summary> /// Clicks the specified button on the <see cref="MessageBox"/> with the specified icon. /// </summary> /// <param name="driver">The <see cref="WisejWebDriver"/> to use.</param> /// <param name="icon">The MessageBoxIcon to look for.</param> /// <param name="resultButton">The result button to click.</param> /// <param name="timeoutInSeconds">The number of seconds to wait for the MessageBox (default is 5).</param> public static void MessageBoxWithIconButtonClick(this WisejWebDriver driver, MessageBoxIcon icon, DialogResult resultButton, long timeoutInSeconds = 5) { MessageBox messageBox = driver.GetMessageBoxWithIcon(icon, true, timeoutInSeconds); messageBox.ButtonClick(resultButton); }
public void W010_AskQuitNo() { TestDriver.SleepDebugTest(2000); // get MainPage and check it's visible Page mainPage = TestDriver.WidgetGet <Page>("MainPage"); // click exit on MainPage mainPage.ButtonClick("exit"); var title = "Exit Application"; var message = "Do you want to exit now?"; var icon = MessageBoxIcon.Question; // get MessageBox using all parameters check it's enabled MessageBox messageBox = TestDriver.GetMessageBox(title, false, icon, message); // click "No" messageBox.ButtonClick(DialogResult.No); // check messageBox doesn't exist TestDriver.MessageBoxAssertNotExists(title, false, icon, message); }