Am using the selenium web driver for internet explorer (IEDriverServer_x64_2.44.0)
I am trying to click on a button which is on a jquery dialog MY Code is as follows:
$("#dialog-text").html(dlg_message);
$("#dialog-msg").dialog({
bgiframe: true,
autoOpen: false,
height: 'auto',
modal: true,
draggable: false,
title: dlg_title,
buttons: btns,
close: function () {
//$('body').css('overflow', 'visible');
for (var item in controlsToEnable)
getControl(controlsToEnable[item]).disabled = false;
},
open: function (event, ui) { $('.ui-widget-overlay').css('width', '100%'); }
});
$("#dialog-message").dialog('open');
$(this).parents('.ui-dialog-buttonpane button:eq(' + indexButtonFocused + ')').focus();
<div id="dialog-msg" style="display: none;">
<p style="margin: 0 7px 50px 7px;">
<span class="ui-icon ui-icon-circle-check"></span><span id="dialog-text">MESSAGE</span>
</p>
</div>
This pop up comes with 2 buttons Yes and No (i store this in the var: btns)btns['No'] and btns['Yes'] How do I click on this button? I have tried,
driver.SwitchTo().Frame(0);
driver.FindElement(By.Name("No")).Click();
also tried,
driver.SwitchTo().Alert().Accept(); --> this works for confirm message
So basically I am trying to click on the buttons of this dialog box and am not able to.