Quantcast

How to "click" ok on a javascript confirm box ?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to "click" ok on a javascript confirm box ?

Eleo-3
Hi,

I have struggling for a couple of hours trying to find a way to click on the "OK" button of a confirm box.
I tried to use the typekeys command (trying to press the enter key) without success.

My question is rather simple:
How should I handle this case?
And does it work for simple alert?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=12539&messageID=39707#39707

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to "click" ok on a javascript confirm box ?

Eleo-3
It's quite simple :)


You have the waitForConfirmation command which accepts one argument, i.e. the text of the confirmation.

In your script you should also include the chooseOkOnNextConfirmation or chooseCancelOnNextConfirmation command to determine how Selenium will respond to the confirmation :)
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=12539&messageID=39709#39709

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to "click" ok on a javascript confirm box ?

Eleo-3
In reply to this post by Eleo-3
It's kinda weird cause I don't see the chooseOkOnNextConfirmation in the commands list :|
I have downloaded the last version of the selenium ide....
Is it normal?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=12539&messageID=39710#39710

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to "click" ok on a javascript confirm box ?

Eleo-3
You should see it.

You're talking about the Command dropdown list in Selenium IDE, right?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=12539&messageID=39713#39713

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to "click" ok on a javascript confirm box ?

Eleo-3
In reply to this post by Eleo-3
Yep
If i type "ch" i just get "check" "checkandwait" and "choosecancelonnextconfirmation" that's it :(
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=12539&messageID=39714#39714

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to "click" ok on a javascript confirm box ?

Eleo-3
chooseOkOnNextConfirmation should be right after chooseCancelOnNextConfirmation.

But I think that if you haven't specified anything Selenium assumes you specified chooseOkOnNextConfirmation.

So if you want Ok don't specify anything.
If you want Cancel specify chooseCancelOnNextConfirmation.
And then use the waitForConfirmation command
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=12539&messageID=39716#39716

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to "click" ok on a javascript confirm box ?

Eleo-3
In reply to this post by Eleo-3
Ok well i think I am screwed cause my box appears with an onload event and apparently selenium is not yet handling this type of event.


However, I don't get why the chooseOk command doesn't appear.
I might have forgotten something in the installation procedure ?
I just got the firefox extension and installed it...
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=12539&messageID=39717#39717

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to "click" ok on a javascript confirm box ?

Eleo-3
Indeed, it turns out that when the confirmation is from the onload event Selenium doesn't catch it. I could be missing something, of course

Installing Selenium IDE is just installing the extension, nothing more.
I don't know why you don't see chooseOkOnNextConfirmation.

Sorry, I wasn't much of a help
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=12539&messageID=39720#39720

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to "click" ok on a javascript confirm box ?

Eleo-3
In reply to this post by Eleo-3
That's ok but can I get around this problem with another command ?
I thought about the typekey but i did not manage to specify the "enter" key
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=12539&messageID=39721#39721

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to "click" ok on a javascript confirm box ?

Eleo-3
In reply to this post by Eleo-3
You can try this
Click | button
assertConfirmation | {message box pattern e.g. "Are you sure you want to delete?"}
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=12539&messageID=39761#39761

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to "click" ok on a javascript confirm box ?

Eleo-3
I already tried that out but i got the "There were no confirmations" message.
I also tried the clickat command but that was not much of a help either.
I am kinda running out of ideas...
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=12539&messageID=40334#40334

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...