I have a dropdown list, when I click on any of the dropdown value then a modal get opens, When I click outside the modal, it will get close. How to handle it with Selenium WebDriver?
here is my Modal Code
<div class="modal fade bd-example-modal-sm show" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" style="display: block;">
<div class="modal-dialog modal-sm">
<div class="modal-content">You click on Dropdown hover Option
</div>
</div>
I have tried with below code
driver.switchTo().defaultContent();
and
driver.switchTo().alert().dismiss();
But both are not working.