IAdapter
IAdapter

Reputation: 64747

How to click on embedded alert in SeleniumIDE?

In HTML there is the code(its not my page)

<script>
alert('1');
</script>

How can I test it with Selenium IDE (click the alert) ???

I tried answers from this question Click in OK button inside an Alert (Selenium IDE) but it does not work.

Upvotes: 2

Views: 1046

Answers (3)

Dave DuPlantis
Dave DuPlantis

Reputation: 6572

Selenium IDE does not currently handle alerts. There is an open issue concerning the ability to handle alerts and prompts; unfortunately it's been open for quite some time (since Halloween 2007), so your best bet is to split your test into two parts, one before the alert and one after it, and dismiss the alert manually.

Upvotes: 1

PaulRoberts
PaulRoberts

Reputation: 19

There are a number of functions that help you deal with alerts/prompts/confirmations. Here are a few that I found:

    defaultSelenium.chooseCancelOnNextConfirmation();
    defaultSelenium.chooseOkOnNextConfirmation();
    defaultSelenium.getAlert();
    defaultSelenium.getPrompt();
    defaultSelenium.isAlertPresent();
    defaultSelenium.isConfirmationPresent();
    defaultSelenium.isPromptPresent();

Upvotes: 0

Martin Jespersen
Martin Jespersen

Reputation: 26183

You cannot, sorry. alert is a modal box that cannot be programmability dismissed, it requires user interaction (which is by design)

Upvotes: 0

Related Questions