File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
examples/javascript/actionsApi Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,29 @@ suite(function(env) {
38
38
const textField = driver . findElement ( By . id ( "textInput" ) ) ;
39
39
assert . deepStrictEqual ( 'Ab' , await textField . getAttribute ( 'value' ) )
40
40
} ) ;
41
+
42
+ it ( 'sendKeys' , async function ( ) {
43
+ await driver . get ( 'https://www.selenium.dev/selenium/web/single_text_input.html' ) ;
44
+
45
+ await driver . actions ( )
46
+ . sendKeys ( 'abc' )
47
+ . perform ( ) ;
48
+
49
+ const textField = driver . findElement ( By . id ( "textInput" ) ) ;
50
+ assert . deepStrictEqual ( 'abc' , await textField . getAttribute ( 'value' ) )
51
+ } ) ;
52
+
53
+ it ( 'Designated Element' , async function ( ) {
54
+ await driver . get ( 'https://www.selenium.dev/selenium/web/single_text_input.html' ) ;
55
+ await driver . findElement ( By . tagName ( "body" ) ) . click ( ) ;
56
+
57
+ const textField = await driver . findElement ( By . id ( "textInput" ) ) ;
58
+ await driver . actions ( )
59
+ . sendKeys ( textField , 'Selenium!' )
60
+ . perform ( ) ;
61
+
62
+ assert . deepStrictEqual ( 'Selenium!' , await textField . getAttribute ( 'value' ) )
63
+ } ) ;
41
64
} ) ;
42
65
} ) ;
43
66
You can’t perform that action at this time.
0 commit comments