Selenium IDE-Comando para esperar 5 segundos
Estoy usando el Selenium IDE para Firefox y buscando un comando wait. Mi problema es que quiero probar un sitio web con un mapa externo incrustado. Este mapa externo necesita 3-5 segundos para cargar.
Mis órdenes:
open /Page/mysite.html
//Wait Command? (5 seconds)
ClickAndWait link=do something
10 answers
Utilice el comando pause. Establezca velocidad en más rápido (Acciones > > Más rápido), de lo contrario no funcionará.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-10-06 23:16:15
Esto retrasará las cosas por 5 segundos:
Orden: pausa
Meta: 5000
Valor:
Esto retrasará las cosas por 3 segundos:
Orden: pausa
Meta: 3000
Valor:
Documentación:
Http://release.seleniumhq.org/selenium-core/1.0/reference.html#pause
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-16 05:22:07
Para aquellos que trabajan con ant
, utilizo esto para indicar una pausa de 5 segundos:
<tr>
<td>pause</td>
<td>5000</td>
<td></td>
</tr>
Es decir, target: 5000
y value
vacío. Como indica la referencia:
Pausa (tiempo de espera)
Argumentos:
- Tiempo de espera-la cantidad de tiempo para dormir (en milisegundos)
Espere la cantidad de tiempo especificada (en milisegundos)
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-09-02 16:03:13
Su mejor apuesta es probablemente waitForCondition
y escribir una función javascript que devuelve true cuando se carga el mapa.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-07-14 14:43:22
Esto hará lo que está buscando en C #(WebDriver/Selenium 2.0)
var browser = new FirefoxDriver();
var overallTimeout = Timespan.FromSeconds(10);
var sleepCycle = TimeSpan.FromMiliseconds(50);
var wait = new WebDriverWait(new SystemClock(), browser, overallTimeout, sleepCycle);
var hasTimedOut = wait.Until(_ => /* here goes code that looks for the map */);
Y nunca use Hilo.Duerme porque hace que tus pruebas sean poco fiables
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-07-17 06:55:31
El comando pause se puede utilizar directamente en el ide en formato html.
Si usas java o C puedes usar Thread.dormir(5000). El tiempo es en milisegundos. Otros idiomas son compatibles con "sleep 5" o time.dormir(5). tiene múltiples opciones para esperar un tiempo establecido.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-07-14 17:56:24
Antes del comando clickAndWait
agregue el siguiente código para que el script espere hasta que el enlace específico sea visible:
<tr>
<td>waitForVisible</td>
<td>link=do something</td>
<td></td>
</tr>
La práctica de usar los comandos wait en lugar de pause es la mayoría de las veces más eficiente y más estable.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-10-10 12:32:40
Esto esperará hasta que su enlace haya aparecido, y luego puede hacer clic en él.
Command: waitForElementPresent
Target: link=do something
Value:
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-05-21 21:50:19
Uno que he encontrado funciona para el sitio que pruebo es este:
WaitForCondition | selenium.browserbot.getUserWindow().$.activo = = 0 | 20000
Klendathu
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-07-13 12:53:30
En Chrome, Para "Selenium IDE", También estaba luchando que no se detiene. Se detendrá, si das como abajo:
- Orden: pausa
- Objetivo: en blanco
- Valor: 10000
Esto se pausará durante 10 segundos.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-01-29 15:34:37