You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creates a JavaScript keyboard event (`onkeydown`, `onkeyup`, `onkeypress`) and sends it to the indicated element.
314
-
Browser Support: IE
315
-
```markup
316
-
usage: sendKeyDownAndWait <wpt-selector> <key>
317
-
example: sendKeyDownAndWait name=user x
318
-
319
-
<wpt-selector> - DOM element to send the click event to
320
-
<key> - Key command to send (special values are ENTER, DEL, DELETE, BACKSPACE, TAB, ESCAPE, PAGEUP, PAGEDOWN)
321
-
```
322
-
323
-
For the list of supported selectors, see [Selectors](#selectors).
324
-
325
-
For the difference between `command` and `commandAndWait` versions, see [`click`](#click) and [`clickAndWait`](#clickandwait).
326
-
327
312
#### `setInnerHTML`
328
313
Sets the innerHTML of the given DOM element to the provided value. This is usually used for filling in something like an editable HTML panel (like the message body in webmail). Use this if you want to include HTML formatting.
<host> - host for which you want to redirect requests
546
-
<new host> - target server to receive the redirected requests
547
-
```
548
-
In this example, http://www.webpagetest.org/index.php will get rewritten to actually request http://staging.webpagetest.org/www.webpagetest.org/index.php
549
-
550
523
#### `addHeader`
551
524
Adds the specified header to every http request (in addition to the headers that exist, does not overwrite an existing header).
552
525
Browser Support: IE, Chrome, Firefox, Safari (no SSL)
@@ -593,16 +566,6 @@ navigate www.yahoo.com
593
566
navigate www.aol.com
594
567
```
595
568
596
-
#### `expireCache`
597
-
Expires any cache entries that will expire within the specified number of seconds. This can be used to simulate a repeat view after a certain amount of time (for example, what it would be like to browse the page the next day). It doesn't help with simulating content changes but any resources with a short expiration will end up being checked with if-modified-since requests.
598
-
Browser Support: IE
599
-
```markup
600
-
usage: expireCache <seconds>
601
-
example: expireCache 86400
602
-
603
-
<seconds> - Any resources with a cache lifetime less than this amount of time will be forced to expire.
604
-
```
605
-
606
569
#### `clearCache`
607
570
Clears all cache and cookies.
608
571
Browser Support: Chrome, Safari on iOS
@@ -676,71 +639,6 @@ There is currently no way to debug failing WebPageTest scripts. If a script comm
676
639
To simplify script development, consider limiting yourself to [Recommended commands](#recommended-commands) only.
677
640
678
641
## Sample scripts
679
-
### Mail test
680
-
```markup
681
-
// load the account name and password
682
-
// bring up the login screen
683
-
setEventName launch
684
-
navigate http://webmail.aol.com
685
-
686
-
// ignore any errors from here on (in case the mailbox is empty or we get image challenged)
687
-
ignoreErrors 1
688
-
689
-
// log in
690
-
setValue name=loginId <username>
691
-
setValue name=password <password>
692
-
setEventName load
693
-
submitForm name=AOLLoginForm
694
-
695
-
// only read and send a mail once an hour
696
-
minInterval AOLMail 60
697
-
698
-
// close the today curtain
699
-
click className=backdrop
700
-
sleep 5
701
-
702
-
// Open the first message with a subject of "test"
703
-
setEventName read
704
-
clickAndWait innerText=test
705
-
706
-
// delete the message
707
-
click title=Delete (del)
708
-
sleep 5
709
-
710
-
// open the compose mail form
711
-
setEventName compose
712
-
clickAndWait title=Write mail (Alt + w)
713
-
714
-
// send a test message to myself
715
-
sleep 1
716
-
setValue tabindex=100 <username>
717
-
setValue name=Subject test
718
-
loadFile msg.txt %MSG%
719
-
setInnerText contentEditable=true Some message text
0 commit comments