-
Notifications
You must be signed in to change notification settings - Fork 14
/
PuppeteerLibrary.libspec
1375 lines (1375 loc) · 41.1 KB
/
PuppeteerLibrary.libspec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<keywordspec name="PuppeteerLibrary" type="LIBRARY" format="HTML" scope="GLOBAL" namedargs="true" generated="2022-04-16T06:48:39Z" specversion="2" source="C:\Users\attha\Documents\Git\QAHive\robotframework-puppeteer\PuppeteerLibrary\__init__.py" lineno="43">
<version>3.1.4</version>
<scope>global</scope>
<namedargs>yes</namedargs>
<doc><p>PuppeteerLibrary is a web testing library for Robot Framework. PuppeteerLibrary uses the pyppeteer library internally to control a web browser.</p>
<p>This document explains how to use keywords provided by PuppeteerLibrary.</p>
<h3>Locator syntax</h3>
<p>PuppeteerLibrary supports finding elements based on different strategies such as the element id, XPath expressions, or CSS selectors same as SeleniumLibrary</p>
<p>Locator strategy is specified with a prefix using either syntax <code>strategy:value</code> or <code>strategy=value</code>.</p>
<table border="1">
<tr>
<th>Strategy</th>
<th>Match based on</th>
<th>Example</th>
</tr>
<tr>
<td>id</td>
<td>Element <code>id</code>.</td>
<td><code>id:example</code></td>
</tr>
<tr>
<td>xpath</td>
<td>XPath expression.</td>
<td><code>xpath://div[@id="example"]</code></td>
</tr>
<tr>
<td>css</td>
<td>CSS selector.</td>
<td><code>css:div#example</code></td>
</tr>
<tr>
<td>link</td>
<td>Exact text a link has.</td>
<td><code>link:Home page</code></td>
</tr>
<tr>
<td>partial link</td>
<td>Partial link text</td>
<td><code>partial link:Home</code></td>
</tr>
</table>
<h3>Chain Locator only for Playwright</h3>
<p>Playwright support <code>Chaining selectors</code> strategy. This allow us to chain following support locator. Selectors can be combined with the <code>&gt;&gt;</code> token, e.g. selector1 &gt;&gt; selector2 &gt;&gt; selectors3. When selectors are chained, next one is queried relative to the previous one's result.</p>
<p>Support chaining locator strategy: css and xpath</p>
<p>More detail [Chaining selectors](https://playwright.dev/docs/selectors#chaining-selectors)</p>
<p>Example:</p>
<p>chain=css=article &gt;&gt; css=.bar &gt; css=.baz &gt;&gt; css=span[attr=value]</p>
<h3>Timeout</h3>
<p>Timeout will use for Wait.. keywords. By default Puppeteer will use default timeout value if you didn't specific in keywords argument. Default Timeout is <code>30 seconds</code>.</p>
<p>User can set new default timeout using <code>Set Timeout</code> keyword</p>
<p><b>Time format</b></p>
<p>All timeouts and waits can be given as numbers considered seconds (e.g. 0.5 or 42) or in Robot Framework's time syntax(e.g. 1.5 seconds or 1 min 30 s).</p>
<p>For more information about the time syntax see the Robot Framework User Guide.</p></doc>
<init lineno="118">
<arguments>
<arg>disable_python_logging=True</arg>
</arguments>
<doc><p>Initialize self. See help(type(self)) for accurate signature.</p></doc>
</init>
<kw name="Add Cookie">
<arguments>
<arg>name</arg>
<arg>value</arg>
</arguments>
<doc><p>Add cookie</p></doc>
</kw>
<kw name="Capture Page Screenshot">
<arguments>
<arg>filename=puppeteer-screenshot-{index}.png</arg>
<arg>fullPage=False</arg>
</arguments>
<doc><p>Capture current web page as image png file.</p>
<p>The <code>filename</code> argument specifies filename and path to save the file. Default valid is 'puppeteer-screenshot-{index}.png'.</p>
<p>The <code>fullPage</code> argument specifieds capture screenshot as full page.</p>
<p>Example:</p>
<table border="1">
<tr>
<td>Capture page screenshot</td>
<td></td>
</tr>
<tr>
<td>Capture page screenshot</td>
<td>custom-{index}.png</td>
</tr>
</table></doc>
</kw>
<kw name="Checkbox Should Be Selected">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Valicate checkbox should selected</p></doc>
</kw>
<kw name="Checkbox Should Not Be Selected">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Valicate checkbox should not be selected</p></doc>
</kw>
<kw name="Clear Element Text">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Clears value of text field identified by <code>locator</code>.</p>
<p>Example:</p>
<table border="1">
<tr>
<td>`Clear Element Text`</td>
<td>id:name</td>
</tr>
</table></doc>
</kw>
<kw name="Click Button">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Clicks button identified by <code>locator</code>.</p>
<p>Example:</p>
<table border="1">
<tr>
<td>`Click Button`</td>
<td>id:submit</td>
</tr>
</table></doc>
</kw>
<kw name="Click Element">
<arguments>
<arg>locator</arg>
<arg>noWaitAfter=False</arg>
</arguments>
<doc><p>Clicks element identified by <code>locator</code>.</p>
<p>The <code>noWaitAfter</code> argument specifies skip wait for animation after click. Only support for webkit and safari (Puppeteer)</p>
<p>Example:</p>
<table border="1">
<tr>
<td>`Click Element`</td>
<td>id:register</td>
<td></td>
</tr>
<tr>
<td>`Click Element`</td>
<td>id:register</td>
<td>${True}</td>
</tr>
</table></doc>
</kw>
<kw name="Click Element At Coordinate">
<arguments>
<arg>locator</arg>
<arg>xoffset</arg>
<arg>yoffset</arg>
</arguments>
<doc><p>Click element at specifict coordiate x and y offset</p></doc>
</kw>
<kw name="Click Image">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Clicks image identified by <code>locator</code>.</p>
<p>Example:</p>
<table border="1">
<tr>
<td>`Click Image`</td>
<td>id:cat_image</td>
</tr>
</table></doc>
</kw>
<kw name="Click Link">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Clicks link identified by <code>locator</code>.</p>
<p>Example:</p>
<table border="1">
<tr>
<td>`Click Link`</td>
<td>id:view_more</td>
</tr>
</table></doc>
</kw>
<kw name="Close All Browser">
<arguments>
</arguments>
<doc><p>Close all browser</p></doc>
</kw>
<kw name="Close Browser">
<arguments>
<arg>alias=None</arg>
</arguments>
<doc><p>Closes the current browser</p></doc>
</kw>
<kw name="Close Puppeteer">
<arguments>
</arguments>
<doc></doc>
</kw>
<kw name="Close Window">
<arguments>
</arguments>
<doc><p>Close current browser tab/page</p></doc>
</kw>
<kw name="Delete All Browser Storage States">
<arguments>
</arguments>
<doc><p>Delete all browser storage state</p>
<p><b>Limitation</b> only support Playwright browser</p></doc>
</kw>
<kw name="Delete All Cookies">
<arguments>
</arguments>
<doc><p>Deletes all cookies.</p></doc>
</kw>
<kw name="Delete Browser Storage State">
<arguments>
<arg>ref</arg>
</arguments>
<doc><p>Delete browser storage state</p>
<p><b>ref</b> : reference state name</p>
<p><b>Limitation</b> only support Playwright browser</p></doc>
</kw>
<kw name="Disable Debug Mode">
<arguments>
</arguments>
<doc><p>Disable debug mode. This keyword will close all browser and reset debug mode to False.</p></doc>
</kw>
<kw name="Download File">
<arguments>
<arg>locator</arg>
<arg>timeout=None</arg>
</arguments>
<doc></doc>
</kw>
<kw name="Drag And Drop">
<arguments>
<arg>src_locator</arg>
<arg>desc_locator</arg>
</arguments>
<doc><p>Drag item form sort locator to destination locator</p>
<p><b>Limitation</b> Drag event only support for css / id locator. Not support for xpath locator or chain locator.</p></doc>
</kw>
<kw name="Element Should Be Disabled">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Verifies that element identified by locator is disabled.</p></doc>
</kw>
<kw name="Element Should Be Enabled">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Verifies that element identified by locator is enabled.</p></doc>
</kw>
<kw name="Element Should Be Visible">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Verifies that element identified by locator is visible.</p></doc>
</kw>
<kw name="Element Should Contain">
<arguments>
<arg>locator</arg>
<arg>expected</arg>
<arg>ignore_case=False</arg>
</arguments>
<doc><p>Verifies that element locator contains text `expected`.</p></doc>
</kw>
<kw name="Element Should Not Be Visible">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Verifies that element identified by locator is not be visible.</p></doc>
</kw>
<kw name="Element Should Not Contain">
<arguments>
<arg>locator</arg>
<arg>expected</arg>
<arg>ignore_case=False</arg>
</arguments>
<doc><p>Verifies that element locator should not contains text `expected`.</p></doc>
</kw>
<kw name="Element Text Should Be">
<arguments>
<arg>locator</arg>
<arg>expected</arg>
<arg>ignore_case=False</arg>
</arguments>
<doc><p>Verifies that element locator contains exact the text `expected`.</p></doc>
</kw>
<kw name="Element Text Should Not Be">
<arguments>
<arg>locator</arg>
<arg>expected</arg>
<arg>ignore_case=False</arg>
</arguments>
<doc><p>Verifies that element locator not contains exact the text `expected`.</p></doc>
</kw>
<kw name="Enable Debug Mode">
<arguments>
<arg>slowMo=150</arg>
<arg>devtools=True</arg>
</arguments>
<doc><p>Enable debug mode.</p>
<p>The <code>slowMo</code> argument specifies delay for each test step. The <code>devtools</code> argument specifies enable devtools or not.</p>
<p>Example:</p>
<table border="1">
<tr>
<td>Enable Debug Mode</td>
<td></td>
<td></td>
</tr>
<tr>
<td>Open browser</td>
<td><a href="http://127.0.0.1:7272">http://127.0.0.1:7272</a></td>
<td></td>
</tr>
<tr>
<td>Input text</td>
<td>id:username_field</td>
<td>demo</td>
</tr>
<tr>
<td>Input text</td>
<td>id:password_field</td>
<td>mode</td>
</tr>
</table></doc>
</kw>
<kw name="Enable Emulate Mode">
<arguments>
<arg>emulate_name</arg>
</arguments>
<doc><p>Emulate specific mobile or tablet</p>
<p>The <code>emulate_name</code> argument specifies which emulator to use. Only support for chrome (Puppeteer)</p>
<table border="1">
<tr>
<th>Example Options</th>
</tr>
<tr>
<td>iPhone X</td>
</tr>
<tr>
<td>Pixel 2</td>
</tr>
</table>
<p>More emulate_name please visit [device_descriptors.py](https://github.com/qahive/robotframework-puppeteer/tree/master/PuppeteerLibrary/utils/device_descriptors.py)</p></doc>
</kw>
<kw name="Execute Javascript">
<arguments>
<arg>code</arg>
</arguments>
<doc><p>Executes the given JavaScript code</p>
<p>Examples:</p>
<table border="1">
<tr>
<td>`Handle Alert`</td>
<td>ACCEPT</td>
</tr>
<tr>
<td>`Execute Javascript`</td>
<td>alert('Hello world');</td>
</tr>
</table>
<p>Examples:</p>
<table border="1">
<tr>
<td>`Execute Javascript`</td>
<td>console.log('Hi 5');</td>
</tr>
</table></doc>
</kw>
<kw name="Get Cookie">
<arguments>
<arg>name</arg>
</arguments>
<doc><p>Get cookie by name</p>
<p>Returns Cookie value</p></doc>
</kw>
<kw name="Get Cookies">
<arguments>
</arguments>
<doc><p>Get all cookies</p>
<p>Returns Dictionary for all cookies of the current page.</p></doc>
</kw>
<kw name="Get Element Attribute">
<arguments>
<arg>locator</arg>
<arg>attribute</arg>
</arguments>
<doc><p>Return the value of <code>attribute</code> from the element.</p></doc>
</kw>
<kw name="Get Element Count">
<arguments>
<arg>locator</arg>
<arg>timeout=None</arg>
</arguments>
<doc><p>Returns the number of elements matching <code>locator</code>.</p></doc>
</kw>
<kw name="Get List Labels">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Return the label list of options from element.</p></doc>
</kw>
<kw name="Get List Values">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Return the value list of options from element.</p></doc>
</kw>
<kw name="Get Location">
<arguments>
</arguments>
<doc><p>Get page location</p></doc>
</kw>
<kw name="Get Screenshot Directory">
<arguments>
</arguments>
<doc></doc>
</kw>
<kw name="Get Selected List Label">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Return the label of selected option from element.</p></doc>
</kw>
<kw name="Get Selected List Labels">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Return the label list of selected options from element.</p></doc>
</kw>
<kw name="Get Selected List Value">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Return the value of selected option from element.</p></doc>
</kw>
<kw name="Get Selected List Values">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Return the value list of selected options from element.</p></doc>
</kw>
<kw name="Get Text">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Returns text value of element identified by <code>locator</code>.</p>
<p>Example:</p>
<table border="1">
<tr>
<td>${text}</td>
<td>`Get Text`</td>
<td>id:username</td>
</tr>
</table></doc>
</kw>
<kw name="Get Title">
<arguments>
</arguments>
<doc><p>Get page title</p></doc>
</kw>
<kw name="Get Value">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Returns specific attribute value of element identified by <code>locator</code>.</p>
<p>Example:</p>
<table border="1">
<tr>
<td>${value}</td>
<td>`Get Value`</td>
<td>id:comment</td>
</tr>
</table></doc>
</kw>
<kw name="Get Window Count">
<arguments>
</arguments>
<doc><p>Get windows count</p></doc>
</kw>
<kw name="Go Back">
<arguments>
</arguments>
<doc><p>Simulate browser go back</p></doc>
</kw>
<kw name="Go To">
<arguments>
<arg>url</arg>
</arguments>
<doc><p>Navigates the current page to the <code>url</code></p></doc>
</kw>
<kw name="Handle Alert">
<arguments>
<arg>action</arg>
<arg>prompt_text=</arg>
</arguments>
<doc><p>Handles the current alert and returns its message.</p>
<p>action:</p>
<ul>
<li>ACCEPT: Accept the alert i.e. press Ok. Default.</li>
<li>DISMISS: Dismiss the alert i.e. press Cancel.`.</li>
</ul>
<p>Example:</p>
<table border="1">
<tr>
<td>`Run Async Keywords`</td>
<td></td>
<td></td>
</tr>
<tr>
<td>... Handle Alert</td>
<td>ACCEPT</td>
<td>AND</td>
</tr>
<tr>
<td>... Click Button</td>
<td>id=alert_confirm</td>
<td></td>
</tr>
</table>
<p>Limitation: Not support for webkit</p></doc>
</kw>
<kw name="Input Password">
<arguments>
<arg>locator</arg>
<arg>text</arg>
<arg>clear=True</arg>
</arguments>
<doc><p>Types the given text into text field same as <code>Input Text</code> Keyword.</p>
<p>Differentiate is only not log the input value into log file.</p></doc>
</kw>
<kw name="Input Text">
<arguments>
<arg>locator</arg>
<arg>text</arg>
<arg>clear=True</arg>
</arguments>
<doc><p>Types the given text into text field identified by <code>locator</code>.</p>
<p>If clear is true, the input element will be cleared before the text is typed into the element. On the other hand clear is false, the previous text will not be cleared from the element.</p>
<p>Examples:</p>
<table border="1">
<tr>
<td>`Input Text`</td>
<td>id:name</td>
<td>John Doe</td>
<td></td>
</tr>
<tr>
<td>`Input Text`</td>
<td>id:username</td>
<td>john</td>
<td>True</td>
</tr>
</table></doc>
</kw>
<kw name="Mock Current Page Api Response">
<arguments>
<arg>url</arg>
<arg>mock_response</arg>
<arg>method=GET</arg>
<arg>body=None</arg>
</arguments>
<doc><p>Mock current page api response.</p>
<p>The <code>mock_response</code> is a dictionary which can have the following fields:</p>
<ul>
<li><code>status</code> (int): Response status code, defaults to 200.</li>
<li><code>headers</code> (dict): Optional response headers.</li>
<li><code>contentType</code> (str): If set, equals to setting <code>Content-Type</code> response header.</li>
<li><code>body</code> (str|bytes): Optional response body.</li>
</ul>
<p>The <code>url</code> is request url. url can be partial url match using regexp Match Options:</p>
<table border="1">
<tr>
<td>Options</td>
<td>Url value</td>
</tr>
<tr>
<td>Exact match</td>
<td>^http://127.0.0.1:7272/ajax_info.json\?count=3$</td>
</tr>
<tr>
<td>Partial match</td>
<td>/ajax_info.json\?count=3</td>
</tr>
<tr>
<td>Regular expression</td>
<td>.*?/ajax_info.json\?count=3</td>
</tr>
</table>
<p>The <code>method</code> is HTTP Request Methods:</p>
<ul>
<li>GET (default)</li>
<li>POST</li>
<li>PUT</li>
<li>HEAD</li>
<li>DELETE</li>
<li>PATCH</li>
</ul>
<p>The <code>body</code> is request body message. body can match using regexp</p>
<p>Example:</p>
<table border="1">
<tr>
<td>&amp;{response}</td>
<td>Create Dictionary</td>
<td>body=I'm a mock response</td>
</tr>
<tr>
<td>Mock Current Page Api Response</td>
<td>/ajax_info.json\?count=3</td>
<td>${response}</td>
</tr>
</table></doc>
</kw>
<kw name="Mouse Down">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Mouse down on the element.</p></doc>
</kw>
<kw name="Mouse Move">
<arguments>
<arg>x</arg>
<arg>y</arg>
</arguments>
<doc><p>Move mouse to position x, y.</p>
<p><b>Limitation</b> Drag event only support for css / id locator. Not support for xpath locator or chain locator.</p></doc>
</kw>
<kw name="Mouse Over">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Mouse over the element.</p></doc>
</kw>
<kw name="Mouse Up">
<arguments>
</arguments>
<doc><p>Mouse up.</p></doc>
</kw>
<kw name="Open Browser">
<arguments>
<arg>url</arg>
<arg>browser=chrome</arg>
<arg>alias=None</arg>
<arg>options={}</arg>
</arguments>
<doc><p>Opens a new browser instance to the specific <code>url</code>.</p>
<p>The <code>browser</code> argument specifies which browser to use.</p>
<table border="1">
<tr>
<th>Browser</th>
<th>Name(s)</th>
<th>Engine</th>
</tr>
<tr>
<td>Google Chrome Default</td>
<td>chrome</td>
<td>Playwright</td>
</tr>
<tr>
<td>Google Chrome Playwright</td>
<td>pwchrome</td>
<td>Playwright</td>
</tr>
<tr>
<td>Google Chrome Puppeteer</td>
<td>ptchrome</td>
<td>Puppeteer</td>
</tr>
<tr>
<td>Webkit (Safari engine)</td>
<td>webkit</td>
<td>Playwright</td>
</tr>
<tr>
<td>Firefox</td>
<td>firefox</td>
<td>Playwright</td>
</tr>
</table>
<p>The <code>options</code> argument as a dictionary</p>
<table border="1">
<tr>
<th>Property</th>
<th>Value</th>
</tr>
<tr>
<td>headless</td>
<td>default True</td>
</tr>
<tr>
<td>width</td>
<td>default 1366</td>
</tr>
<tr>
<td>height</td>
<td>default 768</td>
</tr>
<tr>
<td>emulate</td>
<td>iPhone 11</td>
</tr>
<tr>
<td>state_ref</td>
<td>State Reference</td>
</tr>
</table>
<p><b>*Other options*</b> pwchrome, webkit and firefox please visit: <a href="https://playwright.dev/python/docs/api/class-browser?_highlight=new_page#browsernew_pagekwargs">https://playwright.dev/python/docs/api/class-browser?_highlight=new_page#browsernew_pagekwargs</a> chrome please visit: <a href="https://pptr.dev/#?product=Puppeteer&amp;version=v8.0.0&amp;show=api-puppeteerlaunchoptions">https://pptr.dev/#?product=Puppeteer&amp;version=v8.0.0&amp;show=api-puppeteerlaunchoptions</a></p>
<p>Example:</p>
<table border="1">
<tr>
<td>&amp;{options} =</td>
<td>create dictionary</td>
<td>headless=${False}</td>
</tr>
<tr>
<td>`Open browser`</td>
<td><a href="https://www.w3schools.com/html/html_forms.asp">https://www.w3schools.com/html/html_forms.asp</a></td>
<td>options=${options}</td>
</tr>
</table></doc>
</kw>
<kw name="Press Keys">
<arguments>
<arg>locator</arg>
<arg>*keys</arg>
</arguments>
<doc><p>Press Keys</p>
<p>Simulates the user pressing key(s) to an element or on the active page. A superset of the `key` values can be found here. Examples of the keys are: `F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`, `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc. Please refer to a key <a href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values">https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values</a></p>
<p>keys arguments can contain one or many strings</p>
<p>Example:</p>
<table border="1">
<tr>
<td>`Press Keys`</td>
<td>None</td>
<td>A</td>
<td></td>
</tr>
<tr>
<td>`Press Keys`</td>
<td>id=password</td>
<td>Enter</td>
<td></td>
</tr>
<tr>
<td>`Press Keys`</td>
<td>id=password</td>
<td>A</td>
<td>Enter</td>
</tr>
</table></doc>
</kw>
<kw name="Print As Pdf">
<arguments>
<arg>filename=pdf-{index}.pdf</arg>
</arguments>
<doc><p>Print current web page as pdf file. This keyword only support with <code>HEADLESS</code> mode enable.</p>
<p>The <code>filename</code> argument specifies filename and path to save the file. Default valid is 'pdf-{index}.pdf'.</p>
<p>Example:</p>
<table border="1">
<tr>
<td>&amp;{options} =</td>
<td>create dictionary</td>
<td>headless=${False}</td>
</tr>
<tr>
<td>Open browser</td>
<td><a href="https://www.w3schools.com/html/html_forms.asp">https://www.w3schools.com/html/html_forms.asp</a></td>
<td>options=${options}</td>
</tr>
<tr>
<td>Print as PDF</td>
<td></td>
<td></td>
</tr>
<tr>
<td>Print as PDF</td>
<td>custom-pdf-{index}.pdf</td>
<td></td>
</tr>
</table></doc>
</kw>
<kw name="Reload Page">
<arguments>
</arguments>
<doc><p>Reload the current page</p></doc>
</kw>
<kw name="Run Async Keywords">
<arguments>
<arg>*keywords</arg>
</arguments>
<doc><p>Executes all the given keywords in a asynchronous and wait until all keyword is completed</p>
<p><code>Return</code> Array of result for each keywords based on index</p>
<p>Example:</p>
<table border="1">
<tr>
<td>Open browser</td>
<td>${HOME_PAGE_URL}</td>
<td>options=${options}</td>
<td></td>
</tr>
<tr>
<td>`Run Async Keywords`</td>
<td>Click Element</td>
<td>id:login_button</td>
<td>AND</td>
</tr>
<tr>
<td>...</td>
<td>Wait for response url</td>
<td>${HOME_PAGE_URL}/home.html</td>
<td></td>
</tr>
</table></doc>
</kw>
<kw name="Run Async Keywords And Return First Completed">
<arguments>
<arg>*keywords</arg>
</arguments>
<doc><p>Executes all the given keywords in a asynchronous and wait until first keyword is completed</p>
<p><code>Return</code> Array of result for each keywords based on index</p>
<p>Example</p>
<table border="1">
<tr>
<td>`Run Async Keywords And Return First Completed`</td>
<td>Wait for response url</td>
<td>${HOME_PAGE_URL}/login.html</td>
<td>AND</td>
</tr>
<tr>
<td>...</td>
<td>Wait for response url</td>
<td>${HOME_PAGE_URL}/home.html</td>
<td></td>
</tr>
</table></doc>
</kw>
<kw name="Save Browser Storage State">
<arguments>
<arg>ref=user</arg>
</arguments>
<doc><p>Save browser storage state that can resue Authentication state</p>
<p><b>ref</b> : reference state name</p>
<p><b>Limitation</b> only support Playwright browser</p></doc>
</kw>
<kw name="Scroll Element Into View">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Scroll element into view</p></doc>
</kw>
<kw name="Select Checkbox">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Select checkbox based on locator</p></doc>
</kw>
<kw name="Select Frame">
<arguments>
<arg>locator</arg>
</arguments>
<doc></doc>
</kw>
<kw name="Select From List By Label">
<arguments>
<arg>locator</arg>
<arg>labels</arg>
</arguments>
<doc></doc>
</kw>
<kw name="Select From List By Value">
<arguments>
<arg>locator</arg>
<arg>values</arg>
</arguments>
<doc></doc>
</kw>
<kw name="Set Screenshot Directory">
<arguments>
<arg>path</arg>
</arguments>
<doc></doc>
</kw>
<kw name="Set Timeout">
<arguments>
<arg>timeout</arg>
</arguments>
<doc><p>Sets the timeout that is used by various keywords. The value can be given as a number that is considered to be seconds or as a human-readable string like 1 second. The previous value is returned and can be used to restore the original value later if needed. See the Timeout section above for more information.</p>
<p>Example:</p>
<table border="1">
<tr>
<td>Open page that loads slowly</td>
<td></td>
<td></td>
</tr>
<tr>
<td>Set Timeout</td>
<td>${orig timeout}</td>
<td></td>
</tr>
</table></doc>
</kw>
<kw name="Set View Port Size">
<arguments>
<arg>width</arg>
<arg>height</arg>
</arguments>
<doc></doc>
</kw>
<kw name="Start Tracing">
<arguments>
</arguments>
<doc><p>Create trace log file</p>
<p># View the trace by running following command</p>
<p>playwright show-trace trace.zip</p></doc>
</kw>
<kw name="Stop Tracing">
<arguments>
<arg>path=None</arg>
</arguments>
<doc><p>Stop trace and generate the trace file.</p>
<p>Default will be <code>traces/&lt;testcasename&gt;.zip</code></p></doc>
</kw>
<kw name="Switch Browser">
<arguments>
<arg>alias</arg>
</arguments>
<doc><p>Switch browser context based on alias name</p></doc>
</kw>
<kw name="Switch Window">
<arguments>
<arg>locator=MAIN</arg>
</arguments>
<doc><p>Switches to tabs matching locator locator support options NEW, MAIN and query using name, title and url</p>
<ul>
<li>NEW: latest opened window</li>
<li>MAIN: main window</li>
<li>title="QAHive": window title. Page title will have have error if new tab have auto redirection</li>
<li>url="https://qahive.com": url support regex Example: url=.*qahive.com</li>
</ul></doc>
</kw>
<kw name="Unselect Checkbox">
<arguments>
<arg>locator</arg>
</arguments>
<doc><p>Unselect checkbox based on locator</p></doc>
</kw>
<kw name="Unselect Frame">
<arguments>
</arguments>
<doc></doc>
</kw>
<kw name="Upload File">
<arguments>
<arg>locator</arg>
<arg>file_path</arg>
</arguments>
<doc></doc>
</kw>
<kw name="Wait For Navigation">
<arguments>
<arg>timeout=None</arg>
</arguments>
<doc><p>Waits until web page navigates to new url or reloads.</p>
<p>Example:</p>
<table border="1">
<tr>
<td>Open browser</td>
<td>${HOME_PAGE_URL}</td>
<td>options=${options}</td>
<td></td>
</tr>
<tr>
<td>Input Text</td>
<td>id:username</td>
<td>foo</td>
<td></td>
</tr>
<tr>
<td>Input Text</td>
<td>id:password</td>
<td>bar</td>
<td></td>
</tr>
<tr>
<td>Run Async Keywords</td>
<td>Click Element</td>
<td>id:login_button</td>
<td>AND</td>
</tr>
<tr>
<td>...</td>
<td>`Wait For Navigation`</td>
<td></td>
<td></td>
</tr>
</table></doc>
</kw>
<kw name="Wait For Network Idle">
<arguments>