commentBlock = $("#comment_post_36512").find('.comment-blocks'); commentBlock.find('.loading').hide(); commentBlock.find('.see-all-comments').hide(); commentBlock.html("
<\/a>
\"it_user376134<\/a>
it_user376134<\/a>Senior Automation Test Developer/Automation Test Architect at a computer software company with 51-200 employees<\/span><\/div>
<\/span>Real User<\/span><\/div>
<\/i><\/div>
<\/i>Report as inappropriate<\/a><\/div><\/div><\/div>

It depends on which type of the windows dialog:\n
If it is a new browser dialog, selenium is able to click the button on that dialog by using switch windows method because your main window is window 1, then selenium opened a new one(the windows dialog) is window 2, switch to window 2 and click whatever you want.<\/p>\n\n

If it is a modal, you can just directly operate that, since it is in the same window/browser.<\/p>\n\n

Selenium test is not really a blackbox tests, if you know the front-end code of the application under testing, that would help you to choose correct selenium API to do that.<\/p>\n\n

And also you can use \n
JavascriptExecutor js = (JavascriptExecutor)driver;\n
js.executeScript(\"arguments[0].click();\", \n
It is working for some cases too. It is still depends on the front-end code.<\/p>\n\n

For your case, if it is a File download dialog window, I assume there is only \"yes\" and \"no\" button on it.<\/p>\n\n

If it is an authentication window which requires you to enter \"username\" and \"password\", you may change your url to this way: driver.get(\"http://\$username:\$password@\$yourURL\")<\/p><\/div>