File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
examples/javascript/test/elements Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ const { suite} = require ( 'selenium-webdriver/testing' ) ;
2
+ const { By, Browser} = require ( 'selenium-webdriver' ) ;
3
+ const assert = require ( "node:assert" ) ;
4
+
5
+ suite ( function ( env ) {
6
+ describe ( 'Element Interactions' , function ( ) {
7
+ let driver ;
8
+
9
+ before ( async function ( ) {
10
+ driver = await env . builder ( ) . build ( ) ;
11
+ } ) ;
12
+
13
+ after ( async ( ) => await driver . quit ( ) ) ;
14
+
15
+ it ( 'should Clear input and send keys into input field' , async function ( ) {
16
+
17
+ try {
18
+ await driver . get ( 'https://www.selenium.dev/selenium/web/inputs.html' ) ;
19
+ let inputField = await driver . findElement ( By . name ( 'no_type' ) ) ;
20
+ await inputField . clear ( ) ;
21
+ await inputField . sendKeys ( 'Selenium' ) ;
22
+ assert . strictEqual ( await inputField . getText ( ) , "Selenium" ) ;
23
+ } catch ( e ) {
24
+ console . log ( e )
25
+ }
26
+ } ) ;
27
+ } ) ;
28
+ } , { browsers : [ Browser . CHROME , Browser . FIREFOX ] } ) ;
You can’t perform that action at this time.
0 commit comments