![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is it possible to detect whether a (confirmation or prompt) dialog is present? |
|
And furthermore, how to press OK, Cancel buttons of a dialog? |
#3
| |||
| |||
|
|
Is it possible to detect whether a (confirmation or prompt) dialog is present? |
|
And furthermore, how to press OK, Cancel buttons of a dialog? |
|
I am writing a javascript based test framework. I would like to detect and close dialog using javascript. |
#4
| ||||
| ||||
|
|
On May 17, 6:50 pm, Thomas 'PointedEars' Lahn <PointedE... (AT) web (DOT) de> wrote: Xu, Qian wrote: Is it possible to detect whether a (confirmation or prompt) dialog is present? No, such dialogs are always modal. Script execution in the window from which these have been issued is halted until they have been closed. A dangerous mistake |
|
I once had big troubles with. |
|
In Gecko-based browsers including Firefox build-in dialogs are modal only withing the current execution context. |
|
[example code] |
#5
| |||
| |||
|
|
For instance "enjoy" three alerts displayed at once on Firefox: |
|
* { box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; } |
#6
| |||
| |||
|
|
For instance "enjoy" three alerts displayed at once on Firefox: I've seen 3 successive alerts ... not at once :-) |
|
* { box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; } what these styles are supposed to do ? |
#7
| |||
| |||
|
|
For instance "enjoy" three alerts displayed at once on Firefox: I've seen 3 successive alerts ... not at once :-) I mean if you don't close each alert right away then in ~1.5sec you'll have three alerts at once on the screen: drag one to see other underneath etc. |
|
* { box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; } what these styles are supposed to do ? Nothing relevant to the script. |
|
Normally we are using it in combination with HTML Transitional doctype to have the normal box model for all supported browsers (IE6/IE7, Firefox etc.) See if interested http://www.quirksmode.org/css/box.html |
#8
| |||
| |||
|
|
VK a écrit : For instance "enjoy" three alerts displayed at once on Firefox: I've seen 3 successive alerts ... not at once :-) I mean if you don't close each alert right away then in ~1.5sec you'll have three alerts at once on the screen: drag one to see other underneath etc. No, I'm sorry but I haven't that (on my Mac) with Firefox. The box(es) is(are) centered and attached at the window title bar. With my old IE, Opera and Safari, dialog boxes are floating and ... no ... only one alert after the other. |
|
* { box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; } what these styles are supposed to do ? Nothing relevant to the script. Ha!? OK Normally we are using it in combination with HTML Transitional doctype to have the normal box model for all supported browsers (IE6/IE7, Firefox etc.) See if interested http://www.quirksmode.org/css/box.html That force IE to see borders as all other browsers ? |
#9
| |||
| |||
|
|
On May 18, 6:09 am, SAM <stephanemoriaux.NoAd... (AT) wanadoo (DOT) fr.invalid wrote: VK a écrit : For instance "enjoy" three alerts displayed at once on Firefox: I've seen 3 successive alerts ... not at once :-) I mean if you don't close each alert right away then in ~1.5sec you'll have three alerts at once on the screen: drag one to see other underneath etc. No, I'm sorry but I haven't that (on my Mac) with Firefox. The box(es) is(are) centered and attached at the window title bar. With my old IE, Opera and Safari, dialog boxes are floating and ... no ... only one alert after the other. Strange. Is Firefox using a different script engine for MacOS? |
|
Here for instance Firefox under Mandriva Linux 2008.1 Spring: http://www.geocities.com/schools_ring/tmp/alert.png |
#10
| |||
| |||
|
|
The traditional way that test-frameworks do this is to overwrite the alert and confirm functions with code that simulates a pressed button. The code using them doesn't need to know, it just gets a preconfigured answer back. It might not match your requirements, but try looking at the Selenium test framework. http://selenium-core.openqa.org/ /L |
Thank you All![]() |
| Thread Tools | |
| Display Modes | |
| |