How getAlert() works

236 views
Skip to first unread message

kairei

unread,
Oct 26, 2009, 3:08:36 AM10/26/09
to webdriver
Hi

i am using getAlert() method of webdriverBackedSelenium.java

and notice the note of the method is this:
---------------------------------------------------------------
Getting an alert has the same effect as manually clicking OK.
If an alert is generated but you do not consume it with getAlert,
the next Selenium action will fail.
---------------------------------------------------------------

the code is this:
---------------------------------------------------------------
public String getAlert() {
throw new UnsupportedOperationException("getAlert");
}
---------------------------------------------------------------

but i don't understand how the getAlert() click the [OK] button,
do i need to write extra code ?

Best Regards

Simon Stewart

unread,
Oct 26, 2009, 9:17:44 AM10/26/09
to webd...@googlegroups.com
Short answer: it's not implemented yet. Long answer: I'm waiting for
the webdriver api to support getting alerts before using that to
handle alerts in the selenium emulation.

Simon

kairei

unread,
Oct 26, 2009, 10:18:33 AM10/26/09
to webdriver
Hi Simon

Thanks for you help.

I am stuck by the Alert Dialog in the firefox testing,
could you give me some suggestion to resolve the
problem?

like this:
FirefoxDriver driver = new FirefoxDriver();
Alert alert = driver.switchTo().alert();
alert.accept

or run javascript?

Best Regards.


On Oct 26, 9:17 pm, Simon Stewart <simon.m.stew...@gmail.com> wrote:
> Short answer: it's not implemented yet. Long answer: I'm waiting for
> the webdriver api to support getting alerts before using that to
> handle alerts in the selenium emulation.
>
> Simon
>

PerfectStorm

unread,
Oct 26, 2009, 11:41:30 AM10/26/09
to webdriver
kairei

The information in this post helped me with firefox

http://code.google.com/p/webdriver/issues/detail?id=27
> > > Best Regards- Hide quoted text -
>
> - Show quoted text -

Simon Stewart

unread,
Oct 27, 2009, 11:49:28 AM10/27/09
to webd...@googlegroups.com
That's the best we do. For now.

Simon
Reply all
Reply to author
Forward
0 new messages