I have a modal dialog which I need to close/dismiss after I have identified it's presence and extracted it's text. The modal comes up when I click on the button to download a file and it says "Generating the debuginfo file. Please wait." This modal is present until the file download starts which is too long depending upon the debuginfo file size. Is there a way to close this dialog and exit with text extracted from it.
I am extracting the text using following code:
downloadText = WebDriverWait(self.driver,40).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "div.ui-dialog-content.ui-widgetcontent#dialog"))).get_attribute("innerHTML").split(">")[1]
Following is the html code for this modal:
<div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">
<span id="ui-id-1" class="ui-dialog-title">Download debug info</span>
<button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-dialog-titlebar-close" role="button" aria-disabled="false" title="close">
<span class="ui-button-icon-primary ui-icon ui-icon-closethick">
</span>
<span class="ui-button-text">close</span>
</button>
</div>
<div id="dialog" class="ui-dialog-content ui-widget-content" style="width: auto; min-height: 0px; max-height: none; height: 177px;">
<br>Generating the debuginfo file. Please wait.</div>
<div class="ui-resizable-handle ui-resizable-n" style="z-index: 90;">
</div>
<div class="ui-resizable-handle ui-resizable-e" style="z-index: 90;">
</div>
<div class="ui-resizable-handle ui-resizable-s" style="z-index: 90;">
</div>
<div class="ui-resizable-handle ui-resizable-w" style="z-index: 90;">
</div>
<div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se" style="z-index: 90;">
</div>
<div class="ui-resizable-handle ui-resizable-sw" style="z-index: 90;">
</div>
<div class="ui-resizable-handle ui-resizable-ne" style="z-index: 90;">
</div>
<div class="ui-resizable-handle ui-resizable-nw" style="z-index: 90;">
</div> ```